fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4. %%
  5. [A-Za-z]+ { printf("Word: %s\n", yytext); }
  6. [0-9]+ { printf("Number: %s\n", yytext); }
  7. [@&.,] { printf("Special Character: %s\n", yytext); }
  8. [ \t\n]+ ;
  9. . { printf("Other: %s\n", yytext); }
  10. %%
  11. int main() { yylex(); }
  12.  
Success #stdin #stdout #stderr 0.04s 6900KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/h94kZK/prog:2:1: Syntax error: Operator expected
ERROR: /home/h94kZK/prog:11:23: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit