[Top][All Lists]

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

Re: Reductions during Bison error handling

From: Hans Aberg
Subject: Re: Reductions during Bison error handling
Date: Tue, 14 May 2002 23:49:11 +0200

At 14:13 -0700 2002/05/14, Paul Hilfinger wrote:
>HA > I was under the impression that Bison only uses 2 to present the parser,
>HA > but it wasn't used in the actual parser implementation: The Bison parser
>HA > would need a table with (token, action) pairs to be searched, and that
>HA > does not seem the case.
>Sorry.  I wasn't referring to their discussion of using linked lists,
>but rather to the last sentence:
>    "Moreover, error entries can safely be replaced by error actions...."
>which is the additional information-losing compression device that
>Bison uses.

Yes, but I was under the impression that that was a part of the LALR
algorithm, see Aho et al, p. 240: "However, when presented with an
erroneous input, the LALR parser may proceed to do some reduction after the
LR parser has declared an error..."

>HA > So I think the efficient error recovery must include semantic
>Yes, Corbett and others reached similar conclusions.  They would cite
>examples like
>        A(3) : f;
>where in Ada, an appropriate replacement is A(3) := f; if A is an
>array and f is a variable, and A(3) ; f; if A and f are procedures.

So I finally got to understand what his "semantic parser" is about: I
figure it is error recovery based on semantic information.

  Hans Aberg

reply via email to

[Prev in Thread] Current Thread [Next in Thread]