I have a language I am making a parser for which contains function calls. A few function names are reserved and I would like to handle them differently in my grammer. In EBNF it would look like
FunctionCall ::= FunctionName '(' ')'
SpecialFunctionCall :: SpecialName '(' ')'
FunctionName ::= VariableName - SpecialFunctionName
SpecialFunctionName ::= "special_function_a" | "special_function_b"
My problem is in translating the exception operator from EBNF to flex.
FunctionName {Letter}{LetterOrDigit}
Is a super set of SpecialFunctionName, which is a hard-coded string
SpecialFunctionName "special_function_a" | "special_function_b"
Hence I get a warning from bison saying that SpecialFunction will never be matched. Should I merge the tokens and compare the strings in the parser, or is there a recommended way to resolve this ambiguity in in flex?