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