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