[antlr-interest] Tree gramar, StringTemplate, Java target conditionals problem

Richard Clark rdclark at gmail.com
Fri Jul 6 09:24:34 PDT 2007


This is a known issue, and Ter has a bug filed for it.

For now, use
alias={$ID != null? $ID.text : null}

 ...Richard


On 7/6/07, Bartosz Dobrzelecki <bartosz at epcc.ed.ac.uk> wrote:
> I have the following rule in my tree grammar:
>
> selExpr :       ^(COL expr ID?)
>                 -> template(expression={$expr.st},alias={$ID.text})
>                 "<expression><if(alias)> AS <alias><endif>" ;


More information about the antlr-interest mailing list