fork download
  1. lex_by_file( FileName ) :-
  2. get_input_from_file( FileName, TokenList ),
  3. lex( TokenList, OutputList ),
  4. %write_output( OutputList ), !.
  5. maplist(writeln,OutputList),!.
  6.  
  7. %{
  8. #include<stdio.h>
  9. %}
  10.  
  11. %%
  12. [aeiouAEIOU] {printf("Its a vowel:");}
  13. [a-zA-z] {printf("Its a Consonant");}
  14. %%
  15.  
  16. int main(){
  17. printf("\nEnter a character");
  18. yylex();
  19. return 0;
  20. }
Success #stdin #stdout #stderr 0.03s 7012KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/UKpQda/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit