fork download
  1. %{
  2. int lines = 0, spaces = 0, tabs = 0, meta = 0, others = 0;
  3. %}
  4.  
  5. %%
  6.  
  7. \n { lines++; }
  8. " " { spaces++; }
  9. \t { tabs++; }
  10. [!@#$%^&*()_+=<>?/\\] { meta++; }
  11. . { others++; }
  12.  
  13. %%
  14.  
  15. int main() {
  16. yylex();
  17.  
  18. printf("Lines: %d\nSpaces: %d\nTabs: %d\nMeta Characters: %d\nOther Characters: %d\n",
  19. lines, spaces, tabs, meta, others);
  20.  
  21. return 0;
  22. }
  23.  
  24. int yywrap() { return 1; }
  25.  
Success #stdin #stdout #stderr 0.02s 6956KB
stdin
r
stdout
Standard output is empty
stderr
ERROR: /home/UIXpgu/prog:2:4: Syntax error: Operator expected
ERROR: /home/UIXpgu/prog:24:26: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit