22 #define MAXSHORT 32767
23 #define MINSHORT -32768
24 #define MAXTABLE 32500
25 #define BITS_PER_WORD 32
26 #define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
27 #define BIT(r, n) ((((r)[(n)>>5])>>((n)&31))&1)
28 #define SETBIT(r, n) ((r)[(n)>>5]|=((unsigned)1<<((n)&31)))
42 #define DOUBLE_QUOTE '\"'
43 #define BACKSLASH '\\'
48 #define CODE_SUFFIX ".code.c"
49 #define DEFINES_SUFFIX ".tab.h"
50 #define OUTPUT_SUFFIX ".tab.c"
51 #define VERBOSE_SUFFIX ".output"
77 #define UNDEFINED (-1)
88 #define IS_IDENT(c) (isalnum(c) || (c) == '_' || (c) == '.' || (c) == '$')
89 #define IS_OCTAL(c) ((c) >= '0' && (c) <= '7')
90 #define NUMERIC_VALUE(c) ((c) - '0')
95 #define ISTOKEN(s) ((s) < start_symbol)
96 #define ISVAR(s) ((s) >= start_symbol)
101 #define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n)))
102 #define FREE(x) (free((char*)(x)))
103 #define MALLOC(n) (malloc((unsigned)(n)))
104 #define NEW(t) ((t*)allocate(sizeof(t)))
105 #define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t))))
106 #define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n)))
short * rlhs
List of left-hand sides of all rules.
int ntokens
The number of tokens (terminals) in the grammar.
int nrules
The number of rules in the grammar.
reductions * first_reduction
int nvars
The number of variables (non-terminals) in the grammar.
int nsyms
The number of symbols (terminals + non-terminals) in the grammar.
short * rrhs
List of right-hand sides of all rules.
short * ritem
Representation of all productions (and items)
short ** derives
List of rules that derive each non-terminal.
int start_symbol
Index of the starting symbol of the grammar.
char ** symbol_name
Array of symbol names.
reductions ** reduction_table