[antlr-interest] How to define multi and div?
scott at javadude.com
Sat Dec 10 08:13:17 PST 2005
Because they have the same precedence, they should really be the same rule.
For a really good treatment of expressions (if I do say so myself),
including this exact case , see my ANTLR Tutorial at
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.
org] On Behalf Of ??
Sent: Saturday, December 10, 2005 10:33 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] How to define multi and div?
I'm studing the expression parsing.
here I define the multi expr and div expr.
: (parenExpr | divExpr) (MULTI^ parenExpr)+
: (parenExpr | multiExpr) (DIV^ parenExpr)+
this define raised recurse error. thoe in fact, the left of multi expr can
be div expr.and each other.
can you give me some suggest ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest