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