fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. [a-zA-Z_][a-zA-Z0-9_]*
  6.  
  7. %%
  8. [a-zA-Z_][a-zA-Z0-9_]* {printf("valid"), yytext);}
  9.  
  10.  
  11.  
  12. .|\n { printf("invalid"), yytext); }
  13.  
  14. %%
  15. int yywrap(){
  16. return 1;
  17.  
  18. }
  19. int main() {
  20. yylex();
  21. return 0;
  22. }
  23.  
Success #stdin #stdout #stderr 0.03s 6936KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/2Wvzsh/prog:22:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit