fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. ^[aeiouAEIOU][a-zA-Z]* { printf("Word starts with a VOWEL: %s", yytext); }
  7. ^[b-df-hj-np-tv-zB-DF-HJ-NP-TV-Z][a-zA-Z]*
  8. { printf("Word starts with a CONSONANT: %s", yytext); }
  9. \n ;
  10. . ;
  11. %%
  12.  
  13. int main()
  14. {
  15. printf("Enter a word: ");
  16. yylex();
  17. return 0;
  18. }
  19.  
  20. int yywrap()
  21.  
  22. {
  23. return 1;
  24. }
  25.  
Success #stdin #stdout #stderr 0.03s 6860KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/s5C7Ia/prog:2:1: Syntax error: Operator expected
ERROR: /home/s5C7Ia/prog:24:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit