fork download
  1. %{
  2. #include <stdio.h>
  3. #include <string.h>
  4. %}
  5.  
  6. %%
  7. if { printf("Keyword: if\n"); }
  8. else { printf("Keyword: else\n"); }
  9. while { printf("Keyword: while\n"); }
  10. /* Add more keywords here */
  11.  
  12. [ \t\n] ; /* Skip whitespace and newline characters */
  13. . ; /* Ignore any other characters */
  14.  
  15. %%
  16.  
  17. int main() {
  18. yylex();
  19. return 0;
  20. }
  21.  
Success #stdin #stdout #stderr 0.02s 6912KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/U9MdVZ/prog:2:1: Syntax error: Operator expected
ERROR: /home/U9MdVZ/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit