/[bison]/bison/src/nullable.c
ViewVC logotype

Diff of /bison/src/nullable.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by akim, Wed Dec 5 09:27:08 2001 UTC revision 1.18 by akim, Wed Dec 5 09:27:23 2001 UTC
# Line 28  Line 28 
28  #include "reader.h"  #include "reader.h"
29  #include "types.h"  #include "types.h"
30  #include "gram.h"  #include "gram.h"
31    #include "reduce.h"
32  #include "nullable.h"  #include "nullable.h"
33    
34  char *nullable = NULL;  char *nullable = NULL;
# Line 64  set_nullable (void) Line 65  set_nullable (void)
65    s1 = s2 = squeue;    s1 = s2 = squeue;
66    
67    rcount = XCALLOC (short, nrules + 1);    rcount = XCALLOC (short, nrules + 1);
68    rsets = XCALLOC (shorts *, nvars) - ntokens;  
69      /* RITEM contains all the rules, including useless productions.
70         Hence we must allocate room for useless nonterminals too.  */
71      rsets = XCALLOC (shorts *, nvars + nuseless_nonterminals) - ntokens;
72    /* This is said to be more elements than we actually use.    /* This is said to be more elements than we actually use.
73       Supposedly nitems - nrules is enough.       Supposedly nitems - nrules is enough.
74       But why take the risk?  */       But why take the risk?  */
75    relts = XCALLOC (shorts, nitems + nvars + 1);    relts = XCALLOC (shorts, nitems + nvars + nuseless_nonterminals + 1);
76    p = relts;    p = relts;
77    
78    for (r = ritem; *r; ++r)    for (r = ritem; *r; ++r)

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26