From 3f6f053ce522c0a8d68af527b2c3acc3def9882c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 5 Dec 2001 09:39:27 +0000 Subject: [PATCH] * src/closure.c (set_firsts): De-obfuscate. --- ChangeLog | 4 ++++ src/closure.c | 29 ++++++++++------------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index bad6225a..a0baad07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-12-05 Akim Demaille + + * src/closure.c (set_firsts): De-obfuscate. + 2001-12-05 Akim Demaille * src/output.c (action_row): De-obfuscate diff --git a/src/closure.c b/src/closure.c index 2cee4f80..849b0b62 100644 --- a/src/closure.c +++ b/src/closure.c @@ -124,33 +124,24 @@ print_fderives (void) static void set_firsts (void) { - unsigned *row; - int symbol; - short *sp; int rowsize; - int i; + int i, j; varsetsize = rowsize = WORDSIZE (nvars); firsts = XCALLOC (unsigned, nvars * rowsize); - row = firsts; for (i = ntokens; i < nsyms; i++) - { - sp = derives[i]; - while (*sp >= 0) - { - symbol = ritem[rule_table[*sp++].rhs]; - if (ISVAR (symbol)) - { - symbol -= ntokens; - SETBIT (row, symbol); - } - } - - row += rowsize; - } + for (j = 0; derives[i][j] >= 0; ++j) + { + int symbol = ritem[rule_table[derives[i][j]].rhs]; + if (ISVAR (symbol)) + { + symbol -= ntokens; + SETBIT (FIRSTS (i - ntokens), symbol); + } + } RTC (firsts, nvars); -- 2.45.2