/* Calculate which nonterminals can expand into the null string for Bison.
- Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
if (rules_ruleno->rhs[0] >= 0)
{
/* This rule has a non empty RHS. */
- item_number *r = NULL;
- int any_tokens = 0;
- for (r = rules_ruleno->rhs; *r >= 0; ++r)
- if (ISTOKEN (*r))
- any_tokens = 1;
+ item_number *rp = NULL;
+ bool any_tokens = false;
+ for (rp = rules_ruleno->rhs; *rp >= 0; ++rp)
+ if (ISTOKEN (*rp))
+ any_tokens = true;
/* This rule has only nonterminals: schedule it for the second
pass. */
if (!any_tokens)
- for (r = rules_ruleno->rhs; *r >= 0; ++r)
+ for (rp = rules_ruleno->rhs; *rp >= 0; ++rp)
{
rcount[ruleno]++;
- p->next = rsets[*r - ntokens];
+ p->next = rsets[*rp - ntokens];
p->value = rules_ruleno;
- rsets[*r - ntokens] = p;
+ rsets[*rp - ntokens] = p;
p++;
}
}
if (rules_ruleno->useful
&& ! nullable[rules_ruleno->lhs->number - ntokens])
{
- nullable[rules_ruleno->lhs->number - ntokens] = 1;
+ nullable[rules_ruleno->lhs->number - ntokens] = true;
*s2++ = rules_ruleno->lhs->number;
}
}
if (--rcount[r->number] == 0)
if (r->useful && ! nullable[r->lhs->number - ntokens])
{
- nullable[r->lhs->number - ntokens] = 1;
+ nullable[r->lhs->number - ntokens] = true;
*s2++ = r->lhs->number;
}
}