[antlr-interest] 3.1b1 trouble with a CSharp2/AST example

Johannes Luber JALuber at gmx.de
Fri May 23 16:36:28 PDT 2008


> The C# parser code dies calling NextNode() on stream_INT.
> 
> stream_INT is a RewriteRuleTokenStream and I don't have the code for 
> that to the best of my knowledge, it's in the runtime.  It's throwing a 
> RewriteEmptyStreamException when calling stream_INT.NextNode().
>
> In both the Java and the C# the Parser code looks equivalent to me, and 
> without the code to RewriteRuleTokenStream I can't begin to determine 
> when it would throw this exception.
> 
> The operations performed on this object are as follows...
> - It's allocated (new RewriteRuleTokenStream(adaptor, "token INT");)
> - IToken INT4 is set to (IToken)Match({2x+3x^5}, INT=5, 
> FOLLOW_INT_in_term61={6}), but INT4 comes back null (could this be the 
> problem or is this the right answer?)
> - stream_INT.Add(INT4) is called, passing in null.
> - stream_INT now has Description="token INT", cursor=0, dirty=false, 
> elements=null and singleElement=null, and adaptor=CommonTreeAdaptor
> - stream_INT.NextNode() gets called and throws an error at this point.
> 
> Comments?  Am I supposed to have code for the runtime classes?  'cause I 
> don't know that I have that and this will be about as far as I can go if
> so.
> 
> thanks,
> hamilton
> 

The runtimes should be included in the distribution under the runtime directory. If you have an IDE like VS then you can use the project file.

Johannes

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser


More information about the antlr-interest mailing list