fork download
  1. %{
  2. int count_vowels=0; int count_consts=0;
  3. %}
  4. %%
  5. [aeiouAEIOU] {count_vowels++;} [a-zA-z] {count_consts++;}
  6. %%
  7. int main()
  8. {
  9. printf("Enter the string \n"); yylex();
  10. printf("THe number of vowel are %d\n",count_vowels); printf("The number of consonant is %d\n",count_consts);
  11. }
  12. int yywrap()
  13. {
  14. return 1;
  15. }
  16.  
Success #stdin #stdout #stderr 0.02s 6972KB
stdin
hello
hi
stdout
Standard output is empty
stderr
ERROR: /home/GY1JoN/prog:15:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? Options:
+:                  spy        -:              no spy
/c|e|r|f|u|a goal:  find       .:              repeat find
a:                  abort      A:              alternatives
b:                  break      c (ret, space): creep
[depth] d:          depth      e:              exit
f:                  fail       [ndepth] g:     goals (backtrace)
h (?):              help       i:              ignore
l:                  leap       L:              listing
n:                  no debug   p:              print
r:                  retry      s:              skip
u:                  up         w:              write
m:                  exception details
C:                  toggle show context
   Exception: (3) program ? EOF: exit