mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
* src/output.c (action_row): Let default_rule be always a rule
number.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2002-06-30 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/output.c (action_row): Let default_rule be always a rule
|
||||||
|
number.
|
||||||
|
|
||||||
|
|
||||||
2002-06-30 Akim Demaille <akim@epita.fr>
|
2002-06-30 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/closure.c (print_firsts, print_fderives, closure):
|
* src/closure.c (print_firsts, print_fderives, closure):
|
||||||
|
|||||||
@@ -497,11 +497,11 @@ action_row (state_t *state)
|
|||||||
for (i = 0; i < state->nlookaheads; i++)
|
for (i = 0; i < state->nlookaheads; i++)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
rule_number_t rule = -state->lookaheads_rule[i]->number;
|
rule_number_t rule = state->lookaheads_rule[i]->number;
|
||||||
symbol_number_t j;
|
symbol_number_t j;
|
||||||
|
|
||||||
for (j = 0; j < ntokens; j++)
|
for (j = 0; j < ntokens; j++)
|
||||||
if (actrow[j] == rule)
|
if (actrow[j] == -rule)
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
if (count > max)
|
if (count > max)
|
||||||
@@ -521,10 +521,10 @@ action_row (state_t *state)
|
|||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < ntokens; j++)
|
for (j = 0; j < ntokens; j++)
|
||||||
if (actrow[j] == default_rule && ! (glr_parser && conflrow[j]))
|
if (actrow[j] == -default_rule
|
||||||
|
&& ! (glr_parser && conflrow[j]))
|
||||||
actrow[j] = 0;
|
actrow[j] = 0;
|
||||||
}
|
}
|
||||||
default_rule = -default_rule;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,13 @@ typedef struct state_s
|
|||||||
/* Nonzero if no lookahead is needed to decide what to do in state S. */
|
/* Nonzero if no lookahead is needed to decide what to do in state S. */
|
||||||
char consistent;
|
char consistent;
|
||||||
|
|
||||||
/* Used in LALR, not LR(0). */
|
/* Used in LALR, not LR(0).
|
||||||
|
|
||||||
|
When a state is not consistent (there is an S/R or R/R conflict),
|
||||||
|
lookaheads are needed to enable the reductions. NLOOKAHEADS is
|
||||||
|
the number of lookahead guarded reductions of the
|
||||||
|
LOOKAHEADS_RULE. For each rule LOOKAHEADS_RULE[R], LOOKAHEADS[R]
|
||||||
|
is the bitset of the lookaheads enabling this reduction. */
|
||||||
int nlookaheads;
|
int nlookaheads;
|
||||||
bitsetv lookaheads;
|
bitsetv lookaheads;
|
||||||
rule_t **lookaheads_rule;
|
rule_t **lookaheads_rule;
|
||||||
|
|||||||
Reference in New Issue
Block a user