fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. if { printf("Keyword: if\n"); }
  7. else { printf("Keyword: else\n"); }
  8. while { printf("Keyword: while\n"); }
  9. return { printf("Keyword: return\n"); }
  10. int { printf("Keyword: int\n"); }
  11. [ \t\n] ; /* Skip whitespace */
  12. . { printf("Unknown: %s\n", yytext); }
  13. %%
  14.  
  15. int main() {
  16. yylex();
  17. return 0;
  18. }
  19.  
Success #stdin #stdout #stderr 0.03s 6860KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/4IAP1A/prog:2:1: Syntax error: Operator expected
ERROR: /home/4IAP1A/prog:18:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit