]> git.saurik.com Git - bison.git/blobdiff - src/state.h
* src/state.h (state_t): `solved_conflicts' is a new member.
[bison.git] / src / state.h
index 9446f4f652ca9696391d3fa78f6c5e02cb790073..95b716d89c3e10f2be650d6db6e9f5568cd373dc 100644 (file)
@@ -41,7 +41,7 @@
    the last thing accepted to reach that state.  It is the
    accessing_symbol of the core.
 
-   Each core contains a vector of nitems items which are the indices
+   Each core contains a vector of NITEMS items which are the indices
    in the ritems vector of the items that are selected in this state.
 
    The link field is used for chaining symbols that hash states by
@@ -122,7 +122,7 @@ shifts *shifts_new PARAMS ((int n));
 /* Is the SHIFTS->shifts[Shift] then handling of the error token?. */
 
 #define SHIFT_IS_ERROR(Shifts, Shift) \
-  (SHIFT_SYMBOL (Shifts, Shift) == error_token_number)
+  (SHIFT_SYMBOL (Shifts, Shift) == errtoken->number)
 
 /* When resolving a SR conflicts, if the reduction wins, the shift is
    disabled.  */
@@ -171,7 +171,7 @@ typedef struct state_s
   struct state_s *link;
 
   short number;
-  short accessing_symbol;
+  symbol_number_t accessing_symbol;
   shifts     *shifts;
   reductions *reductions;
   errs       *errs;
@@ -184,13 +184,18 @@ typedef struct state_s
   short lookaheadsp;
   int nlookaheads;
 
-  /* Its items. */
-  short nitems;
-  short items[1];
+  /* If some conflicts were solved thanks to precedence/associativity,
+     a human readable description of the resolution.  */
+  const char *solved_conflicts;
+
+  /* Its items.  Must be last, since ITEMS can be arbitrarily large.
+     */
+  unsigned short nitems;
+  item_number_t items[1];
 } state_t;
 
 #define STATE_ALLOC(Nitems)                                            \
   (state_t *) xcalloc ((unsigned) (sizeof (state_t)                    \
-                                  + (Nitems - 1) * sizeof (short)), 1)
+                                  + (Nitems - 1) * sizeof (item_number_t)), 1)
 
 #endif /* !STATE_H_ */