[antlr-interest] Stringt. propagation in dispatcher rules

Terence Parr parrt at cs.usfca.edu
Wed Apr 30 08:19:30 PDT 2008


improvements in this area to arrive soon after 3.1 (which is imminent).
Ter
On Apr 30, 2008, at 12:00 AM, Felix Dorner wrote:

> Hey,
>
> I don't know if this can be handled more elegantly. I have a  
> template grammar. The rule 'statement' is a mere dispatcher and  
> doesn't really do anything to the output, so I simply need to  
> propagate the template for every alternative. It would be great if  
> this would happen by default (i.e. if there's no ->). But then it  
> might be unclear which one to choose if an alternative invokes two  
> or more subrules..
>
> Thanks, Felix
>
> statement
>    : declaration -> {$declaration.st}
>    | expression -> {$expression.st}
>    | block -> {$block.st}
>    | ifStatement -> {$ifStatement.st}
>    ;



More information about the antlr-interest mailing list