fork download
  1. %{
  2. int _non_capital = 0;
  3. int _capital = 0;
  4. int others = 0;
  5. %}
  6. non-capital [a-z]
  7. capital [A-Z]
  8. %%
  9. [\n] { printf("Capital = %d - Non-Capital = %d - Others = %d",_capital,_non_capital,others); return
  10. 0 ;}
  11. {non-capital} { _non_capital++ ; }
  12. {capital} {_capital++;}
  13. [ \t]+ {}
  14. . {others++;}
  15. %%
  16. int main ( void ){
  17. yylex();
  18. return (0) ; }
  19. int yywrap(void)
  20. {return 1;}
  21.  
Success #stdin #stdout #stderr 0.03s 6892KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/wjSkOj/prog:2:5: Syntax error: Operator expected
ERROR: /home/wjSkOj/prog:20:12: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit