Thank you, I wasn't aware of any such thing as nested rewrites.

Manfred

On 09/06/10 18:20, Jim Idle wrote:
I have never seen a case whereby the second part of your tree cannot be
moved to another rule, but I will believe it is possible. Anyway, you just
need to use rewrite rules rather than annotating the tokens with tree
construction.

->^(X ^(Y other))

And do not use 'Literals' in your parser/tree parser, make real lexer
tokens.

Jim

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Manfred Wölfel
Sent: Monday, September 06, 2010 7:38 AM
To: [email protected]
Subject: [antlr-dev] Nested trees

  Is there a way to make a sequence
'X'^ ('Y'^ other)
yield a tree like (X (Y other)) instead of just Y? Because whenever it
encounters ^ it makes the token root of a new tree forgetting about the
past.
The above mentioned code is straightforward generated from a different
language. So it's hard to move the code in brackets into a separate rule
or use
rewrite rules.
_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev


--
Systementwicklung Dr. Manfred Wölfel GmbH
Wilhelm-Külz-Str. 26, D-99423 Weimar
Tel. (03643) 748500
Fax (03643) 748502
Geschäftsführer: Dr. Manfred Wölfel
Amtsgericht: D-07745 Jena (HRB 500921)
Umsatzsteuer-Id.: DE251702442

<<attachment: mail.vcf>>

_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to