%{ #include<stdio.h> int word_count = 0; %} %% [a-zA-Z]+ { word_count++; } . { /* Ignore everything else */ } %% int main() { yylex(); return 0; }
hello there
Standard output is empty
ERROR: /home/JSpPUp/prog:2:1: Syntax error: Operator expected ERROR: /home/JSpPUp/prog:15:1: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit