title: Bison lookahead token in the rules
body: <p>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:</p>
  
  <pre><code>Statement :
      Block |
      /*...*/
      ExpressionStatement |
      /*...*/
      ;
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>%nonassoc '{'
  %nonassoc BLOCK
  
  Block :
      '{' StatementListOpt '}' %prec BLOCK
      ;
  </code></pre>
  
  <p>Assuming I'm doing somethig wrong.</p>
  
  <p>Conflict happens after '{' and before '}' (I mean with '}' lookahead).</p>