[antlr-interest] How to do complex Tree Pattern Matching

Terence Parr parrt at cs.usfca.edu
Sat Sep 12 15:21:07 PDT 2009


yeah, I realized that I had opened up a huge issue without thinking it  
through. I'd like to have something like inContext but the more I  
added to it, the more I realized that the simplest thing to do would  
be to give the programmer basic tools like hasAncestor and let them  
add whatever logic they need.

Ter
On Sep 12, 2009, at 3:18 PM, Gerald Rosenberg wrote:

> At 02:07 PM 9/12/2009, Terence Parr wrote:
>
>> On Sep 12, 2009, at 12:06 AM, Gerald Rosenberg wrote:
>>> Given an existing AST with the two paths:
>>
>> i'd recommend doing ^(m .*) match and a pred in front that says
>> hasAncestor(a) or something
>> Ter
>
> OK, I completely missed BaseTree#hasAncestor
>
> Regards the "or something,"  TreeParser#inContext would seem to be
> it.  However, that method seems to have gone missing from 3.1.3 (it
> was in 3.1.2, but is still absent in 3.1.4).  Is there a reason that
> method got pulled?
>
> Thanks.
>
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list