fork download
  1. %{
  2. %}
  3.  
  4. %s A DEAD
  5.  
  6. %%
  7. <INITIAL>0 BEGIN A;
  8. <INITIAL>1 BEGIN INITIAL;
  9. <INITIAL>[^01\n] BEGIN DEAD;
  10. <INITIAL>\n BEGIN INITIAL; {printf("Not Accepted\n");}
  11.  
  12. <A>0 BEGIN A;
  13. <A>1 BEGIN INITIAL;
  14. <A>[^01\n] BEGIN DEAD;
  15. <A>\n BEGIN INITIAL; {printf("Accepted\n");}
  16.  
  17. <DEAD>[^\n] BEGIN DEAD;
  18. <DEAD>\n BEGIN INITIAL; {printf("Invalid\n");}
  19.  
  20. %%
  21.  
  22. int main()
  23. {
  24. printf("Enter String\n");
  25. yylex();
  26. return 0;
  27. }
Success #stdin #stdout #stderr 0.03s 6968KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/nraxWn/prog:27:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit