[antlr-interest] sub-tree tree parsing

Terence Parr parrt at cs.usfca.edu
Sun Dec 7 15:28:54 PST 2008


On Dec 7, 2008, at 3:17 PM, Sohail Somani wrote:

> Terence Parr wrote:
>> On Dec 7, 2008, at 2:55 PM, Sohail Somani wrote:
>>> Thanks for the quick reply. The timing of the addition in your
>>> branch is
>>> a nice coincidence!
>>>
>>> Is the idea that the rest of the tree passes through unchanged,  
>>> except
>>> for the parts I am interested in?
>>
>> Indeed.  It does the rewrite in place too. no creating an entirely  
>> new
>> tree.  i love it.
>
> Whoo.. That is nice.
>
> It isn't entirely clear but are topdown and bottomup special rules
> (understood by ANTLR) here?

yep. it says which rules to do on its way up or down.

> I'm assuming that the bottomup rule
> corresponds to the downup "strategy".

both are done during downup strategy.  don't do topdown rule if you  
only want bottomup pass.

> The last time I used ANTLR was ANTLR2 when ANTLR3 only had a Java
> target. Looks like I got a bit of reading to do :-)

You sure do!  Look at ANTLRWorks too

Ter


More information about the antlr-interest mailing list