[antlr-interest] Tree Evaluation with Logical Operators (AND and OR)

Priolo, Scott spriolo at walkerinfo.com
Thu Jan 22 03:57:38 PST 2009


Sorry about that, I'm trying to setup a walker that will know what to do with "OR" and "AND" operators.  I have the parser setup so that the AST is nicely formed with expr such as (< a 3).  I'm able to walk and evaluate these simple expr too. But! when I walk (or (and (< a 3) (< b 3)) (< c 3)) I'm stumped.

This must have been solved before and I would guess that there is probably a design pattern for walking boolean AST.

Thanks,
Scott

-----Original Message-----
From: Oliver Zeigermann [mailto:oliver.zeigermann at gmail.com]
Sent: Thu 1/22/2009 4:19 AM
To: Priolo, Scott
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Tree Evaluation with Logical Operators (AND and OR)
 
Hi!

Not quite sure what your problem is. Are you asking how an AST for a
logical expression might look like? Or the grammar that creates it? Or
the tree grammar that walks it? Or something else?

-Oliver


2009/1/22 Priolo, Scott <spriolo at walkerinfo.com>:
> Hello,
>
>
>
> I've searched high and low and can't find a reference to describe the
> Logical Operators (and, or) design pattern for Tree Evaluation (after
> purchasing the book I came up empty handed too).
>
>
>
> Any help?
>
>
>
> Thanks.
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090122/e1c7ca70/attachment.html 


More information about the antlr-interest mailing list