[antlr-interest] Tree grammars & optional AST nodes
Terence Parr
parrt at cs.usfca.edu
Sat Oct 21 09:36:43 PDT 2006
On Oct 20, 2006, at 11:42 PM, Nicolas Rouquette wrote:
> Nicolas Rouquette <nicolas.rouquette at ...> writes:
>
>>
>> Terence Parr <parrt <at> ...> writes:
>>
>>> On Oct 19, 2006, at 5:09 PM, Nicolas Rouquette wrote:
>>>
>>>> <at> init { boolean flag=false; }
>>>> : e1=conditionalExpression (op=assignmentOperator e2=expression
>>>> {flag=true;})?
>>>> -> {flag} ? ^($op $e1 $e2)
>>>> -> $e1
>>>> ;
>>>
>>> or use {$op!=null}? without the flag mumbojumbo.
>
> Bizarre... {op!=null} works.
Yes $op is op.
Ter
More information about the antlr-interest
mailing list