fork download
  1. %{
  2. #include "y.tab.h";
  3. %}
  4. %%
  5. read|run|is return verb;
  6. Sita|raju|ramu return noun;
  7. He|she|It return pronoun;
  8. \n return 0;
  9. %%
  10. %{
  11. #include<stdio.h>
  12. %}
  13. %tokens noun, pronoun,verb;
  14. %%
  15. Sentence:s{printf("valid sentence");}
  16. S:noun, pronoun,verb;
  17. %%
  18. void yyerror (char*s)
  19. {
  20. Printf("error");
  21. }
  22. int main(void)
  23. {
  24. return yyparse ();
  25. }
  26.  
Success #stdin #stdout #stderr 0.03s 6864KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/rurDDF/prog:25:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit