[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More comments, and the ANTLR code is too complex

Mark H Weaver:
> However, _if_ turns out that a non-LL(1) grammar would be easier to
> understand, then I think that's what should be used in the actual
> specification.

If it turns out that it's *MUCH* easier, that would make sense.
At this point we don't know if *this* grammar will be
much easier to understand or not.

However, non-LL(1) grammars are more difficult to implement
with recursive descent parsers (you have to implement all those
transformations).  As far as I know practically
EVERYONE implements Lisp readers (including Scheme) using
recursive descent.  So I think it has to MUCH easier to justify things.

> If you disagree, then consider this: if you were reading the
> specification of a traditional infix language...

The usual transformations to turn a grammar into LL(1)
break down rules into a much larger set of rules (often with funky nulls).
In this case, we only have a few rules, so it's not clear to me
that a non-LL(1) grammar would be that much simpler.

It *might* be.  If anyone has ideas to "reverse transform" our
existing grammar into something simpler, LL(1) or not, I'd love to know!

--- David A. Wheeler