%{ #include<stdio.h>; %} %% if|else|while|for|switch|int|char {printf("keyword");} [a-z]([a-z][0-9])*{printf("id");} [0-9]* {printf("number");} .*{printf("invalid");} %% main(){ yylex(); return 0; } int yywrap() { }
Standard input is empty
Standard output is empty
ERROR: /home/vZAqIX/prog:16:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit