From 5a670b1ed96b92ef0440c06c89b01cf1688db370 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 29 Dec 2001 14:19:13 +0000 Subject: [PATCH] * src/gram.c, src/gram.h (sprec, sassoc): Remove. Adjust all users to use symbols[i]->prec or ->assoc. --- ChangeLog | 6 ++++++ src/conflicts.c | 2 +- src/gram.c | 4 +--- src/gram.h | 5 +---- src/reader.c | 3 --- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1da8f2c..849440c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-12-29 Akim Demaille + + * src/gram.c, src/gram.h (sprec, sassoc): Remove. + Adjust all users to use symbols[i]->prec or ->assoc. + + 2001-12-29 Akim Demaille * src/reader.c, src/reader.h (tags): Remove. diff --git a/src/conflicts.c b/src/conflicts.c index 05f37bd1..2dc1cc5c 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -122,7 +122,7 @@ resolve_sr_conflict (state_t *state, int lookahead) For right association, keep only the shift. For nonassociation, keep neither. */ - switch (sassoc[i]) + switch (symbols[i]->assoc) { case right_assoc: log_resolution (state, lookahead, i, _("shift")); diff --git a/src/gram.c b/src/gram.c index c901c0be..adc0e203 100644 --- a/src/gram.c +++ b/src/gram.c @@ -38,11 +38,9 @@ int nritems; rule_t *rule_table = NULL; short *rprec = NULL; short *rprecsym = NULL; +short *rassoc = NULL; struct bucket **symbols = NULL; -short *sprec = NULL; -short *rassoc = NULL; -short *sassoc = NULL; short *token_translations = NULL; int start_symbol; diff --git a/src/gram.h b/src/gram.h index b8d1c93b..bf49c402 100644 --- a/src/gram.h +++ b/src/gram.h @@ -78,7 +78,7 @@ Item numbers are used in the finite state machine to represent places that parsing can get to. - SPREC records the precedence level of each symbol. + SYMBOLS[I]->PREC records the precedence level of each symbol. Precedence levels are assigned in increasing order starting with 1 so that numerically higher precedence values mean tighter binding @@ -100,9 +100,6 @@ extern int nvars; extern short *ritem; extern int nritems; -extern short *sprec; -extern short *sassoc; - extern int start_symbol; /* associativity values in elements of rassoc, sassoc. */ diff --git a/src/reader.c b/src/reader.c index 45b3eb73..cff0f911 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1570,8 +1570,6 @@ packsymbols (void) user_toknums = XCALLOC (short, nsyms + 1); symbols = XCALLOC (bucket *, nsyms); - sassoc = XCALLOC (short, nsyms); - max_user_token_number = 256; last_user_token_number = 256; @@ -1643,7 +1641,6 @@ packsymbols (void) symbols[bp->value] = bp; user_toknums[bp->value] = bp->user_token_number; - sassoc[bp->value] = bp->assoc; } token_translations_init (); -- 2.45.2