[antlr-interest] Get rule text only if rule was applied

Miguel Ping mblp at mega.ist.utl.pt
Sat Mar 31 19:22:51 PDT 2007


That was the first thing I tried, didn't work :)

On 3/31/07, Oliver Zeigermann <oliver.zeigermann at gmail.com> wrote:
> I have not tried this, but doesn't
>
> tableAlias
>         : (schemaName DOT)? tableName  alias?
>           {refs.notityTableRef($tableName.text, $alias == null ? null
> : $alias.text, this.scope);}
>         ;
>
> work?
>
> HTH
>
> Oliver
>
> 2007/3/31, Miguel Ping <mblp at mega.ist.utl.pt>:
> > Hi all,
> >
> > I got this rule:
> >
> >
> > tableAlias
> >         : (schemaName DOT)? tableName  alias?
> >           {refs.notityTableRef($tableName.text, $alias.text, this.scope);}
> >
> > But as you can see, if  the alias? part was not applied, $alias.text
> > throws me a NullPointerException (of course, because $alias does not
> > exist). How can I check if alias rule was applied?
> >
> > Thanks,
> > Miguel Ping
> >
>


More information about the antlr-interest mailing list