[antlr-interest] Help on template rewrite
Jim Idle
jimi at temporal-wave.com
Tue Jul 21 11:09:20 PDT 2009
You are acumuating the tokens, which is fine but in the template you
need <it.text>
Or create the template manually and set the formal parameter as you go.
$st = %identifierList();
Etc...
Jim
On Jul 21, 2009, at 5:33 AM, Vincent Dupuis <vincedupuis at hotmail.com>
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 d
> e vos disques durs.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090721/2f2dee2b/attachment.html
More information about the antlr-interest
mailing list