[antlr-interest] Help on template rewrite

Terence Parr parrt at cs.usfca.edu
Tue Jul 21 11:07:18 PDT 2009


ST calls toString on the token list.

<identifiers:{ t | <t.name>}>

  is probably more what you want
T
On Jul 21, 2009, at 8:33 AM, Vincent Dupuis wrote:

> Hi,
>
> I need help on how to rewrite a rule to a fill a template with a  
> list of tokens.
>
> The rule:
>
> identList
>     : i+=IDENT (',' i+=IDENT)*
>     -> identifierList(identifiers={$i})
>     ;
>
> returns:
>
> [@17,102:106='ident1',<4>,10:17][@19,109:112='ident2',<4>,10:24]
>
> when using <identifiers> in a template group.
>
> How can I do it properly?
>
>
>
> Attention à tous les Humains. Nous sommes vos photos. Libérez-nous  
> de vos disques durs.
> 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