[antlr-interest] Tree parser eats up DOWN node when navigating optional child node
Gerald Rosenberg
gerald at certiv.net
Wed Aug 4 10:53:49 PDT 2010
------ Original Message (Wednesday, August 04, 2010 9:53:09
AM) From: Junkman ------
Subject: Re: [antlr-interest] Tree parser eats up DOWN node when navigating
optional child node
>
>> parent: ^(parent_a B?) ;
>> parent_a: ^(PARENT A?) ;
>> --------------------------------------------
>
. . . is the same as
parent: ^( ^(PARENT A?) B? ) ;
which will not match ^(PARENT B), but will match ^( ^(PARENT) B). BTW,
a subtree match() will always properly consume the UP DOWN subtree
delimiters.
You probably want
parent: ^(parent_a B?) ;
parent_a: PARENT A? ;
More information about the antlr-interest
mailing list