title: ANTLR ambiguous reference
body: <p>When I compile the following ANTLR grammar file,</p>
  
  <pre><code>conditional_expression
      : (logical_or_expression -&gt; logical_or_expression) ('?' expression ':' rhs=conditional_expression -&gt; ^('?' $conditional_expression expression $rhs))?
      ;
  </code></pre>
  
  <p>I get the following error message.</p>
  
  <blockquote>
    <p>error(132): nesC.g:769:109: reference $conditional_expression is
    ambiguous; rule  conditional_expression is enclosing rule and
    referenced in the production (assu ming enclosing rule)</p>
  </blockquote>
  
  <p>Can anybody tell me the solution to this? Thanks. :-)</p>