Re: [go-nuts] Re: Parsing ambiguity?

2016-09-16 Thread Jan Mercl
On Fri, Sep 16, 2016 at 4:13 PM adonovan via golang-nuts < golang-nuts@googlegroups.com> wrote: > 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

[go-nuts] Re: Parsing ambiguity?

2016-09-16 Thread adonovan via golang-nuts
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