fork download
  1. %{
  2. #include <stdio.h>
  3.  
  4. int yywrap(void) {
  5. return 1;
  6. }
  7. %}
  8.  
  9. %%
  10.  
  11. \"([^\\\"]|\\.)*\" { printf("STRING: %s\n", yytext); }
  12. [a-zA-Z0-9_!#$%^&*()_+.]+ { printf("IDENTIFIER: %s\n", yytext); }
  13. [ \t\n]+ { /* skip whitespace */ }
  14. . { printf("UNKNOWN: %s\n", yytext); }
  15.  
  16. %%
  17.  
  18. int main(void) {
  19. return yylex();
  20. }
  21.  
Success #stdin #stdout #stderr 0.02s 6924KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/o4xeie/prog:2:1: Syntax error: Operator expected
ERROR: /home/o4xeie/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit