[antlr-interest] Re: Bug in ANTLR C# Codegen?

micheal_jor open.zone at virgin.net
Tue Nov 5 07:30:38 PST 2002


Hi Richard,

> After I posted my fix to the unreachable code warnings I tested the 
new
> ANTLR on some other grammar files and found what appears to be a 
bug that is
> causing a throw exception statement to no get inserted.

Firstly, thank you for the code fixes you contributed for inclusion 
in the C# codegen. I would be grateful if you could send your updated 
CSharpCodeGenerator.java file (and all other affected files) with all 
the fixes incorporated. It is much easier to integrate whole file 
fixes in our environment.

As for the new bug you are reporting, are you testing with ANTLR 
2.7.2a4 ("...the new ANTLR...") ?. If so, please be aware that the C# 
codegen is still being updated for 2.7.2a4. Nevertheless, thanks for 
testing it with the latest version and we are grateful for all early 
adopter test reports.  ;-)

> In this case when
> genBlockFinish gets called it is passed a CSharpBlockFinishingInfo 
class and
> what appears to be a valid noViableAction string containing an 
exception.
> What appears strange is that the fields in the howToFinish instance 
of the
> class states that both an IF and SWITCH were generated and the it 
doesn't
> need a Error Clause. Based on the values for those fields the 
noViableAction
> will never get printed to the output file. 
> 
> Has anyone else encountered this or is my fix to the warning the 
only thing
> that has exposed this?

I certainly haven't come across this before, perhaps others on the 
list have?. Is this behavior present in other langauges -- C++ and/or 
Java?

I would be grateful for a simple grammar file that exposes this 
behaviour. I suspect we would need a grammar file and detailed 
comments that allow us to re-create the behaviour and also explains 
why the behaviour is wrong.

Thanks,

Micheal




 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list