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