%{ #include<stdio.h> } %% "if"|"else" {printf("keyword",yytext);} [a-zA-Z][a-zA-Z0-9_]* {printf("identifier",yytext);} %% int main() { printf("enter the input"); yylex(); return 0; } int yywrap() { return 1; }
Standard input is empty
Standard output is empty
ERROR: /home/KkMC9m/prog:17:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit