fork download
  1. %{
  2. int line_no = 0;
  3. int char_no = 0;
  4. %}
  5. %%
  6. \n ++line_no;
  7. . ++char_no;
  8. end return 0;
  9. %%
  10. int yywrap()
  11. {}
  12. int main()
  13. {
  14.  
  15. yylex();
  16. printf("number of lines = %d, number of chars = %d\n", line_no, char_no );
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout #stderr 0.03s 6876KB
stdin
Hello World
stdout
Standard output is empty
stderr
ERROR: /home/6x63Ym/prog:2:4: Syntax error: Operator expected
ERROR: /home/6x63Ym/prog:19:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? ERROR: Unknown option (h for help)
   Exception: (3) program ? EOF: exit