fork(1) download
  1. %{
  2. #include<stdio.h>
  3. #include<string.h>
  4. %}
  5.  
  6. %%
  7. auto|break|case|char|const|continue|default|do|double|else
  8. |enum|extern|float|for|goto|if|int|long|register|return
  9. |short|signed|sizeof|static|struct|switch|typedef|union
  10. |unsigned|void|volatile|while { printf("Reserved word: %s\n", yytext); }
  11. [a-zA-Z_][a-zA-Z0-9_]* { printf("Identifier: %s\n", yytext); }
  12. . { /* Ignore all other characters */ }
  13. %%
  14.  
  15. int main() {
  16. yylex();
  17. return 0;
  18. }
  19.  
Success #stdin #stdout #stderr 0.02s 6972KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/bnb5B5/prog:2:1: Syntax error: Operator expected
ERROR: /home/bnb5B5/prog:18:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit