Line 18 (
{}
) is just wrong; flex will treat that as a pattern, not an action.You probably meant to write
lineno
(that is, a way of typing "Line Nº" which is an abbreviation for "line number".) But did you declare it somewhere? Or did you intend to useyylineno
?Did you define
{id}
? The error message suggests you didn't, but you didn't paste your definitions.In line 32, the pattern for the default rule is
.
:. {tokenval = NONE; return yytext[0];}
Have you read the handy flex manual?
In addition to the above, as a replacement to point 3, the definition:
id {letter}({letter} | {digit})*
is incorrect because regular expressions cannot include unquoted whitespace. You need to write that as
id {letter}({letter}|{digit})*