]> git.saurik.com Git - bison.git/blobdiff - src/state.h
* src/state.h (SHIFT_SYMBOL): New.
[bison.git] / src / state.h
index 37598cb0ff7642573057307a18b85549f9b74e4b..535742971c0ecdddfeebab424db58e484eecad70 100644 (file)
@@ -124,10 +124,17 @@ typedef struct shifts
   (shifts *) xcalloc ((unsigned) (sizeof (shifts)                      \
                                   + (Nshifts - 1) * sizeof (short)), 1)
 
+/* What is the symbol which is shifted by SHIFTS->shifts[Shift]?  Can
+   be a token (amongst which the error token), or non terminals in
+   case of gotos.  */
+
+#define SHIFT_SYMBOL(Shifts, Shift) \
+  (state_table[Shifts->shifts[Shift]].accessing_symbol)
+
 /* Is the SHIFTS->shifts[Shift] a real shift? (as opposed to gotos.) */
 
 #define SHIFT_IS_SHIFT(Shifts, Shift) \
-  (ISTOKEN (state_table[Shifts->shifts[Shift]].accessing_symbol))
+  (ISTOKEN (SHIFT_SYMBOL (Shifts, Shift)))
 
 /* Is the SHIFTS->shifts[Shift] a goto?. */
 
@@ -137,7 +144,7 @@ typedef struct shifts
 /* Is the SHIFTS->shifts[Shift] then handling of the error token?. */
 
 #define SHIFT_IS_ERROR(Shifts, Shift) \
-  (state_table[Shifts->shifts[Shift]].accessing_symbol == error_token_number)
+  (SHIFT_SYMBOL (Shifts, Shift) == error_token_number)
 
 
 /*-------.