[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: Mon, 13 May 2002 19:37:25 +0200

At 11:00 -0600 2002/05/13, Richard Stallman wrote:
>    >Yeesh; you are demonstrating to me how many different uses of the word
>    >"default" there are in this system!
>Perhaps this means we should clarify the manual.
>Could someone make a clear list of the different kinds
>of defaulting that need to be distinguished clearly?

This in fact a constructive input. :-)

We only crossed over the following concepts:

1. Default reduction.
  a. The reduction marked $default in the .output file.
  b. In a reduce/reduce conflict, which rule to use as default.

2. Default action (when the action is left out at a rule in the .y file).

I confused 2 with 1 due to a sloppy reading of Paul Hilfinger's original
posting, and it is named differently ("action" not "reduction"), so I
figure there is not much to dwell about here.

1b is not relevant to Paul's error recovery problem, but under POSIX, a
part of the input (.y) grammar and spec how to act when LALR(1) cannot.

I am not sure why 1a must always be a reduction (why cannot there be a
default shift?). But anyway, it depends on the LALR(1) algorithm it seems
me, and on not error recovery as a part of the grammar only.

If one should be specific, then perhaps 1b should be called the
reduce/reduce conflict default reduction, and 1a the LALR(1) algorithm
default reduction. (The reduce/reduce conflicts one gets depend on the
parsing algorithm, too, but this is not something specified by the
algorithm directly; so 1b is a way to cover up where the algorithm fails,
and is thus not an "LALR(1) algorithm default reduction".)

  Hans Aberg

reply via email to

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