fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. "int" { printf("INT_KEYWORD\n"); }
  7. [a-zA-Z]+ { printf("IDENTIFIER\n"); }
  8. "5" { printf("NUMBER\n"); }
  9. "@" { printf("SPECIAL\n"); }
  10. "=" { printf("OPERATOR\n"); }
  11. [ \t\n] ; /* Ignore whitespace */
  12. . { printf("UNKNOWN\n"); }
  13. %%
  14.  
  15. int main() {
  16. yylex();
  17. return 0;
  18. }
Success #stdin #stdout #stderr 0.02s 6920KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/RTASCF/prog:2:1: Syntax error: Operator expected
ERROR: /home/RTASCF/prog:18:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit