%{ #include<stdio.h> int key_word=0; %} %% "include"|"for"|"define" {key_word++;} %% int main() { printf("enter the sentence"); yylex(); printf("keyword are: %d\n ",key_word); } int yywrap() { return 1; }
Standard input is empty
Standard output is empty
ERROR: /home/x63Mvw/prog:14:25: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit