* src/lalr.h (state_t): New.

(state_table): Be a state_t * instead of a core **.
(accessing_symbol): Remove, part of state_t.
* src/lalr.c: Adjust.
(set_accessing_symbol): Merge into...
(set_state_table): this.
* src/print_graph.c, src/conflicts.c: Adjust.
This commit is contained in:
Akim Demaille
2001-11-19 10:07:14 +00:00
parent d803322e27
commit 9703cc49e0
7 changed files with 82 additions and 64 deletions

View File

@@ -68,7 +68,7 @@ flush_shift (int state, int token)
for (i = 0; i < k; i++)
{
if (shiftp->shifts[i]
&& token == accessing_symbol[shiftp->shifts[i]])
&& token == state_table[shiftp->shifts[i]].accessing_symbol)
(shiftp->shifts[i]) = 0;
}
}
@@ -203,7 +203,7 @@ set_conflicts (int state)
k = shiftp->nshifts;
for (i = 0; i < k; i++)
{
symbol = accessing_symbol[shiftp->shifts[i]];
symbol = state_table[shiftp->shifts[i]].accessing_symbol;
if (ISVAR (symbol))
break;
SETBIT (lookaheadset, symbol);
@@ -303,7 +303,7 @@ count_sr_conflicts (int state)
{
if (!shiftp->shifts[i])
continue;
symbol = accessing_symbol[shiftp->shifts[i]];
symbol = state_table[shiftp->shifts[i]].accessing_symbol;
if (ISVAR (symbol))
break;
SETBIT (shiftset, symbol);
@@ -541,7 +541,7 @@ print_reductions (FILE *out, int state)
{
if (!shiftp->shifts[i])
continue;
symbol = accessing_symbol[shiftp->shifts[i]];
symbol = state_table[shiftp->shifts[i]].accessing_symbol;
if (ISVAR (symbol))
break;
/* if this state has a shift for the error token,
@@ -656,7 +656,7 @@ print_reductions (FILE *out, int state)
{
if (!shiftp->shifts[i])
continue;
symbol = accessing_symbol[shiftp->shifts[i]];
symbol = state_table[shiftp->shifts[i]].accessing_symbol;
if (ISVAR (symbol))
break;
SETBIT (shiftset, symbol);