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