[antlr-interest] Token as rule argument

Christian chwchw at gmx.de
Thu Dec 15 23:12:11 PST 2011


It should be possible to map a generic Token class (for passing as
parameter in ANTLR) to each language since the lexers and parsers of the
target languages have to know the basic type Token to work.

Would you implement this feature?

Am 07.11.2011 23:22, schrieb Christian:
> Hello,
>
> is it possible to give a rule a token as parameter and duplicate it in
> the rule's rewrite rule? To illustrate my purpose:
>
>     t=type     typed_class_member_decl[$t]
>
> where
>
>     typed_class_member_decl[Token t]
>       : variable_declarator (','   variable_declarator)* -> ($t
> variable_declarator)+
>       ;
>
> For me, it is important that the type Token is programming
> language-independent, i.e., ANTLR should be able to generate every
> target language code without errors and adaptions.
>
> Best Regards,
> Christian
>
> 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