fork download
  1. %{
  2. #include<stdio.h>
  3. int vowels = 0;
  4. int consonants = 0;
  5. %}
  6.  
  7. %%
  8. [ \t\n]+ ;
  9. [aeiouAEIOU] { vowels++; }
  10. [b-df-hj-np-tv-zB-DF-HJ-NP-TV-Z] { consonants++; }
  11. . ;
  12. %%
  13.  
  14. int main(){
  15. yylex();
  16. printf("Vowels : %d\n", vowels);
  17. printf("Consonants : %d\n", consonants);
  18. return 0;
  19. }
  20.  
  21. int yywrap(){
  22. return 1;
  23. }
  24.  
Success #stdin #stdout #stderr 0.03s 6860KB
stdin
ASDhsa dcASdckjh asASDc
stdout
Standard output is empty
stderr
ERROR: /home/U64AVv/prog:2:1: Syntax error: Operator expected
ERROR: /home/U64AVv/prog:23:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit