bnfc
bnfc copied to clipboard
List category of internal category should be internal
BNFC creates an invalid parser if one makes a list of internal non-terminals.
EVar. Exp ::= Ident ;
internal VInteger. Val ::= Integer ;
internal VExp. Val ::= Exp "{" [Eq] "}" ;
internal VEq. Eq ::= Ident ":=" Val ;
separator Eq "," ;
I didn't find any version of BNFC that would alert of the problem or silently do the right thing (make [Eq] internal as well).
Update: coercions of purely internal categories also end up in the parser, but do not cause errors there (just garbage).
Maybe we should support internal { ... } blocks which can also contain list pragmas and rules etc.