|
Building Parsers with Java | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--sjm.examples.minimath.MiniWrongAssociativity
This class uses a problematic grammar for Minimath. For
a better grammar, see class MinimathCompute.
Here, the grammar is:
e = Num '-' e | Num;
Writing a parser directly from this grammar will show
that the associativity is wrong. For example, this
grammar will lead to a parser that calculates the value
of 25 - 16 - 9 as 18.
| Constructor Summary | |
MiniWrongAssociativity()
|
|
| Method Summary | |
static void |
main(java.lang.String[] args)
Demonstrates incorrect associativity. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MiniWrongAssociativity()
| Method Detail |
public static void main(java.lang.String[] args)
|
by Steve Metsker | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||