55 register action *actions, *temp;
66 for (i = sp->
nshifts - 1; i >= 0; i--)
91 register int i, j, m, n;
93 register unsigned *rowp;
98 for (i = m; i < n; i++)
102 for (j =
ntokens - 1; j >= 0; j--)
115 register
int ruleno, symbol;
120 for (next = actions; next && next->
symbol < symbol; next = next->
next)
129 while (next && next->
symbol == symbol &&
155 register int goal, i;
162 for (i = p->
nshifts - 1; i >= 0; --i)
178 for (i = 0; i <
nrules; ++i)
183 for (p = parser[i]; p; p = p->
next)
191 for (i = 3; i <
nrules; ++i)
196 fprintf(stderr,
"%s: 1 rule never reduced\n",
myname);
198 fprintf(stderr,
"%s: %d rules never reduced\n",
myname,
nunused);
206 register action *p, *pref;
217 for (p = parser[i]; p; p = p->
next)
279 fprintf(stderr,
"%s: ",
myname);
281 fprintf(stderr,
"1 shift/reduce conflict");
283 fprintf(stderr,
"%d shift/reduce conflicts",
SRtotal);
286 fprintf(stderr,
", ");
289 fprintf(stderr,
"1 reduce/reduce conflict");
291 fprintf(stderr,
"%d reduce/reduce conflicts",
RRtotal);
293 fprintf(stderr,
".\n");
301 register int count, ruleno;
306 for (p = parser[stateno]; p; p = p->
next)
312 if (ruleno > 0 && p->
number != ruleno)
free_action_row(action *p)
int ntokens
The number of tokens (terminals) in the grammar.
int sole_reduction(int stateno)
int nrules
The number of rules in the grammar.
short * ritem
Representation of all productions (and items)
action * add_reductions()