29 |
/* Associativity values for tokens and rules. */ |
/* Associativity values for tokens and rules. */ |
30 |
typedef enum |
typedef enum |
31 |
{ |
{ |
32 |
|
undef_assoc, |
33 |
right_assoc, |
right_assoc, |
34 |
left_assoc, |
left_assoc, |
35 |
non_assoc |
non_assoc |
85 |
/* Fetch (or create) the symbol associated to KEY. */ |
/* Fetch (or create) the symbol associated to KEY. */ |
86 |
symbol_t *getsym PARAMS ((const char *key)); |
symbol_t *getsym PARAMS ((const char *key)); |
87 |
|
|
88 |
/* Declare the new SYMBOL. Make it an alias of SYMVAL, and type */ |
/* Declare the new SYMBOL. Make it an alias of SYMVAL. */ |
89 |
/* them with TYPENAME. */ |
void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval)); |
|
void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval, |
|
|
char *typename)); |
|
90 |
|
|
91 |
/* Set the TYPE_NAME associated to SYMBOL. */ |
/* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as |
92 |
|
TYPE_NAME. */ |
93 |
void symbol_type_set PARAMS ((symbol_t *symbol, char *type_name)); |
void symbol_type_set PARAMS ((symbol_t *symbol, char *type_name)); |
94 |
|
|
95 |
/* Set the PRECEDENCE associated to SYMBOL. */ |
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a |
96 |
|
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */ |
97 |
void symbol_precedence_set PARAMS ((symbol_t *symbol, |
void symbol_precedence_set PARAMS ((symbol_t *symbol, |
98 |
int prec, associativity assoc)); |
int prec, associativity assoc)); |
99 |
|
|
132 |
/* Free all the memory allocated for symbols. */ |
/* Free all the memory allocated for symbols. */ |
133 |
void symbols_free PARAMS ((void)); |
void symbols_free PARAMS ((void)); |
134 |
|
|
135 |
/* Check that all the symbols are defined. Report any undefined */ |
/* Check that all the symbols are defined. Report any undefined |
136 |
/* symbols and consider them nonterminals. */ |
symbols and consider them nonterminals. */ |
137 |
void symbols_check_defined PARAMS ((void)); |
void symbols_check_defined PARAMS ((void)); |
138 |
|
|
139 |
/* Perform various sanity checks, assign symbol numbers, and set up |
/* Perform various sanity checks, assign symbol numbers, and set up |