]> git.saurik.com Git - bison.git/blobdiff - src/state.h
* src/derives.c (print_derives): Display the ruleno.
[bison.git] / src / state.h
index 43e6809b4aaa519de342f35345dc9b2a2ee64f7b..4c60a271268689937b0a60b0b254926d128552cf 100644 (file)
@@ -1,5 +1,5 @@
 /* Type definitions for nondeterministic finite state machine for bison,
 /* Type definitions for nondeterministic finite state machine for bison,
-   Copyright (C) 1984, 1989, 2000 Free Software Foundation, Inc.
+   Copyright 1984, 1989, 2000 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -99,7 +99,9 @@ typedef struct core
 }
 core;
 
 }
 core;
 
-
+#define CORE_ALLOC(Nitems)                                             \
+  (core *) xcalloc ((unsigned) (sizeof (core)                          \
+                                + (Nitems - 1) * sizeof (short)), 1)
 
 typedef struct shifts
 {
 
 typedef struct shifts
 {
@@ -110,6 +112,9 @@ typedef struct shifts
 }
 shifts;
 
 }
 shifts;
 
+#define SHIFTS_ALLOC(Nshifts)                                          \
+  (shifts *) xcalloc ((unsigned) (sizeof (shifts)                      \
+                                  + (Nshifts - 1) * sizeof (short)), 1)
 
 
 typedef struct errs
 
 
 typedef struct errs
@@ -119,6 +124,10 @@ typedef struct errs
 }
 errs;
 
 }
 errs;
 
+#define ERRS_ALLOC(Nerrs)                                              \
+  (errs *) xcalloc ((unsigned) (sizeof (errs)                          \
+                                  + (Nerrs - 1) * sizeof (short)), 1)
+
 
 
 typedef struct reductions
 
 
 typedef struct reductions
@@ -130,9 +139,8 @@ typedef struct reductions
 }
 reductions;
 
 }
 reductions;
 
-extern int nstates;
-extern core *first_state;
-extern shifts *first_shift;
-extern reductions *first_reduction;
+#define REDUCTIONS_ALLOC(Nreductions)                                  \
+  (reductions *) xcalloc ((unsigned) (sizeof (reductions)              \
+                                  + (Nreductions - 1) * sizeof (short)), 1)
 
 #endif /* !STATE_H_ */
 
 #endif /* !STATE_H_ */