23 |
# define SYMTAB_H_ |
# define SYMTAB_H_ |
24 |
|
|
25 |
# include "location.h" |
# include "location.h" |
26 |
|
# include "assoc.h" |
27 |
|
|
28 |
/*----------. |
/*----------. |
29 |
| Symbols. | |
| Symbols. | |
30 |
`----------*/ |
`----------*/ |
31 |
|
|
|
/* Associativity values for tokens and rules. */ |
|
|
typedef enum |
|
|
{ |
|
|
undef_assoc, |
|
|
right_assoc, |
|
|
left_assoc, |
|
|
non_assoc |
|
|
} associativity; |
|
|
|
|
|
|
|
32 |
/* Symbol classes. */ |
/* Symbol classes. */ |
33 |
typedef enum |
typedef enum |
34 |
{ |
{ |
59 |
|
|
60 |
symbol_number_t number; |
symbol_number_t number; |
61 |
short prec; |
short prec; |
62 |
associativity assoc; |
assoc_t assoc; |
63 |
int user_token_number; |
int user_token_number; |
64 |
|
|
65 |
/* Points to the other in the identifier-symbol pair for an alias. |
/* Points to the other in the identifier-symbol pair for an alias. |
109 |
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a |
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a |
110 |
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */ |
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */ |
111 |
void symbol_precedence_set PARAMS ((symbol_t *symbol, |
void symbol_precedence_set PARAMS ((symbol_t *symbol, |
112 |
int prec, associativity assoc, |
int prec, assoc_t assoc, |
113 |
location_t location)); |
location_t location)); |
114 |
|
|
115 |
/* Set the CLASS associated to SYMBOL. */ |
/* Set the CLASS associated to SYMBOL. */ |