[antlr-interest] Match any node/subtree

Johannes Luber jaluber at gmx.de
Sat Jul 5 08:13:08 PDT 2008


Thomas Vial schrieb:
> Hi,
> 
> Is there a way to have a rule, in a tree grammar, match any node/subtree 
> whatever it is (like a wildcard)? Something like:
> 
> rule:
>    ^(NODE child) { doSomething($child); }   // child is any subtree, no 
> subrule to match it explicitely
> 
> 
> Thanks,
> 
> Thomas

rule:
     ^(NODE child=.) { doSomething($child); };

should work.

Johannes


More information about the antlr-interest mailing list