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