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 int const GUESS_PLET = 5;
132 int guess_plet_a[GUESS_PLET] =
145 #define YYERROR_VERBOSE 1
147 #define YYPARSE_PARAM my_lily_parser_l
148 #define YYLEX_PARAM my_lily_parser_l
149 #define THIS ((My_lily_parser *) my_lily_parser_l)
151 #define yyerror THIS->parser_error
156 Array<Interval>* intarr;
157 Array<Melodic_req*> *melreqvec;/* should clean up naming */
158 Array<String> * strvec;
166 Music_list *musiclist;
171 Melodic_req * melreq;
173 Music_output_def * outputdef;
180 General_script_def * script;
185 Symtables * symtables;
194 #line 107 "parser.yy"
198 yylex (YYSTYPE *s, void * v_l)
200 My_lily_parser *pars_l = (My_lily_parser*) v_l;
201 My_lily_lexer * lex_l = pars_l->lexer_p_;
203 lex_l->lexval_l = (void*) s;
204 return lex_l->yylex ();
219 #define YYFLAG -32768
222 #define YYTRANSLATE(x) ((unsigned)(x) <= 336 ? yytranslate[x] : 191)
224 static const char yytranslate[] = { 0,
225 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
226 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
227 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
228 2, 2, 92, 2, 2, 2, 2, 2, 2, 95,
229 98, 86, 100, 2, 101, 87, 91, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 97, 82, 88,
231 85, 89, 2, 2, 2, 2, 2, 2, 2, 2,
232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
234 96, 2, 93, 99, 103, 2, 2, 2, 2, 2,
235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
236 102, 2, 2, 2, 2, 2, 2, 2, 2, 2,
237 2, 2, 83, 90, 84, 94, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
240 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4, 5,
251 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
252 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
253 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
254 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
255 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
256 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
257 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
258 76, 77, 78, 79, 80, 81
262 static const short yyprhs[] = { 0,
263 0, 1, 4, 7, 10, 13, 16, 19, 23, 28,
264 29, 32, 37, 38, 44, 49, 50, 53, 54, 59,
265 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
266 81, 83, 88, 90, 94, 100, 105, 110, 111, 117,
267 118, 120, 123, 126, 129, 132, 134, 136, 137, 142,
268 147, 148, 150, 155, 158, 164, 170, 175, 181, 184,
269 185, 189, 194, 195, 200, 205, 209, 212, 217, 221,
270 222, 225, 227, 231, 237, 239, 241, 243, 245, 248,
271 249, 253, 254, 258, 260, 262, 267, 274, 276, 278,
272 282, 286, 287, 290, 294, 298, 300, 303, 305, 307,
273 309, 311, 314, 316, 318, 321, 323, 328, 331, 333,
274 336, 339, 342, 345, 348, 349, 352, 355, 357, 359,
275 361, 363, 365, 367, 370, 373, 375, 378, 385, 391,
276 396, 402, 406, 409, 412, 414, 417, 419, 421, 423,
277 425, 427, 429, 433, 436, 439, 441, 443, 445, 447,
278 449, 454, 461, 464, 466, 468, 470, 472, 474, 476,
279 478, 480, 482, 484, 486, 488, 490, 492, 494, 496,
280 498, 500, 501, 504, 507, 510, 511, 515, 518, 519,
281 522, 524, 527, 528, 530, 532, 534, 536, 538, 541,
282 545, 549, 551, 554, 557, 560, 563, 564, 567, 569,
283 571, 573, 576, 578, 580, 582, 585, 587, 589, 591,
284 593, 598, 599, 601, 605, 610, 615, 616, 620, 623,
288 static const short yyrhs[] = { -1,
289 104, 109, 0, 104, 116, 0, 104, 111, 0, 104,
290 1, 0, 104, 105, 0, 104, 106, 0, 54, 78,
291 82, 0, 30, 83, 107, 84, 0, 0, 107, 9,
292 0, 107, 78, 85, 149, 0, 0, 108, 78, 85,
293 110, 82, 0, 20, 83, 108, 84, 0, 0, 110,
294 78, 0, 0, 78, 112, 85, 113, 0, 116, 0,
295 121, 0, 124, 0, 158, 0, 129, 0, 184, 0,
296 181, 0, 180, 0, 146, 0, 149, 0, 114, 0,
297 150, 0, 19, 83, 115, 84, 0, 70, 0, 49,
298 78, 82, 0, 115, 78, 85, 134, 82, 0, 115,
299 12, 78, 82, 0, 115, 13, 78, 82, 0, 0,
300 38, 117, 83, 118, 84, 0, 0, 72, 0, 118,
301 109, 0, 118, 129, 0, 118, 119, 0, 118, 1,
302 0, 121, 0, 124, 0, 0, 120, 180, 86, 180,
303 0, 33, 83, 122, 84, 0, 0, 74, 0, 122,
304 32, 78, 82, 0, 122, 184, 0, 122, 78, 85,
305 182, 82, 0, 122, 78, 85, 181, 82, 0, 122,
306 78, 85, 114, 0, 122, 40, 85, 123, 82, 0,
307 122, 1, 0, 0, 123, 182, 182, 0, 25, 83,
308 125, 84, 0, 0, 125, 78, 85, 114, 0, 125,
309 32, 78, 82, 0, 125, 126, 82, 0, 125, 1,
310 0, 48, 172, 85, 179, 0, 83, 128, 84, 0,
311 0, 128, 129, 0, 138, 0, 49, 78, 129, 0,
312 49, 78, 85, 78, 129, 0, 127, 0, 135, 0,
313 137, 0, 64, 0, 64, 82, 0, 0, 24, 130,
314 129, 0, 0, 22, 131, 129, 0, 133, 0, 132,
315 0, 19, 78, 85, 78, 0, 53, 78, 87, 78,
316 85, 134, 0, 78, 0, 180, 0, 88, 136, 89,
317 0, 29, 179, 135, 0, 0, 136, 129, 0, 47,
318 147, 129, 0, 167, 139, 144, 0, 140, 0, 168,
319 82, 0, 176, 0, 177, 0, 141, 0, 142, 0,
320 143, 82, 0, 90, 0, 68, 0, 4, 78, 0,
321 7, 0, 27, 179, 91, 179, 0, 41, 170, 0,
322 126, 0, 8, 179, 0, 34, 170, 0, 10, 78,
323 0, 23, 178, 0, 18, 120, 0, 0, 144, 145,
324 0, 144, 154, 0, 160, 0, 146, 0, 66, 0,
325 151, 0, 175, 0, 60, 0, 147, 80, 0, 81,
326 147, 0, 147, 0, 148, 92, 0, 26, 83, 180,
327 180, 180, 84, 0, 15, 83, 180, 179, 84, 0,
328 16, 83, 179, 84, 0, 42, 83, 180, 180, 84,
329 0, 179, 91, 179, 0, 91, 179, 0, 93, 152,
330 0, 36, 0, 36, 152, 0, 94, 0, 95, 0,
331 93, 0, 56, 0, 57, 0, 153, 0, 96, 97,
332 179, 0, 96, 152, 0, 35, 152, 0, 55, 0,
333 98, 0, 96, 0, 155, 0, 156, 0, 39, 83,
334 159, 84, 0, 78, 180, 180, 180, 180, 180, 0,
335 166, 161, 0, 162, 0, 165, 0, 163, 0, 78,
336 0, 59, 0, 99, 0, 100, 0, 101, 0, 90,
337 0, 102, 0, 89, 0, 87, 0, 67, 0, 158,
338 0, 164, 0, 103, 0, 99, 0, 101, 0, 0,
339 167, 157, 0, 15, 78, 0, 15, 172, 0, 0,
340 31, 169, 147, 0, 51, 78, 0, 0, 170, 174,
341 0, 87, 0, 171, 87, 0, 0, 171, 0, 174,
342 0, 172, 0, 179, 0, 61, 0, 174, 87, 0,
343 174, 86, 179, 0, 174, 91, 179, 0, 97, 0,
344 97, 179, 0, 148, 173, 0, 77, 173, 0, 162,
345 173, 0, 0, 178, 60, 0, 79, 0, 59, 0,
346 179, 0, 101, 179, 0, 71, 0, 76, 0, 69,
347 0, 181, 183, 0, 14, 0, 21, 0, 28, 0,
348 37, 0, 45, 83, 185, 84, 0, 0, 62, 0,
349 185, 50, 78, 0, 185, 78, 85, 186, 0, 46,
350 83, 187, 84, 0, 0, 187, 78, 188, 0, 78,
351 189, 0, 78, 0, 190, 190, 0, 182, 182, 0
357 static const short yyrline[] = { 0,
358 258, 259, 263, 266, 267, 268, 269, 272, 285, 288,
359 291, 294, 300, 304, 311, 318, 322, 331, 335, 342,
360 347, 351, 355, 359, 363, 367, 371, 374, 377, 381,
361 384, 391, 396, 401, 406, 411, 415, 424, 428, 442,
362 445, 448, 451, 456, 459, 464, 468, 473, 475, 484,
363 489, 493, 496, 500, 501, 504, 507, 511, 515, 520,
364 524, 531, 537, 540, 544, 548, 552, 557, 570, 576,
365 581, 586, 588, 593, 600, 601, 602, 603, 604, 605,
366 608, 610, 613, 614, 615, 618, 631, 645, 647, 651,
367 653, 659, 665, 670, 683, 688, 689, 692, 694, 697,
368 707, 709, 712, 716, 721, 726, 731, 736, 744, 747,
369 750, 754, 758, 764, 769, 778, 782, 791, 793, 796,
370 800, 803, 815, 820, 823, 829, 835, 841, 850, 858,
371 864, 872, 877, 885, 893, 900, 909, 913, 916, 919,
372 922, 925, 929, 941, 949, 958, 962, 965, 968, 970,
373 976, 980, 989, 1000, 1005, 1009, 1015, 1026, 1036, 1038,
374 1039, 1040, 1041, 1042, 1043, 1048, 1050, 1051, 1057, 1059,
375 1060, 1063, 1066, 1075, 1080, 1084, 1094, 1098, 1104, 1108,
376 1113, 1115, 1118, 1122, 1126, 1132, 1138, 1148, 1151, 1154,
377 1157, 1163, 1167, 1177, 1185, 1191, 1203, 1206, 1211, 1215,
378 1219, 1223, 1226, 1233, 1237, 1246, 1251, 1252, 1253, 1254,
379 1260, 1264, 1268, 1271, 1275, 1281, 1285, 1287, 1294, 1300,
385 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
387 static const char * const yytname[] = { "$","error","$undefined.","ALIAS",
388 "BAR","BEAMPLET","MAEBTELP","BREAK","CADENZA","CLEAR","CLEF","CONTAINS","CONSISTS",
389 "ACCEPTS","CM_T","DURATION","ABSDYNAMIC","END","GROUPING","TRANSLATOR","HEADER",
390 "IN_T","LYRIC","KEY","MELODIC","MIDI","MELODIC_REQUEST","METER","MM_T","MULTI",
391 "NOTENAMES","OCTAVE","OUTPUT","PAPER","PARTIAL","PLET","TELP","PT_T","SCORE",
392 "SCRIPT","SHAPE","SKIP","SPANDYNAMIC","STAFF","START_T","SYMBOLTABLES","TABLE",
393 "TRANSPOSE","TEMPO","TYPE","TEXID","TEXTSTYLE","TITLE","PROPERTY","VERSION",
394 "E_EXCLAMATION","E_SMALLER","E_BIGGER","E_CHAR","DIGIT","NOTENAME_ID","DURATION_IDENTIFIER",
395 "IDENTIFIER","MELODIC_REQUEST_IDENTIFIER","MUSIC_IDENTIFIER","VOICE_IDENTIFIER",
396 "POST_REQUEST_IDENTIFIER","SCRIPT_IDENTIFIER","COMMAND_IDENTIFIER","REAL_IDENTIFIER",
397 "TRANS_IDENTIFIER","INT_IDENTIFIER","SCORE_IDENTIFIER","MIDI_IDENTIFIER","PAPER_IDENTIFIER",
398 "REQUEST_IDENTIFIER","REAL","RESTNAME","STRING","UNSIGNED","POST_QUOTES","PRE_QUOTES",
399 "';'","'{'","'}'","'='","'*'","'.'","'<'","'>'","'|'","'/'","'!'","']'","'~'",
400 "'('","'['","':'","')'","'^'","'+'","'-'","'o'","'_'","mudela","check_version",
401 "add_notenames","notenames_body","mudela_header_body","mudela_header","concat_strings",
402 "add_declaration","@1","identifier_init","translator_spec","translator_spec_body",
403 "score_block","@2","score_body","output_def","intastint_list","paper_block",
404 "paper_body","shape_array","midi_block","midi_body","tempo_request","Voice",
405 "Voice_body","Music","@3","@4","translator_change","property_def","scalar","Chord",
406 "Chord_body","transposed_music","full_element","simple_element","command_elt",
407 "command_req","abbrev_command_req","verbose_command_req","post_requests","structured_post_request",
408 "post_request","steno_melodic_req","steno_note_req","melodic_request","explicit_duration",
409 "dynamic_req","plet_fraction","close_plet_parens","close_request_parens","open_abbrev_parens",
410 "open_plet_parens","open_request_parens","script_definition","script_body","script_req",
411 "gen_script_def","text_def","finger","script_abbreviation","mudela_script","script_dir",
412 "pre_requests","voice_command","@5","duration_length","dots","entered_notemode_duration",
413 "notemode_duration","explicit_steno_duration","abbrev_type","music_elt","lyrics_elt",
414 "pitch_list","unsigned","int","real","dim","unit","symtables","symtables_body",
415 "symtable","symtable_body","symboldef","box","dinterval", NULL
419 static const short yyr1[] = { 0,
420 104, 104, 104, 104, 104, 104, 104, 105, 106, 107,
421 107, 107, 108, 108, 109, 110, 110, 112, 111, 113,
422 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
423 113, 114, 115, 115, 115, 115, 115, 117, 116, 118,
424 118, 118, 118, 118, 118, 119, 119, 120, 120, 121,
425 122, 122, 122, 122, 122, 122, 122, 122, 122, 123,
426 123, 124, 125, 125, 125, 125, 125, 126, 127, 128,
427 128, 129, 129, 129, 129, 129, 129, 129, 129, 130,
428 129, 131, 129, 129, 129, 132, 133, 134, 134, 135,
429 135, 136, 136, 137, 138, 138, 138, 139, 139, 140,
430 141, 141, 142, 142, 143, 143, 143, 143, 143, 143,
431 143, 143, 143, 143, 144, 144, 144, 145, 145, 146,
432 146, 146, 147, 147, 147, 148, 148, 149, 150, 151,
433 151, 152, 152, 153, 153, 153, 154, 154, 154, 154,
434 154, 154, 155, 156, 156, 157, 157, 157, 157, 157,
435 158, 159, 160, 161, 161, 161, 162, 163, 164, 164,
436 164, 164, 164, 164, 164, 165, 165, 165, 166, 166,
437 166, 167, 167, 168, 168, 169, 168, 168, 170, 170,
438 171, 171, 172, 172, 172, 173, 174, 174, 174, 174,
439 174, 175, 175, 176, 176, 177, 178, 178, 179, 179,
440 180, 180, 180, 181, 181, 182, 183, 183, 183, 183,
441 184, 185, 185, 185, 185, 186, 187, 187, 188, 188,
445 static const short yyr2[] = { 0,
446 0, 2, 2, 2, 2, 2, 2, 3, 4, 0,
447 2, 4, 0, 5, 4, 0, 2, 0, 4, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 4, 1, 3, 5, 4, 4, 0, 5, 0,
450 1, 2, 2, 2, 2, 1, 1, 0, 4, 4,
451 0, 1, 4, 2, 5, 5, 4, 5, 2, 0,
452 3, 4, 0, 4, 4, 3, 2, 4, 3, 0,
453 2, 1, 3, 5, 1, 1, 1, 1, 2, 0,
454 3, 0, 3, 1, 1, 4, 6, 1, 1, 3,
455 3, 0, 2, 3, 3, 1, 2, 1, 1, 1,
456 1, 2, 1, 1, 2, 1, 4, 2, 1, 2,
457 2, 2, 2, 2, 0, 2, 2, 1, 1, 1,
458 1, 1, 1, 2, 2, 1, 2, 6, 5, 4,
459 5, 3, 2, 2, 1, 2, 1, 1, 1, 1,
460 1, 1, 3, 2, 2, 1, 1, 1, 1, 1,
461 4, 6, 2, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 0, 2, 2, 2, 0, 3, 2, 0, 2,
464 1, 2, 0, 1, 1, 1, 1, 1, 2, 3,
465 3, 1, 2, 2, 2, 2, 0, 2, 1, 1,
466 1, 2, 1, 1, 1, 2, 1, 1, 1, 1,
467 4, 0, 1, 3, 4, 4, 0, 3, 2, 1,
471 static const short yydefact[] = { 1,
472 0, 5, 0, 0, 38, 0, 18, 6, 7, 2,
473 4, 3, 13, 10, 0, 0, 0, 0, 0, 40,
474 8, 172, 0, 15, 11, 0, 9, 41, 0, 0,
475 106, 0, 0, 183, 0, 48, 0, 82, 197, 80,
476 0, 0, 0, 0, 176, 0, 179, 0, 179, 0,
477 0, 0, 183, 0, 0, 0, 200, 78, 120, 104,
478 205, 203, 204, 199, 70, 92, 103, 192, 0, 19,
479 30, 20, 21, 22, 109, 75, 24, 85, 84, 76,
480 77, 72, 96, 100, 101, 0, 28, 29, 31, 121,
481 23, 0, 0, 122, 201, 27, 26, 25, 16, 0,
482 45, 183, 0, 39, 42, 44, 46, 47, 43, 105,
483 110, 112, 188, 174, 0, 181, 184, 175, 185, 187,
484 0, 114, 0, 0, 172, 113, 172, 63, 0, 0,
485 0, 0, 51, 111, 0, 108, 0, 212, 123, 0,
486 172, 0, 172, 178, 0, 79, 172, 172, 193, 202,
487 102, 0, 146, 183, 157, 148, 147, 115, 126, 183,
488 149, 150, 173, 183, 98, 99, 97, 0, 12, 0,
489 182, 0, 189, 0, 0, 0, 0, 0, 33, 0,
490 83, 198, 81, 0, 0, 0, 91, 177, 52, 0,
491 180, 0, 0, 0, 213, 0, 125, 124, 94, 0,
492 0, 73, 0, 69, 71, 90, 93, 0, 145, 0,
493 186, 195, 0, 144, 95, 127, 194, 196, 17, 14,
494 0, 190, 191, 130, 0, 86, 0, 0, 0, 0,
495 32, 67, 0, 0, 62, 0, 0, 107, 59, 0,
496 0, 0, 50, 54, 0, 151, 0, 0, 0, 211,
497 68, 172, 0, 133, 0, 143, 135, 140, 141, 139,
498 137, 138, 170, 171, 169, 116, 119, 142, 117, 118,
499 0, 129, 49, 34, 0, 0, 0, 0, 0, 66,
500 0, 0, 60, 0, 0, 131, 214, 0, 74, 0,
501 132, 136, 134, 158, 166, 165, 164, 162, 159, 160,
502 161, 163, 167, 153, 154, 156, 168, 155, 36, 37,
503 88, 0, 89, 65, 0, 64, 128, 53, 0, 57,
504 0, 0, 0, 0, 215, 87, 35, 58, 0, 0,
505 207, 208, 209, 210, 56, 206, 55, 0, 217, 61,
506 152, 0, 0, 216, 220, 218, 0, 219, 0, 222,
510 static const short yydefgoto[] = { 1,
511 8, 9, 19, 18, 10, 168, 11, 17, 70, 71,
512 180, 12, 15, 29, 106, 122, 73, 190, 319, 74,
513 184, 75, 76, 147, 77, 127, 125, 78, 79, 312,
514 80, 148, 81, 82, 158, 83, 84, 85, 86, 215,
515 266, 87, 141, 160, 88, 89, 90, 209, 268, 269,
516 161, 162, 163, 91, 193, 270, 304, 164, 306, 307,
517 308, 271, 92, 93, 132, 134, 117, 211, 212, 119,
518 94, 165, 166, 126, 95, 313, 329, 347, 336, 98,
519 196, 325, 342, 346, 348, 349
522 static const short yypact[] = {-32768,
523 19,-32768, -66, -47,-32768, -18,-32768,-32768,-32768,-32768,
524 -32768,-32768,-32768,-32768, -14, -6, 28, 50, -4, 12,
525 -32768, 243, 46,-32768,-32768, 53,-32768,-32768, 328, 62,
526 -32768, 51, 71, 134, 68,-32768, -52,-32768,-32768,-32768,
527 91, 92, 51, 51,-32768, 97,-32768, 100,-32768, 114,
528 118, -46, 141, 126, 127, 128,-32768, 54,-32768,-32768,
529 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 51, 51,-32768,
530 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
531 -32768,-32768,-32768,-32768,-32768, 132,-32768,-32768,-32768,-32768,
532 -32768, 113, 136,-32768,-32768,-32768,-32768,-32768,-32768, 170,
533 -32768, 120, 138,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
534 -32768,-32768,-32768,-32768, 107,-32768, 123,-32768, 101,-32768,
535 51, 107, 137, 7, 608, 159, 608,-32768, 107, 142,
536 -23, -46, 151, -36, 149, -36, 107, 168,-32768, -46,
537 413, 147, 461,-32768, 148,-32768, 509, 557,-32768,-32768,
538 -32768, 73,-32768, 141,-32768, -27,-32768,-32768, 154, 58,
539 -32768,-32768,-32768, 141,-32768,-32768,-32768, 20,-32768, 51,
540 -32768, 51,-32768, 51, 152, 153, 160, 162,-32768, 34,
541 -32768,-32768,-32768, 10, 107, 51,-32768, 154,-32768, 8,
542 101, 107, 157, 107,-32768, -17, 154,-32768,-32768, 51,
543 164,-32768, 165,-32768,-32768,-32768,-32768, 51,-32768, 146,
544 -32768,-32768, 51,-32768, -12,-32768,-32768,-32768,-32768,-32768,
545 161,-32768,-32768,-32768, 107,-32768, 166, 171, 174, 169,
546 -32768,-32768, 177, 172,-32768, 178, 107,-32768,-32768, 193,
547 188, 190,-32768,-32768, 107,-32768, 194, 201, 195,-32768,
548 -32768, 608, 198,-32768, 51,-32768, 73,-32768,-32768, 73,
549 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
550 57,-32768,-32768,-32768, 204, 205, 83, 207, 225,-32768,
551 209, 213,-32768, -1, 107,-32768,-32768, 200,-32768, 83,
552 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
553 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
554 -32768, 215,-32768,-32768, 173,-32768,-32768,-32768, -10,-32768,
555 13, 216, 107, 217,-32768,-32768,-32768,-32768, 139, -48,
556 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 107,-32768,-32768,
557 -32768, 87, 221,-32768, -48,-32768, -48,-32768, -48,-32768,
561 static const short yypgoto[] = {-32768,
562 -32768,-32768,-32768,-32768, 275,-32768,-32768,-32768,-32768, -170,
563 -32768, 283,-32768,-32768,-32768,-32768, 277,-32768,-32768, 279,
564 -32768, 129,-32768,-32768, -21,-32768,-32768,-32768,-32768, 27,
565 179,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
566 -32768, 103, -77,-32768, 220,-32768,-32768, -149,-32768,-32768,
567 -32768,-32768,-32768, 44,-32768,-32768,-32768, 52,-32768,-32768,
568 -32768,-32768,-32768,-32768,-32768, 272,-32768, -24, 25, -35,
569 -32768,-32768,-32768,-32768, -31, -22, -20, -268,-32768, 135,
570 -32768,-32768,-32768,-32768,-32768, -25
577 static const short yytable[] = { 96,
578 111, 97, 120, 35, 25, 44, 214, 109, 239, 118,
579 232, 130, 131, 139, 159, 322, 13, 315, 352, 2,
580 61, 120, 57, 257, 113, 123, 331, 63, 142, 50,
581 124, 57, 248, 332, 140, 14, 149, 150, 3, 240,
582 333, 233, 64, 258, 259, 228, 229, 241, 4, 334,
583 330, 64, 51, 59, 188, 178, 5, 53, 61, 16,
584 249, 340, 197, 208, 66, 63, 250, 61, 20, 213,
585 120, 328, 6, 26, 63, 21, 179, 118, 350, 27,
586 260, 261, 262, 28, 68, 242, 263, 234, 264, 175,
587 265, 243, 170, 235, 335, 48, 7, 219, 191, 176,
588 191, 220, 120, 181, 120, 183, 185, 292, 316, 57,
589 293, 230, 22, 320, 194, 294, 57, 231, 113, 199,
590 210, 202, 120, 295, 210, 205, 207, 23, 120, 64,
591 99, 57, 120, 24, 155, 146, 64, 100, 221, 110,
592 222, 57, 223, 296, 116, 297, 298, 152, 112, 216,
593 121, 64, 331, 62, 238, 299, 300, 301, 302, 332,
594 311, 64, 237, 208, 343, 57, 333, 153, 251, 245,
595 344, 247, 139, 128, 129, 334, 254, 62, 57, 133,
596 113, 256, 135, 69, 217, 64, 172, 173, 218, 154,
597 155, 174, 57, 140, 113, 42, 137, 114, 64, 57,
598 138, 113, 273, 143, 144, 145, 116, 69, 156, 171,
599 157, 114, 64, 151, 281, 123, 115, 167, 182, 64,
600 116, 177, 285, 291, 189, 210, 192, 116, 210, 195,
601 289, 200, 186, 198, 203, 224, 255, 226, 225, 227,
602 246, 252, 253, 315, 272, 324, 30, 274, 275, 31,
603 32, 276, 33, 277, 278, 124, 279, 34, 35, 280,
604 36, 37, 323, 321, 38, 39, 40, 41, 42, 43,
605 282, 44, 283, 45, 284, 46, 47, 286, 287, 288,
606 5, 48, 290, 49, 50, 309, 310, 51, 314, 52,
607 53, 54, 317, 55, 318, 56, 327, 337, 345, 339,
608 338, 57, 353, 105, 72, 107, 58, 108, 59, 187,
609 60, 61, 236, 62, 303, 341, 326, 267, 63, 169,
610 136, 64, 305, 351, 244, 65, 0, 0, 101, 0,
611 66, 30, 67, 0, 31, 32, 0, 33, 0, 68,
612 0, 0, 102, 69, 0, 36, 103, 3, 0, 38,
613 39, 40, 41, 0, 43, 0, 44, 0, 45, 0,
614 46, 47, -172, 0, 0, 0, 0, 0, 49, 0,
615 0, 0, 0, 0, 52, 53, 54, 0, 55, 0,
616 56, 0, -172, 0, 0, 0, 0, -172, 0, 0,
617 0, 58, 0, 0, 0, 60, 0, 0, 0, 0,
618 0, 0, 0, 0, -172, -172, 0, 0, -172, 0,
619 65, 104, 0, 0, 0, 66, 30, 67, 0, 31,
620 32, 0, 33, -172, 0, -172, 0, 102, 0, 0,
621 36, 103, 0, 0, 38, 39, 40, 0, 0, 43,
622 0, 44, 0, 45, 0, 0, 47, 0, 0, 0,
623 0, 0, 0, 49, 0, 0, 0, 0, 0, 52,
624 53, 54, 0, 55, 30, 56, 0, 31, 32, 0,
625 33, 0, 0, 0, 0, 102, 58, 0, 36, 103,
626 60, 0, 38, 39, 40, 0, 0, 43, 0, 44,
627 0, 45, 198, 0, 47, 65, 0, 0, 0, 0,
628 66, 49, 67, 0, 0, 0, 0, 52, 53, 54,
629 0, 55, 30, 56, 0, 31, 32, 0, 33, 0,
630 0, 0, 0, 102, 58, 0, 36, 103, 60, 0,
631 38, 39, 40, 0, 0, 43, 0, 44, 0, 45,
632 0, 0, 47, 65, 0, 201, 0, 0, 66, 49,
633 67, 0, 0, 0, 0, 52, 53, 54, 0, 55,
634 30, 56, 0, 31, 32, 0, 33, 0, 0, 0,
635 0, 102, 58, 0, 36, 103, 60, 0, 38, 39,
636 40, 0, 0, 43, 0, 44, 0, 45, 0, 0,
637 47, 65, 204, 0, 0, 0, 66, 49, 67, 0,
638 0, 0, 0, 52, 53, 54, 0, 55, 0, 56,
639 0, 30, 0, 0, 31, 32, 0, 33, 0, 0,
640 58, 0, 102, 0, 60, 36, 103, 0, 0, 38,
641 39, 40, 0, 0, 43, 0, 44, 0, 45, 65,
642 0, 47, 0, 0, 66, 206, 67, 0, 49, 0,
643 0, 0, 0, 0, 52, 53, 54, 0, 55, 0,
644 56, 0, 0, 0, 0, 0, 0, 0, 0, 0,
645 0, 58, 0, 0, 0, 60, 0, 0, 0, 0,
646 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
647 65, 0, 0, 0, 0, 66, 0, 67
650 static const short yycheck[] = { 22,
651 32, 22, 34, 16, 9, 29, 156, 29, 1, 34,
652 1, 43, 44, 60, 92, 284, 83, 19, 0, 1,
653 69, 53, 59, 36, 61, 78, 14, 76, 53, 42,
654 83, 59, 50, 21, 81, 83, 68, 69, 20, 32,
655 28, 32, 79, 56, 57, 12, 13, 40, 30, 37,
656 319, 79, 45, 66, 132, 49, 38, 48, 69, 78,
657 78, 330, 140, 91, 88, 76, 84, 69, 83, 97,
658 102, 82, 54, 78, 76, 82, 70, 102, 347, 84,
659 93, 94, 95, 72, 97, 78, 99, 78, 101, 121,
660 103, 84, 115, 84, 82, 39, 78, 78, 134, 122,
661 136, 82, 134, 125, 136, 127, 129, 257, 279, 59,
662 260, 78, 85, 284, 137, 59, 59, 84, 61, 141,
663 152, 143, 154, 67, 156, 147, 148, 78, 160, 79,
664 85, 59, 164, 84, 78, 82, 79, 85, 170, 78,
665 172, 59, 174, 87, 87, 89, 90, 35, 78, 92,
666 83, 79, 14, 71, 186, 99, 100, 101, 102, 21,
667 78, 79, 185, 91, 78, 59, 28, 55, 200, 192,
668 84, 194, 60, 83, 83, 37, 208, 71, 59, 83,
669 61, 213, 83, 101, 160, 79, 86, 87, 164, 77,
670 78, 91, 59, 81, 61, 26, 83, 78, 79, 59,
671 83, 61, 225, 78, 78, 78, 87, 101, 96, 87,
672 98, 78, 79, 82, 237, 78, 83, 82, 60, 79,
673 87, 85, 245, 255, 74, 257, 78, 87, 260, 62,
674 252, 85, 91, 80, 87, 84, 91, 78, 86, 78,
675 84, 78, 78, 19, 84, 46, 4, 82, 78, 7,
676 8, 78, 10, 85, 78, 83, 85, 15, 16, 82,
677 18, 19, 285, 284, 22, 23, 24, 25, 26, 27,
678 78, 29, 85, 31, 85, 33, 34, 84, 78, 85,
679 38, 39, 85, 41, 42, 82, 82, 45, 82, 47,
680 48, 49, 84, 51, 82, 53, 82, 82, 78, 83,
681 323, 59, 0, 29, 22, 29, 64, 29, 66, 131,
682 68, 69, 184, 71, 271, 338, 290, 215, 76, 100,
683 49, 79, 271, 349, 190, 83, -1, -1, 1, -1,
684 88, 4, 90, -1, 7, 8, -1, 10, -1, 97,
685 -1, -1, 15, 101, -1, 18, 19, 20, -1, 22,
686 23, 24, 25, -1, 27, -1, 29, -1, 31, -1,
687 33, 34, 35, -1, -1, -1, -1, -1, 41, -1,
688 -1, -1, -1, -1, 47, 48, 49, -1, 51, -1,
689 53, -1, 55, -1, -1, -1, -1, 60, -1, -1,
690 -1, 64, -1, -1, -1, 68, -1, -1, -1, -1,
691 -1, -1, -1, -1, 77, 78, -1, -1, 81, -1,
692 83, 84, -1, -1, -1, 88, 4, 90, -1, 7,
693 8, -1, 10, 96, -1, 98, -1, 15, -1, -1,
694 18, 19, -1, -1, 22, 23, 24, -1, -1, 27,
695 -1, 29, -1, 31, -1, -1, 34, -1, -1, -1,
696 -1, -1, -1, 41, -1, -1, -1, -1, -1, 47,
697 48, 49, -1, 51, 4, 53, -1, 7, 8, -1,
698 10, -1, -1, -1, -1, 15, 64, -1, 18, 19,
699 68, -1, 22, 23, 24, -1, -1, 27, -1, 29,
700 -1, 31, 80, -1, 34, 83, -1, -1, -1, -1,
701 88, 41, 90, -1, -1, -1, -1, 47, 48, 49,
702 -1, 51, 4, 53, -1, 7, 8, -1, 10, -1,
703 -1, -1, -1, 15, 64, -1, 18, 19, 68, -1,
704 22, 23, 24, -1, -1, 27, -1, 29, -1, 31,
705 -1, -1, 34, 83, -1, 85, -1, -1, 88, 41,
706 90, -1, -1, -1, -1, 47, 48, 49, -1, 51,
707 4, 53, -1, 7, 8, -1, 10, -1, -1, -1,
708 -1, 15, 64, -1, 18, 19, 68, -1, 22, 23,
709 24, -1, -1, 27, -1, 29, -1, 31, -1, -1,
710 34, 83, 84, -1, -1, -1, 88, 41, 90, -1,
711 -1, -1, -1, 47, 48, 49, -1, 51, -1, 53,
712 -1, 4, -1, -1, 7, 8, -1, 10, -1, -1,
713 64, -1, 15, -1, 68, 18, 19, -1, -1, 22,
714 23, 24, -1, -1, 27, -1, 29, -1, 31, 83,
715 -1, 34, -1, -1, 88, 89, 90, -1, 41, -1,
716 -1, -1, -1, -1, 47, 48, 49, -1, 51, -1,
717 53, -1, -1, -1, -1, -1, -1, -1, -1, -1,
718 -1, 64, -1, -1, -1, 68, -1, -1, -1, -1,
719 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
720 83, -1, -1, -1, -1, 88, -1, 90
724 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
725 #line 3 "/usr/lib/bison.simple"
727 /* Skeleton output parser for bison,
728 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
730 This program is free software; you can redistribute it and/or modify
731 it under the terms of the GNU General Public License as published by
732 the Free Software Foundation; either version 2, or (at your option)
735 This program is distributed in the hope that it will be useful,
736 but WITHOUT ANY WARRANTY; without even the implied warranty of
737 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
738 GNU General Public License for more details.
740 You should have received a copy of the GNU General Public License
741 along with this program; if not, write to the Free Software
742 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
744 /* As a special exception, when this file is copied by Bison into a
745 Bison output file, you may use that output file without restriction.
746 This special exception was added by the Free Software Foundation
747 in version 1.24 of Bison. */
751 #define alloca __builtin_alloca
752 #else /* not GNU C. */
753 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
755 #else /* not sparc */
756 #if defined (MSDOS) && !defined (__TURBOC__)
758 #else /* not MSDOS, or __TURBOC__ */
762 #else /* not MSDOS, __TURBOC__, or _AIX */
766 void *alloca (unsigned int);
768 #else /* not __cplusplus */
770 #endif /* not __cplusplus */
772 #endif /* not _AIX */
773 #endif /* not MSDOS, or __TURBOC__ */
774 #endif /* not sparc. */
775 #endif /* not GNU C. */
776 #endif /* alloca not defined. */
778 /* This is the parser code that is written into each bison parser
779 when the %semantic_parser declaration is not specified in the grammar.
780 It was written by Richard Stallman by simplifying the hairy parser
781 used when %semantic_parser is specified. */
783 /* Note: there must be only one dollar sign in this file.
784 It is replaced by the list of actions, each action
785 as one case of the switch. */
787 #define yyerrok (yyerrstatus = 0)
788 #define yyclearin (yychar = YYEMPTY)
791 #define YYACCEPT return(0)
792 #define YYABORT return(1)
793 #define YYERROR goto yyerrlab1
794 /* Like YYERROR except do call yyerror.
795 This remains here temporarily to ease the
796 transition to the new meaning of YYERROR, for GCC.
797 Once GCC version 2 has supplanted version 1, this can go. */
798 #define YYFAIL goto yyerrlab
799 #define YYRECOVERING() (!!yyerrstatus)
800 #define YYBACKUP(token, value) \
802 if (yychar == YYEMPTY && yylen == 1) \
803 { yychar = (token), yylval = (value); \
804 yychar1 = YYTRANSLATE (yychar); \
809 { yyerror ("syntax error: cannot back up"); YYERROR; } \
813 #define YYERRCODE 256
816 #define YYLEX yylex()
822 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
824 #define YYLEX yylex(&yylval, &yylloc)
826 #else /* not YYLSP_NEEDED */
828 #define YYLEX yylex(&yylval, YYLEX_PARAM)
830 #define YYLEX yylex(&yylval)
832 #endif /* not YYLSP_NEEDED */
835 /* If nonreentrant, generate the variables here */
839 int yychar; /* the lookahead symbol */
840 YYSTYPE yylval; /* the semantic value of the */
841 /* lookahead symbol */
844 YYLTYPE yylloc; /* location data for the lookahead */
848 int yynerrs; /* number of parse errors so far */
849 #endif /* not YYPURE */
852 int yydebug; /* nonzero means print parse trace */
853 /* Since this is uninitialized, it does not stop multiple parsers
857 /* YYINITDEPTH indicates the initial size of the parser's stacks */
860 #define YYINITDEPTH 200
863 /* YYMAXDEPTH is the maximum size the stacks can grow to
864 (effective only if the built-in stack extension method is used). */
871 #define YYMAXDEPTH 10000
874 /* Prevent warning if -Wstrict-prototypes. */
879 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
880 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
881 #else /* not GNU C or C++ */
884 /* This is the most reliable way to avoid incompatibilities
885 in available built-in functions on various systems. */
887 __yy_memcpy (to, from, count)
892 register char *f = from;
893 register char *t = to;
894 register int i = count;
900 #else /* __cplusplus */
902 /* This is the most reliable way to avoid incompatibilities
903 in available built-in functions on various systems. */
905 __yy_memcpy (char *to, char *from, int count)
907 register char *f = from;
908 register char *t = to;
909 register int i = count;
918 #line 196 "/usr/lib/bison.simple"
920 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
921 into yyparse. The argument should have type void *.
922 It should actually point to an object.
923 Grammar actions can access the variable by casting it
924 to the proper pointer type. */
928 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
929 #define YYPARSE_PARAM_DECL
930 #else /* not __cplusplus */
931 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
932 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
933 #endif /* not __cplusplus */
934 #else /* not YYPARSE_PARAM */
935 #define YYPARSE_PARAM_ARG
936 #define YYPARSE_PARAM_DECL
937 #endif /* not YYPARSE_PARAM */
940 yyparse(YYPARSE_PARAM_ARG)
943 register int yystate;
945 register short *yyssp;
946 register YYSTYPE *yyvsp;
947 int yyerrstatus; /* number of tokens to shift before error messages enabled */
948 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
950 short yyssa[YYINITDEPTH]; /* the state stack */
951 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
953 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
954 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
957 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
958 YYLTYPE *yyls = yylsa;
961 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
963 #define YYPOPSTACK (yyvsp--, yyssp--)
966 int yystacksize = YYINITDEPTH;
977 YYSTYPE yyval; /* the variable used to return */
978 /* semantic values from the action */
985 fprintf(stderr, "Starting parse\n");
991 yychar = YYEMPTY; /* Cause a token to be read. */
993 /* Initialize stack pointers.
994 Waste one element of value and location stack
995 so that they stay on the same level as the state stack.
996 The wasted elements are never initialized. */
1004 /* Push a new state, which is found in yystate . */
1005 /* In all cases, when you get here, the value and location stacks
1006 have just been pushed. so pushing a state here evens the stacks. */
1011 if (yyssp >= yyss + yystacksize - 1)
1013 /* Give user a chance to reallocate the stack */
1014 /* Use copies of these so that the &'s don't force the real ones into memory. */
1015 YYSTYPE *yyvs1 = yyvs;
1016 short *yyss1 = yyss;
1018 YYLTYPE *yyls1 = yyls;
1021 /* Get the current used size of the three stacks, in elements. */
1022 int size = yyssp - yyss + 1;
1025 /* Each stack pointer address is followed by the size of
1026 the data in use in that stack, in bytes. */
1028 /* This used to be a conditional around just the two extra args,
1029 but that might be undefined if yyoverflow is a macro. */
1030 yyoverflow("parser stack overflow",
1031 &yyss1, size * sizeof (*yyssp),
1032 &yyvs1, size * sizeof (*yyvsp),
1033 &yyls1, size * sizeof (*yylsp),
1036 yyoverflow("parser stack overflow",
1037 &yyss1, size * sizeof (*yyssp),
1038 &yyvs1, size * sizeof (*yyvsp),
1042 yyss = yyss1; yyvs = yyvs1;
1046 #else /* no yyoverflow */
1047 /* Extend the stack our own way. */
1048 if (yystacksize >= YYMAXDEPTH)
1050 yyerror("parser stack overflow");
1054 if (yystacksize > YYMAXDEPTH)
1055 yystacksize = YYMAXDEPTH;
1056 yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
1057 __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
1058 yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
1059 __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
1061 yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
1062 __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
1064 #endif /* no yyoverflow */
1066 yyssp = yyss + size - 1;
1067 yyvsp = yyvs + size - 1;
1069 yylsp = yyls + size - 1;
1074 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1077 if (yyssp >= yyss + yystacksize - 1)
1083 fprintf(stderr, "Entering state %d\n", yystate);
1089 /* Do appropriate processing given the current state. */
1090 /* Read a lookahead token if we need one and don't already have one. */
1093 /* First try to decide what to do without reference to lookahead token. */
1095 yyn = yypact[yystate];
1099 /* Not known => get a lookahead token if don't already have one. */
1101 /* yychar is either YYEMPTY or YYEOF
1102 or a valid token in external form. */
1104 if (yychar == YYEMPTY)
1108 fprintf(stderr, "Reading a token: ");
1113 /* Convert token to internal form (in yychar1) for indexing tables with */
1115 if (yychar <= 0) /* This means end of input. */
1118 yychar = YYEOF; /* Don't call YYLEX any more */
1122 fprintf(stderr, "Now at end of input.\n");
1127 yychar1 = YYTRANSLATE(yychar);
1132 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1133 /* Give the individual parser a way to print the precise meaning
1134 of a token, for further debugging info. */
1136 YYPRINT (stderr, yychar, yylval);
1138 fprintf (stderr, ")\n");
1144 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1149 /* yyn is what to do for this token type in this state.
1150 Negative => reduce, -yyn is rule number.
1151 Positive => shift, yyn is new state.
1152 New state is final state => don't bother to shift,
1153 just return success.
1154 0, or most negative number => error. */
1169 /* Shift the lookahead token. */
1173 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1176 /* Discard the token being shifted unless it is eof. */
1177 if (yychar != YYEOF)
1185 /* count tokens shifted since error; after three, turn off error status. */
1186 if (yyerrstatus) yyerrstatus--;
1191 /* Do the default action for the current state. */
1194 yyn = yydefact[yystate];
1198 /* Do a reduction. yyn is the number of a rule to reduce with. */
1202 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1209 fprintf (stderr, "Reducing via rule %d (line %d), ",
1212 /* Print the symbols being reduced, and their result. */
1213 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1214 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1215 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1223 #line 259 "parser.yy"
1225 delete THIS->default_header_p_ ;
1226 THIS->default_header_p_ = yyvsp[0].header;
1230 #line 263 "parser.yy"
1232 add_score (yyvsp[0].score);
1236 #line 266 "parser.yy"
1240 #line 268 "parser.yy"
1244 #line 269 "parser.yy"
1248 #line 273 "parser.yy"
1250 if (String (*yyvsp[-1].string) != MUDELA_VERSION) {
1251 if (THIS->ignore_version_b_) {
1252 THIS->here_input ().error ("Incorrect mudela version");
1254 THIS->fatal_error_i_ = 1;
1255 THIS->parser_error ("Incorrect mudela version");
1261 #line 289 "parser.yy"
1266 #line 291 "parser.yy"
1268 THIS->clear_notenames ();
1272 #line 294 "parser.yy"
1274 THIS->add_notename (*yyvsp[-2].string, yyvsp[0].melreq);
1275 delete yyvsp[-2].string;
1279 #line 301 "parser.yy"
1281 yyval.header = new Header;
1285 #line 304 "parser.yy"
1287 (*yyval.header)[*yyvsp[-3].string] = *yyvsp[-1].string;
1288 delete yyvsp[-3].string;
1289 delete yyvsp[-1].string;
1293 #line 312 "parser.yy"
1295 yyval.header = yyvsp[-1].header;
1299 #line 319 "parser.yy"
1301 yyval.string = new String;
1305 #line 322 "parser.yy"
1307 *yyval.string += *yyvsp[0].string;
1311 #line 332 "parser.yy"
1313 THIS->remember_spot ();
1317 #line 335 "parser.yy"
1319 THIS->lexer_p_->set_identifier (*yyvsp[-3].string, yyvsp[0].id);
1320 yyvsp[0].id->init_b_ = THIS->init_parse_b_;
1321 yyvsp[0].id->set_spot (THIS->pop_spot ());
1325 #line 343 "parser.yy"
1327 yyval.id = new Score_id (yyvsp[0].score, SCORE_IDENTIFIER);
1332 #line 347 "parser.yy"
1334 yyval.id = new Paper_def_id (yyvsp[0].paper, PAPER_IDENTIFIER);
1339 #line 351 "parser.yy"
1341 yyval.id = new Midi_def_id (yyvsp[0].midi, MIDI_IDENTIFIER);
1346 #line 355 "parser.yy"
1348 yyval.id = new Script_id (yyvsp[0].script, SCRIPT_IDENTIFIER);
1353 #line 359 "parser.yy"
1355 yyval.id = new Music_id (yyvsp[0].music, MUSIC_IDENTIFIER);
1360 #line 363 "parser.yy"
1362 yyval.id = new Lookup_id (yyvsp[0].lookup, IDENTIFIER);
1367 #line 367 "parser.yy"
1369 yyval.id = new Real_id (new Real (yyvsp[0].real), REAL_IDENTIFIER);
1374 #line 371 "parser.yy"
1376 yyval.id = new Int_id (new int (yyvsp[0].i), INT_IDENTIFIER);
1380 #line 374 "parser.yy"
1382 yyval.id = new Request_id (yyvsp[0].request, POST_REQUEST_IDENTIFIER);
1386 #line 377 "parser.yy"
1388 yyval.id = new Request_id (yyvsp[0].melreq, MELODIC_REQUEST_IDENTIFIER);
1393 #line 381 "parser.yy"
1395 yyval.id = new Translator_id (yyvsp[0].trans, TRANS_IDENTIFIER);
1399 #line 384 "parser.yy"
1401 yyval.id = new Duration_id (yyvsp[0].duration, DURATION_IDENTIFIER);
1405 #line 393 "parser.yy"
1406 { yyval.trans = yyvsp[-1].trans; ;
1409 #line 397 "parser.yy"
1411 yyval.trans = yyvsp[0].id->translator ();
1412 yyval.trans-> set_spot (THIS->here_input ());
1416 #line 401 "parser.yy"
1418 yyval.trans = get_translator_l (*yyvsp[-1].string)->clone ();
1419 yyval.trans->set_spot (THIS->here_input ());
1420 delete yyvsp[-1].string;
1424 #line 406 "parser.yy"
1426 yyval.trans-> set_property (*yyvsp[-3].string, *yyvsp[-1].scalar);
1427 delete yyvsp[-3].string;
1428 delete yyvsp[-1].scalar;
1432 #line 411 "parser.yy"
1434 yyval.trans->group_l ()->consists_str_arr_.push (*yyvsp[-1].string);
1435 delete yyvsp[-1].string;
1439 #line 415 "parser.yy"
1441 yyval.trans->group_l ()->accepts_str_arr_.push (*yyvsp[-1].string);
1442 delete yyvsp[-1].string;
1446 #line 425 "parser.yy"
1447 { THIS->remember_spot ();
1448 THIS->error_level_i_ =0;
1452 #line 428 "parser.yy"
1454 yyval.score = yyvsp[-1].score;
1455 yyval.score->set_spot (THIS->pop_spot ());
1456 if (!yyval.score->def_p_arr_.size ())
1457 yyval.score->add (THIS->default_paper ());
1459 /* handle error levels. */
1460 yyval.score->errorlevel_i_ = THIS->error_level_i_;
1461 THIS->error_level_i_ = 0;
1462 if (!yyval.score->header_p_ && THIS->default_header_p_)
1463 yyval.score->header_p_ = new Header (*THIS->default_header_p_);
1467 #line 442 "parser.yy"
1469 yyval.score = new Score;
1473 #line 445 "parser.yy"
1475 yyval.score = yyvsp[0].id->score ();
1479 #line 448 "parser.yy"
1481 yyval.score->header_p_ = yyvsp[0].header;
1485 #line 451 "parser.yy"
1487 if (yyval.score->music_p_)
1488 yyvsp[0].music->warning ("More than one music block");
1489 yyval.score->music_p_ = yyvsp[0].music;
1493 #line 456 "parser.yy"
1495 yyval.score->add (yyvsp[0].outputdef);
1499 #line 459 "parser.yy"
1505 #line 465 "parser.yy"
1507 yyval.outputdef = yyvsp[0].paper;
1511 #line 468 "parser.yy"
1513 yyval.outputdef= yyvsp[0].midi;
1517 #line 474 "parser.yy"
1518 { yyval.intvec =new Array<int>; ;
1521 #line 475 "parser.yy"
1523 yyval.intvec->push (yyvsp[-2].i); yyval.intvec->push (yyvsp[0].i);
1527 #line 486 "parser.yy"
1528 { yyval.paper = yyvsp[-1].paper; ;
1531 #line 490 "parser.yy"
1533 yyval.paper = THIS->default_paper ();
1537 #line 493 "parser.yy"
1539 yyval.paper = yyvsp[0].id->paperdef ();
1543 #line 496 "parser.yy"
1545 yyval.paper->outfile_str_ = *yyvsp[-1].string;
1546 delete yyvsp[-1].string;
1550 #line 500 "parser.yy"
1551 { yyval.paper->set (yyvsp[0].lookup); ;
1554 #line 501 "parser.yy"
1556 yyval.paper->set_var (*yyvsp[-3].string, yyvsp[-1].real);
1560 #line 504 "parser.yy"
1562 yyval.paper->set_var (*yyvsp[-3].string, yyvsp[-1].real);
1566 #line 507 "parser.yy"
1568 yyval.paper-> assign_translator (*yyvsp[-2].string, yyvsp[0].trans);
1569 delete yyvsp[-2].string;
1573 #line 511 "parser.yy"
1575 yyval.paper->shape_int_a_ = *yyvsp[-1].intarr;
1576 delete yyvsp[-1].intarr;
1580 #line 515 "parser.yy"
1586 #line 521 "parser.yy"
1588 yyval.intarr = new Array<Interval>;
1592 #line 524 "parser.yy"
1594 yyval.intarr->push(Interval(yyvsp[-1].real, yyvsp[-1].real + yyvsp[0].real));
1598 #line 534 "parser.yy"
1599 { yyval.midi = yyvsp[-1].midi; ;
1602 #line 537 "parser.yy"
1604 yyval.midi = THIS->default_midi ();
1608 #line 540 "parser.yy"
1610 yyval.midi-> assign_translator (*yyvsp[-2].string, yyvsp[0].trans);
1611 delete yyvsp[-2].string;
1615 #line 544 "parser.yy"
1617 yyval.midi->outfile_str_ = *yyvsp[-1].string;
1618 delete yyvsp[-1].string;
1622 #line 548 "parser.yy"
1624 yyval.midi->set_tempo (yyvsp[-1].tempo->dur_.length (), yyvsp[-1].tempo->metronome_i_);
1625 delete yyvsp[-1].tempo;
1629 #line 552 "parser.yy"
1635 #line 558 "parser.yy"
1637 yyval.tempo = new Tempo_req;
1638 yyval.tempo->dur_ = *yyvsp[-2].duration;
1639 delete yyvsp[-2].duration;
1640 yyval.tempo-> metronome_i_ = yyvsp[0].i;
1644 #line 571 "parser.yy"
1646 yyval.musiclist = yyvsp[-1].musiclist;
1650 #line 577 "parser.yy"
1652 yyval.musiclist = new Voice;
1653 yyval.musiclist->set_spot (THIS->here_input ());
1657 #line 581 "parser.yy"
1659 yyval.musiclist->add (yyvsp[0].music);
1663 #line 587 "parser.yy"
1664 { yyval.music = yyvsp[0].music; ;
1667 #line 588 "parser.yy"
1669 yyval.music = yyvsp[0].music;
1670 yyval.music->translator_type_str_ = *yyvsp[-1].string;
1671 delete yyvsp[-1].string;
1675 #line 593 "parser.yy"
1677 yyval.music = yyvsp[0].music;
1678 yyval.music->translator_type_str_ = *yyvsp[-3].string;
1679 yyval.music->translator_id_str_ = *yyvsp[-1].string;
1680 delete yyvsp[-3].string;
1681 delete yyvsp[-1].string;
1685 #line 600 "parser.yy"
1686 { yyval.music = yyvsp[0].musiclist; ;
1689 #line 601 "parser.yy"
1690 { yyval.music = yyvsp[0].chord; ;
1693 #line 602 "parser.yy"
1694 { yyval.music = yyvsp[0].music; ;
1697 #line 603 "parser.yy"
1698 { yyval.music = yyvsp[0].id->music (); ;
1701 #line 604 "parser.yy"
1702 { yyval.music = yyvsp[-1].id->music (); ;
1705 #line 606 "parser.yy"
1706 { THIS->lexer_p_->push_note_state (); ;
1709 #line 608 "parser.yy"
1710 { yyval.music=yyvsp[0].music; THIS->lexer_p_->pop_state (); ;
1713 #line 611 "parser.yy"
1714 { THIS->lexer_p_->push_lyric_state (); ;
1717 #line 613 "parser.yy"
1718 { yyval.music = yyvsp[0].music; THIS->lexer_p_->pop_state (); ;
1721 #line 619 "parser.yy"
1723 Change_translator * t = new Change_translator;
1724 t-> change_to_type_str_ = *yyvsp[-2].string;
1725 t-> change_to_id_str_ = *yyvsp[0].string;
1728 yyval.music->set_spot (THIS->here_input ());
1729 delete yyvsp[-2].string;
1730 delete yyvsp[0].string;
1734 #line 632 "parser.yy"
1736 Translation_property *t = new Translation_property;
1737 t-> translator_type_str_ = *yyvsp[-4].string;
1738 t-> var_str_ = *yyvsp[-2].string;
1739 t-> value_ = *yyvsp[0].scalar;
1741 yyval.music->set_spot (THIS->here_input ());
1742 delete yyvsp[-4].string;
1743 delete yyvsp[-2].string;
1744 delete yyvsp[0].scalar;
1748 #line 646 "parser.yy"
1749 { yyval.scalar = new Scalar (*yyvsp[0].string); delete yyvsp[0].string; ;
1752 #line 647 "parser.yy"
1753 { yyval.scalar = new Scalar (yyvsp[0].i); ;
1756 #line 652 "parser.yy"
1757 { yyval.chord = yyvsp[-1].chord; ;
1760 #line 653 "parser.yy"
1762 yyval.chord = yyvsp[0].chord;
1763 yyval.chord->multi_level_i_=yyvsp[-1].i;
1767 #line 660 "parser.yy"
1769 yyval.chord = new Chord;
1770 yyval.chord-> multi_level_i_ = 1;
1771 yyval.chord->set_spot (THIS->here_input ());
1775 #line 665 "parser.yy"
1777 yyval.chord->add (yyvsp[0].music);
1781 #line 671 "parser.yy"
1783 yyval.music = yyvsp[0].music;
1784 yyval.music -> transpose (yyvsp[-1].melreq);
1786 delete yyvsp[-1].melreq;
1790 #line 684 "parser.yy"
1792 THIS->add_requests ((Chord*)yyvsp[-1].music);//ugh
1793 yyval.music = yyvsp[-1].music;
1797 #line 689 "parser.yy"
1798 { yyval.music = 0; ;
1801 #line 698 "parser.yy"
1803 yyval.music = new Request_chord;
1804 yyval.music-> set_spot (THIS->here_input ());
1805 yyvsp[0].request-> set_spot (THIS->here_input ());
1806 ((Chord*)yyval.music) ->add (yyvsp[0].request);//ugh
1811 #line 709 "parser.yy"
1812 { yyval.request = yyvsp[-1].request; ;
1815 #line 713 "parser.yy"
1817 yyval.request = new Barcheck_req;
1821 #line 716 "parser.yy"
1823 yyval.request = yyvsp[0].id->request ();
1827 #line 722 "parser.yy"
1829 yyval.request = new Bar_req (*yyvsp[0].string);
1830 delete yyvsp[0].string;
1834 #line 726 "parser.yy"
1836 Break_force_req * f = new Break_force_req;
1837 f-> set_spot (THIS->here_input ());
1842 #line 731 "parser.yy"
1844 Meter_change_req *m = new Meter_change_req;
1845 m->set (yyvsp[-2].i,yyvsp[0].i);
1850 #line 736 "parser.yy"
1852 Skip_req * skip_p = new Skip_req;
1853 skip_p->duration_.set_plet (yyvsp[0].moment->num (),
1854 yyvsp[0].moment->den ());
1856 delete yyvsp[0].moment;
1857 yyval.request = skip_p;
1861 #line 744 "parser.yy"
1863 yyval.request = yyvsp[0].tempo;
1867 #line 747 "parser.yy"
1869 yyval.request = new Cadenza_req (yyvsp[0].i);
1873 #line 750 "parser.yy"
1875 yyval.request = new Partial_measure_req (*yyvsp[0].moment);
1876 delete yyvsp[0].moment;
1880 #line 754 "parser.yy"
1882 yyval.request = new Clef_change_req (*yyvsp[0].string);
1883 delete yyvsp[0].string;
1887 #line 758 "parser.yy"
1889 Key_change_req *key_p= new Key_change_req;
1890 key_p->melodic_p_arr_ = *yyvsp[0].melreqvec;
1891 yyval.request = key_p;
1892 delete yyvsp[0].melreqvec;
1896 #line 764 "parser.yy"
1898 yyval.request = get_grouping_req (*yyvsp[0].intvec); delete yyvsp[0].intvec;
1902 #line 770 "parser.yy"
1904 /* something silly happened. Junk this stuff*/
1905 if (!THIS->post_reqs.empty ())
1907 warning ("Junking post-requests");
1908 THIS->post_reqs.clear ();
1913 #line 778 "parser.yy"
1915 yyvsp[0].request->set_spot (THIS->here_input ());
1916 THIS->post_reqs.push (yyvsp[0].request);
1920 #line 782 "parser.yy"
1922 Array<Request*>& r = *THIS->get_parens_request (yyvsp[0].i);
1923 for (int i = 0; i < r.size (); i++ )
1924 r[i]->set_spot (THIS->here_input ());
1925 THIS->post_reqs.concat (r);
1930 #line 797 "parser.yy"
1932 yyval.request = (Request*)yyvsp[0].id->request ();
1936 #line 800 "parser.yy"
1938 yyval.request = yyvsp[0].request;
1942 #line 803 "parser.yy"
1944 Abbreviation_req* a = new Abbreviation_req;
1945 a->type_i_ = yyvsp[0].i;
1950 #line 816 "parser.yy"
1952 yyval.melreq = yyvsp[0].melreq->clone ()->musical ()->melodic ();
1953 yyval.melreq->octave_i_ += THIS->default_octave_i_;
1957 #line 820 "parser.yy"
1959 yyval.melreq-> octave_i_ += yyvsp[0].i;
1963 #line 823 "parser.yy"
1965 yyval.melreq = yyvsp[0].melreq;
1966 yyvsp[0].melreq-> octave_i_ -= yyvsp[-1].i;
1970 #line 830 "parser.yy"
1972 yyval.notereq = new Note_req;
1973 * (Melodic_req *) yyval.notereq = *yyvsp[0].melreq;
1974 delete yyvsp[0].melreq;
1978 #line 835 "parser.yy"
1980 yyval.notereq->forceacc_b_ = ! yyval.notereq->forceacc_b_;
1984 #line 842 "parser.yy"
1986 yyval.melreq = new Melodic_req;
1987 yyval.melreq->octave_i_ = yyvsp[-3].i;
1988 yyval.melreq->notename_i_ = yyvsp[-2].i;
1989 yyval.melreq->accidental_i_ = yyvsp[-1].i;
1993 #line 851 "parser.yy"
1995 yyval.duration = new Duration;
1996 yyval.duration-> durlog_i_ = yyvsp[-2].i;
1997 yyval.duration-> dots_i_ = yyvsp[-1].i;
2001 #line 859 "parser.yy"
2003 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
2004 ad_p ->loudness_ = (Dynamic_req::Loudness)yyvsp[-1].i;
2005 yyval.request =ad_p;
2009 #line 864 "parser.yy"
2011 Span_dynamic_req * sp_p = new Span_dynamic_req;
2012 sp_p->spantype = yyvsp[-1].i;
2013 sp_p-> dynamic_dir_ = yyvsp[-2].i;
2014 yyval.request = sp_p;
2018 #line 873 "parser.yy"
2020 yyval.pair[0] = yyvsp[-2].i;
2021 yyval.pair[1] = yyvsp[0].i;
2025 #line 878 "parser.yy"
2027 int num = yyvsp[0].i >? 1;
2028 yyval.pair[0] = guess_plet_a[(num <? GUESS_PLET) - 1];
2029 yyval.pair[1] = num;
2033 #line 886 "parser.yy"
2036 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2037 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2038 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2039 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2043 #line 893 "parser.yy"
2046 THIS->plet_.type_i_ = 1;
2047 THIS->plet_.iso_i_ = 1;
2048 THIS->default_duration_.plet_.iso_i_ = 1;
2049 THIS->default_duration_.plet_.type_i_ = 1;
2053 #line 900 "parser.yy"
2056 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2057 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2058 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2059 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2063 #line 910 "parser.yy"
2069 #line 913 "parser.yy"
2075 #line 916 "parser.yy"
2081 #line 919 "parser.yy"
2087 #line 922 "parser.yy"
2093 #line 925 "parser.yy"
2098 #line 930 "parser.yy"
2101 if (!Duration::duration_type_b (yyvsp[0].i))
2102 THIS->parser_error ("1:Not a duration");
2103 else if (yyvsp[0].i < 8)
2104 THIS->parser_error ("Can't abbreviate");
2106 THIS->set_abbrev_beam (yyvsp[0].i);
2110 #line 942 "parser.yy"
2113 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2114 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2115 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2116 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2120 #line 949 "parser.yy"
2123 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2124 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2125 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2126 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2130 #line 959 "parser.yy"
2136 #line 962 "parser.yy"
2142 #line 965 "parser.yy"
2148 #line 968 "parser.yy"
2153 #line 970 "parser.yy"
2158 #line 977 "parser.yy"
2159 { yyval.script = yyvsp[-1].script; ;
2162 #line 981 "parser.yy"
2164 Script_def *s = new Script_def;
2165 s->set_from_input (*yyvsp[-5].string,yyvsp[-4].i, yyvsp[-3].i,yyvsp[-2].i,yyvsp[-1].i, yyvsp[0].i);
2167 delete yyvsp[-5].string;
2171 #line 990 "parser.yy"
2173 Musical_script_req *m = new Musical_script_req;
2175 m->scriptdef_p_ = yyvsp[0].script;
2176 m->set_spot (THIS->here_input ());
2178 m->dir_ = yyvsp[-1].i;
2182 #line 1001 "parser.yy"
2184 yyval.script = yyvsp[0].textdef;
2185 ((Text_def*) yyval.script)->align_i_ = CENTER; /* UGH */
2189 #line 1005 "parser.yy"
2191 yyval.script = yyvsp[0].script;
2192 yyval.script-> set_spot (THIS->here_input ());
2196 #line 1009 "parser.yy"
2198 yyval.script = yyvsp[0].textdef;
2199 ((Text_def*)yyval.script)->align_i_ = CENTER;
2203 #line 1016 "parser.yy"
2205 Text_def *t = new Text_def;
2207 t->text_str_ = *yyvsp[0].string;
2208 delete yyvsp[0].string;
2209 t->style_str_ = THIS->textstyle_str_;
2210 yyval.textdef->set_spot (THIS->here_input ());
2214 #line 1027 "parser.yy"
2216 Text_def* t = new Text_def;
2218 t->text_str_ = String (yyvsp[0].i);
2219 t->style_str_ = "finger";
2220 yyval.textdef->set_spot (THIS->here_input ());
2224 #line 1037 "parser.yy"
2225 { yyval.string = get_scriptdef ('^'); ;
2228 #line 1038 "parser.yy"
2229 { yyval.string = get_scriptdef ('+'); ;
2232 #line 1039 "parser.yy"
2233 { yyval.string = get_scriptdef ('-'); ;
2236 #line 1040 "parser.yy"
2237 { yyval.string = get_scriptdef ('|'); ;
2240 #line 1041 "parser.yy"
2241 { yyval.string = get_scriptdef ('o'); ;
2244 #line 1042 "parser.yy"
2245 { yyval.string = get_scriptdef ('>'); ;
2248 #line 1043 "parser.yy"
2250 yyval.string = get_scriptdef ('.');
2254 #line 1049 "parser.yy"
2255 { yyval.script = yyvsp[0].id->script (); ;
2258 #line 1050 "parser.yy"
2259 { yyval.script = yyvsp[0].script; ;
2262 #line 1051 "parser.yy"
2264 yyval.script = THIS->lexer_p_->lookup_identifier (*yyvsp[0].string)->script ();
2265 delete yyvsp[0].string;
2269 #line 1058 "parser.yy"
2273 #line 1059 "parser.yy"
2277 #line 1060 "parser.yy"
2281 #line 1064 "parser.yy"
2286 #line 1066 "parser.yy"
2288 Array<Request*>& r = *THIS->get_parens_request (yyvsp[0].i);
2289 for (int i = 0; i < r.size (); i++ )
2290 r[i]->set_spot (THIS->here_input ());
2291 THIS->pre_reqs.concat (r);
2296 #line 1076 "parser.yy"
2298 THIS->set_duration_mode (*yyvsp[0].string);
2299 delete yyvsp[0].string;
2303 #line 1080 "parser.yy"
2305 THIS->set_default_duration (yyvsp[0].duration);
2306 delete yyvsp[0].duration;
2310 #line 1084 "parser.yy"
2313 This is weird, but default_octave_i_
2314 is used in steno_note_req too
2316 c' -> default_octave_i_ == 1
2318 /* why can't we have \oct 0 iso \oct{c'}*/
2319 THIS->default_octave_i_ = 1; ;
2322 #line 1094 "parser.yy"
2324 THIS->default_octave_i_ = yyvsp[0].melreq->octave_i_;
2325 delete yyvsp[0].melreq;
2329 #line 1098 "parser.yy"
2331 THIS->textstyle_str_ = *yyvsp[0].string;
2332 delete yyvsp[0].string;
2336 #line 1105 "parser.yy"
2338 yyval.moment = new Moment (0,1);
2342 #line 1108 "parser.yy"
2344 *yyval.moment += yyvsp[0].duration->length ();
2348 #line 1114 "parser.yy"
2352 #line 1115 "parser.yy"
2356 #line 1119 "parser.yy"
2358 yyval.duration = new Duration (THIS->default_duration_);
2362 #line 1122 "parser.yy"
2364 yyval.duration = new Duration (THIS->default_duration_);
2365 yyval.duration->dots_i_ = yyvsp[0].i;
2369 #line 1126 "parser.yy"
2371 THIS->set_last_duration (yyvsp[0].duration);
2372 yyval.duration = yyvsp[0].duration;
2376 #line 1133 "parser.yy"
2378 yyval.duration = yyvsp[0].duration;
2382 #line 1139 "parser.yy"
2384 yyval.duration = new Duration;
2385 if (!Duration::duration_type_b (yyvsp[0].i))
2386 THIS->parser_error ("2:Not a duration");
2388 yyval.duration->durlog_i_ = Duration_convert::i2_type (yyvsp[0].i);
2389 yyval.duration->set_plet (THIS->default_duration_);
2394 #line 1148 "parser.yy"
2396 yyval.duration = yyvsp[0].id->duration ();
2400 #line 1151 "parser.yy"
2402 yyval.duration->dots_i_ ++;
2406 #line 1154 "parser.yy"
2408 yyval.duration->plet_.iso_i_ = yyvsp[0].i;
2412 #line 1157 "parser.yy"
2414 yyval.duration->plet_.type_i_ = yyvsp[0].i;
2418 #line 1164 "parser.yy"
2424 #line 1167 "parser.yy"
2426 if (!Duration::duration_type_b (yyvsp[0].i))
2427 THIS->parser_error ("3:Not a duration");
2428 else if (yyvsp[0].i < 8)
2429 THIS->parser_error ("Can't abbreviate");
2430 yyval.i = yyvsp[0].i;
2434 #line 1178 "parser.yy"
2436 if (!THIS->lexer_p_->note_state_b ())
2437 THIS->parser_error ("have to be in Note mode for notes");
2438 yyvsp[-1].notereq->set_duration (*yyvsp[0].duration);
2439 int durlog_i = yyvsp[0].duration->durlog_i_;
2440 yyval.music = THIS->get_note_element (yyvsp[-1].notereq, yyvsp[0].duration);
2444 #line 1185 "parser.yy"
2446 yyval.music = THIS->get_rest_element (*yyvsp[-1].string, yyvsp[0].duration);
2447 delete yyvsp[-1].string;
2451 #line 1192 "parser.yy"
2453 /* this sux! text-def should be feature of lyric-engraver. */
2454 if (!THIS->lexer_p_->lyric_state_b ())
2455 THIS->parser_error ("Have to be in Lyric mode for lyrics");
2456 yyval.music = THIS->get_word_element (yyvsp[-1].textdef, yyvsp[0].duration);
2461 #line 1203 "parser.yy"
2463 yyval.melreqvec = new Array<Melodic_req*>;
2467 #line 1206 "parser.yy"
2469 yyval.melreqvec->push (yyvsp[0].melreq->clone ()->musical ()->melodic ());
2473 #line 1212 "parser.yy"
2475 yyval.i = yyvsp[0].i;
2479 #line 1215 "parser.yy"
2481 yyval.i = yyvsp[0].i;
2485 #line 1220 "parser.yy"
2487 yyval.i = yyvsp[0].i;
2491 #line 1223 "parser.yy"
2493 yyval.i = -yyvsp[0].i;
2497 #line 1226 "parser.yy"
2499 int *i_p = yyvsp[0].id->intid ();
2505 #line 1234 "parser.yy"
2507 yyval.real = yyvsp[0].real;
2511 #line 1237 "parser.yy"
2513 Real *r_p = yyvsp[0].id->real ();
2519 #line 1247 "parser.yy"
2520 { yyval.real = yyvsp[-1].real*yyvsp[0].real; ;
2523 #line 1251 "parser.yy"
2524 { yyval.real = 1 CM; ;
2527 #line 1252 "parser.yy"
2528 { yyval.real = 1 INCH; ;
2531 #line 1253 "parser.yy"
2532 { yyval.real = 1 MM; ;
2535 #line 1254 "parser.yy"
2536 { yyval.real = 1 PT; ;
2539 #line 1261 "parser.yy"
2540 { yyval.lookup = yyvsp[-1].lookup; ;
2543 #line 1265 "parser.yy"
2545 yyval.lookup = new Lookup;
2549 #line 1268 "parser.yy"
2551 yyval.lookup = yyvsp[0].id->lookup ();
2555 #line 1271 "parser.yy"
2557 yyval.lookup->texsetting = *yyvsp[0].string;
2558 delete yyvsp[0].string;
2562 #line 1275 "parser.yy"
2564 yyval.lookup->add (*yyvsp[-2].string, yyvsp[0].symtable);
2565 delete yyvsp[-2].string;
2569 #line 1282 "parser.yy"
2570 { yyval.symtable = yyvsp[-1].symtable; ;
2573 #line 1286 "parser.yy"
2574 { yyval.symtable = new Symtable; ;
2577 #line 1287 "parser.yy"
2579 yyval.symtable->add (*yyvsp[-1].string, *yyvsp[0].symbol);
2580 delete yyvsp[-1].string;
2581 delete yyvsp[0].symbol;
2585 #line 1295 "parser.yy"
2587 yyval.symbol = new Atom (*yyvsp[-1].string, *yyvsp[0].box);
2588 delete yyvsp[-1].string;
2589 delete yyvsp[0].box;
2593 #line 1300 "parser.yy"
2595 Box b (Interval (0,0), Interval (0,0));
2596 yyval.symbol = new Atom (*yyvsp[0].string, b);
2597 delete yyvsp[0].string;
2601 #line 1308 "parser.yy"
2603 yyval.box = new Box (*yyvsp[-1].interval, *yyvsp[0].interval);
2604 delete yyvsp[-1].interval;
2605 delete yyvsp[0].interval;
2609 #line 1315 "parser.yy"
2611 yyval.interval = new Interval (yyvsp[-1].real, yyvsp[0].real);
2615 /* the action file gets copied in in place of this dollarsign */
2616 #line 498 "/usr/lib/bison.simple"
2627 short *ssp1 = yyss - 1;
2628 fprintf (stderr, "state stack now");
2629 while (ssp1 != yyssp)
2630 fprintf (stderr, " %d", *++ssp1);
2631 fprintf (stderr, "\n");
2641 yylsp->first_line = yylloc.first_line;
2642 yylsp->first_column = yylloc.first_column;
2643 yylsp->last_line = (yylsp-1)->last_line;
2644 yylsp->last_column = (yylsp-1)->last_column;
2649 yylsp->last_line = (yylsp+yylen-1)->last_line;
2650 yylsp->last_column = (yylsp+yylen-1)->last_column;
2654 /* Now "shift" the result of the reduction.
2655 Determine what state that goes to,
2656 based on the state we popped back to
2657 and the rule number reduced by. */
2661 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2662 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2663 yystate = yytable[yystate];
2665 yystate = yydefgoto[yyn - YYNTBASE];
2669 yyerrlab: /* here on detecting error */
2672 /* If not already recovering from an error, report this error. */
2676 #ifdef YYERROR_VERBOSE
2677 yyn = yypact[yystate];
2679 if (yyn > YYFLAG && yyn < YYLAST)
2686 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
2687 for (x = (yyn < 0 ? -yyn : 0);
2688 x < (sizeof(yytname) / sizeof(char *)); x++)
2689 if (yycheck[x + yyn] == x)
2690 size += strlen(yytname[x]) + 15, count++;
2691 msg = (char *) malloc(size + 15);
2694 strcpy(msg, "parse error");
2699 for (x = (yyn < 0 ? -yyn : 0);
2700 x < (sizeof(yytname) / sizeof(char *)); x++)
2701 if (yycheck[x + yyn] == x)
2703 strcat(msg, count == 0 ? ", expecting `" : " or `");
2704 strcat(msg, yytname[x]);
2713 yyerror ("parse error; also virtual memory exceeded");
2716 #endif /* YYERROR_VERBOSE */
2717 yyerror("parse error");
2721 yyerrlab1: /* here on error raised explicitly by an action */
2723 if (yyerrstatus == 3)
2725 /* if just tried and failed to reuse lookahead token after an error, discard it. */
2727 /* return failure if at end of input */
2728 if (yychar == YYEOF)
2733 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2739 /* Else will try to reuse lookahead token
2740 after shifting the error token. */
2742 yyerrstatus = 3; /* Each real token shifted decrements this */
2746 yyerrdefault: /* current state does not do anything special for the error token. */
2749 /* This is wrong; only states that explicitly want error tokens
2750 should shift them. */
2751 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2752 if (yyn) goto yydefault;
2755 yyerrpop: /* pop the current state because it cannot handle the error token */
2757 if (yyssp == yyss) YYABORT;
2767 short *ssp1 = yyss - 1;
2768 fprintf (stderr, "Error: state stack now");
2769 while (ssp1 != yyssp)
2770 fprintf (stderr, " %d", *++ssp1);
2771 fprintf (stderr, "\n");
2777 yyn = yypact[yystate];
2782 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2801 fprintf(stderr, "Shifting error token, ");
2812 #line 1320 "parser.yy"
2816 My_lily_parser::set_yydebug (bool b)
2823 My_lily_parser::do_yyparse ()
2825 yyparse ((void*)this);
2829 My_lily_parser::default_paper ()
2831 Identifier *id = lexer_p_->lookup_identifier ("default_paper");
2832 return id ? id->paperdef () : new Paper_def ;
2836 My_lily_parser::default_midi ()
2838 Identifier *id = lexer_p_->lookup_identifier ("default_midi");
2839 return id ? id->mididef () : new Midi_def ;