X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/3ae2b51f0851bfd63f73ca4bc263292839d757b1..e9955c83:/src/symtab.h diff --git a/src/symtab.h b/src/symtab.h index 4ca81465..3f167d9f 100644 --- a/src/symtab.h +++ b/src/symtab.h @@ -29,6 +29,7 @@ /* Associativity values for tokens and rules. */ typedef enum { + undef_assoc, right_assoc, left_assoc, non_assoc @@ -84,18 +85,25 @@ struct symbol_s /* Fetch (or create) the symbol associated to KEY. */ symbol_t *getsym PARAMS ((const char *key)); -/* Declare the new SYMBOL. Make it an alias of SYMVAL, and type */ -/* them with TYPENAME. */ -void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval, - char *typename)); +/* Declare the new SYMBOL. Make it an alias of SYMVAL. */ +void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval)); -/* Set the TYPE_NAME associated to SYMBOL. */ +/* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as + TYPE_NAME. */ void symbol_type_set PARAMS ((symbol_t *symbol, char *type_name)); -/* Set the PRECEDENCE associated to SYMBOL. */ +/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a + terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */ void symbol_precedence_set PARAMS ((symbol_t *symbol, int prec, associativity assoc)); +/* Set the CLASS associated to SYMBOL. */ +void symbol_class_set PARAMS ((symbol_t *symbol, symbol_class class)); + +/* Set the USER_TOKEN_NUMBER associated to SYMBOL. */ +void symbol_user_token_number_set PARAMS ((symbol_t *symbol, int user_number)); + + /* Distinguished symbols. AXIOM is the real start symbol, that used by the automaton. STARTSYMBOL is the one specified by the user. */ @@ -124,8 +132,8 @@ void symbols_do PARAMS ((symbol_processor processor, void *processor_data)); /* Free all the memory allocated for symbols. */ void symbols_free PARAMS ((void)); -/* Check that all the symbols are defined. Report any undefined */ -/* symbols and consider them nonterminals. */ +/* Check that all the symbols are defined. Report any undefined + symbols and consider them nonterminals. */ void symbols_check_defined PARAMS ((void)); /* Perform various sanity checks, assign symbol numbers, and set up