On Apr 19, 12:45 pm, Joep Suijs <[email protected]> wrote: > 3) Add a rewrite-rule that adds an 'OPERATOR' node above the tree, so: > > Rootnode: type "OPERATOR' with no value > Subnode: undetermined type with value '<' > Sub-Subnodes: > 1 type IDENTIFIER, value 'a' > 2 type IDENTIFIER, value 'b' > > The rule would look something like (not actually tested, but the > guru's say it will solve my problem): > equality_expr : relational_expr (('<' | '>' | '<=' | '>=' ) > relational_expr)* ->^(OPERATOR relational_expr (('<' | '>' | '<=' | > '>=' ) relational_expr )*) ; > > This is easy to scan (just one node to detect) and allows generic > processing (which is useful in this case but I don't know if it > universal useful). It does however add an other level to the tree > which is not very neat. >
After further thought, This may be useful too, or instead of option #4. I'm still leaning towards #4, but #3 is 'growing' on me. :-) William -- You received this message because you are subscribed to the Google Groups "jallib" 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/jallib?hl=en.
