[antlr-interest] optional rule refs

Randall R Schulz rschulz at sonic.net
Thu Aug 23 12:41:49 PDT 2007


On Thursday 23 August 2007 09:19, Terence Parr wrote:
> Howdy,
>
> When obtained results from optional rule refs in template generation,
> you can get a null ptr:
>
> ...
>
> I propose that all refs to rule properties become the equivalent of:
>
> $rr!=null?$rr.property:null
>
> ...

Someone's been looking into Groovy?

It has a ?. dereference operator which has precisely the semantics 
you're describing.


> Comments?
>
> Ter


Randall Schulz


More information about the antlr-interest mailing list