fork download
  1. %{
  2. #include<stdio.h>
  3. int count=0;
  4. %}
  5. %%
  6. [A-Z] {printf("%s is a Capital Letter:\n",yytext);count++;}
  7. . {printf("%s is not Capital Letter:\n",yytext);}
  8. \n {return 0;}
  9. %%
  10. int yywrap(){}
  11. int main()
  12. {
  13. printf("Enter any sentence:\n");
  14. yylex();
  15. printf("No.of Capital Letters in a input:\n",count);
  16. return 0;
  17. }
Success #stdin #stdout #stderr 0.03s 6936KB
stdin
Ssfgfdg
stdout
Standard output is empty
stderr
ERROR: /home/JMiwRA/prog:2:9: Syntax error: Operator expected
ERROR: /home/JMiwRA/prog:17:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit