On Friday, 16 September 2016 06:43:38 UTC-4, Jan Mercl wrote:
> Which rule selects the first parse? Can anybody please enlighten me? 
> Thanks in advance.

The grammar is indeed ambiguous, but the ambiguity is (implicitly) resolved 
by favoring the leftmost derivation, which is what you get from an LL(k) 
parser.  By the same token (hah!), the grammar expresses that unary 
operations have higher precedence than binary ones.  For example, -x + y is 
parsed as (-x)+y, not -(x+y).   If you want a derivation other than the 
leftmost one, you need to use parentheses.

You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to