>Stephen Horne wrote:>> In LR(1), it is *easy* to give a message of the form "expected one of>> <token list>, but <token> was found." - the set of possible next>> tokens is part of the description of each state, and this can easily>> be traced back to a set of productions (or else the parser could never>> know when/what to reduce).>>>> Yacc and Bison don't support reporting errors in this form AFAIK, but>> the tool isn't the same as the algorithm the tool uses.>>Those use LALR(1), though LR(1) support may be in the works for Bison,

Just making sure I haven't misunderstood...

LALR(1) is basically a minor variation of LR(1). The derivation of the
state model is a little different, but each state still has a set of
valid next tokens, used to choose between shifting and reducing.

>which compacts the states in such a way that when an error token>appears, some extra reductions may take place before issuing the error.

This sounds like table compression modified by some form of
preprocessing of the state model, but it doesn't sound like an
inherent part of LALR, but rather an optimisation specific to Bison?