fork download
  1. %{
  2. #include<stdio.h>
  3. %}
  4.  
  5. %%
  6. if |
  7. else |
  8. printf |
  9. printf{printf("\n%s is a keyword" , yytext);}
  10. [0-9]+ {printf("\n%s is a number", yytext);}
  11. [a-zA-Z]+{printf("\n%s is a word", yytext);}
  12. .|\n {ECHO}
  13. %%
  14.  
  15. int main()
  16. {
  17. prinf("\n Enter the string: ");
  18. yylex();
  19. }
  20.  
  21. int yywrap()
  22. {
  23. return 1;
  24. }
  25.  
Success #stdin #stdout #stderr 0.02s 6920KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/1t7jWe/prog:24:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit