I've got some errors in my lex code, maybe someone know what i made wrong ...
16 %%
17 {ws} {/*no action and no return */}
18 {}
19 {newline} {lineo++;}
20 {number} {tokenval=atoi(yytext); return(NUM);}
21 {id} {
22 int p = 0;
23 p = lookup(yytext);
24 if (p == 0)
25 p = insert (yytext, ID);
26 tokenval = p;
27 return symtable[p].token;
28
29 }
30
31 <<EOF>> {return DONE;}
32 {tokenval = NONE; return yytext[0];}
33
34
35 %%
I'm newbie in this kind of technology, and I spend on it many of time but without any positive result. Below errors from the console:
new.l:21: unrecognized rule
new.l:28: unrecognized rule
new.l:28: unrecognized rule
new.l:36: EOF encountered inside an action
new.l:36: unrecognized rule
new.l:36: fatal parse error
make: *** [lex.yy.c] Error 1
When I'm deleted that lines of code whoes bad (lines: 21-32) I've got that error:
new.l:19:2: error: ‘lineo’ undeclared (first use in this function) {newline} {lineo++;}