! Welcome to GOLD Parser Builder 5.2
"Start Symbol" = <Program>
Identifier = [a]
<Program> ::= <Expression>
<Expression> ::= '(' <Expression> ')'
| <Lambda Expression>
| <Variable>
<Variable> ::= Identifier
<Parameter> ::= Identifier
<Lambda Expression> ::= '(' <Parameter> ')' '=>' '{' <Expression> '}'
As you can probably read, both "(i)" and "(i) => { i }" should be valid inputs here, but instead I get a reduce/reduce conflict cause it doesn't know whether to reduce to <Variable> or <Parameter>. The "normal" way to solve this problem (or rather, the way I've found, used in for instance mono's C# compiler) is to have the tokenizer generate different open_paren tokens based on the next tokens (specifically, it looks ahead for the arrow (=>) token and generates lambda_open_paren instead of just open_paren in the case that it is found. Now, my question is, how can I solve this problem in GOLD, or do I need to use some other parser-generator?