[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: syntactic completion
From: |
Vincent Zweije |
Subject: |
RE: syntactic completion |
Date: |
Fri, 30 Jul 2004 10:20:49 +0200 |
Hans Aberg <address@hidden> wrote:
> One problem with the LALR(1) algorithm is that rather
> than indicating an error right away, it may introduce a
> $default symbol, representing all remaining token in the
> grammar. It will then reduce, and the error will be
> discovered in a later state. This happens because of the
> technique used to compact LR(1). It could happen that a
> LR(1) parser is better for this kind of tweaks, but Bison
> does not support that (yet).
To be pedantic, I don't think the compaction problem had
anything to do with LALR versus LR. Doesn't really matter for
the problem at hand though.
Another problem with LALR is that, compared to LR, it will join
parser states that have the same items, without considering the
lookahead tokens.
Consequently, an LALR parser state may have spurious lookahead
tokens, brought in from another LR state, that are really valid
only if you get into the state through a different path at parse
time. It happens relatively rarely, though.
--
Answer: no.
Question: should I reply before the quote?