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