50 |
RULE_TABLE[R].rhs -- the index in RITEM of the beginning of the |
RULE_TABLE[R].rhs -- the index in RITEM of the beginning of the |
51 |
portion for rule R. |
portion for rule R. |
52 |
|
|
53 |
|
RULE_TABLE[R].prec -- the precedence level of R. |
54 |
|
|
55 |
|
RULE_TABLE[R].precsym -- the symbol-number of the symbol in %prec |
56 |
|
for R (if any). |
57 |
|
|
58 |
|
RULE_TABLE[R].assoc -- the associativity of the rule. |
59 |
|
|
60 |
The right hand side is stored as symbol numbers in a portion of |
The right hand side is stored as symbol numbers in a portion of |
61 |
RITEM. |
RITEM. |
62 |
|
|
74 |
Item numbers are used in the finite state machine to represent |
Item numbers are used in the finite state machine to represent |
75 |
places that parsing can get to. |
places that parsing can get to. |
76 |
|
|
77 |
Precedence levels are recorded in the vectors sprec and rprec. |
SPREC records the precedence level of each symbol. |
|
sprec records the precedence level of each symbol, rprec the |
|
|
precedence level of each rule. rprecsym is the symbol-number of |
|
|
the symbol in %prec for this rule (if any). |
|
78 |
|
|
79 |
Precedence levels are assigned in increasing order starting with 1 |
Precedence levels are assigned in increasing order starting with 1 |
80 |
so that numerically higher precedence values mean tighter binding |
so that numerically higher precedence values mean tighter binding |
95 |
|
|
96 |
extern short *ritem; |
extern short *ritem; |
97 |
|
|
|
extern short *rprec; |
|
|
extern short *rprecsym; |
|
98 |
extern short *sprec; |
extern short *sprec; |
|
extern short *rassoc; |
|
99 |
extern short *sassoc; |
extern short *sassoc; |
100 |
extern short *rline; /* Source line number of each rule */ |
extern short *rline; /* Source line number of each rule */ |
101 |
|
|
102 |
extern int start_symbol; |
extern int start_symbol; |
103 |
|
|
|
typedef struct rule_s |
|
|
{ |
|
|
short lhs; |
|
|
short rhs; |
|
|
} rule_t; |
|
|
|
|
|
extern struct rule_s *rule_table; |
|
|
|
|
104 |
/* associativity values in elements of rassoc, sassoc. */ |
/* associativity values in elements of rassoc, sassoc. */ |
105 |
typedef enum |
typedef enum |
106 |
{ |
{ |
110 |
} associativity; |
} associativity; |
111 |
|
|
112 |
|
|
113 |
|
typedef struct rule_s |
114 |
|
{ |
115 |
|
short lhs; |
116 |
|
short rhs; |
117 |
|
short prec; |
118 |
|
short precsym; |
119 |
|
short assoc; |
120 |
|
} rule_t; |
121 |
|
|
122 |
|
extern struct rule_s *rule_table; |
123 |
|
|
124 |
/* token translation table: indexed by a token number as returned by |
/* token translation table: indexed by a token number as returned by |
125 |
the user's yylex routine, it yields the internal token number used |
the user's yylex routine, it yields the internal token number used |
126 |
by the parser and throughout bison. */ |
by the parser and throughout bison. */ |