See http://www.webber-labs.com/wp-content/uploads/2015/08/mpl-03.pdf#page=2 G1: ::= a | b | c | - G2: ::= - | // right associative :: = a | b | a G3: ::= - | // left associative :: = a | b | c Parse the same expression, b - c - a, using each of G1, G2 and G3. G1. Two left derivations and two parses of b - c - a using G1. -> - -> b - -> b - - -> b - c - -> b - c - a b - (c - a) / | \ | | - / | \ b / | \ - | | c a -> - -> - - -> b - - -> b - c - -> b - c - a (b - c) - a / | \ - / | \ | - a | | b c G2. A unique left derivation and parse of b - c - a using G2. -> - -> b - -> b - - -> b - c - -> b - c - -> b - c - a b - (c - a) / | \ - | / | \ b - | | c | a G3. A unique left derivation and parse of b - c - a using G3. -> - -> - - -> - - -> b - - -> b - c - -> b - c - a (b - c) - a / | \ - / | \ | - a | | c | b The G2 grammar forces right associative parses. The G3 grammar forces left associative parses. The G1 grammar is ambiguous and does not force a particular parse. The assignment operator in Java is right associative. d = 4; c = 3; b = 2; a = b = c = d; // assignment is right associative a = (b = (c = d)); The < operator in Java cannot be used in an associative way. x < y < z (x < y) < z x < (y < z) // < is NOT associative // (in the sense that x 0 < x && x < 1 1 - 2 - 3 // subtraction is "not associative" in the sense that (x-y)-z != x-(y-z) 1 + 2 + 3 // addition is associative in the sense that (x+y)+z == x+(y+z) 1 * 2 * 3 // multiplication is associative in the sense that (x*y)*z == x*(y*z) So it makes sense for G1, G2, and G3 to use - instead of + or *.