[antlr-interest] Tree grammars with output=AST and generating problem

Thomas Karcher thkarcher at gmx.de
Thu Mar 20 05:25:19 PDT 2008


Hi,

> last working build was in January, though, if you still want to try it.

Thanks, Johannes, for that hint - with the January version, it seems to
work ...

But I got another problem that I'm not sure if it is my mistake or a
bug:

I have a lexer/parser grammar with CSharp AST output like

start:	rule1
rule:	rule2*
rule2:	TOKEN1 rule3 TOKEN2 -> rule3
...

which I generate with ANTLRWorks 1.2b1.

Unfortunately, the parser crashes with an
Antlr.Runtime.Tree.RewriteEmptyStreamException. I debugged the generated
parser code a bit and found something out: For the AST generation, a
variable named root_0 is initialized with null. During rule processing,
this future root node of the returned AST is not properly filled ... not
even with the nil node. If I fix this by hand, the parser works.
Is this an issue that you know about? I'd be glad to help you debugging
if necessary.


Thanks,
Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20080320/975dcb8e/attachment.bin 


More information about the antlr-interest mailing list