The error that you're getting is:
Reduce-Reduce Conflict
'?' can follow more than one completed rule. A Reduce-Reduce error is a caused when a grammar allows two or more rules to be reduced at the same time, for the same token. The grammar is ambigious. Please see the documentation for more information.
It's saying that after it's evaluated some tokens, it's unable to decide whether it's just read a <bool-val>
or whether it read an <rval>
.
To make more sense your grammar ought to say what a <bool-val>
is, specifically, and then say that an <rval>
is a <bool-val>
or other things.
Here's another example of a reduce/reduce error, and here's the GOLD documentation. Gold will try to hide (i.e. emit a warning instead of an error) about a shift/reduce, but it treats reduce/reduce as an error.
I don't entirely understand this; I'm new to parsing. Maybe you're right about this being unexpected behaviour? However the GOLD mailing list seems to be down at the moment, perhaps because it's moderated and Devin has been offline for months.