Filename.l: 16: EOF occurs inside an action
I have a lex file like this
%{
#include "y.tab.h"
%}
%%
"print" {return print;}
"exit" {return exit_command;}
[a-zA-Z] {yylval.id = atoi(yytext); return identifier;}
[0-9]+ {yylval.num = atoi(yytext);} return number;}
[ \t\n] ;
[-+=;] {return yytext[0];}
. {ECHO; yyerror("unexpected charater");}
%%
int yywrap(void){return 1;}
But when I try to run lex filename.l
I get the following error
filename.l:16: EOF encountered inside an action
Can anyone see the error
+3
user2493476
source
to share