2 /* A Bison parser, made from parser.yy
3 by GNU Bison version 1.25
6 #define YYBISON 1 /* Identify Bison output. */
21 #define ABSDYNAMIC 271
24 #define TRANSLATOR 274
31 #define MELODIC_REQUEST 281
47 #define SPANDYNAMIC 297
50 #define SYMBOLTABLES 300
60 #define E_EXCLAMATION 310
65 #define NOTENAME_ID 315
66 #define DURATION_IDENTIFIER 316
67 #define IDENTIFIER 317
68 #define MELODIC_REQUEST_IDENTIFIER 318
69 #define MUSIC_IDENTIFIER 319
70 #define VOICE_IDENTIFIER 320
71 #define POST_REQUEST_IDENTIFIER 321
72 #define SCRIPT_IDENTIFIER 322
73 #define COMMAND_IDENTIFIER 323
74 #define REAL_IDENTIFIER 324
75 #define TRANS_IDENTIFIER 325
76 #define INT_IDENTIFIER 326
77 #define SCORE_IDENTIFIER 327
78 #define MIDI_IDENTIFIER 328
79 #define PAPER_IDENTIFIER 329
80 #define REQUEST_IDENTIFIER 330
85 #define POST_QUOTES 335
86 #define PRE_QUOTES 336
92 parser.yy -- YACC -> C++ parser for mudela
94 source file of the GNU LilyPond music typesetter
96 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
97 Jan Nieuwenhuizen <jan@digicash.com>
100 #include <iostream.h>
103 #define MUDELA_VERSION "0.1.9"
106 #include "translation-property.hh"
107 #include "script-def.hh"
108 #include "symtable.hh"
111 #include "my-lily-lexer.hh"
112 #include "paper-def.hh"
113 #include "midi-def.hh"
115 #include "keyword.hh"
117 #include "parseconstruct.hh"
119 #include "identifier.hh"
120 #include "command-request.hh"
121 #include "musical-request.hh"
122 #include "my-lily-parser.hh"
123 #include "text-def.hh"
124 #include "translator-group.hh"
126 #include "music-list.hh"
128 #include "duration-convert.hh"
129 #include "change-translator.hh"
131 // needed for bison.simple's malloc() and free()
134 int const GUESS_PLET
= 5;
135 int guess_plet_a
[GUESS_PLET
] =
148 #define YYERROR_VERBOSE 1
150 #define YYPARSE_PARAM my_lily_parser_l
151 #define YYLEX_PARAM my_lily_parser_l
152 #define THIS ((My_lily_parser *) my_lily_parser_l)
154 #define yyerror THIS->parser_error
159 Array
<Interval
>* intarr
;
160 Array
<Melodic_req
*> *melreqvec
;/* should clean up naming */
161 Array
<String
> * strvec
;
169 Music_list
*musiclist
;
174 Melodic_req
* melreq
;
176 Music_output_def
* outputdef
;
183 General_script_def
* script
;
188 Symtables
* symtables
;
197 #line 110 "parser.yy"
201 yylex (YYSTYPE
*s
, void * v_l
)
203 My_lily_parser
*pars_l
= (My_lily_parser
*) v_l
;
204 My_lily_lexer
* lex_l
= pars_l
->lexer_p_
;
206 lex_l
->lexval_l
= (void*) s
;
207 return lex_l
->yylex ();
222 #define YYFLAG -32768
225 #define YYTRANSLATE(x) ((unsigned)(x) <= 336 ? yytranslate[x] : 191)
227 static const char yytranslate
[] = { 0,
228 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
229 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
231 2, 2, 92, 2, 2, 2, 2, 2, 2, 95,
232 98, 86, 100, 2, 101, 87, 91, 2, 2, 2,
233 2, 2, 2, 2, 2, 2, 2, 97, 82, 88,
234 85, 89, 2, 2, 2, 2, 2, 2, 2, 2,
235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
237 96, 2, 93, 99, 103, 2, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
239 102, 2, 2, 2, 2, 2, 2, 2, 2, 2,
240 2, 2, 83, 90, 84, 94, 2, 2, 2, 2,
241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
242 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
243 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
244 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
245 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
246 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
249 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
251 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
252 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
253 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
254 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
255 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
256 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
257 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
258 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
259 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
260 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
261 76, 77, 78, 79, 80, 81
265 static const short yyprhs
[] = { 0,
266 0, 1, 4, 7, 10, 13, 16, 19, 23, 28,
267 29, 32, 37, 38, 44, 49, 50, 53, 54, 59,
268 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
269 81, 83, 88, 90, 94, 100, 105, 110, 111, 117,
270 118, 120, 123, 126, 129, 132, 134, 136, 137, 142,
271 147, 148, 150, 155, 158, 164, 170, 175, 181, 184,
272 185, 189, 194, 195, 200, 205, 209, 212, 217, 221,
273 222, 225, 227, 231, 237, 239, 241, 243, 245, 248,
274 249, 253, 254, 258, 260, 262, 267, 274, 276, 278,
275 282, 286, 287, 290, 294, 298, 300, 303, 305, 307,
276 309, 311, 314, 316, 318, 321, 323, 328, 331, 333,
277 336, 339, 342, 345, 348, 349, 352, 355, 357, 359,
278 361, 363, 365, 367, 370, 373, 375, 378, 385, 391,
279 396, 402, 406, 409, 412, 414, 417, 419, 421, 423,
280 425, 427, 429, 433, 436, 439, 441, 443, 445, 447,
281 449, 454, 461, 464, 466, 468, 470, 472, 474, 476,
282 478, 480, 482, 484, 486, 488, 490, 492, 494, 496,
283 498, 500, 501, 504, 507, 510, 511, 515, 518, 519,
284 522, 524, 527, 528, 530, 532, 534, 536, 538, 541,
285 545, 549, 551, 554, 557, 560, 563, 564, 567, 569,
286 571, 573, 576, 578, 580, 582, 585, 587, 589, 591,
287 593, 598, 599, 601, 605, 610, 615, 616, 620, 623,
291 static const short yyrhs
[] = { -1,
292 104, 109, 0, 104, 116, 0, 104, 111, 0, 104,
293 1, 0, 104, 105, 0, 104, 106, 0, 54, 78,
294 82, 0, 30, 83, 107, 84, 0, 0, 107, 9,
295 0, 107, 78, 85, 149, 0, 0, 108, 78, 85,
296 110, 82, 0, 20, 83, 108, 84, 0, 0, 110,
297 78, 0, 0, 78, 112, 85, 113, 0, 116, 0,
298 121, 0, 124, 0, 158, 0, 129, 0, 184, 0,
299 181, 0, 180, 0, 146, 0, 149, 0, 114, 0,
300 150, 0, 19, 83, 115, 84, 0, 70, 0, 49,
301 78, 82, 0, 115, 78, 85, 134, 82, 0, 115,
302 12, 78, 82, 0, 115, 13, 78, 82, 0, 0,
303 38, 117, 83, 118, 84, 0, 0, 72, 0, 118,
304 109, 0, 118, 129, 0, 118, 119, 0, 118, 1,
305 0, 121, 0, 124, 0, 0, 120, 180, 86, 180,
306 0, 33, 83, 122, 84, 0, 0, 74, 0, 122,
307 32, 78, 82, 0, 122, 184, 0, 122, 78, 85,
308 182, 82, 0, 122, 78, 85, 181, 82, 0, 122,
309 78, 85, 114, 0, 122, 40, 85, 123, 82, 0,
310 122, 1, 0, 0, 123, 182, 182, 0, 25, 83,
311 125, 84, 0, 0, 125, 78, 85, 114, 0, 125,
312 32, 78, 82, 0, 125, 126, 82, 0, 125, 1,
313 0, 48, 172, 85, 179, 0, 83, 128, 84, 0,
314 0, 128, 129, 0, 138, 0, 49, 78, 129, 0,
315 49, 78, 85, 78, 129, 0, 127, 0, 135, 0,
316 137, 0, 64, 0, 64, 82, 0, 0, 24, 130,
317 129, 0, 0, 22, 131, 129, 0, 133, 0, 132,
318 0, 19, 78, 85, 78, 0, 53, 78, 87, 78,
319 85, 134, 0, 78, 0, 180, 0, 88, 136, 89,
320 0, 29, 179, 135, 0, 0, 136, 129, 0, 47,
321 147, 129, 0, 167, 139, 144, 0, 140, 0, 168,
322 82, 0, 176, 0, 177, 0, 141, 0, 142, 0,
323 143, 82, 0, 90, 0, 68, 0, 4, 78, 0,
324 7, 0, 27, 179, 91, 179, 0, 41, 170, 0,
325 126, 0, 8, 179, 0, 34, 170, 0, 10, 78,
326 0, 23, 178, 0, 18, 120, 0, 0, 144, 145,
327 0, 144, 154, 0, 160, 0, 146, 0, 66, 0,
328 151, 0, 175, 0, 60, 0, 147, 80, 0, 81,
329 147, 0, 147, 0, 148, 92, 0, 26, 83, 180,
330 180, 180, 84, 0, 15, 83, 180, 179, 84, 0,
331 16, 83, 179, 84, 0, 42, 83, 180, 180, 84,
332 0, 179, 91, 179, 0, 91, 179, 0, 93, 152,
333 0, 36, 0, 36, 152, 0, 94, 0, 95, 0,
334 93, 0, 56, 0, 57, 0, 153, 0, 96, 97,
335 179, 0, 96, 152, 0, 35, 152, 0, 55, 0,
336 98, 0, 96, 0, 155, 0, 156, 0, 39, 83,
337 159, 84, 0, 78, 180, 180, 180, 180, 180, 0,
338 166, 161, 0, 162, 0, 165, 0, 163, 0, 78,
339 0, 59, 0, 99, 0, 100, 0, 101, 0, 90,
340 0, 102, 0, 89, 0, 87, 0, 67, 0, 158,
341 0, 164, 0, 103, 0, 99, 0, 101, 0, 0,
342 167, 157, 0, 15, 78, 0, 15, 172, 0, 0,
343 31, 169, 147, 0, 51, 78, 0, 0, 170, 174,
344 0, 87, 0, 171, 87, 0, 0, 171, 0, 174,
345 0, 172, 0, 179, 0, 61, 0, 174, 87, 0,
346 174, 86, 179, 0, 174, 91, 179, 0, 97, 0,
347 97, 179, 0, 148, 173, 0, 77, 173, 0, 162,
348 173, 0, 0, 178, 60, 0, 79, 0, 59, 0,
349 179, 0, 101, 179, 0, 71, 0, 76, 0, 69,
350 0, 181, 183, 0, 14, 0, 21, 0, 28, 0,
351 37, 0, 45, 83, 185, 84, 0, 0, 62, 0,
352 185, 50, 78, 0, 185, 78, 85, 186, 0, 46,
353 83, 187, 84, 0, 0, 187, 78, 188, 0, 78,
354 189, 0, 78, 0, 190, 190, 0, 182, 182, 0
360 static const short yyrline
[] = { 0,
361 261, 262, 266, 269, 270, 271, 272, 275, 288, 291,
362 294, 297, 303, 307, 314, 321, 325, 334, 338, 345,
363 350, 354, 358, 362, 366, 370, 374, 377, 380, 384,
364 387, 394, 399, 404, 409, 414, 418, 427, 431, 445,
365 448, 451, 454, 459, 462, 467, 471, 476, 478, 487,
366 492, 496, 499, 503, 504, 507, 510, 514, 518, 523,
367 527, 534, 540, 543, 547, 551, 555, 560, 573, 579,
368 584, 589, 591, 596, 603, 604, 605, 606, 607, 608,
369 611, 613, 616, 617, 618, 621, 634, 648, 650, 654,
370 656, 662, 668, 673, 686, 691, 692, 695, 697, 700,
371 710, 712, 715, 719, 724, 729, 734, 739, 747, 750,
372 753, 757, 761, 767, 772, 781, 785, 794, 796, 799,
373 803, 806, 818, 823, 826, 832, 838, 844, 853, 861,
374 867, 875, 880, 888, 896, 903, 912, 916, 919, 922,
375 925, 928, 932, 944, 952, 961, 965, 968, 971, 973,
376 979, 983, 992, 1003, 1008, 1012, 1018, 1029, 1039, 1041,
377 1042, 1043, 1044, 1045, 1046, 1051, 1053, 1054, 1060, 1062,
378 1063, 1066, 1069, 1078, 1083, 1087, 1097, 1101, 1107, 1111,
379 1116, 1118, 1121, 1125, 1129, 1135, 1141, 1151, 1154, 1157,
380 1160, 1166, 1170, 1180, 1188, 1194, 1206, 1209, 1214, 1218,
381 1222, 1226, 1229, 1236, 1240, 1249, 1254, 1255, 1256, 1257,
382 1263, 1267, 1271, 1274, 1278, 1284, 1288, 1290, 1297, 1303,
388 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
390 static const char * const yytname
[] = { "$","error","$undefined.","ALIAS",
391 "BAR","BEAMPLET","MAEBTELP","BREAK","CADENZA","CLEAR","CLEF","CONTAINS","CONSISTS",
392 "ACCEPTS","CM_T","DURATION","ABSDYNAMIC","END","GROUPING","TRANSLATOR","HEADER",
393 "IN_T","LYRIC","KEY","MELODIC","MIDI","MELODIC_REQUEST","METER","MM_T","MULTI",
394 "NOTENAMES","OCTAVE","OUTPUT","PAPER","PARTIAL","PLET","TELP","PT_T","SCORE",
395 "SCRIPT","SHAPE","SKIP","SPANDYNAMIC","STAFF","START_T","SYMBOLTABLES","TABLE",
396 "TRANSPOSE","TEMPO","TYPE","TEXID","TEXTSTYLE","TITLE","PROPERTY","VERSION",
397 "E_EXCLAMATION","E_SMALLER","E_BIGGER","E_CHAR","DIGIT","NOTENAME_ID","DURATION_IDENTIFIER",
398 "IDENTIFIER","MELODIC_REQUEST_IDENTIFIER","MUSIC_IDENTIFIER","VOICE_IDENTIFIER",
399 "POST_REQUEST_IDENTIFIER","SCRIPT_IDENTIFIER","COMMAND_IDENTIFIER","REAL_IDENTIFIER",
400 "TRANS_IDENTIFIER","INT_IDENTIFIER","SCORE_IDENTIFIER","MIDI_IDENTIFIER","PAPER_IDENTIFIER",
401 "REQUEST_IDENTIFIER","REAL","RESTNAME","STRING","UNSIGNED","POST_QUOTES","PRE_QUOTES",
402 "';'","'{'","'}'","'='","'*'","'.'","'<'","'>'","'|'","'/'","'!'","']'","'~'",
403 "'('","'['","':'","')'","'^'","'+'","'-'","'o'","'_'","mudela","check_version",
404 "add_notenames","notenames_body","mudela_header_body","mudela_header","concat_strings",
405 "add_declaration","@1","identifier_init","translator_spec","translator_spec_body",
406 "score_block","@2","score_body","output_def","intastint_list","paper_block",
407 "paper_body","shape_array","midi_block","midi_body","tempo_request","Voice",
408 "Voice_body","Music","@3","@4","translator_change","property_def","scalar","Chord",
409 "Chord_body","transposed_music","full_element","simple_element","command_elt",
410 "command_req","abbrev_command_req","verbose_command_req","post_requests","structured_post_request",
411 "post_request","steno_melodic_req","steno_note_req","melodic_request","explicit_duration",
412 "dynamic_req","plet_fraction","close_plet_parens","close_request_parens","open_abbrev_parens",
413 "open_plet_parens","open_request_parens","script_definition","script_body","script_req",
414 "gen_script_def","text_def","finger","script_abbreviation","mudela_script","script_dir",
415 "pre_requests","voice_command","@5","duration_length","dots","entered_notemode_duration",
416 "notemode_duration","explicit_steno_duration","abbrev_type","music_elt","lyrics_elt",
417 "pitch_list","unsigned","int","real","dim","unit","symtables","symtables_body",
418 "symtable","symtable_body","symboldef","box","dinterval", NULL
422 static const short yyr1
[] = { 0,
423 104, 104, 104, 104, 104, 104, 104, 105, 106, 107,
424 107, 107, 108, 108, 109, 110, 110, 112, 111, 113,
425 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
426 113, 114, 115, 115, 115, 115, 115, 117, 116, 118,
427 118, 118, 118, 118, 118, 119, 119, 120, 120, 121,
428 122, 122, 122, 122, 122, 122, 122, 122, 122, 123,
429 123, 124, 125, 125, 125, 125, 125, 126, 127, 128,
430 128, 129, 129, 129, 129, 129, 129, 129, 129, 130,
431 129, 131, 129, 129, 129, 132, 133, 134, 134, 135,
432 135, 136, 136, 137, 138, 138, 138, 139, 139, 140,
433 141, 141, 142, 142, 143, 143, 143, 143, 143, 143,
434 143, 143, 143, 143, 144, 144, 144, 145, 145, 146,
435 146, 146, 147, 147, 147, 148, 148, 149, 150, 151,
436 151, 152, 152, 153, 153, 153, 154, 154, 154, 154,
437 154, 154, 155, 156, 156, 157, 157, 157, 157, 157,
438 158, 159, 160, 161, 161, 161, 162, 163, 164, 164,
439 164, 164, 164, 164, 164, 165, 165, 165, 166, 166,
440 166, 167, 167, 168, 168, 169, 168, 168, 170, 170,
441 171, 171, 172, 172, 172, 173, 174, 174, 174, 174,
442 174, 175, 175, 176, 176, 177, 178, 178, 179, 179,
443 180, 180, 180, 181, 181, 182, 183, 183, 183, 183,
444 184, 185, 185, 185, 185, 186, 187, 187, 188, 188,
448 static const short yyr2
[] = { 0,
449 0, 2, 2, 2, 2, 2, 2, 3, 4, 0,
450 2, 4, 0, 5, 4, 0, 2, 0, 4, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 1, 4, 1, 3, 5, 4, 4, 0, 5, 0,
453 1, 2, 2, 2, 2, 1, 1, 0, 4, 4,
454 0, 1, 4, 2, 5, 5, 4, 5, 2, 0,
455 3, 4, 0, 4, 4, 3, 2, 4, 3, 0,
456 2, 1, 3, 5, 1, 1, 1, 1, 2, 0,
457 3, 0, 3, 1, 1, 4, 6, 1, 1, 3,
458 3, 0, 2, 3, 3, 1, 2, 1, 1, 1,
459 1, 2, 1, 1, 2, 1, 4, 2, 1, 2,
460 2, 2, 2, 2, 0, 2, 2, 1, 1, 1,
461 1, 1, 1, 2, 2, 1, 2, 6, 5, 4,
462 5, 3, 2, 2, 1, 2, 1, 1, 1, 1,
463 1, 1, 3, 2, 2, 1, 1, 1, 1, 1,
464 4, 6, 2, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466 1, 0, 2, 2, 2, 0, 3, 2, 0, 2,
467 1, 2, 0, 1, 1, 1, 1, 1, 2, 3,
468 3, 1, 2, 2, 2, 2, 0, 2, 1, 1,
469 1, 2, 1, 1, 1, 2, 1, 1, 1, 1,
470 4, 0, 1, 3, 4, 4, 0, 3, 2, 1,
474 static const short yydefact
[] = { 1,
475 0, 5, 0, 0, 38, 0, 18, 6, 7, 2,
476 4, 3, 13, 10, 0, 0, 0, 0, 0, 40,
477 8, 172, 0, 15, 11, 0, 9, 41, 0, 0,
478 106, 0, 0, 183, 0, 48, 0, 82, 197, 80,
479 0, 0, 0, 0, 176, 0, 179, 0, 179, 0,
480 0, 0, 183, 0, 0, 0, 200, 78, 120, 104,
481 205, 203, 204, 199, 70, 92, 103, 192, 0, 19,
482 30, 20, 21, 22, 109, 75, 24, 85, 84, 76,
483 77, 72, 96, 100, 101, 0, 28, 29, 31, 121,
484 23, 0, 0, 122, 201, 27, 26, 25, 16, 0,
485 45, 183, 0, 39, 42, 44, 46, 47, 43, 105,
486 110, 112, 188, 174, 0, 181, 184, 175, 185, 187,
487 0, 114, 0, 0, 172, 113, 172, 63, 0, 0,
488 0, 0, 51, 111, 0, 108, 0, 212, 123, 0,
489 172, 0, 172, 178, 0, 79, 172, 172, 193, 202,
490 102, 0, 146, 183, 157, 148, 147, 115, 126, 183,
491 149, 150, 173, 183, 98, 99, 97, 0, 12, 0,
492 182, 0, 189, 0, 0, 0, 0, 0, 33, 0,
493 83, 198, 81, 0, 0, 0, 91, 177, 52, 0,
494 180, 0, 0, 0, 213, 0, 125, 124, 94, 0,
495 0, 73, 0, 69, 71, 90, 93, 0, 145, 0,
496 186, 195, 0, 144, 95, 127, 194, 196, 17, 14,
497 0, 190, 191, 130, 0, 86, 0, 0, 0, 0,
498 32, 67, 0, 0, 62, 0, 0, 107, 59, 0,
499 0, 0, 50, 54, 0, 151, 0, 0, 0, 211,
500 68, 172, 0, 133, 0, 143, 135, 140, 141, 139,
501 137, 138, 170, 171, 169, 116, 119, 142, 117, 118,
502 0, 129, 49, 34, 0, 0, 0, 0, 0, 66,
503 0, 0, 60, 0, 0, 131, 214, 0, 74, 0,
504 132, 136, 134, 158, 166, 165, 164, 162, 159, 160,
505 161, 163, 167, 153, 154, 156, 168, 155, 36, 37,
506 88, 0, 89, 65, 0, 64, 128, 53, 0, 57,
507 0, 0, 0, 0, 215, 87, 35, 58, 0, 0,
508 207, 208, 209, 210, 56, 206, 55, 0, 217, 61,
509 152, 0, 0, 216, 220, 218, 0, 219, 0, 222,
513 static const short yydefgoto
[] = { 1,
514 8, 9, 19, 18, 10, 168, 11, 17, 70, 71,
515 180, 12, 15, 29, 106, 122, 73, 190, 319, 74,
516 184, 75, 76, 147, 77, 127, 125, 78, 79, 312,
517 80, 148, 81, 82, 158, 83, 84, 85, 86, 215,
518 266, 87, 141, 160, 88, 89, 90, 209, 268, 269,
519 161, 162, 163, 91, 193, 270, 304, 164, 306, 307,
520 308, 271, 92, 93, 132, 134, 117, 211, 212, 119,
521 94, 165, 166, 126, 95, 313, 329, 347, 336, 98,
522 196, 325, 342, 346, 348, 349
525 static const short yypact
[] = {-32768,
526 19,-32768, -66, -47,-32768, -18,-32768,-32768,-32768,-32768,
527 -32768,-32768,-32768,-32768, -14, -6, 28, 50, -4, 12,
528 -32768, 243, 46,-32768,-32768, 53,-32768,-32768, 328, 62,
529 -32768, 51, 71, 134, 68,-32768, -52,-32768,-32768,-32768,
530 91, 92, 51, 51,-32768, 97,-32768, 100,-32768, 114,
531 118, -46, 141, 126, 127, 128,-32768, 54,-32768,-32768,
532 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 51, 51,-32768,
533 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
534 -32768,-32768,-32768,-32768,-32768, 132,-32768,-32768,-32768,-32768,
535 -32768, 113, 136,-32768,-32768,-32768,-32768,-32768,-32768, 170,
536 -32768, 120, 138,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
537 -32768,-32768,-32768,-32768, 107,-32768, 123,-32768, 101,-32768,
538 51, 107, 137, 7, 608, 159, 608,-32768, 107, 142,
539 -23, -46, 151, -36, 149, -36, 107, 168,-32768, -46,
540 413, 147, 461,-32768, 148,-32768, 509, 557,-32768,-32768,
541 -32768, 73,-32768, 141,-32768, -27,-32768,-32768, 154, 58,
542 -32768,-32768,-32768, 141,-32768,-32768,-32768, 20,-32768, 51,
543 -32768, 51,-32768, 51, 152, 153, 160, 162,-32768, 34,
544 -32768,-32768,-32768, 10, 107, 51,-32768, 154,-32768, 8,
545 101, 107, 157, 107,-32768, -17, 154,-32768,-32768, 51,
546 164,-32768, 165,-32768,-32768,-32768,-32768, 51,-32768, 146,
547 -32768,-32768, 51,-32768, -12,-32768,-32768,-32768,-32768,-32768,
548 161,-32768,-32768,-32768, 107,-32768, 166, 171, 174, 169,
549 -32768,-32768, 177, 172,-32768, 178, 107,-32768,-32768, 193,
550 188, 190,-32768,-32768, 107,-32768, 194, 201, 195,-32768,
551 -32768, 608, 198,-32768, 51,-32768, 73,-32768,-32768, 73,
552 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
553 57,-32768,-32768,-32768, 204, 205, 83, 207, 225,-32768,
554 209, 213,-32768, -1, 107,-32768,-32768, 200,-32768, 83,
555 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
556 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
557 -32768, 215,-32768,-32768, 173,-32768,-32768,-32768, -10,-32768,
558 13, 216, 107, 217,-32768,-32768,-32768,-32768, 139, -48,
559 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 107,-32768,-32768,
560 -32768, 87, 221,-32768, -48,-32768, -48,-32768, -48,-32768,
564 static const short yypgoto
[] = {-32768,
565 -32768,-32768,-32768,-32768, 275,-32768,-32768,-32768,-32768, -170,
566 -32768, 283,-32768,-32768,-32768,-32768, 277,-32768,-32768, 279,
567 -32768, 129,-32768,-32768, -21,-32768,-32768,-32768,-32768, 27,
568 179,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
569 -32768, 103, -77,-32768, 220,-32768,-32768, -149,-32768,-32768,
570 -32768,-32768,-32768, 44,-32768,-32768,-32768, 52,-32768,-32768,
571 -32768,-32768,-32768,-32768,-32768, 272,-32768, -24, 25, -35,
572 -32768,-32768,-32768,-32768, -31, -22, -20, -268,-32768, 135,
573 -32768,-32768,-32768,-32768,-32768, -25
580 static const short yytable
[] = { 96,
581 111, 97, 120, 35, 25, 44, 214, 109, 239, 118,
582 232, 130, 131, 139, 159, 322, 13, 315, 352, 2,
583 61, 120, 57, 257, 113, 123, 331, 63, 142, 50,
584 124, 57, 248, 332, 140, 14, 149, 150, 3, 240,
585 333, 233, 64, 258, 259, 228, 229, 241, 4, 334,
586 330, 64, 51, 59, 188, 178, 5, 53, 61, 16,
587 249, 340, 197, 208, 66, 63, 250, 61, 20, 213,
588 120, 328, 6, 26, 63, 21, 179, 118, 350, 27,
589 260, 261, 262, 28, 68, 242, 263, 234, 264, 175,
590 265, 243, 170, 235, 335, 48, 7, 219, 191, 176,
591 191, 220, 120, 181, 120, 183, 185, 292, 316, 57,
592 293, 230, 22, 320, 194, 294, 57, 231, 113, 199,
593 210, 202, 120, 295, 210, 205, 207, 23, 120, 64,
594 99, 57, 120, 24, 155, 146, 64, 100, 221, 110,
595 222, 57, 223, 296, 116, 297, 298, 152, 112, 216,
596 121, 64, 331, 62, 238, 299, 300, 301, 302, 332,
597 311, 64, 237, 208, 343, 57, 333, 153, 251, 245,
598 344, 247, 139, 128, 129, 334, 254, 62, 57, 133,
599 113, 256, 135, 69, 217, 64, 172, 173, 218, 154,
600 155, 174, 57, 140, 113, 42, 137, 114, 64, 57,
601 138, 113, 273, 143, 144, 145, 116, 69, 156, 171,
602 157, 114, 64, 151, 281, 123, 115, 167, 182, 64,
603 116, 177, 285, 291, 189, 210, 192, 116, 210, 195,
604 289, 200, 186, 198, 203, 224, 255, 226, 225, 227,
605 246, 252, 253, 315, 272, 324, 30, 274, 275, 31,
606 32, 276, 33, 277, 278, 124, 279, 34, 35, 280,
607 36, 37, 323, 321, 38, 39, 40, 41, 42, 43,
608 282, 44, 283, 45, 284, 46, 47, 286, 287, 288,
609 5, 48, 290, 49, 50, 309, 310, 51, 314, 52,
610 53, 54, 317, 55, 318, 56, 327, 337, 345, 339,
611 338, 57, 353, 105, 72, 107, 58, 108, 59, 187,
612 60, 61, 236, 62, 303, 341, 326, 267, 63, 169,
613 136, 64, 305, 351, 244, 65, 0, 0, 101, 0,
614 66, 30, 67, 0, 31, 32, 0, 33, 0, 68,
615 0, 0, 102, 69, 0, 36, 103, 3, 0, 38,
616 39, 40, 41, 0, 43, 0, 44, 0, 45, 0,
617 46, 47, -172, 0, 0, 0, 0, 0, 49, 0,
618 0, 0, 0, 0, 52, 53, 54, 0, 55, 0,
619 56, 0, -172, 0, 0, 0, 0, -172, 0, 0,
620 0, 58, 0, 0, 0, 60, 0, 0, 0, 0,
621 0, 0, 0, 0, -172, -172, 0, 0, -172, 0,
622 65, 104, 0, 0, 0, 66, 30, 67, 0, 31,
623 32, 0, 33, -172, 0, -172, 0, 102, 0, 0,
624 36, 103, 0, 0, 38, 39, 40, 0, 0, 43,
625 0, 44, 0, 45, 0, 0, 47, 0, 0, 0,
626 0, 0, 0, 49, 0, 0, 0, 0, 0, 52,
627 53, 54, 0, 55, 30, 56, 0, 31, 32, 0,
628 33, 0, 0, 0, 0, 102, 58, 0, 36, 103,
629 60, 0, 38, 39, 40, 0, 0, 43, 0, 44,
630 0, 45, 198, 0, 47, 65, 0, 0, 0, 0,
631 66, 49, 67, 0, 0, 0, 0, 52, 53, 54,
632 0, 55, 30, 56, 0, 31, 32, 0, 33, 0,
633 0, 0, 0, 102, 58, 0, 36, 103, 60, 0,
634 38, 39, 40, 0, 0, 43, 0, 44, 0, 45,
635 0, 0, 47, 65, 0, 201, 0, 0, 66, 49,
636 67, 0, 0, 0, 0, 52, 53, 54, 0, 55,
637 30, 56, 0, 31, 32, 0, 33, 0, 0, 0,
638 0, 102, 58, 0, 36, 103, 60, 0, 38, 39,
639 40, 0, 0, 43, 0, 44, 0, 45, 0, 0,
640 47, 65, 204, 0, 0, 0, 66, 49, 67, 0,
641 0, 0, 0, 52, 53, 54, 0, 55, 0, 56,
642 0, 30, 0, 0, 31, 32, 0, 33, 0, 0,
643 58, 0, 102, 0, 60, 36, 103, 0, 0, 38,
644 39, 40, 0, 0, 43, 0, 44, 0, 45, 65,
645 0, 47, 0, 0, 66, 206, 67, 0, 49, 0,
646 0, 0, 0, 0, 52, 53, 54, 0, 55, 0,
647 56, 0, 0, 0, 0, 0, 0, 0, 0, 0,
648 0, 58, 0, 0, 0, 60, 0, 0, 0, 0,
649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
650 65, 0, 0, 0, 0, 66, 0, 67
653 static const short yycheck
[] = { 22,
654 32, 22, 34, 16, 9, 29, 156, 29, 1, 34,
655 1, 43, 44, 60, 92, 284, 83, 19, 0, 1,
656 69, 53, 59, 36, 61, 78, 14, 76, 53, 42,
657 83, 59, 50, 21, 81, 83, 68, 69, 20, 32,
658 28, 32, 79, 56, 57, 12, 13, 40, 30, 37,
659 319, 79, 45, 66, 132, 49, 38, 48, 69, 78,
660 78, 330, 140, 91, 88, 76, 84, 69, 83, 97,
661 102, 82, 54, 78, 76, 82, 70, 102, 347, 84,
662 93, 94, 95, 72, 97, 78, 99, 78, 101, 121,
663 103, 84, 115, 84, 82, 39, 78, 78, 134, 122,
664 136, 82, 134, 125, 136, 127, 129, 257, 279, 59,
665 260, 78, 85, 284, 137, 59, 59, 84, 61, 141,
666 152, 143, 154, 67, 156, 147, 148, 78, 160, 79,
667 85, 59, 164, 84, 78, 82, 79, 85, 170, 78,
668 172, 59, 174, 87, 87, 89, 90, 35, 78, 92,
669 83, 79, 14, 71, 186, 99, 100, 101, 102, 21,
670 78, 79, 185, 91, 78, 59, 28, 55, 200, 192,
671 84, 194, 60, 83, 83, 37, 208, 71, 59, 83,
672 61, 213, 83, 101, 160, 79, 86, 87, 164, 77,
673 78, 91, 59, 81, 61, 26, 83, 78, 79, 59,
674 83, 61, 225, 78, 78, 78, 87, 101, 96, 87,
675 98, 78, 79, 82, 237, 78, 83, 82, 60, 79,
676 87, 85, 245, 255, 74, 257, 78, 87, 260, 62,
677 252, 85, 91, 80, 87, 84, 91, 78, 86, 78,
678 84, 78, 78, 19, 84, 46, 4, 82, 78, 7,
679 8, 78, 10, 85, 78, 83, 85, 15, 16, 82,
680 18, 19, 285, 284, 22, 23, 24, 25, 26, 27,
681 78, 29, 85, 31, 85, 33, 34, 84, 78, 85,
682 38, 39, 85, 41, 42, 82, 82, 45, 82, 47,
683 48, 49, 84, 51, 82, 53, 82, 82, 78, 83,
684 323, 59, 0, 29, 22, 29, 64, 29, 66, 131,
685 68, 69, 184, 71, 271, 338, 290, 215, 76, 100,
686 49, 79, 271, 349, 190, 83, -1, -1, 1, -1,
687 88, 4, 90, -1, 7, 8, -1, 10, -1, 97,
688 -1, -1, 15, 101, -1, 18, 19, 20, -1, 22,
689 23, 24, 25, -1, 27, -1, 29, -1, 31, -1,
690 33, 34, 35, -1, -1, -1, -1, -1, 41, -1,
691 -1, -1, -1, -1, 47, 48, 49, -1, 51, -1,
692 53, -1, 55, -1, -1, -1, -1, 60, -1, -1,
693 -1, 64, -1, -1, -1, 68, -1, -1, -1, -1,
694 -1, -1, -1, -1, 77, 78, -1, -1, 81, -1,
695 83, 84, -1, -1, -1, 88, 4, 90, -1, 7,
696 8, -1, 10, 96, -1, 98, -1, 15, -1, -1,
697 18, 19, -1, -1, 22, 23, 24, -1, -1, 27,
698 -1, 29, -1, 31, -1, -1, 34, -1, -1, -1,
699 -1, -1, -1, 41, -1, -1, -1, -1, -1, 47,
700 48, 49, -1, 51, 4, 53, -1, 7, 8, -1,
701 10, -1, -1, -1, -1, 15, 64, -1, 18, 19,
702 68, -1, 22, 23, 24, -1, -1, 27, -1, 29,
703 -1, 31, 80, -1, 34, 83, -1, -1, -1, -1,
704 88, 41, 90, -1, -1, -1, -1, 47, 48, 49,
705 -1, 51, 4, 53, -1, 7, 8, -1, 10, -1,
706 -1, -1, -1, 15, 64, -1, 18, 19, 68, -1,
707 22, 23, 24, -1, -1, 27, -1, 29, -1, 31,
708 -1, -1, 34, 83, -1, 85, -1, -1, 88, 41,
709 90, -1, -1, -1, -1, 47, 48, 49, -1, 51,
710 4, 53, -1, 7, 8, -1, 10, -1, -1, -1,
711 -1, 15, 64, -1, 18, 19, 68, -1, 22, 23,
712 24, -1, -1, 27, -1, 29, -1, 31, -1, -1,
713 34, 83, 84, -1, -1, -1, 88, 41, 90, -1,
714 -1, -1, -1, 47, 48, 49, -1, 51, -1, 53,
715 -1, 4, -1, -1, 7, 8, -1, 10, -1, -1,
716 64, -1, 15, -1, 68, 18, 19, -1, -1, 22,
717 23, 24, -1, -1, 27, -1, 29, -1, 31, 83,
718 -1, 34, -1, -1, 88, 89, 90, -1, 41, -1,
719 -1, -1, -1, -1, 47, 48, 49, -1, 51, -1,
720 53, -1, -1, -1, -1, -1, -1, -1, -1, -1,
721 -1, 64, -1, -1, -1, 68, -1, -1, -1, -1,
722 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
723 83, -1, -1, -1, -1, 88, -1, 90
727 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
728 #line 3 "/usr/lib/bison.simple"
730 /* Skeleton output parser for bison,
731 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
733 This program is free software; you can redistribute it and/or modify
734 it under the terms of the GNU General Public License as published by
735 the Free Software Foundation; either version 2, or (at your option)
738 This program is distributed in the hope that it will be useful,
739 but WITHOUT ANY WARRANTY; without even the implied warranty of
740 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
741 GNU General Public License for more details.
743 You should have received a copy of the GNU General Public License
744 along with this program; if not, write to the Free Software
745 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
747 /* As a special exception, when this file is copied by Bison into a
748 Bison output file, you may use that output file without restriction.
749 This special exception was added by the Free Software Foundation
750 in version 1.24 of Bison. */
754 #define alloca __builtin_alloca
755 #else /* not GNU C. */
756 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
758 #else /* not sparc */
759 #if defined (MSDOS) && !defined (__TURBOC__)
761 #else /* not MSDOS, or __TURBOC__ */
765 #else /* not MSDOS, __TURBOC__, or _AIX */
769 void *alloca (unsigned int);
771 #else /* not __cplusplus */
773 #endif /* not __cplusplus */
775 #endif /* not _AIX */
776 #endif /* not MSDOS, or __TURBOC__ */
777 #endif /* not sparc. */
778 #endif /* not GNU C. */
779 #endif /* alloca not defined. */
781 /* This is the parser code that is written into each bison parser
782 when the %semantic_parser declaration is not specified in the grammar.
783 It was written by Richard Stallman by simplifying the hairy parser
784 used when %semantic_parser is specified. */
786 /* Note: there must be only one dollar sign in this file.
787 It is replaced by the list of actions, each action
788 as one case of the switch. */
790 #define yyerrok (yyerrstatus = 0)
791 #define yyclearin (yychar = YYEMPTY)
794 #define YYACCEPT return(0)
795 #define YYABORT return(1)
796 #define YYERROR goto yyerrlab1
797 /* Like YYERROR except do call yyerror.
798 This remains here temporarily to ease the
799 transition to the new meaning of YYERROR, for GCC.
800 Once GCC version 2 has supplanted version 1, this can go. */
801 #define YYFAIL goto yyerrlab
802 #define YYRECOVERING() (!!yyerrstatus)
803 #define YYBACKUP(token, value) \
805 if (yychar == YYEMPTY && yylen == 1) \
806 { yychar = (token), yylval = (value); \
807 yychar1 = YYTRANSLATE (yychar); \
812 { yyerror ("syntax error: cannot back up"); YYERROR; } \
816 #define YYERRCODE 256
819 #define YYLEX yylex()
825 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
827 #define YYLEX yylex(&yylval, &yylloc)
829 #else /* not YYLSP_NEEDED */
831 #define YYLEX yylex(&yylval, YYLEX_PARAM)
833 #define YYLEX yylex(&yylval)
835 #endif /* not YYLSP_NEEDED */
838 /* If nonreentrant, generate the variables here */
842 int yychar
; /* the lookahead symbol */
843 YYSTYPE yylval
; /* the semantic value of the */
844 /* lookahead symbol */
847 YYLTYPE yylloc
; /* location data for the lookahead */
851 int yynerrs
; /* number of parse errors so far */
852 #endif /* not YYPURE */
855 int yydebug
; /* nonzero means print parse trace */
856 /* Since this is uninitialized, it does not stop multiple parsers
860 /* YYINITDEPTH indicates the initial size of the parser's stacks */
863 #define YYINITDEPTH 200
866 /* YYMAXDEPTH is the maximum size the stacks can grow to
867 (effective only if the built-in stack extension method is used). */
874 #define YYMAXDEPTH 10000
877 /* Prevent warning if -Wstrict-prototypes. */
882 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
883 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
884 #else /* not GNU C or C++ */
887 /* This is the most reliable way to avoid incompatibilities
888 in available built-in functions on various systems. */
890 __yy_memcpy (to
, from
, count
)
895 register char *f
= from
;
896 register char *t
= to
;
897 register int i
= count
;
903 #else /* __cplusplus */
905 /* This is the most reliable way to avoid incompatibilities
906 in available built-in functions on various systems. */
908 __yy_memcpy (char *to
, char *from
, int count
)
910 register char *f
= from
;
911 register char *t
= to
;
912 register int i
= count
;
921 #line 196 "/usr/lib/bison.simple"
923 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
924 into yyparse. The argument should have type void *.
925 It should actually point to an object.
926 Grammar actions can access the variable by casting it
927 to the proper pointer type. */
931 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
932 #define YYPARSE_PARAM_DECL
933 #else /* not __cplusplus */
934 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
935 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
936 #endif /* not __cplusplus */
937 #else /* not YYPARSE_PARAM */
938 #define YYPARSE_PARAM_ARG
939 #define YYPARSE_PARAM_DECL
940 #endif /* not YYPARSE_PARAM */
943 yyparse(YYPARSE_PARAM_ARG
)
946 register int yystate
;
948 register short *yyssp
;
949 register YYSTYPE
*yyvsp
;
950 int yyerrstatus
; /* number of tokens to shift before error messages enabled */
951 int yychar1
= 0; /* lookahead token as an internal (translated) token number */
953 short yyssa
[YYINITDEPTH
]; /* the state stack */
954 YYSTYPE yyvsa
[YYINITDEPTH
]; /* the semantic value stack */
956 short *yyss
= yyssa
; /* refer to the stacks thru separate pointers */
957 YYSTYPE
*yyvs
= yyvsa
; /* to allow yyoverflow to reallocate them elsewhere */
960 YYLTYPE yylsa
[YYINITDEPTH
]; /* the location stack */
961 YYLTYPE
*yyls
= yylsa
;
964 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
966 #define YYPOPSTACK (yyvsp--, yyssp--)
969 int yystacksize
= YYINITDEPTH
;
980 YYSTYPE yyval
; /* the variable used to return */
981 /* semantic values from the action */
988 fprintf(stderr
, "Starting parse\n");
994 yychar
= YYEMPTY
; /* Cause a token to be read. */
996 /* Initialize stack pointers.
997 Waste one element of value and location stack
998 so that they stay on the same level as the state stack.
999 The wasted elements are never initialized. */
1007 /* Push a new state, which is found in yystate . */
1008 /* In all cases, when you get here, the value and location stacks
1009 have just been pushed. so pushing a state here evens the stacks. */
1014 if (yyssp
>= yyss
+ yystacksize
- 1)
1016 /* Give user a chance to reallocate the stack */
1017 /* Use copies of these so that the &'s don't force the real ones into memory. */
1018 YYSTYPE
*yyvs1
= yyvs
;
1019 short *yyss1
= yyss
;
1021 YYLTYPE
*yyls1
= yyls
;
1024 /* Get the current used size of the three stacks, in elements. */
1025 int size
= yyssp
- yyss
+ 1;
1028 /* Each stack pointer address is followed by the size of
1029 the data in use in that stack, in bytes. */
1031 /* This used to be a conditional around just the two extra args,
1032 but that might be undefined if yyoverflow is a macro. */
1033 yyoverflow("parser stack overflow",
1034 &yyss1
, size
* sizeof (*yyssp
),
1035 &yyvs1
, size
* sizeof (*yyvsp
),
1036 &yyls1
, size
* sizeof (*yylsp
),
1039 yyoverflow("parser stack overflow",
1040 &yyss1
, size
* sizeof (*yyssp
),
1041 &yyvs1
, size
* sizeof (*yyvsp
),
1045 yyss
= yyss1
; yyvs
= yyvs1
;
1049 #else /* no yyoverflow */
1050 /* Extend the stack our own way. */
1051 if (yystacksize
>= YYMAXDEPTH
)
1053 yyerror("parser stack overflow");
1057 if (yystacksize
> YYMAXDEPTH
)
1058 yystacksize
= YYMAXDEPTH
;
1059 yyss
= (short *) alloca (yystacksize
* sizeof (*yyssp
));
1060 __yy_memcpy ((char *)yyss
, (char *)yyss1
, size
* sizeof (*yyssp
));
1061 yyvs
= (YYSTYPE
*) alloca (yystacksize
* sizeof (*yyvsp
));
1062 __yy_memcpy ((char *)yyvs
, (char *)yyvs1
, size
* sizeof (*yyvsp
));
1064 yyls
= (YYLTYPE
*) alloca (yystacksize
* sizeof (*yylsp
));
1065 __yy_memcpy ((char *)yyls
, (char *)yyls1
, size
* sizeof (*yylsp
));
1067 #endif /* no yyoverflow */
1069 yyssp
= yyss
+ size
- 1;
1070 yyvsp
= yyvs
+ size
- 1;
1072 yylsp
= yyls
+ size
- 1;
1077 fprintf(stderr
, "Stack size increased to %d\n", yystacksize
);
1080 if (yyssp
>= yyss
+ yystacksize
- 1)
1086 fprintf(stderr
, "Entering state %d\n", yystate
);
1092 /* Do appropriate processing given the current state. */
1093 /* Read a lookahead token if we need one and don't already have one. */
1096 /* First try to decide what to do without reference to lookahead token. */
1098 yyn
= yypact
[yystate
];
1102 /* Not known => get a lookahead token if don't already have one. */
1104 /* yychar is either YYEMPTY or YYEOF
1105 or a valid token in external form. */
1107 if (yychar
== YYEMPTY
)
1111 fprintf(stderr
, "Reading a token: ");
1116 /* Convert token to internal form (in yychar1) for indexing tables with */
1118 if (yychar
<= 0) /* This means end of input. */
1121 yychar
= YYEOF
; /* Don't call YYLEX any more */
1125 fprintf(stderr
, "Now at end of input.\n");
1130 yychar1
= YYTRANSLATE(yychar
);
1135 fprintf (stderr
, "Next token is %d (%s", yychar
, yytname
[yychar1
]);
1136 /* Give the individual parser a way to print the precise meaning
1137 of a token, for further debugging info. */
1139 YYPRINT (stderr
, yychar
, yylval
);
1141 fprintf (stderr
, ")\n");
1147 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1152 /* yyn is what to do for this token type in this state.
1153 Negative => reduce, -yyn is rule number.
1154 Positive => shift, yyn is new state.
1155 New state is final state => don't bother to shift,
1156 just return success.
1157 0, or most negative number => error. */
1172 /* Shift the lookahead token. */
1176 fprintf(stderr
, "Shifting token %d (%s), ", yychar
, yytname
[yychar1
]);
1179 /* Discard the token being shifted unless it is eof. */
1180 if (yychar
!= YYEOF
)
1188 /* count tokens shifted since error; after three, turn off error status. */
1189 if (yyerrstatus
) yyerrstatus
--;
1194 /* Do the default action for the current state. */
1197 yyn
= yydefact
[yystate
];
1201 /* Do a reduction. yyn is the number of a rule to reduce with. */
1205 yyval
= yyvsp
[1-yylen
]; /* implement default value of the action */
1212 fprintf (stderr
, "Reducing via rule %d (line %d), ",
1215 /* Print the symbols being reduced, and their result. */
1216 for (i
= yyprhs
[yyn
]; yyrhs
[i
] > 0; i
++)
1217 fprintf (stderr
, "%s ", yytname
[yyrhs
[i
]]);
1218 fprintf (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1226 #line 262 "parser.yy"
1228 delete THIS
->default_header_p_
;
1229 THIS
->default_header_p_
= yyvsp
[0].header
;
1233 #line 266 "parser.yy"
1235 add_score (yyvsp
[0].score
);
1239 #line 269 "parser.yy"
1243 #line 271 "parser.yy"
1247 #line 272 "parser.yy"
1251 #line 276 "parser.yy"
1253 if (String (*yyvsp
[-1].string
) != MUDELA_VERSION
) {
1254 if (THIS
->ignore_version_b_
) {
1255 THIS
->here_input ().error ("Incorrect mudela version");
1257 THIS
->fatal_error_i_
= 1;
1258 THIS
->parser_error ("Incorrect mudela version");
1264 #line 292 "parser.yy"
1269 #line 294 "parser.yy"
1271 THIS
->clear_notenames ();
1275 #line 297 "parser.yy"
1277 THIS
->add_notename (*yyvsp
[-2].string
, yyvsp
[0].melreq
);
1278 delete yyvsp
[-2].string
;
1282 #line 304 "parser.yy"
1284 yyval
.header
= new Header
;
1288 #line 307 "parser.yy"
1290 (*yyval
.header
)[*yyvsp
[-3].string
] = *yyvsp
[-1].string
;
1291 delete yyvsp
[-3].string
;
1292 delete yyvsp
[-1].string
;
1296 #line 315 "parser.yy"
1298 yyval
.header
= yyvsp
[-1].header
;
1302 #line 322 "parser.yy"
1304 yyval
.string
= new String
;
1308 #line 325 "parser.yy"
1310 *yyval
.string
+= *yyvsp
[0].string
;
1314 #line 335 "parser.yy"
1316 THIS
->remember_spot ();
1320 #line 338 "parser.yy"
1322 THIS
->lexer_p_
->set_identifier (*yyvsp
[-3].string
, yyvsp
[0].id
);
1323 yyvsp
[0].id
->init_b_
= THIS
->init_parse_b_
;
1324 yyvsp
[0].id
->set_spot (THIS
->pop_spot ());
1328 #line 346 "parser.yy"
1330 yyval
.id
= new Score_id (yyvsp
[0].score
, SCORE_IDENTIFIER
);
1335 #line 350 "parser.yy"
1337 yyval
.id
= new Paper_def_id (yyvsp
[0].paper
, PAPER_IDENTIFIER
);
1342 #line 354 "parser.yy"
1344 yyval
.id
= new Midi_def_id (yyvsp
[0].midi
, MIDI_IDENTIFIER
);
1349 #line 358 "parser.yy"
1351 yyval
.id
= new Script_id (yyvsp
[0].script
, SCRIPT_IDENTIFIER
);
1356 #line 362 "parser.yy"
1358 yyval
.id
= new Music_id (yyvsp
[0].music
, MUSIC_IDENTIFIER
);
1363 #line 366 "parser.yy"
1365 yyval
.id
= new Lookup_id (yyvsp
[0].lookup
, IDENTIFIER
);
1370 #line 370 "parser.yy"
1372 yyval
.id
= new Real_id (new Real (yyvsp
[0].real
), REAL_IDENTIFIER
);
1377 #line 374 "parser.yy"
1379 yyval
.id
= new Int_id (new int (yyvsp
[0].i
), INT_IDENTIFIER
);
1383 #line 377 "parser.yy"
1385 yyval
.id
= new Request_id (yyvsp
[0].request
, POST_REQUEST_IDENTIFIER
);
1389 #line 380 "parser.yy"
1391 yyval
.id
= new Request_id (yyvsp
[0].melreq
, MELODIC_REQUEST_IDENTIFIER
);
1396 #line 384 "parser.yy"
1398 yyval
.id
= new Translator_id (yyvsp
[0].trans
, TRANS_IDENTIFIER
);
1402 #line 387 "parser.yy"
1404 yyval
.id
= new Duration_id (yyvsp
[0].duration
, DURATION_IDENTIFIER
);
1408 #line 396 "parser.yy"
1409 { yyval
.trans
= yyvsp
[-1].trans
; ;
1412 #line 400 "parser.yy"
1414 yyval
.trans
= yyvsp
[0].id
->translator ();
1415 yyval
.trans
-> set_spot (THIS
->here_input ());
1419 #line 404 "parser.yy"
1421 yyval
.trans
= get_translator_l (*yyvsp
[-1].string
)->clone ();
1422 yyval
.trans
->set_spot (THIS
->here_input ());
1423 delete yyvsp
[-1].string
;
1427 #line 409 "parser.yy"
1429 yyval
.trans
-> set_property (*yyvsp
[-3].string
, *yyvsp
[-1].scalar
);
1430 delete yyvsp
[-3].string
;
1431 delete yyvsp
[-1].scalar
;
1435 #line 414 "parser.yy"
1437 yyval
.trans
->group_l ()->consists_str_arr_
.push (*yyvsp
[-1].string
);
1438 delete yyvsp
[-1].string
;
1442 #line 418 "parser.yy"
1444 yyval
.trans
->group_l ()->accepts_str_arr_
.push (*yyvsp
[-1].string
);
1445 delete yyvsp
[-1].string
;
1449 #line 428 "parser.yy"
1450 { THIS
->remember_spot ();
1451 THIS
->error_level_i_
=0;
1455 #line 431 "parser.yy"
1457 yyval
.score
= yyvsp
[-1].score
;
1458 yyval
.score
->set_spot (THIS
->pop_spot ());
1459 if (!yyval
.score
->def_p_arr_
.size ())
1460 yyval
.score
->add (THIS
->default_paper ());
1462 /* handle error levels. */
1463 yyval
.score
->errorlevel_i_
= THIS
->error_level_i_
;
1464 THIS
->error_level_i_
= 0;
1465 if (!yyval
.score
->header_p_
&& THIS
->default_header_p_
)
1466 yyval
.score
->header_p_
= new Header (*THIS
->default_header_p_
);
1470 #line 445 "parser.yy"
1472 yyval
.score
= new Score
;
1476 #line 448 "parser.yy"
1478 yyval
.score
= yyvsp
[0].id
->score ();
1482 #line 451 "parser.yy"
1484 yyval
.score
->header_p_
= yyvsp
[0].header
;
1488 #line 454 "parser.yy"
1490 if (yyval
.score
->music_p_
)
1491 yyvsp
[0].music
->warning ("More than one music block");
1492 yyval
.score
->music_p_
= yyvsp
[0].music
;
1496 #line 459 "parser.yy"
1498 yyval
.score
->add (yyvsp
[0].outputdef
);
1502 #line 462 "parser.yy"
1508 #line 468 "parser.yy"
1510 yyval
.outputdef
= yyvsp
[0].paper
;
1514 #line 471 "parser.yy"
1516 yyval
.outputdef
= yyvsp
[0].midi
;
1520 #line 477 "parser.yy"
1521 { yyval
.intvec
=new Array
<int>; ;
1524 #line 478 "parser.yy"
1526 yyval
.intvec
->push (yyvsp
[-2].i
); yyval
.intvec
->push (yyvsp
[0].i
);
1530 #line 489 "parser.yy"
1531 { yyval
.paper
= yyvsp
[-1].paper
; ;
1534 #line 493 "parser.yy"
1536 yyval
.paper
= THIS
->default_paper ();
1540 #line 496 "parser.yy"
1542 yyval
.paper
= yyvsp
[0].id
->paperdef ();
1546 #line 499 "parser.yy"
1548 yyval
.paper
->outfile_str_
= *yyvsp
[-1].string
;
1549 delete yyvsp
[-1].string
;
1553 #line 503 "parser.yy"
1554 { yyval
.paper
->set (yyvsp
[0].lookup
); ;
1557 #line 504 "parser.yy"
1559 yyval
.paper
->set_var (*yyvsp
[-3].string
, yyvsp
[-1].real
);
1563 #line 507 "parser.yy"
1565 yyval
.paper
->set_var (*yyvsp
[-3].string
, yyvsp
[-1].real
);
1569 #line 510 "parser.yy"
1571 yyval
.paper
-> assign_translator (*yyvsp
[-2].string
, yyvsp
[0].trans
);
1572 delete yyvsp
[-2].string
;
1576 #line 514 "parser.yy"
1578 yyval
.paper
->shape_int_a_
= *yyvsp
[-1].intarr
;
1579 delete yyvsp
[-1].intarr
;
1583 #line 518 "parser.yy"
1589 #line 524 "parser.yy"
1591 yyval
.intarr
= new Array
<Interval
>;
1595 #line 527 "parser.yy"
1597 yyval
.intarr
->push(Interval(yyvsp
[-1].real
, yyvsp
[-1].real
+ yyvsp
[0].real
));
1601 #line 537 "parser.yy"
1602 { yyval
.midi
= yyvsp
[-1].midi
; ;
1605 #line 540 "parser.yy"
1607 yyval
.midi
= THIS
->default_midi ();
1611 #line 543 "parser.yy"
1613 yyval
.midi
-> assign_translator (*yyvsp
[-2].string
, yyvsp
[0].trans
);
1614 delete yyvsp
[-2].string
;
1618 #line 547 "parser.yy"
1620 yyval
.midi
->outfile_str_
= *yyvsp
[-1].string
;
1621 delete yyvsp
[-1].string
;
1625 #line 551 "parser.yy"
1627 yyval
.midi
->set_tempo (yyvsp
[-1].tempo
->dur_
.length (), yyvsp
[-1].tempo
->metronome_i_
);
1628 delete yyvsp
[-1].tempo
;
1632 #line 555 "parser.yy"
1638 #line 561 "parser.yy"
1640 yyval
.tempo
= new Tempo_req
;
1641 yyval
.tempo
->dur_
= *yyvsp
[-2].duration
;
1642 delete yyvsp
[-2].duration
;
1643 yyval
.tempo
-> metronome_i_
= yyvsp
[0].i
;
1647 #line 574 "parser.yy"
1649 yyval
.musiclist
= yyvsp
[-1].musiclist
;
1653 #line 580 "parser.yy"
1655 yyval
.musiclist
= new Voice
;
1656 yyval
.musiclist
->set_spot (THIS
->here_input ());
1660 #line 584 "parser.yy"
1662 yyval
.musiclist
->add (yyvsp
[0].music
);
1666 #line 590 "parser.yy"
1667 { yyval
.music
= yyvsp
[0].music
; ;
1670 #line 591 "parser.yy"
1672 yyval
.music
= yyvsp
[0].music
;
1673 yyval
.music
->translator_type_str_
= *yyvsp
[-1].string
;
1674 delete yyvsp
[-1].string
;
1678 #line 596 "parser.yy"
1680 yyval
.music
= yyvsp
[0].music
;
1681 yyval
.music
->translator_type_str_
= *yyvsp
[-3].string
;
1682 yyval
.music
->translator_id_str_
= *yyvsp
[-1].string
;
1683 delete yyvsp
[-3].string
;
1684 delete yyvsp
[-1].string
;
1688 #line 603 "parser.yy"
1689 { yyval
.music
= yyvsp
[0].musiclist
; ;
1692 #line 604 "parser.yy"
1693 { yyval
.music
= yyvsp
[0].chord
; ;
1696 #line 605 "parser.yy"
1697 { yyval
.music
= yyvsp
[0].music
; ;
1700 #line 606 "parser.yy"
1701 { yyval
.music
= yyvsp
[0].id
->music (); ;
1704 #line 607 "parser.yy"
1705 { yyval
.music
= yyvsp
[-1].id
->music (); ;
1708 #line 609 "parser.yy"
1709 { THIS
->lexer_p_
->push_note_state (); ;
1712 #line 611 "parser.yy"
1713 { yyval
.music
=yyvsp
[0].music
; THIS
->lexer_p_
->pop_state (); ;
1716 #line 614 "parser.yy"
1717 { THIS
->lexer_p_
->push_lyric_state (); ;
1720 #line 616 "parser.yy"
1721 { yyval
.music
= yyvsp
[0].music
; THIS
->lexer_p_
->pop_state (); ;
1724 #line 622 "parser.yy"
1726 Change_translator
* t
= new Change_translator
;
1727 t
-> change_to_type_str_
= *yyvsp
[-2].string
;
1728 t
-> change_to_id_str_
= *yyvsp
[0].string
;
1731 yyval
.music
->set_spot (THIS
->here_input ());
1732 delete yyvsp
[-2].string
;
1733 delete yyvsp
[0].string
;
1737 #line 635 "parser.yy"
1739 Translation_property
*t
= new Translation_property
;
1740 t
-> translator_type_str_
= *yyvsp
[-4].string
;
1741 t
-> var_str_
= *yyvsp
[-2].string
;
1742 t
-> value_
= *yyvsp
[0].scalar
;
1744 yyval
.music
->set_spot (THIS
->here_input ());
1745 delete yyvsp
[-4].string
;
1746 delete yyvsp
[-2].string
;
1747 delete yyvsp
[0].scalar
;
1751 #line 649 "parser.yy"
1752 { yyval
.scalar
= new Scalar (*yyvsp
[0].string
); delete yyvsp
[0].string
; ;
1755 #line 650 "parser.yy"
1756 { yyval
.scalar
= new Scalar (yyvsp
[0].i
); ;
1759 #line 655 "parser.yy"
1760 { yyval
.chord
= yyvsp
[-1].chord
; ;
1763 #line 656 "parser.yy"
1765 yyval
.chord
= yyvsp
[0].chord
;
1766 yyval
.chord
->multi_level_i_
=yyvsp
[-1].i
;
1770 #line 663 "parser.yy"
1772 yyval
.chord
= new Chord
;
1773 yyval
.chord
-> multi_level_i_
= 1;
1774 yyval
.chord
->set_spot (THIS
->here_input ());
1778 #line 668 "parser.yy"
1780 yyval
.chord
->add (yyvsp
[0].music
);
1784 #line 674 "parser.yy"
1786 yyval
.music
= yyvsp
[0].music
;
1787 yyval
.music
-> transpose (yyvsp
[-1].melreq
);
1789 delete yyvsp
[-1].melreq
;
1793 #line 687 "parser.yy"
1795 THIS
->add_requests ((Chord
*)yyvsp
[-1].music
);//ugh
1796 yyval
.music
= yyvsp
[-1].music
;
1800 #line 692 "parser.yy"
1801 { yyval
.music
= 0; ;
1804 #line 701 "parser.yy"
1806 yyval
.music
= new Request_chord
;
1807 yyval
.music
-> set_spot (THIS
->here_input ());
1808 yyvsp
[0].request
-> set_spot (THIS
->here_input ());
1809 ((Chord
*)yyval
.music
) ->add (yyvsp
[0].request
);//ugh
1814 #line 712 "parser.yy"
1815 { yyval
.request
= yyvsp
[-1].request
; ;
1818 #line 716 "parser.yy"
1820 yyval
.request
= new Barcheck_req
;
1824 #line 719 "parser.yy"
1826 yyval
.request
= yyvsp
[0].id
->request ();
1830 #line 725 "parser.yy"
1832 yyval
.request
= new Bar_req (*yyvsp
[0].string
);
1833 delete yyvsp
[0].string
;
1837 #line 729 "parser.yy"
1839 Break_force_req
* f
= new Break_force_req
;
1840 f
-> set_spot (THIS
->here_input ());
1845 #line 734 "parser.yy"
1847 Meter_change_req
*m
= new Meter_change_req
;
1848 m
->set (yyvsp
[-2].i
,yyvsp
[0].i
);
1853 #line 739 "parser.yy"
1855 Skip_req
* skip_p
= new Skip_req
;
1856 skip_p
->duration_
.set_plet (yyvsp
[0].moment
->num (),
1857 yyvsp
[0].moment
->den ());
1859 delete yyvsp
[0].moment
;
1860 yyval
.request
= skip_p
;
1864 #line 747 "parser.yy"
1866 yyval
.request
= yyvsp
[0].tempo
;
1870 #line 750 "parser.yy"
1872 yyval
.request
= new Cadenza_req (yyvsp
[0].i
);
1876 #line 753 "parser.yy"
1878 yyval
.request
= new Partial_measure_req (*yyvsp
[0].moment
);
1879 delete yyvsp
[0].moment
;
1883 #line 757 "parser.yy"
1885 yyval
.request
= new Clef_change_req (*yyvsp
[0].string
);
1886 delete yyvsp
[0].string
;
1890 #line 761 "parser.yy"
1892 Key_change_req
*key_p
= new Key_change_req
;
1893 key_p
->melodic_p_arr_
= *yyvsp
[0].melreqvec
;
1894 yyval
.request
= key_p
;
1895 delete yyvsp
[0].melreqvec
;
1899 #line 767 "parser.yy"
1901 yyval
.request
= get_grouping_req (*yyvsp
[0].intvec
); delete yyvsp
[0].intvec
;
1905 #line 773 "parser.yy"
1907 /* something silly happened. Junk this stuff*/
1908 if (!THIS
->post_reqs
.empty ())
1910 warning ("Junking post-requests");
1911 THIS
->post_reqs
.clear ();
1916 #line 781 "parser.yy"
1918 yyvsp
[0].request
->set_spot (THIS
->here_input ());
1919 THIS
->post_reqs
.push (yyvsp
[0].request
);
1923 #line 785 "parser.yy"
1925 Array
<Request
*>& r
= *THIS
->get_parens_request (yyvsp
[0].i
);
1926 for (int i
= 0; i
< r
.size (); i
++ )
1927 r
[i
]->set_spot (THIS
->here_input ());
1928 THIS
->post_reqs
.concat (r
);
1933 #line 800 "parser.yy"
1935 yyval
.request
= (Request
*)yyvsp
[0].id
->request ();
1939 #line 803 "parser.yy"
1941 yyval
.request
= yyvsp
[0].request
;
1945 #line 806 "parser.yy"
1947 Abbreviation_req
* a
= new Abbreviation_req
;
1948 a
->type_i_
= yyvsp
[0].i
;
1953 #line 819 "parser.yy"
1955 yyval
.melreq
= yyvsp
[0].melreq
->clone ()->musical ()->melodic ();
1956 yyval
.melreq
->octave_i_
+= THIS
->default_octave_i_
;
1960 #line 823 "parser.yy"
1962 yyval
.melreq
-> octave_i_
+= yyvsp
[0].i
;
1966 #line 826 "parser.yy"
1968 yyval
.melreq
= yyvsp
[0].melreq
;
1969 yyvsp
[0].melreq
-> octave_i_
-= yyvsp
[-1].i
;
1973 #line 833 "parser.yy"
1975 yyval
.notereq
= new Note_req
;
1976 * (Melodic_req
*) yyval
.notereq
= *yyvsp
[0].melreq
;
1977 delete yyvsp
[0].melreq
;
1981 #line 838 "parser.yy"
1983 yyval
.notereq
->forceacc_b_
= ! yyval
.notereq
->forceacc_b_
;
1987 #line 845 "parser.yy"
1989 yyval
.melreq
= new Melodic_req
;
1990 yyval
.melreq
->octave_i_
= yyvsp
[-3].i
;
1991 yyval
.melreq
->notename_i_
= yyvsp
[-2].i
;
1992 yyval
.melreq
->accidental_i_
= yyvsp
[-1].i
;
1996 #line 854 "parser.yy"
1998 yyval
.duration
= new Duration
;
1999 yyval
.duration
-> durlog_i_
= yyvsp
[-2].i
;
2000 yyval
.duration
-> dots_i_
= yyvsp
[-1].i
;
2004 #line 862 "parser.yy"
2006 Absolute_dynamic_req
*ad_p
= new Absolute_dynamic_req
;
2007 ad_p
->loudness_
= (Dynamic_req::Loudness
)yyvsp
[-1].i
;
2008 yyval
.request
=ad_p
;
2012 #line 867 "parser.yy"
2014 Span_dynamic_req
* sp_p
= new Span_dynamic_req
;
2015 sp_p
->spantype
= (Span_req::Spantype
)yyvsp
[-1].i
;
2016 sp_p
-> dynamic_dir_
= (Direction
)yyvsp
[-2].i
;
2017 yyval
.request
= sp_p
;
2021 #line 876 "parser.yy"
2023 yyval
.pair
[0] = yyvsp
[-2].i
;
2024 yyval
.pair
[1] = yyvsp
[0].i
;
2028 #line 881 "parser.yy"
2030 int num
= yyvsp
[0].i
>? 1;
2031 yyval
.pair
[0] = guess_plet_a
[(num
<? GUESS_PLET
) - 1];
2032 yyval
.pair
[1] = num
;
2036 #line 889 "parser.yy"
2039 THIS
->plet_
.type_i_
= yyvsp
[0].pair
[1];
2040 THIS
->plet_
.iso_i_
= yyvsp
[0].pair
[0];
2041 THIS
->default_duration_
.plet_
.type_i_
= yyvsp
[0].pair
[1];
2042 THIS
->default_duration_
.plet_
.iso_i_
= yyvsp
[0].pair
[0];
2046 #line 896 "parser.yy"
2049 THIS
->plet_
.type_i_
= 1;
2050 THIS
->plet_
.iso_i_
= 1;
2051 THIS
->default_duration_
.plet_
.iso_i_
= 1;
2052 THIS
->default_duration_
.plet_
.type_i_
= 1;
2056 #line 903 "parser.yy"
2059 THIS
->plet_
.type_i_
= yyvsp
[0].pair
[1];
2060 THIS
->plet_
.iso_i_
= yyvsp
[0].pair
[0];
2061 THIS
->default_duration_
.plet_
.type_i_
= yyvsp
[0].pair
[1];
2062 THIS
->default_duration_
.plet_
.iso_i_
= yyvsp
[0].pair
[0];
2066 #line 913 "parser.yy"
2072 #line 916 "parser.yy"
2078 #line 919 "parser.yy"
2084 #line 922 "parser.yy"
2090 #line 925 "parser.yy"
2096 #line 928 "parser.yy"
2101 #line 933 "parser.yy"
2104 if (!Duration::duration_type_b (yyvsp
[0].i
))
2105 THIS
->parser_error ("1:Not a duration");
2106 else if (yyvsp
[0].i
< 8)
2107 THIS
->parser_error ("Can't abbreviate");
2109 THIS
->set_abbrev_beam (yyvsp
[0].i
);
2113 #line 945 "parser.yy"
2116 THIS
->plet_
.type_i_
= yyvsp
[0].pair
[1];
2117 THIS
->plet_
.iso_i_
= yyvsp
[0].pair
[0];
2118 THIS
->default_duration_
.plet_
.type_i_
= yyvsp
[0].pair
[1];
2119 THIS
->default_duration_
.plet_
.iso_i_
= yyvsp
[0].pair
[0];
2123 #line 952 "parser.yy"
2126 THIS
->plet_
.type_i_
= yyvsp
[0].pair
[1];
2127 THIS
->plet_
.iso_i_
= yyvsp
[0].pair
[0];
2128 THIS
->default_duration_
.plet_
.type_i_
= yyvsp
[0].pair
[1];
2129 THIS
->default_duration_
.plet_
.iso_i_
= yyvsp
[0].pair
[0];
2133 #line 962 "parser.yy"
2139 #line 965 "parser.yy"
2145 #line 968 "parser.yy"
2151 #line 971 "parser.yy"
2156 #line 973 "parser.yy"
2161 #line 980 "parser.yy"
2162 { yyval
.script
= yyvsp
[-1].script
; ;
2165 #line 984 "parser.yy"
2167 Script_def
*s
= new Script_def
;
2168 s
->set_from_input (*yyvsp
[-5].string
,yyvsp
[-4].i
, yyvsp
[-3].i
,yyvsp
[-2].i
,yyvsp
[-1].i
, yyvsp
[0].i
);
2170 delete yyvsp
[-5].string
;
2174 #line 993 "parser.yy"
2176 Musical_script_req
*m
= new Musical_script_req
;
2178 m
->scriptdef_p_
= yyvsp
[0].script
;
2179 m
->set_spot (THIS
->here_input ());
2181 m
->dir_
= (Direction
)yyvsp
[-1].i
;
2185 #line 1004 "parser.yy"
2187 yyval
.script
= yyvsp
[0].textdef
;
2188 ((Text_def
*) yyval
.script
)->align_i_
= CENTER
; /* UGH */
2192 #line 1008 "parser.yy"
2194 yyval
.script
= yyvsp
[0].script
;
2195 yyval
.script
-> set_spot (THIS
->here_input ());
2199 #line 1012 "parser.yy"
2201 yyval
.script
= yyvsp
[0].textdef
;
2202 ((Text_def
*)yyval
.script
)->align_i_
= CENTER
;
2206 #line 1019 "parser.yy"
2208 Text_def
*t
= new Text_def
;
2210 t
->text_str_
= *yyvsp
[0].string
;
2211 delete yyvsp
[0].string
;
2212 t
->style_str_
= THIS
->textstyle_str_
;
2213 yyval
.textdef
->set_spot (THIS
->here_input ());
2217 #line 1030 "parser.yy"
2219 Text_def
* t
= new Text_def
;
2221 t
->text_str_
= String (yyvsp
[0].i
);
2222 t
->style_str_
= "finger";
2223 yyval
.textdef
->set_spot (THIS
->here_input ());
2227 #line 1040 "parser.yy"
2228 { yyval
.string
= get_scriptdef ('^'); ;
2231 #line 1041 "parser.yy"
2232 { yyval
.string
= get_scriptdef ('+'); ;
2235 #line 1042 "parser.yy"
2236 { yyval
.string
= get_scriptdef ('-'); ;
2239 #line 1043 "parser.yy"
2240 { yyval
.string
= get_scriptdef ('|'); ;
2243 #line 1044 "parser.yy"
2244 { yyval
.string
= get_scriptdef ('o'); ;
2247 #line 1045 "parser.yy"
2248 { yyval
.string
= get_scriptdef ('>'); ;
2251 #line 1046 "parser.yy"
2253 yyval
.string
= get_scriptdef ('.');
2257 #line 1052 "parser.yy"
2258 { yyval
.script
= yyvsp
[0].id
->script (); ;
2261 #line 1053 "parser.yy"
2262 { yyval
.script
= yyvsp
[0].script
; ;
2265 #line 1054 "parser.yy"
2267 yyval
.script
= THIS
->lexer_p_
->lookup_identifier (*yyvsp
[0].string
)->script ();
2268 delete yyvsp
[0].string
;
2272 #line 1061 "parser.yy"
2276 #line 1062 "parser.yy"
2280 #line 1063 "parser.yy"
2284 #line 1067 "parser.yy"
2289 #line 1069 "parser.yy"
2291 Array
<Request
*>& r
= *THIS
->get_parens_request (yyvsp
[0].i
);
2292 for (int i
= 0; i
< r
.size (); i
++ )
2293 r
[i
]->set_spot (THIS
->here_input ());
2294 THIS
->pre_reqs
.concat (r
);
2299 #line 1079 "parser.yy"
2301 THIS
->set_duration_mode (*yyvsp
[0].string
);
2302 delete yyvsp
[0].string
;
2306 #line 1083 "parser.yy"
2308 THIS
->set_default_duration (yyvsp
[0].duration
);
2309 delete yyvsp
[0].duration
;
2313 #line 1087 "parser.yy"
2316 This is weird, but default_octave_i_
2317 is used in steno_note_req too
2319 c' -> default_octave_i_ == 1
2321 /* why can't we have \oct 0 iso \oct{c'}*/
2322 THIS
->default_octave_i_
= 1; ;
2325 #line 1097 "parser.yy"
2327 THIS
->default_octave_i_
= yyvsp
[0].melreq
->octave_i_
;
2328 delete yyvsp
[0].melreq
;
2332 #line 1101 "parser.yy"
2334 THIS
->textstyle_str_
= *yyvsp
[0].string
;
2335 delete yyvsp
[0].string
;
2339 #line 1108 "parser.yy"
2341 yyval
.moment
= new Moment (0,1);
2345 #line 1111 "parser.yy"
2347 *yyval
.moment
+= yyvsp
[0].duration
->length ();
2351 #line 1117 "parser.yy"
2355 #line 1118 "parser.yy"
2359 #line 1122 "parser.yy"
2361 yyval
.duration
= new Duration (THIS
->default_duration_
);
2365 #line 1125 "parser.yy"
2367 yyval
.duration
= new Duration (THIS
->default_duration_
);
2368 yyval
.duration
->dots_i_
= yyvsp
[0].i
;
2372 #line 1129 "parser.yy"
2374 THIS
->set_last_duration (yyvsp
[0].duration
);
2375 yyval
.duration
= yyvsp
[0].duration
;
2379 #line 1136 "parser.yy"
2381 yyval
.duration
= yyvsp
[0].duration
;
2385 #line 1142 "parser.yy"
2387 yyval
.duration
= new Duration
;
2388 if (!Duration::duration_type_b (yyvsp
[0].i
))
2389 THIS
->parser_error ("2:Not a duration");
2391 yyval
.duration
->durlog_i_
= Duration_convert::i2_type (yyvsp
[0].i
);
2392 yyval
.duration
->set_plet (THIS
->default_duration_
);
2397 #line 1151 "parser.yy"
2399 yyval
.duration
= yyvsp
[0].id
->duration ();
2403 #line 1154 "parser.yy"
2405 yyval
.duration
->dots_i_
++;
2409 #line 1157 "parser.yy"
2411 yyval
.duration
->plet_
.iso_i_
= yyvsp
[0].i
;
2415 #line 1160 "parser.yy"
2417 yyval
.duration
->plet_
.type_i_
= yyvsp
[0].i
;
2421 #line 1167 "parser.yy"
2427 #line 1170 "parser.yy"
2429 if (!Duration::duration_type_b (yyvsp
[0].i
))
2430 THIS
->parser_error ("3:Not a duration");
2431 else if (yyvsp
[0].i
< 8)
2432 THIS
->parser_error ("Can't abbreviate");
2433 yyval
.i
= yyvsp
[0].i
;
2437 #line 1181 "parser.yy"
2439 if (!THIS
->lexer_p_
->note_state_b ())
2440 THIS
->parser_error ("have to be in Note mode for notes");
2441 yyvsp
[-1].notereq
->set_duration (*yyvsp
[0].duration
);
2442 int durlog_i
= yyvsp
[0].duration
->durlog_i_
;
2443 yyval
.music
= THIS
->get_note_element (yyvsp
[-1].notereq
, yyvsp
[0].duration
);
2447 #line 1188 "parser.yy"
2449 yyval
.music
= THIS
->get_rest_element (*yyvsp
[-1].string
, yyvsp
[0].duration
);
2450 delete yyvsp
[-1].string
;
2454 #line 1195 "parser.yy"
2456 /* this sux! text-def should be feature of lyric-engraver. */
2457 if (!THIS
->lexer_p_
->lyric_state_b ())
2458 THIS
->parser_error ("Have to be in Lyric mode for lyrics");
2459 yyval
.music
= THIS
->get_word_element (yyvsp
[-1].textdef
, yyvsp
[0].duration
);
2464 #line 1206 "parser.yy"
2466 yyval
.melreqvec
= new Array
<Melodic_req
*>;
2470 #line 1209 "parser.yy"
2472 yyval
.melreqvec
->push (yyvsp
[0].melreq
->clone ()->musical ()->melodic ());
2476 #line 1215 "parser.yy"
2478 yyval
.i
= yyvsp
[0].i
;
2482 #line 1218 "parser.yy"
2484 yyval
.i
= yyvsp
[0].i
;
2488 #line 1223 "parser.yy"
2490 yyval
.i
= yyvsp
[0].i
;
2494 #line 1226 "parser.yy"
2496 yyval
.i
= -yyvsp
[0].i
;
2500 #line 1229 "parser.yy"
2502 int *i_p
= yyvsp
[0].id
->intid ();
2508 #line 1237 "parser.yy"
2510 yyval
.real
= yyvsp
[0].real
;
2514 #line 1240 "parser.yy"
2516 Real
*r_p
= yyvsp
[0].id
->real ();
2522 #line 1250 "parser.yy"
2523 { yyval
.real
= yyvsp
[-1].real
*yyvsp
[0].real
; ;
2526 #line 1254 "parser.yy"
2527 { yyval
.real
= 1 CM
; ;
2530 #line 1255 "parser.yy"
2531 { yyval
.real
= 1 INCH
; ;
2534 #line 1256 "parser.yy"
2535 { yyval
.real
= 1 MM
; ;
2538 #line 1257 "parser.yy"
2539 { yyval
.real
= 1 PT
; ;
2542 #line 1264 "parser.yy"
2543 { yyval
.lookup
= yyvsp
[-1].lookup
; ;
2546 #line 1268 "parser.yy"
2548 yyval
.lookup
= new Lookup
;
2552 #line 1271 "parser.yy"
2554 yyval
.lookup
= yyvsp
[0].id
->lookup ();
2558 #line 1274 "parser.yy"
2560 yyval
.lookup
->texsetting
= *yyvsp
[0].string
;
2561 delete yyvsp
[0].string
;
2565 #line 1278 "parser.yy"
2567 yyval
.lookup
->add (*yyvsp
[-2].string
, yyvsp
[0].symtable
);
2568 delete yyvsp
[-2].string
;
2572 #line 1285 "parser.yy"
2573 { yyval
.symtable
= yyvsp
[-1].symtable
; ;
2576 #line 1289 "parser.yy"
2577 { yyval
.symtable
= new Symtable
; ;
2580 #line 1290 "parser.yy"
2582 yyval
.symtable
->add (*yyvsp
[-1].string
, *yyvsp
[0].symbol
);
2583 delete yyvsp
[-1].string
;
2584 delete yyvsp
[0].symbol
;
2588 #line 1298 "parser.yy"
2590 yyval
.symbol
= new Atom (*yyvsp
[-1].string
, *yyvsp
[0].box
);
2591 delete yyvsp
[-1].string
;
2592 delete yyvsp
[0].box
;
2596 #line 1303 "parser.yy"
2598 Box
b (Interval (0,0), Interval (0,0));
2599 yyval
.symbol
= new Atom (*yyvsp
[0].string
, b
);
2600 delete yyvsp
[0].string
;
2604 #line 1311 "parser.yy"
2606 yyval
.box
= new Box (*yyvsp
[-1].interval
, *yyvsp
[0].interval
);
2607 delete yyvsp
[-1].interval
;
2608 delete yyvsp
[0].interval
;
2612 #line 1318 "parser.yy"
2614 yyval
.interval
= new Interval (yyvsp
[-1].real
, yyvsp
[0].real
);
2618 /* the action file gets copied in in place of this dollarsign */
2619 #line 498 "/usr/lib/bison.simple"
2630 short *ssp1
= yyss
- 1;
2631 fprintf (stderr
, "state stack now");
2632 while (ssp1
!= yyssp
)
2633 fprintf (stderr
, " %d", *++ssp1
);
2634 fprintf (stderr
, "\n");
2644 yylsp
->first_line
= yylloc
.first_line
;
2645 yylsp
->first_column
= yylloc
.first_column
;
2646 yylsp
->last_line
= (yylsp
-1)->last_line
;
2647 yylsp
->last_column
= (yylsp
-1)->last_column
;
2652 yylsp
->last_line
= (yylsp
+yylen
-1)->last_line
;
2653 yylsp
->last_column
= (yylsp
+yylen
-1)->last_column
;
2657 /* Now "shift" the result of the reduction.
2658 Determine what state that goes to,
2659 based on the state we popped back to
2660 and the rule number reduced by. */
2664 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
2665 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2666 yystate
= yytable
[yystate
];
2668 yystate
= yydefgoto
[yyn
- YYNTBASE
];
2672 yyerrlab
: /* here on detecting error */
2675 /* If not already recovering from an error, report this error. */
2679 #ifdef YYERROR_VERBOSE
2680 yyn
= yypact
[yystate
];
2682 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
2689 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
2690 for (x
= (yyn
< 0 ? -yyn
: 0);
2691 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
2692 if (yycheck
[x
+ yyn
] == x
)
2693 size
+= strlen(yytname
[x
]) + 15, count
++;
2694 msg
= (char *) malloc(size
+ 15);
2697 strcpy(msg
, "parse error");
2702 for (x
= (yyn
< 0 ? -yyn
: 0);
2703 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
2704 if (yycheck
[x
+ yyn
] == x
)
2706 strcat(msg
, count
== 0 ? ", expecting `" : " or `");
2707 strcat(msg
, yytname
[x
]);
2716 yyerror ("parse error; also virtual memory exceeded");
2719 #endif /* YYERROR_VERBOSE */
2720 yyerror("parse error");
2724 yyerrlab1
: /* here on error raised explicitly by an action */
2726 if (yyerrstatus
== 3)
2728 /* if just tried and failed to reuse lookahead token after an error, discard it. */
2730 /* return failure if at end of input */
2731 if (yychar
== YYEOF
)
2736 fprintf(stderr
, "Discarding token %d (%s).\n", yychar
, yytname
[yychar1
]);
2742 /* Else will try to reuse lookahead token
2743 after shifting the error token. */
2745 yyerrstatus
= 3; /* Each real token shifted decrements this */
2749 yyerrdefault
: /* current state does not do anything special for the error token. */
2752 /* This is wrong; only states that explicitly want error tokens
2753 should shift them. */
2754 yyn
= yydefact
[yystate
]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2755 if (yyn
) goto yydefault
;
2758 yyerrpop
: /* pop the current state because it cannot handle the error token */
2760 if (yyssp
== yyss
) YYABORT
;
2770 short *ssp1
= yyss
- 1;
2771 fprintf (stderr
, "Error: state stack now");
2772 while (ssp1
!= yyssp
)
2773 fprintf (stderr
, " %d", *++ssp1
);
2774 fprintf (stderr
, "\n");
2780 yyn
= yypact
[yystate
];
2785 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
2804 fprintf(stderr
, "Shifting error token, ");
2815 #line 1323 "parser.yy"
2819 My_lily_parser::set_yydebug (bool b
)
2826 My_lily_parser::do_yyparse ()
2828 yyparse ((void*)this);
2832 My_lily_parser::default_paper ()
2834 Identifier
*id
= lexer_p_
->lookup_identifier ("default_paper");
2835 return id
? id
->paperdef () : new Paper_def
;
2839 My_lily_parser::default_midi ()
2841 Identifier
*id
= lexer_p_
->lookup_identifier ("default_midi");
2842 return id
? id
->mididef () : new Midi_def
;