[antlr-interest] sub-tree tree parsing

Sohail Somani sohail at taggedtype.net
Sun Dec 7 14:56:25 PST 2008


Terence Parr wrote:
> On Dec 7, 2008, at 2:21 PM, Sohail Somani wrote:
> 
>> Hi,
>>
>> I've been out of ANTLR for a little while but I seem to recall that
>> sub-tree tree parsing was going to be made possible. That is, given a
>> tree grammar, you could write a parser that would only need to
>> understand a part of it. This was in contrast to replicating the whole
>> grammar in each tree parser.
>>
>> You could call it a "rule-based" tree parser.
>>
>> Did this ever occur or did I dream it?
> 
> Welcome back Sohail!  Heh, just happened (in my dev branch).  Search  
> for tree pattern matching in archives for link to code.
> 
> see this too
> 
> <http://www.antlr.org/wiki/display/~admin/2008/11/30/Example+tree+rewriting+with+patterns>
> <http://www.antlr.org/wiki/display/~admin/2008/11/29/Woohoo%21+Tree+pattern+matching%2C+rewriting+a+reality>

Hey Terence,

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?

-- 
Sohail Somani
http://uint32t.blogspot.com



More information about the antlr-interest mailing list