My question is regarding bison rules syntax. I'm trying to produce parser for ecmascript and end up with shift-reduce conflict about '{' '}' where this production can be either object literal or block. Thing is that specification declares rule for statement:
Statement :
Block |
/*...*/
ExpressionStatement |
/*...*/
;
and ExpressionStatement is descriped in specification as Expression when lookahead is not "function" or '{'. How can I achieve this with bison? I've tried to use precedence but without sucess:
%nonassoc '{'
%nonassoc BLOCK
Block :
'{' StatementListOpt '}' %prec BLOCK
;
Assuming I'm doing somethig wrong.
Conflict happens after '{' and before '}' (I mean with '}' lookahead).