Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/byacc/closure.c
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | set_first_derives(void) | ||||
for (j = start_symbol; j < nsyms; k++, j++) | for (j = start_symbol; j < nsyms; k++, j++) | ||||
{ | { | ||||
if (k >= BITS_PER_WORD) | if (k >= BITS_PER_WORD) | ||||
{ | { | ||||
cword = *vrow++; | cword = *vrow++; | ||||
k = 0; | k = 0; | ||||
} | } | ||||
if (cword & (unsigned)(1 << k)) | if (cword & (1u << k)) | ||||
{ | { | ||||
rp = derives[j]; | rp = derives[j]; | ||||
while ((rule = *rp++) >= 0) | while ((rule = *rp++) >= 0) | ||||
{ | { | ||||
SETBIT(rrow, rule); | SETBIT(rrow, rule); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if (ISVAR(symbol)) | ||||
csp = nucleus; | csp = nucleus; | ||||
for (rsp = ruleset; rsp < rsend; ++rsp) | for (rsp = ruleset; rsp < rsend; ++rsp) | ||||
{ | { | ||||
word = *rsp; | word = *rsp; | ||||
if (word) | if (word) | ||||
{ | { | ||||
for (i = 0; i < BITS_PER_WORD; ++i) | for (i = 0; i < BITS_PER_WORD; ++i) | ||||
{ | { | ||||
if (word & (unsigned)(1 << i)) | if (word & (1u << i)) | ||||
{ | { | ||||
itemno = rrhs[ruleno + i]; | itemno = rrhs[ruleno + i]; | ||||
while (csp < csend && *csp < itemno) | while (csp < csend && *csp < itemno) | ||||
*itemsetend++ = *csp++; | *itemsetend++ = *csp++; | ||||
*itemsetend++ = itemno; | *itemsetend++ = itemno; | ||||
while (csp < csend && *csp == itemno) | while (csp < csend && *csp == itemno) | ||||
++csp; | ++csp; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |