Repost: [antlr-interest] Possible bug in generated code

Anakreon Mejdi amejdi at ertonline.gr
Wed Nov 6 07:18:14 PST 2002



Ric Klaren wrote:
> Hi,
> 
> On Wed, Nov 06, 2002 at 12:20:01PM +0200, Anakreon Mejdi wrote:
> 
>>Few days ago I posted a message for a possible bug in the generated 
>>code(Java).
>>
>>Is anybody investigating for this problem?
>>I'd like to know if it is a bug after all.
>>If I can help in any whay please let me know.
> 
> 
> You might want to check if this 2.7.1 snapshot fixes the problem:
> 
> http://wwwhome.cs.utwente.nl/~klaren/antlr/antlr-devel-20010304.tar.gz
> 
> This is version contains a number of fixes for several bugs in 2.7.1. Let
> me grab the opportunity to once more suggest removing or replacing the
> 2.7.1 tarball on antlr.org.
> 
> If you're not using the version of the link above then you're bound to
> stumble upon stuff that's 'odd'.
> 
> Ric

I downloaded the new version.
I have written a TokenStream implementor who stores the tokens into a 
List and removes the first element of the List when nextToken is called
and returns the removed Token.
The reason I wrote this class is debugging.
If nextToken is called but the List is empty a RuntimeException is thrown.
So parsing failed with the new version as well.
However when I passed the JsLexer as TokenStream it did work which seems
odd to me.
When an asp page is parsed the JsParser fails again with message:
line 6:1: unexpected token: null
	at gr.omadak.leviathan.asp.JsParser.if_rule(JsParser.java:910)
	at gr.omadak.leviathan.asp.JsParser.statement(JsParser.java:224)
	at gr.omadak.leviathan.asp.JsParser.start_rule(JsParser.java:111)
	at Main2.main(Main2.java:52)
When the code of the Parser is altered as mentioned in my previus 
posting it doesn't fail.

The new version generates exactly the same code for the optional part of 
the if_rule.
So the failure is what I expected to happen.
I would suggest, someone whou knows how antlr works internally to check
if the code generated is what it should be.
Unfortunatly I can't do it myself since I am a newby in antlr.

Thanks for the suggestion anywhay.

Anakreon.



 

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



More information about the antlr-interest mailing list