[antlr-interest] Antlr3 b.5 treeparser problem - misplaced action

Terence Parr parrt at cs.usfca.edu
Wed Jan 3 11:37:44 PST 2007


Thanks!  Adding to list.
Ter
On Jan 3, 2007, at 8:39 AM, Shmuel Siegel wrote:

> I wrote the following pattern
>
>             ^(e=entity{value=$e} X?)
>
>
>
> Antlr produced the following logic
>
>
>
>             e=entity();
>
>             if( input.LA(1) == Token.DOWN){
>
>                         match(input Token.DOWN, null);
>
>                         value = e;.
>
>             ……
>
>                         match(input Token.UP, null);
>
>             }
>
>
>
> In other words, Antlr was perfectly willing to deal with the  
> possibility that no X means no tree. But the action was only done  
> if there was a tree.
>
>
>
>



More information about the antlr-interest mailing list