[antlr-interest] Possible bug in (not) setting TokenStartIndex and TokenStopIndex during AST rewrites
Terence Parr
parrt at cs.usfca.edu
Thu Aug 7 11:15:38 PDT 2008
Interesting. I think I only set the start and stop information at the
root for rule because that is the only information I have tracked.
Ter
On Aug 6, 2008, at 11:34 AM, Sam Harwell wrote:
> If you take the following rule:
>
> postfix_expression
> : ( IDENTIFIER
> -> ^(IDENTIFIER)
> )
> ( '.' IDENTIFIER
> -> ^(AST_DIRECT_MEMBER $postfix_expression
> IDENTIFIER)
> )*
> ;
>
>
> And run it on the following input:
>
> a.b.c
>
> You get the following AST:
>
> AST_DIRECT_MEMBER /* has Token Start/Stop Info set */
> - AST_DIRECT_MEMBER /* DOES NOT have Token Start/Stop Info set! */
> -- a /* has Token Start/Stop Info set */
> -- b /* has Token Start/Stop Info set */
> - c /* has Token Start/Stop Info set */
>
>
More information about the antlr-interest
mailing list