fork download
  1. %{
  2. #include<stdio.h>
  3. %}
  4.  
  5. %%
  6. [a,e,i,o,u,A,E,I,O,U]
  7. {
  8. printf("%s is a vowel\n",yytext);
  9. }
  10. [a-z A-Z]
  11. {
  12. printf("%s is a consonant\n",yytext);
  13. }
  14. [\t\n]+
  15. {
  16. printf("%s is an unk\n",yytext);
  17. }
  18. %%
  19. int main()
  20. {
  21. printf("Enter");
  22. yylex();
  23. return 0;
  24. }
  25. int yywrap()
  26. {
  27. return 1;
  28. }
  29.  
Success #stdin #stdout #stderr 0.03s 6960KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/bYcVRY/prog:29:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit