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