%{ #include<stdio.h> l=0 w=0 c=0 %} %% [^ \t\n] {w++;c+=yyleng;} [\n] {l++;c++} . {c++} %% int main() { yylex(); printf("lines : %d",l); printf("char : %d",c); printf("words : %d",w); }
Standard input is empty
Standard output is empty
ERROR: /home/FUmz7Y/prog:2:5: Syntax error: Operator expected ERROR: /home/FUmz7Y/prog:23:1: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit