I also don't know how to short circuit further parsing of sub trees when 
appropriate. I suspect these problems are related. :-)

Jane

On May 28, 2010, at 8:47 AM, Jane Eisenstein wrote:

> I'm working with a simple expression grammar:
> 
> condition:    conditional_expression  EOF
>       ;
> 
> conditional_expression 
>       :       conditional_term  
>               (  OR conditional_expression  )?
>       ;
> 
> conditional_term 
>       :       conditional_factor
>               ( AND conditional_term  )? 
>       ;
> 
> conditional_factor 
>       :       conditional_primary
>       |       NOT conditional_primary
>       ;
> 
> conditional_primary 
>       : ID 
>       | LEFT_PAREN conditional_expression RIGHT_PAREN 
>       ;
> 
> At runtime, ID tokens evaluate to either true or false. Once it is clear the 
> condition as a whole will evaluate to either true or false, I'd like to stop 
> the evaluation and return the value of the condition. So far, all I've 
> managed to do is short-circuit further ID evaluations once an upper level 
> outcome is know.
> 
> Is there a way to short circuit the entire parse? I'm not sure how to even 
> tell it would be time to do so.
> 
> Jane
> 
> 
> 
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to