%{ int ch=0, wr=0; %} %% [^\t\n ]+ {wr++;ch+=yyleng;} [^\n\t] {ch++;} %% int main() { yylex(); printf("Character=%d\nWords=%d\n", ch, wr); return 0; } int yywrap(){ return 1; }
Standard input is empty
Standard output is empty
ERROR: /home/A0gIN3/prog:19:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit