/* Find the rules which are reduced. */
if (!glr_parser)
for (r = 0; r < nrules; ++r)
- rules[r].useful = FALSE;
+ rules[r].useful = false;
for (i = 0; i < nstates; ++i)
{
{
for (j = 0; j < ntokens; ++j)
if (actrow[j] < 0 && actrow[j] != ACTION_MIN)
- rules[item_number_as_rule_number (actrow[j])].useful = TRUE;
+ rules[item_number_as_rule_number (actrow[j])].useful = true;
if (yydefact[i])
- rules[yydefact[i] - 1].useful = TRUE;
+ rules[yydefact[i] - 1].useful = true;
}
}
t = tally[i];
w = width[i];
+ /* If VECTOR has GLR conflicts, return -1 */
+ if (conflict_tos[i] != NULL)
+ {
+ int j;
+ for (j = 0; j < t; j += 1)
+ if (conflict_tos[i][j] != 0)
+ return -1;
+ }
+
for (prev = vector - 1; prev >= 0; prev--)
{
vector_number_t j = order[prev];
return -1;
for (k = 0; match && k < t; k++)
- if (tos[j][k] != tos[i][k] || froms[j][k] != froms[i][k])
+ if (tos[j][k] != tos[i][k] || froms[j][k] != froms[i][k]
+ || (conflict_tos[j] != NULL && conflict_tos[j][k] != 0))
match = 0;
if (match)