I have the following lemon grammar (simplified from the real grammar):
%right ASSIGN .
%nonassoc FN_CALL .
program ::= expression .
expression ::= expression ASSIGN expression .
expression ::= function_call . [FN_CALL]
expression ::= IDENTIFIER .
function_call ::= expression LPAREN RPAREN . [FN_CALL]
I'm not able to fix the shift-reduce conflict in the following state:
State 3:
expression ::= expression * ASSIGN expression
(1) expression ::= expression ASSIGN expression *
function_call ::= expression * LPAREN RPAREN
ASSIGN shift 1
LPAREN shift 4
LPAREN reduce 1 ** Parsing conflict **
{default} reduce 1
My thought is that the problem was the ambiguity between a=(b(c)) and (a=b)(c), but I would have thought that giving the function call a higher precedence than assignment would fix it. Any ideas what could be the case?