%{ #include<stdio.h> %} %% ^[a-zA-Z_][a-zA-Z0-9]* { printf("vaild identifier"); } ^[^a-zA-Z_] .; {printf("invaild identifier"); } int yywrap() { return 1; } int main() { printf("enter the expression") yylex(); }
Standard input is empty
Standard output is empty
ERROR: /home/Kyk1dd/prog:21:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit