Folks

I'm trying to use a tree grammar I'm using to implement transforms on  
logical formulae.  The rule in question is

xform
        : ^(AND x=(options{greedy=false;}:sent)* ^(OR y=sent+) z=sent*)
        -> ....
        ;

What I want to do is output an AST that represents the distribution of  
the inner OR over AND.  Example

(AND A (OR B C) D) => (OR (AND A B D) (AND A C D))

which involves iteration over the list y (to get B and C in the  
resulting disjuncts) and carrying over [A] and [D] intact.

Can this be done in the grammar without resorting to Java actions?

Bill Andersen
Ontology Works, Inc. (www.ontologyworks.com)
3600 O'Donnell Street, Suite 600
Baltimore, MD 21224
Office: +1.410.675.1201
Cell: +1.443.858.6444
Fax: +1.410.675.1204





List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/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