89 |
%token PERCENT_UNION "%union" |
%token PERCENT_UNION "%union" |
90 |
%token PERCENT_EXPECT "%expect" |
%token PERCENT_EXPECT "%expect" |
91 |
%token PERCENT_START "%start" |
%token PERCENT_START "%start" |
|
%token PERCENT_LEFT "%left" |
|
|
%token PERCENT_RIGHT "%right" |
|
|
%token PERCENT_NONASSOC "%nonassoc" |
|
92 |
%token PERCENT_PREC "%prec" |
%token PERCENT_PREC "%prec" |
93 |
%token PERCENT_VERBOSE "%verbose" |
%token PERCENT_VERBOSE "%verbose" |
94 |
%token PERCENT_ERROR_VERBOSE "%error-verbose" |
%token PERCENT_ERROR_VERBOSE "%error-verbose" |
143 |
|
|
144 |
declarations: |
declarations: |
145 |
/* Nothing */ |
/* Nothing */ |
146 |
| declarations declaration |
| declarations declaration semi_colon.opt |
147 |
; |
; |
148 |
|
|
149 |
declaration: |
declaration: |
173 |
{ |
{ |
174 |
grammar_start_symbol_set ($2); |
grammar_start_symbol_set ($2); |
175 |
} |
} |
176 |
| "%union" BRACED_CODE semi_colon_opt |
| "%union" BRACED_CODE |
177 |
{ |
{ |
178 |
typed = 1; |
typed = 1; |
179 |
MUSCLE_INSERT_INT ("stype_line", @2.first_line); |
MUSCLE_INSERT_INT ("stype_line", @2.first_line); |
205 |
{ current_assoc = non_assoc; current_type = NULL; } |
{ current_assoc = non_assoc; current_type = NULL; } |
206 |
; |
; |
207 |
|
|
208 |
|
%token PERCENT_LEFT "%left"; |
209 |
|
%token PERCENT_RIGHT "%right"; |
210 |
|
%token PERCENT_NONASSOC "%nonassoc"; |
211 |
precedence_declarator: |
precedence_declarator: |
212 |
"%left" { $$ = left_assoc; } |
"%left" { $$ = left_assoc; } |
213 |
| "%right" { $$ = right_assoc; } |
| "%right" { $$ = right_assoc; } |
285 |
`------------------------------------------*/ |
`------------------------------------------*/ |
286 |
|
|
287 |
grammar: |
grammar: |
288 |
|
rules_or_grammar_declaration |
289 |
|
| grammar rules_or_grammar_declaration |
290 |
|
; |
291 |
|
|
292 |
|
/* As a Bison extension, one can use the grammar declarations in the |
293 |
|
body of the grammar. But to remain LALR(1), they must be ended |
294 |
|
with a semi-colon. */ |
295 |
|
rules_or_grammar_declaration: |
296 |
rules |
rules |
297 |
| grammar rules |
| grammar_declaration ";" |
298 |
; |
; |
299 |
|
|
300 |
rules: |
rules: |
358 |
} |
} |
359 |
; |
; |
360 |
|
|
361 |
semi_colon_opt: |
semi_colon.opt: |
362 |
/* Nothing. */ |
/* Nothing. */ |
363 |
| ";" |
| ";" |
364 |
; |
; |