[antlr-interest] Rewriting trees
Maassen, H.A.M.
H.A.M.Maassen at student.tue.nl
Tue Nov 30 03:17:24 PST 2004
Thanks for the help.
Although I did indeed include the BuildAST option, your suggestion helped me find the real culprit:
ASTLabelType = "antlr.CommonAST";
I don't even remember how that got there... chalk one up to blind copy/pasting ;)
Regards, Harald Maassen
-----Original Message-----
From: Monty Zukowski [mailto:monty at codetransform.com]
Sent: Fri 11/26/2004 4:51 PM
To: antlr-interest at yahoogroups.com
Cc:
Subject: Re: [antlr-interest] Rewriting trees
Terence Parr wrote:
>
> On Nov 26, 2004, at 2:33 AM, Maassen, H.A.M. wrote:
>
>
>>Ok I'm stumped.. I've looked through the manual, the FAQ, but I can't
>>figure out how to reorder trees using a treeparser.. why won't this
>>work:
>>
>>rule: "if" // ignore subtrees for now
>> { ## = #([VIRT,"IF STATEMENT"], ##); }
>> ;
>>
>>How do I tell the treewalker to just copy subtrees without having to
>>describe their exact structure?
>>
>>rule: #("if" (.)*) // this doesn't work :(
>> ;
>>
>>Am I missing anything? Is it right under my nose? I know it can't be
>>this difficult...
>>Are there any tree-reordering examples out there? The ones I
>>downloaded from ANTLR.org don't rewrite but rather generate code or
>>calculate expressions or something else unrelated...
>
Note that the tree parser builds trees as it parses. If it doesn't
parse -- like when you use "." -- then it will not build that tree.
Monty
Yahoo! Groups Links
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5790 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20041130/c4696ad7/attachment.bin
More information about the antlr-interest
mailing list