[antlr-interest] parse tree construction

Safiye Celik safisce at gmail.com
Thu Aug 13 06:33:25 PDT 2009


Hi,
I have a grammar such below:

a: b A
b: C^ B

What I want is to set "A" token in rule "a" as the last branch of rule "b"
's parse tree without changing the grammar, rules, tokens etc. (because the
rules and tokens are used somewhere else, the grammar is not such simple of
course)

That's, I want a tree like: ^(C B A). But I only know how to set "A" as the
root of  rule "a" with this grammar(that is done by a: b A^), and it causes
a tree like ^(A C B) which I do not want.

Is there a way to construct the tree I want with above grammar??

I need an urgent answer. Thanks in advance.
-- 
-safiye
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090813/0154b7ef/attachment.html 


More information about the antlr-interest mailing list