[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TODO update
From: |
Akim Demaille |
Subject: |
Re: TODO update |
Date: |
24 Jul 2002 17:37:47 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| > There is something which remains unclear to me: you seem to say we
| > should not display them as $default, but they are. They are because
| > conflrow and others are not used to generate .output.
|
| Well, no, but the change I introduced for the benefit of GLR affects
| 'actrow', and thus prevents it from being set to the 'default' marker
| (0), and therefore from being compressed away. Take a look at the
| output you provided:
I think we are still not understanding each other. output is
generated *before* the computation of actrow and the like. It does
*not* use the same computation of `default' as the ``real'' automaton
does.
As I said, I agree it is a problem in the design of Bison, but i do
not want to change this now.
|Take a look at the output you provided:
| > | State 5 contains 1 shift/reduce conflict and 2 reduce/reduce conflicts.
| > |
| > |
| > | Grammar
| > |
| > | 0 $axiom: exp $
| > |
| > | 1 exp: exp '+' exp
| > | 2 | exp '+' exp
| > | 3 | '0'
| > |
| ...
| > | state 5
| > |
| > | 1 exp: exp . '+' exp [$, '+']
| > | 1 | exp '+' exp . [$, '+']
| > | 2 | exp . '+' exp [$, '+']
| > | 2 | exp '+' exp . [$, '+']
| > |
| > | '+' shift, and go to state 4
| > |
| > | $ reduce using rule 1 (exp)
| > | $ [reduce using rule 2 (exp)]
| > | '+' [reduce using rule 1 (exp)]
| > | '+' [reduce using rule 2 (exp)]
| > | $default reduce using rule 1 (exp)
|
| This says there are conflicts on $ and '+'. For $, it gives the two
| reductions; for '+', it gives the two possible reductions and the shift.
I'm referring to the fact that, unless I'm mistaken, there is no such
thing as a $default in GLR, so first of all, $default has nothing to
do here.
| > The presentation of this state is very confusing.
|
| I'm not sure why you say so. The one potentially confusing thing is
| that the first $ rule (since there is no S/R conflict) is not
| bracketed, even though it is, in fact, treated identically to the
| other $ rule (which is bracketed). This is an artifact of bison's
| reporting of the OTHER sense of 'default' reduction---i.e., the
| reduction taken by default when there is a R/R conflict for the
| ordinary LALR(1) parser.
I disaagree on the reading. What Bison wrote above is
There are several possible actions on $: r1 and r2.
r2 is disabled.
There are several on +: s4, r1, r2.
r1 and r2 are disabled.
*That's* what ``means'' Bison. `[]' means `possible according to the
grammar, but no executed at all because of conflicts', not `because of
$default'.
Play as much as you want with or without %glr, there is *no
difference*. In the present case, it ought to be
state 5
1 exp: exp . '+' exp [$, '+']
1 | exp '+' exp . [$, '+']
2 | exp . '+' exp [$, '+']
2 | exp '+' exp . [$, '+']
'+' shift, and go to state 4
$ reduce using rule 1 (exp)
$ reduce using rule 2 (exp)
'+' reduce using rule 1 (exp)
'+' reduce using rule 2 (exp)
$default reduce using rule 1 (exp)
and I was, in addition, questioning the presence of this $default
guy. Should it be:
state 5
1 exp: exp . '+' exp [$, '+']
1 | exp '+' exp . [$, '+']
2 | exp . '+' exp [$, '+']
2 | exp '+' exp . [$, '+']
'+' shift, and go to state 4
$ reduce using rule 1 (exp)
$ reduce using rule 2 (exp)
'+' reduce using rule 1 (exp)
'+' reduce using rule 2 (exp)
???
- TODO update, Akim Demaille, 2002/07/09
- Re: TODO update, Paul Hilfinger, 2002/07/21
- Re: TODO update, Akim Demaille, 2002/07/22
- Re: TODO update, Paul Hilfinger, 2002/07/22
- Re: TODO update, Akim Demaille, 2002/07/23
- Re: TODO update, Paul Hilfinger, 2002/07/23
- Re: TODO update,
Akim Demaille <=
- Re: TODO update, Paul Hilfinger, 2002/07/24
- Re: TODO update, Akim Demaille, 2002/07/25
- Re: TODO update, Paul Hilfinger, 2002/07/25
- Re: TODO update, Akim Demaille, 2002/07/26
- Re: TODO update, Paul Hilfinger, 2002/07/28