I'm trying to parse CPP using BNFC and I've come to the "typedef-name: identifier" problem (https://en.wikipedia.org/wiki/The_lexer_hack).
This is the spec for BNFC: https://bnfc.readthedocs.io/en/latest/.
The problem comes up when a new type is defined in a program (In C using typedef
) and needs to be lexed as a type for the parser to handle it correctly, but lexing stage has already occured. Other systems have hacks around this issue but I'm not sure how to solve it in BNFC.