X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/90b4416b5b154710407d10d6ed995c83a889a9df..bb527fc2715bf579a512b8a4c7787b4f09954bf9:/src/conflicts.c diff --git a/src/conflicts.c b/src/conflicts.c index 2f213850..a0c0986d 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -97,7 +97,7 @@ resolve_sr_conflict (int state, int lookaheadnum) redprec = rprec[LAruleno[lookaheadnum]]; mask = 1; - fp1 = LA + lookaheadnum * tokensetsize; + fp1 = LA (lookaheadnum); fp2 = lookaheadset; for (i = 0; i < ntokens; i++) { @@ -191,7 +191,7 @@ set_conflicts (int state) unsigned *fp1; int symbol; - if (consistent[state]) + if (state_table[state].consistent) return; for (i = 0; i < tokensetsize; i++) @@ -210,16 +210,16 @@ set_conflicts (int state) } } - k = lookaheads[state + 1]; + k = state_table[state + 1].lookaheads; fp4 = lookaheadset + tokensetsize; /* Loop over all rules which require lookahead in this state. First check for shift-reduce conflict, and try to resolve using precedence */ - for (i = lookaheads[state]; i < k; i++) + for (i = state_table[state].lookaheads; i < k; i++) if (rprec[LAruleno[i]]) { - fp1 = LA + i * tokensetsize; + fp1 = LA (i); fp2 = fp1; fp3 = lookaheadset; @@ -236,9 +236,9 @@ set_conflicts (int state) /* Loop over all rules which require lookahead in this state. Check for conflicts not resolved above. */ - for (i = lookaheads[state]; i < k; i++) + for (i = state_table[state].lookaheads; i < k; i++) { - fp1 = LA + i * tokensetsize; + fp1 = LA (i); fp2 = fp1; fp3 = lookaheadset; @@ -309,12 +309,12 @@ count_sr_conflicts (int state) SETBIT (shiftset, symbol); } - k = lookaheads[state + 1]; + k = state_table[state + 1].lookaheads; fp3 = lookaheadset + tokensetsize; - for (i = lookaheads[state]; i < k; i++) + for (i = state_table[state].lookaheads; i < k; i++) { - fp1 = LA + i * tokensetsize; + fp1 = LA (i); fp2 = lookaheadset; while (fp2 < fp3) @@ -359,14 +359,14 @@ count_rr_conflicts (int state) int rrc_count = 0; - int m = lookaheads[state]; - int n = lookaheads[state + 1]; + int m = state_table[state].lookaheads; + int n = state_table[state + 1].lookaheads; if (n - m < 2) return 0; mask = 1; - baseword = LA + m * tokensetsize; + baseword = LA (m); for (i = 0; i < ntokens; i++) { unsigned *wordp = baseword; @@ -565,14 +565,14 @@ print_reductions (FILE *out, int state) } } - m = lookaheads[state]; - n = lookaheads[state + 1]; + m = state_table[state].lookaheads; + n = state_table[state + 1].lookaheads; if (n - m == 1 && !nodefault) { default_rule = LAruleno[m]; - fp1 = LA + m * tokensetsize; + fp1 = LA (m); fp2 = shiftset; fp3 = lookaheadset; fp4 = lookaheadset + tokensetsize; @@ -609,7 +609,7 @@ print_reductions (FILE *out, int state) if (!nodefault) for (i = m; i < n; i++) { - fp1 = LA + i * tokensetsize; + fp1 = LA (i); fp2 = shiftset; fp3 = lookaheadset; @@ -664,7 +664,7 @@ print_reductions (FILE *out, int state) } mask = 1; - fp1 = LA + m * tokensetsize; + fp1 = LA (m); fp2 = shiftset; for (i = 0; i < ntokens; i++) {