fork download
  1. %{
  2. #include<stdio.h>
  3. %}
  4. %%
  5. if |
  6. Else |
  7. While |
  8. Int |
  9. Switch |
  10. For |
  11. char |
  12. do |
  13. break |
  14. continue {printf(“keyword”);}
  15. [a-z]([a-z]|[0-9])* {printf(“identifier”);}
  16. [0-9]* {printf(number);}
  17. .* {printf(“invalid”);}
  18. %%
  19. main()
  20. {
  21. yylex();
  22. }
  23.  
Success #stdin #stdout #stderr 0.02s 6836KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/rA3LUP/prog:23:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit