[antlr-interest] Yacc to antlr guide?

Bryan Ewbank ewbankb at yahoo.com
Fri Nov 14 14:03:05 PST 2003


> 1. How do I deal with operator precedence?  The yacc grammar uses
> precedence declarations, and I don't see any equivalent.

You could defer construction of the "correct" tree until the entire
expression is built - construct a stack of operands and operators,
left-to-right, then process it once the entire equation is scanned
and generate the tree at that point.

That means ANTRL will treat all operators as the same level and left
to right, but it does centralizes your precedence table.

=====
- Bryan Ewbank <><

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list