%{ #include<stdio.h> int words = 0; %} %% [ ]+ ; [a-zA-Z]+ { words++; } \n ; %% int yywrap() { return 1; } int main() { yylex(); printf("Total words = %d\n" , words); return 0; }
Student good morning.
Standard output is empty
ERROR: /home/vstlfA/prog:22:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit