Hi all,
<div><br></div><div>I think I&#39;ve come across another bug in the C# target when rewriting ASTs in tree grammars.</div><div><br></div><div>I have included two files needed to reproduce the bug. The behaviour is this:</div>
<div><br></div><div>It happens when a tree grammar is created with rules which return values, like:</div><div><br></div><div><div>qualifier returns [List&lt;string&gt; ids]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>:<span class="Apple-tab-span" style="white-space:pre">        </span>^(fqual=FQUALIFIER IDENTIFIER+ ARRAY?)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>ids = new List&lt;String&gt;() { &quot;System&quot;, &quot;Void&quot; };</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;</div><div><br></div><div>The C# compiler complains about the variable ids which it cannot find.</div>
<div>Also, when you reference the return value of such a rule somewhere, as in qual=qualifier, you will have a variable qual with type qualifier_return, instead of List&lt;string&gt;.</div><div><br></div><div>I guess this is a bug in the C# target of ANTLR - but if it&#39;s not, what should I do to make the code compile correctly?</div>
<div>I am using the latest version of ANTLR (3.1.3)</div><div><br></div><div>Thanks,</div><div>Floris</div></div>