[Flex-help] Diagnostic Message: unrecognized rule
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Arthur S. <ho...@sl...> - 2023-06-08 17:21:23
|
Flex v2.6.4 Bison v3.8.2 Win 7/11-x64 I am updating my Flex file from 2013 and integrating it with the latest Bison. When I ran flex two 'unrecognized rule' errors were generated. I've looked at the Flex 2.6.0 manual pg. 104 and 120 in the FAQ to see what the error is and how to locate the point of error but they don't appear to apply. ERASEME57, pg. 104 says "flex can’t accommodate an action on a separate line". unnamed-faq-90: pg. 120 says "You can’t use the ’/’ operator inside parentheses". Neither of these two conditions seem to apply in my case. The error message does provide a line number where the error was detected but gives a line number at the end of rule processing, "slip.lex:464: unrecognized rule". Is there any way of finding what 'rule' caused the error. I can't seem to find what's wrong. My code begins on the same line as the rule, so ERASEME57 does not apply. The rules containing a '/' are not within a parenthesis, so unnamed-faq-90 does not seem to apply. The rules are: FOLLOW [,;:\(\)<>/{}|[:cntrl:]| ] NAMEEND ([[:graph:]_\$]{-}[,;:\(\)<>/{}]) "/*" { DEBUG(lexerDebugFlag, printf("Lex: %3d:%4d /* BEGIN COMMENT %s\n", lineno, col, yytext);) col++; BEGIN(COMMENT); } "//" { DEBUG(lexerDebugFlag, printf("Lex: %3d:%4d EOL COMMENT %s\n", lineno, col, yytext);) col++; BEGIN(EOLCOMMENT); } .*"*/" { DEBUG(lexerDebugFlag, printf("Lex: %3d:%4d END COMMENT `%s`\n", lineno, col, yytext);) BEGIN(INITIAL); } I'm stuck. Are there other issues associated with the "unrecognized rule" message? Thanks |