]> git.donarmstrong.com Git - lilypond.git/blob - lily/parser.cc
584b05711b18cc5e5c27c9e8fffe5bc3f0c4c9fd
[lilypond.git] / lily / parser.cc
1
2 /*  A Bison parser, made from parser.yy
3  by  GNU Bison version 1.25
4   */
5
6 #define YYBISON 1  /* Identify Bison output.  */
7
8 #define ALIAS   258
9 #define BAR     259
10 #define BEAMPLET        260
11 #define MAEBTELP        261
12 #define BREAK   262
13 #define CADENZA 263
14 #define CLEAR   264
15 #define CLEF    265
16 #define CONTAINS        266
17 #define CONSISTS        267
18 #define ACCEPTS 268
19 #define CM_T    269
20 #define DURATION        270
21 #define ABSDYNAMIC      271
22 #define END     272
23 #define GROUPING        273
24 #define TRANSLATOR      274
25 #define HEADER  275
26 #define IN_T    276
27 #define LYRIC   277
28 #define KEY     278
29 #define MELODIC 279
30 #define MIDI    280
31 #define MELODIC_REQUEST 281
32 #define METER   282
33 #define MM_T    283
34 #define MULTI   284
35 #define NOTENAMES       285
36 #define OCTAVE  286
37 #define OUTPUT  287
38 #define PAPER   288
39 #define PARTIAL 289
40 #define PLET    290
41 #define TELP    291
42 #define PT_T    292
43 #define SCORE   293
44 #define SCRIPT  294
45 #define SHAPE   295
46 #define SKIP    296
47 #define SPANDYNAMIC     297
48 #define STAFF   298
49 #define START_T 299
50 #define SYMBOLTABLES    300
51 #define TABLE   301
52 #define TRANSPOSE       302
53 #define TEMPO   303
54 #define TYPE    304
55 #define TEXID   305
56 #define TEXTSTYLE       306
57 #define TITLE   307
58 #define PROPERTY        308
59 #define VERSION 309
60 #define E_EXCLAMATION   310
61 #define E_SMALLER       311
62 #define E_BIGGER        312
63 #define E_CHAR  313
64 #define DIGIT   314
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
81 #define REAL    331
82 #define RESTNAME        332
83 #define STRING  333
84 #define UNSIGNED        334
85 #define POST_QUOTES     335
86 #define PRE_QUOTES      336
87
88 #line 1 "parser.yy"
89  // -*-Fundamental-*-
90
91 /*
92   parser.yy -- YACC -> C++ parser for mudela
93
94   source file of the GNU LilyPond music typesetter
95
96   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
97            Jan Nieuwenhuizen <jan@digicash.com>
98 */
99
100 #include <iostream.h>
101
102 // mmm
103 #define MUDELA_VERSION "0.1.9"
104
105 #include "scalar.hh"
106 #include "translation-property.hh"
107 #include "script-def.hh"
108 #include "symtable.hh"
109 #include "lookup.hh"
110 #include "misc.hh"
111 #include "my-lily-lexer.hh"
112 #include "paper-def.hh"
113 #include "midi-def.hh"
114 #include "main.hh"
115 #include "keyword.hh"
116 #include "debug.hh"
117 #include "parseconstruct.hh"
118 #include "dimen.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"
125 #include "score.hh"
126 #include "music-list.hh"
127 #include "header.hh"
128 #include "duration-convert.hh"
129 #include "change-translator.hh"
130
131 // needed for bison.simple's malloc() and free()
132 #include <malloc.h>
133
134 int const GUESS_PLET = 5;
135 int guess_plet_a[GUESS_PLET] =
136
137   1,
138   3,
139   2,
140   3,
141   4
142 };
143
144 #ifndef NDEBUG
145 #define YYDEBUG 1
146 #endif
147
148 #define YYERROR_VERBOSE 1
149
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)
153
154 #define yyerror THIS->parser_error
155
156
157 #line 71 "parser.yy"
158 typedef union {
159     Array<Interval>* intarr;
160     Array<Melodic_req*> *melreqvec;/* should clean up naming */
161     Array<String> * strvec;
162     Array<int> *intvec;
163     Box *box;
164     Chord * chord;
165     Duration *duration;
166     Identifier *id;
167     Translator* trans;
168     Music *music;
169     Music_list *musiclist;
170     Score *score;
171     Header *header;
172     Interval *interval;
173     Lookup*lookup;
174     Melodic_req * melreq;
175     Musical_req* musreq;
176     Music_output_def * outputdef;
177     Midi_def* midi;
178     Moment *moment;
179     Note_req *notereq;
180     Paper_def *paper;
181     Real real;
182     Request * request;
183     General_script_def * script;
184     Scalar *scalar;
185     String *string;
186     Atom * symbol;
187     Symtable * symtable;
188     Symtables * symtables;
189     Text_def * textdef;
190     Tempo_req *tempo;
191     char c;
192     const char *consstr;
193     int i;
194     int pair[2];
195     int ii[10];
196 } YYSTYPE;
197 #line 110 "parser.yy"
198
199
200 int
201 yylex (YYSTYPE *s,  void * v_l)
202 {
203         My_lily_parser   *pars_l = (My_lily_parser*) v_l;
204         My_lily_lexer * lex_l = pars_l->lexer_p_;
205
206         lex_l->lexval_l = (void*) s;
207         return lex_l->yylex ();
208 }
209
210
211 #include <stdio.h>
212
213 #ifndef __cplusplus
214 #ifndef __STDC__
215 #define const
216 #endif
217 #endif
218
219
220
221 #define YYFINAL         353
222 #define YYFLAG          -32768
223 #define YYNTBASE        104
224
225 #define YYTRANSLATE(x) ((unsigned)(x) <= 336 ? yytranslate[x] : 191)
226
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
262 };
263
264 #if YYDEBUG != 0
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,
288    625,   628
289 };
290
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
355 };
356
357 #endif
358
359 #if YYDEBUG != 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,
383   1310,  1318
384 };
385 #endif
386
387
388 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
389
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
419 };
420 #endif
421
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,
445    189,   190
446 };
447
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,
471      2,     2
472 };
473
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,
510    221,     0,     0
511 };
512
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
523 };
524
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,
561 -32768,   303,-32768
562 };
563
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
574 };
575
576
577 #define YYLAST          698
578
579
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
651 };
652
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
724 };
725 #define YYPURE 1
726
727 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
728 #line 3 "/usr/lib/bison.simple"
729
730 /* Skeleton output parser for bison,
731    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
732
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)
736    any later version.
737
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.
742
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.  */
746
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.  */
751
752 #ifndef alloca
753 #ifdef __GNUC__
754 #define alloca __builtin_alloca
755 #else /* not GNU C.  */
756 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
757 #include <alloca.h>
758 #else /* not sparc */
759 #if defined (MSDOS) && !defined (__TURBOC__)
760 #include <malloc.h>
761 #else /* not MSDOS, or __TURBOC__ */
762 #if defined(_AIX)
763 #include <malloc.h>
764  #pragma alloca
765 #else /* not MSDOS, __TURBOC__, or _AIX */
766 #ifdef __hpux
767 #ifdef __cplusplus
768 extern "C" {
769 void *alloca (unsigned int);
770 };
771 #else /* not __cplusplus */
772 void *alloca ();
773 #endif /* not __cplusplus */
774 #endif /* __hpux */
775 #endif /* not _AIX */
776 #endif /* not MSDOS, or __TURBOC__ */
777 #endif /* not sparc.  */
778 #endif /* not GNU C.  */
779 #endif /* alloca not defined.  */
780
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.  */
785
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.  */
789
790 #define yyerrok         (yyerrstatus = 0)
791 #define yyclearin       (yychar = YYEMPTY)
792 #define YYEMPTY         -2
793 #define YYEOF           0
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) \
804 do                                                              \
805   if (yychar == YYEMPTY && yylen == 1)                          \
806     { yychar = (token), yylval = (value);                       \
807       yychar1 = YYTRANSLATE (yychar);                           \
808       YYPOPSTACK;                                               \
809       goto yybackup;                                            \
810     }                                                           \
811   else                                                          \
812     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
813 while (0)
814
815 #define YYTERROR        1
816 #define YYERRCODE       256
817
818 #ifndef YYPURE
819 #define YYLEX           yylex()
820 #endif
821
822 #ifdef YYPURE
823 #ifdef YYLSP_NEEDED
824 #ifdef YYLEX_PARAM
825 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
826 #else
827 #define YYLEX           yylex(&yylval, &yylloc)
828 #endif
829 #else /* not YYLSP_NEEDED */
830 #ifdef YYLEX_PARAM
831 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
832 #else
833 #define YYLEX           yylex(&yylval)
834 #endif
835 #endif /* not YYLSP_NEEDED */
836 #endif
837
838 /* If nonreentrant, generate the variables here */
839
840 #ifndef YYPURE
841
842 int     yychar;                 /*  the lookahead symbol                */
843 YYSTYPE yylval;                 /*  the semantic value of the           */
844                                 /*  lookahead symbol                    */
845
846 #ifdef YYLSP_NEEDED
847 YYLTYPE yylloc;                 /*  location data for the lookahead     */
848                                 /*  symbol                              */
849 #endif
850
851 int yynerrs;                    /*  number of parse errors so far       */
852 #endif  /* not YYPURE */
853
854 #if YYDEBUG != 0
855 int yydebug;                    /*  nonzero means print parse trace     */
856 /* Since this is uninitialized, it does not stop multiple parsers
857    from coexisting.  */
858 #endif
859
860 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
861
862 #ifndef YYINITDEPTH
863 #define YYINITDEPTH 200
864 #endif
865
866 /*  YYMAXDEPTH is the maximum size the stacks can grow to
867     (effective only if the built-in stack extension method is used).  */
868
869 #if YYMAXDEPTH == 0
870 #undef YYMAXDEPTH
871 #endif
872
873 #ifndef YYMAXDEPTH
874 #define YYMAXDEPTH 10000
875 #endif
876
877 /* Prevent warning if -Wstrict-prototypes.  */
878 #ifdef __GNUC__
879 int yyparse (void);
880 #endif
881 \f
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++ */
885 #ifndef __cplusplus
886
887 /* This is the most reliable way to avoid incompatibilities
888    in available built-in functions on various systems.  */
889 static void
890 __yy_memcpy (to, from, count)
891      char *to;
892      char *from;
893      int count;
894 {
895   register char *f = from;
896   register char *t = to;
897   register int i = count;
898
899   while (i-- > 0)
900     *t++ = *f++;
901 }
902
903 #else /* __cplusplus */
904
905 /* This is the most reliable way to avoid incompatibilities
906    in available built-in functions on various systems.  */
907 static void
908 __yy_memcpy (char *to, char *from, int count)
909 {
910   register char *f = from;
911   register char *t = to;
912   register int i = count;
913
914   while (i-- > 0)
915     *t++ = *f++;
916 }
917
918 #endif
919 #endif
920 \f
921 #line 196 "/usr/lib/bison.simple"
922
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.  */
928
929 #ifdef YYPARSE_PARAM
930 #ifdef __cplusplus
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 */
941
942 int
943 yyparse(YYPARSE_PARAM_ARG)
944      YYPARSE_PARAM_DECL
945 {
946   register int yystate;
947   register int yyn;
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 */
952
953   short yyssa[YYINITDEPTH];     /*  the state stack                     */
954   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
955
956   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
957   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
958
959 #ifdef YYLSP_NEEDED
960   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
961   YYLTYPE *yyls = yylsa;
962   YYLTYPE *yylsp;
963
964 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
965 #else
966 #define YYPOPSTACK   (yyvsp--, yyssp--)
967 #endif
968
969   int yystacksize = YYINITDEPTH;
970
971 #ifdef YYPURE
972   int yychar;
973   YYSTYPE yylval;
974   int yynerrs;
975 #ifdef YYLSP_NEEDED
976   YYLTYPE yylloc;
977 #endif
978 #endif
979
980   YYSTYPE yyval;                /*  the variable used to return         */
981                                 /*  semantic values from the action     */
982                                 /*  routines                            */
983
984   int yylen;
985
986 #if YYDEBUG != 0
987   if (yydebug)
988     fprintf(stderr, "Starting parse\n");
989 #endif
990
991   yystate = 0;
992   yyerrstatus = 0;
993   yynerrs = 0;
994   yychar = YYEMPTY;             /* Cause a token to be read.  */
995
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.  */
1000
1001   yyssp = yyss - 1;
1002   yyvsp = yyvs;
1003 #ifdef YYLSP_NEEDED
1004   yylsp = yyls;
1005 #endif
1006
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.  */
1010 yynewstate:
1011
1012   *++yyssp = yystate;
1013
1014   if (yyssp >= yyss + yystacksize - 1)
1015     {
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;
1020 #ifdef YYLSP_NEEDED
1021       YYLTYPE *yyls1 = yyls;
1022 #endif
1023
1024       /* Get the current used size of the three stacks, in elements.  */
1025       int size = yyssp - yyss + 1;
1026
1027 #ifdef yyoverflow
1028       /* Each stack pointer address is followed by the size of
1029          the data in use in that stack, in bytes.  */
1030 #ifdef YYLSP_NEEDED
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),
1037                  &yystacksize);
1038 #else
1039       yyoverflow("parser stack overflow",
1040                  &yyss1, size * sizeof (*yyssp),
1041                  &yyvs1, size * sizeof (*yyvsp),
1042                  &yystacksize);
1043 #endif
1044
1045       yyss = yyss1; yyvs = yyvs1;
1046 #ifdef YYLSP_NEEDED
1047       yyls = yyls1;
1048 #endif
1049 #else /* no yyoverflow */
1050       /* Extend the stack our own way.  */
1051       if (yystacksize >= YYMAXDEPTH)
1052         {
1053           yyerror("parser stack overflow");
1054           return 2;
1055         }
1056       yystacksize *= 2;
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));
1063 #ifdef YYLSP_NEEDED
1064       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
1065       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
1066 #endif
1067 #endif /* no yyoverflow */
1068
1069       yyssp = yyss + size - 1;
1070       yyvsp = yyvs + size - 1;
1071 #ifdef YYLSP_NEEDED
1072       yylsp = yyls + size - 1;
1073 #endif
1074
1075 #if YYDEBUG != 0
1076       if (yydebug)
1077         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1078 #endif
1079
1080       if (yyssp >= yyss + yystacksize - 1)
1081         YYABORT;
1082     }
1083
1084 #if YYDEBUG != 0
1085   if (yydebug)
1086     fprintf(stderr, "Entering state %d\n", yystate);
1087 #endif
1088
1089   goto yybackup;
1090  yybackup:
1091
1092 /* Do appropriate processing given the current state.  */
1093 /* Read a lookahead token if we need one and don't already have one.  */
1094 /* yyresume: */
1095
1096   /* First try to decide what to do without reference to lookahead token.  */
1097
1098   yyn = yypact[yystate];
1099   if (yyn == YYFLAG)
1100     goto yydefault;
1101
1102   /* Not known => get a lookahead token if don't already have one.  */
1103
1104   /* yychar is either YYEMPTY or YYEOF
1105      or a valid token in external form.  */
1106
1107   if (yychar == YYEMPTY)
1108     {
1109 #if YYDEBUG != 0
1110       if (yydebug)
1111         fprintf(stderr, "Reading a token: ");
1112 #endif
1113       yychar = YYLEX;
1114     }
1115
1116   /* Convert token to internal form (in yychar1) for indexing tables with */
1117
1118   if (yychar <= 0)              /* This means end of input. */
1119     {
1120       yychar1 = 0;
1121       yychar = YYEOF;           /* Don't call YYLEX any more */
1122
1123 #if YYDEBUG != 0
1124       if (yydebug)
1125         fprintf(stderr, "Now at end of input.\n");
1126 #endif
1127     }
1128   else
1129     {
1130       yychar1 = YYTRANSLATE(yychar);
1131
1132 #if YYDEBUG != 0
1133       if (yydebug)
1134         {
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.  */
1138 #ifdef YYPRINT
1139           YYPRINT (stderr, yychar, yylval);
1140 #endif
1141           fprintf (stderr, ")\n");
1142         }
1143 #endif
1144     }
1145
1146   yyn += yychar1;
1147   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1148     goto yydefault;
1149
1150   yyn = yytable[yyn];
1151
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.  */
1158
1159   if (yyn < 0)
1160     {
1161       if (yyn == YYFLAG)
1162         goto yyerrlab;
1163       yyn = -yyn;
1164       goto yyreduce;
1165     }
1166   else if (yyn == 0)
1167     goto yyerrlab;
1168
1169   if (yyn == YYFINAL)
1170     YYACCEPT;
1171
1172   /* Shift the lookahead token.  */
1173
1174 #if YYDEBUG != 0
1175   if (yydebug)
1176     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1177 #endif
1178
1179   /* Discard the token being shifted unless it is eof.  */
1180   if (yychar != YYEOF)
1181     yychar = YYEMPTY;
1182
1183   *++yyvsp = yylval;
1184 #ifdef YYLSP_NEEDED
1185   *++yylsp = yylloc;
1186 #endif
1187
1188   /* count tokens shifted since error; after three, turn off error status.  */
1189   if (yyerrstatus) yyerrstatus--;
1190
1191   yystate = yyn;
1192   goto yynewstate;
1193
1194 /* Do the default action for the current state.  */
1195 yydefault:
1196
1197   yyn = yydefact[yystate];
1198   if (yyn == 0)
1199     goto yyerrlab;
1200
1201 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
1202 yyreduce:
1203   yylen = yyr2[yyn];
1204   if (yylen > 0)
1205     yyval = yyvsp[1-yylen]; /* implement default value of the action */
1206
1207 #if YYDEBUG != 0
1208   if (yydebug)
1209     {
1210       int i;
1211
1212       fprintf (stderr, "Reducing via rule %d (line %d), ",
1213                yyn, yyrline[yyn]);
1214
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]]);
1219     }
1220 #endif
1221
1222
1223   switch (yyn) {
1224
1225 case 2:
1226 #line 262 "parser.yy"
1227 {
1228                 delete THIS->default_header_p_ ;
1229                 THIS->default_header_p_ = yyvsp[0].header;
1230         ;
1231     break;}
1232 case 3:
1233 #line 266 "parser.yy"
1234 {
1235                 add_score (yyvsp[0].score);
1236         ;
1237     break;}
1238 case 4:
1239 #line 269 "parser.yy"
1240 { ;
1241     break;}
1242 case 6:
1243 #line 271 "parser.yy"
1244 { ;
1245     break;}
1246 case 7:
1247 #line 272 "parser.yy"
1248 { ;
1249     break;}
1250 case 8:
1251 #line 276 "parser.yy"
1252 {
1253                 if (String (*yyvsp[-1].string) != MUDELA_VERSION) {
1254                         if (THIS->ignore_version_b_) {
1255                                 THIS->here_input ().error ("Incorrect mudela version");
1256                         } else {
1257                                 THIS->fatal_error_i_ = 1;
1258                                 THIS->parser_error ("Incorrect mudela version");
1259                         }
1260                 }
1261         ;
1262     break;}
1263 case 10:
1264 #line 292 "parser.yy"
1265 {
1266         ;
1267     break;}
1268 case 11:
1269 #line 294 "parser.yy"
1270 {
1271                 THIS->clear_notenames ();
1272         ;
1273     break;}
1274 case 12:
1275 #line 297 "parser.yy"
1276 {
1277                 THIS->add_notename (*yyvsp[-2].string, yyvsp[0].melreq);
1278                 delete yyvsp[-2].string;
1279         ;
1280     break;}
1281 case 13:
1282 #line 304 "parser.yy"
1283 {
1284                 yyval.header = new Header;
1285         ;
1286     break;}
1287 case 14:
1288 #line 307 "parser.yy"
1289 {
1290                 (*yyval.header)[*yyvsp[-3].string] = *yyvsp[-1].string;
1291                 delete yyvsp[-3].string;
1292                 delete yyvsp[-1].string;
1293         ;
1294     break;}
1295 case 15:
1296 #line 315 "parser.yy"
1297 {
1298                 yyval.header = yyvsp[-1].header;
1299         ;
1300     break;}
1301 case 16:
1302 #line 322 "parser.yy"
1303 {
1304                 yyval.string = new String;
1305         ;
1306     break;}
1307 case 17:
1308 #line 325 "parser.yy"
1309 {
1310                 *yyval.string += *yyvsp[0].string;
1311         ;
1312     break;}
1313 case 18:
1314 #line 335 "parser.yy"
1315 {
1316                 THIS->remember_spot ();
1317         ;
1318     break;}
1319 case 19:
1320 #line 338 "parser.yy"
1321 {
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 ());
1325         ;
1326     break;}
1327 case 20:
1328 #line 346 "parser.yy"
1329 {
1330                 yyval.id = new Score_id (yyvsp[0].score, SCORE_IDENTIFIER);
1331
1332         ;
1333     break;}
1334 case 21:
1335 #line 350 "parser.yy"
1336 {
1337                 yyval.id = new Paper_def_id (yyvsp[0].paper, PAPER_IDENTIFIER);
1338
1339         ;
1340     break;}
1341 case 22:
1342 #line 354 "parser.yy"
1343 {
1344                 yyval.id = new Midi_def_id (yyvsp[0].midi, MIDI_IDENTIFIER);
1345
1346         ;
1347     break;}
1348 case 23:
1349 #line 358 "parser.yy"
1350 {
1351                 yyval.id = new Script_id (yyvsp[0].script, SCRIPT_IDENTIFIER);
1352
1353         ;
1354     break;}
1355 case 24:
1356 #line 362 "parser.yy"
1357 {
1358                 yyval.id = new Music_id (yyvsp[0].music, MUSIC_IDENTIFIER);
1359
1360         ;
1361     break;}
1362 case 25:
1363 #line 366 "parser.yy"
1364 {
1365                 yyval.id = new Lookup_id (yyvsp[0].lookup, IDENTIFIER);
1366
1367         ;
1368     break;}
1369 case 26:
1370 #line 370 "parser.yy"
1371 {
1372                 yyval.id = new Real_id (new Real (yyvsp[0].real), REAL_IDENTIFIER);
1373
1374         ;
1375     break;}
1376 case 27:
1377 #line 374 "parser.yy"
1378 {
1379                 yyval.id = new Int_id (new int (yyvsp[0].i), INT_IDENTIFIER);
1380         ;
1381     break;}
1382 case 28:
1383 #line 377 "parser.yy"
1384 {
1385                 yyval.id = new Request_id (yyvsp[0].request, POST_REQUEST_IDENTIFIER);
1386         ;
1387     break;}
1388 case 29:
1389 #line 380 "parser.yy"
1390 {
1391                 yyval.id = new Request_id (yyvsp[0].melreq, MELODIC_REQUEST_IDENTIFIER);
1392
1393         ;
1394     break;}
1395 case 30:
1396 #line 384 "parser.yy"
1397 {
1398                 yyval.id = new Translator_id (yyvsp[0].trans, TRANS_IDENTIFIER);
1399         ;
1400     break;}
1401 case 31:
1402 #line 387 "parser.yy"
1403 {
1404                 yyval.id = new Duration_id (yyvsp[0].duration, DURATION_IDENTIFIER);
1405         ;
1406     break;}
1407 case 32:
1408 #line 396 "parser.yy"
1409 { yyval.trans = yyvsp[-1].trans; ;
1410     break;}
1411 case 33:
1412 #line 400 "parser.yy"
1413 {
1414                 yyval.trans = yyvsp[0].id->translator ();
1415                 yyval.trans-> set_spot (THIS->here_input ());
1416         ;
1417     break;}
1418 case 34:
1419 #line 404 "parser.yy"
1420 {
1421                 yyval.trans = get_translator_l (*yyvsp[-1].string)->clone ();
1422                 yyval.trans->set_spot (THIS->here_input ());
1423                 delete yyvsp[-1].string;
1424         ;
1425     break;}
1426 case 35:
1427 #line 409 "parser.yy"
1428 {
1429                 yyval.trans-> set_property (*yyvsp[-3].string, *yyvsp[-1].scalar);
1430                 delete yyvsp[-3].string;
1431                 delete yyvsp[-1].scalar;
1432         ;
1433     break;}
1434 case 36:
1435 #line 414 "parser.yy"
1436 {
1437                 yyval.trans->group_l ()->consists_str_arr_.push (*yyvsp[-1].string);
1438                 delete yyvsp[-1].string;
1439         ;
1440     break;}
1441 case 37:
1442 #line 418 "parser.yy"
1443 {
1444                 yyval.trans->group_l ()->accepts_str_arr_.push (*yyvsp[-1].string);
1445                 delete yyvsp[-1].string;
1446         ;
1447     break;}
1448 case 38:
1449 #line 428 "parser.yy"
1450 { THIS->remember_spot ();
1451                 THIS->error_level_i_ =0;
1452         ;
1453     break;}
1454 case 39:
1455 #line 431 "parser.yy"
1456 {
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 ());
1461
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_);
1467         ;
1468     break;}
1469 case 40:
1470 #line 445 "parser.yy"
1471 {
1472                 yyval.score = new Score;
1473         ;
1474     break;}
1475 case 41:
1476 #line 448 "parser.yy"
1477 {
1478                 yyval.score = yyvsp[0].id->score ();
1479         ;
1480     break;}
1481 case 42:
1482 #line 451 "parser.yy"
1483 {
1484                 yyval.score->header_p_ = yyvsp[0].header;
1485         ;
1486     break;}
1487 case 43:
1488 #line 454 "parser.yy"
1489 {
1490                 if (yyval.score->music_p_)
1491                         yyvsp[0].music->warning ("More than one music block");  
1492                 yyval.score->music_p_ = yyvsp[0].music;
1493         ;
1494     break;}
1495 case 44:
1496 #line 459 "parser.yy"
1497 {
1498                 yyval.score->add (yyvsp[0].outputdef);
1499         ;
1500     break;}
1501 case 45:
1502 #line 462 "parser.yy"
1503 {
1504
1505         ;
1506     break;}
1507 case 46:
1508 #line 468 "parser.yy"
1509 {
1510                 yyval.outputdef = yyvsp[0].paper;
1511         ;
1512     break;}
1513 case 47:
1514 #line 471 "parser.yy"
1515 {
1516                 yyval.outputdef= yyvsp[0].midi;
1517         ;
1518     break;}
1519 case 48:
1520 #line 477 "parser.yy"
1521 { yyval.intvec =new Array<int>; ;
1522     break;}
1523 case 49:
1524 #line 478 "parser.yy"
1525 {
1526                 yyval.intvec->push (yyvsp[-2].i); yyval.intvec->push (yyvsp[0].i);
1527         ;
1528     break;}
1529 case 50:
1530 #line 489 "parser.yy"
1531 { yyval.paper = yyvsp[-1].paper; ;
1532     break;}
1533 case 51:
1534 #line 493 "parser.yy"
1535 {
1536                 yyval.paper = THIS->default_paper ();
1537         ;
1538     break;}
1539 case 52:
1540 #line 496 "parser.yy"
1541 {
1542                 yyval.paper = yyvsp[0].id->paperdef ();
1543         ;
1544     break;}
1545 case 53:
1546 #line 499 "parser.yy"
1547
1548                 yyval.paper->outfile_str_ = *yyvsp[-1].string;
1549                 delete yyvsp[-1].string;
1550         ;
1551     break;}
1552 case 54:
1553 #line 503 "parser.yy"
1554 { yyval.paper->set (yyvsp[0].lookup); ;
1555     break;}
1556 case 55:
1557 #line 504 "parser.yy"
1558 {
1559                 yyval.paper->set_var (*yyvsp[-3].string, yyvsp[-1].real);
1560         ;
1561     break;}
1562 case 56:
1563 #line 507 "parser.yy"
1564 {
1565                 yyval.paper->set_var (*yyvsp[-3].string, yyvsp[-1].real);
1566         ;
1567     break;}
1568 case 57:
1569 #line 510 "parser.yy"
1570 {
1571                 yyval.paper-> assign_translator (*yyvsp[-2].string, yyvsp[0].trans);
1572                 delete yyvsp[-2].string;
1573         ;
1574     break;}
1575 case 58:
1576 #line 514 "parser.yy"
1577 {
1578                 yyval.paper->shape_int_a_ = *yyvsp[-1].intarr;
1579                 delete yyvsp[-1].intarr;
1580         ;
1581     break;}
1582 case 59:
1583 #line 518 "parser.yy"
1584 {
1585
1586         ;
1587     break;}
1588 case 60:
1589 #line 524 "parser.yy"
1590 {
1591                 yyval.intarr = new Array<Interval>;
1592         ;
1593     break;}
1594 case 61:
1595 #line 527 "parser.yy"
1596 {
1597                 yyval.intarr->push(Interval(yyvsp[-1].real, yyvsp[-1].real + yyvsp[0].real));
1598         ;
1599     break;}
1600 case 62:
1601 #line 537 "parser.yy"
1602 { yyval.midi = yyvsp[-1].midi; ;
1603     break;}
1604 case 63:
1605 #line 540 "parser.yy"
1606 {
1607                 yyval.midi = THIS->default_midi ();
1608         ;
1609     break;}
1610 case 64:
1611 #line 543 "parser.yy"
1612 {
1613                 yyval.midi-> assign_translator (*yyvsp[-2].string, yyvsp[0].trans);
1614                 delete yyvsp[-2].string;
1615         ;
1616     break;}
1617 case 65:
1618 #line 547 "parser.yy"
1619 {
1620                 yyval.midi->outfile_str_ = *yyvsp[-1].string;
1621                 delete yyvsp[-1].string;
1622         ;
1623     break;}
1624 case 66:
1625 #line 551 "parser.yy"
1626 {
1627                 yyval.midi->set_tempo (yyvsp[-1].tempo->dur_.length (), yyvsp[-1].tempo->metronome_i_);
1628                 delete yyvsp[-1].tempo;
1629         ;
1630     break;}
1631 case 67:
1632 #line 555 "parser.yy"
1633 {
1634
1635         ;
1636     break;}
1637 case 68:
1638 #line 561 "parser.yy"
1639 {
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;
1644         ;
1645     break;}
1646 case 69:
1647 #line 574 "parser.yy"
1648 {
1649                 yyval.musiclist = yyvsp[-1].musiclist;
1650         ;
1651     break;}
1652 case 70:
1653 #line 580 "parser.yy"
1654 {
1655                 yyval.musiclist = new Voice;
1656                 yyval.musiclist->set_spot (THIS->here_input ());
1657         ;
1658     break;}
1659 case 71:
1660 #line 584 "parser.yy"
1661 {
1662                 yyval.musiclist->add (yyvsp[0].music);
1663         ;
1664     break;}
1665 case 72:
1666 #line 590 "parser.yy"
1667 { yyval.music = yyvsp[0].music; ;
1668     break;}
1669 case 73:
1670 #line 591 "parser.yy"
1671 {
1672                 yyval.music = yyvsp[0].music;
1673                 yyval.music->translator_type_str_ = *yyvsp[-1].string;
1674                 delete yyvsp[-1].string;
1675         ;
1676     break;}
1677 case 74:
1678 #line 596 "parser.yy"
1679 {
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;
1685         ;
1686     break;}
1687 case 75:
1688 #line 603 "parser.yy"
1689 { yyval.music = yyvsp[0].musiclist; ;
1690     break;}
1691 case 76:
1692 #line 604 "parser.yy"
1693 { yyval.music = yyvsp[0].chord; ;
1694     break;}
1695 case 77:
1696 #line 605 "parser.yy"
1697 { yyval.music = yyvsp[0].music; ;
1698     break;}
1699 case 78:
1700 #line 606 "parser.yy"
1701 { yyval.music = yyvsp[0].id->music (); ;
1702     break;}
1703 case 79:
1704 #line 607 "parser.yy"
1705 { yyval.music = yyvsp[-1].id->music (); ;
1706     break;}
1707 case 80:
1708 #line 609 "parser.yy"
1709 { THIS->lexer_p_->push_note_state (); ;
1710     break;}
1711 case 81:
1712 #line 611 "parser.yy"
1713 { yyval.music=yyvsp[0].music; THIS->lexer_p_->pop_state (); ;
1714     break;}
1715 case 82:
1716 #line 614 "parser.yy"
1717 { THIS->lexer_p_->push_lyric_state (); ;
1718     break;}
1719 case 83:
1720 #line 616 "parser.yy"
1721 { yyval.music = yyvsp[0].music; THIS->lexer_p_->pop_state (); ;
1722     break;}
1723 case 86:
1724 #line 622 "parser.yy"
1725 {
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;
1729
1730                 yyval.music = t;
1731                 yyval.music->set_spot (THIS->here_input ());
1732                 delete yyvsp[-2].string;
1733                 delete yyvsp[0].string;
1734         ;
1735     break;}
1736 case 87:
1737 #line 635 "parser.yy"
1738 {
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;
1743                 yyval.music = t;
1744                 yyval.music->set_spot (THIS->here_input ());
1745                 delete yyvsp[-4].string;
1746                 delete yyvsp[-2].string;
1747                 delete yyvsp[0].scalar;
1748         ;
1749     break;}
1750 case 88:
1751 #line 649 "parser.yy"
1752 { yyval.scalar = new Scalar (*yyvsp[0].string); delete yyvsp[0].string; ;
1753     break;}
1754 case 89:
1755 #line 650 "parser.yy"
1756 { yyval.scalar = new Scalar (yyvsp[0].i); ;
1757     break;}
1758 case 90:
1759 #line 655 "parser.yy"
1760 { yyval.chord  = yyvsp[-1].chord; ;
1761     break;}
1762 case 91:
1763 #line 656 "parser.yy"
1764 {
1765                 yyval.chord = yyvsp[0].chord;
1766                 yyval.chord->multi_level_i_=yyvsp[-1].i;
1767         ;
1768     break;}
1769 case 92:
1770 #line 663 "parser.yy"
1771 {
1772                 yyval.chord = new Chord;
1773                 yyval.chord-> multi_level_i_ = 1;
1774                 yyval.chord->set_spot (THIS->here_input ());
1775         ;
1776     break;}
1777 case 93:
1778 #line 668 "parser.yy"
1779 {
1780                 yyval.chord->add (yyvsp[0].music);
1781         ;
1782     break;}
1783 case 94:
1784 #line 674 "parser.yy"
1785 {
1786                 yyval.music = yyvsp[0].music;
1787                 yyval.music -> transpose (yyvsp[-1].melreq);
1788
1789                 delete yyvsp[-1].melreq;
1790         ;
1791     break;}
1792 case 95:
1793 #line 687 "parser.yy"
1794 {
1795                 THIS->add_requests ((Chord*)yyvsp[-1].music);//ugh
1796                 yyval.music = yyvsp[-1].music;
1797         ;
1798     break;}
1799 case 97:
1800 #line 692 "parser.yy"
1801 { yyval.music = 0; ;
1802     break;}
1803 case 100:
1804 #line 701 "parser.yy"
1805 {
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
1810
1811         ;
1812     break;}
1813 case 102:
1814 #line 712 "parser.yy"
1815 { yyval.request = yyvsp[-1].request; ;
1816     break;}
1817 case 103:
1818 #line 716 "parser.yy"
1819 {
1820                 yyval.request = new Barcheck_req;
1821         ;
1822     break;}
1823 case 104:
1824 #line 719 "parser.yy"
1825 {
1826                 yyval.request = yyvsp[0].id->request ();
1827         ;
1828     break;}
1829 case 105:
1830 #line 725 "parser.yy"
1831 {
1832                 yyval.request = new Bar_req (*yyvsp[0].string);
1833                 delete yyvsp[0].string;
1834         ;
1835     break;}
1836 case 106:
1837 #line 729 "parser.yy"
1838 {
1839                 Break_force_req * f = new Break_force_req;
1840                 f-> set_spot (THIS->here_input ());
1841                 yyval.request = f;
1842         ;
1843     break;}
1844 case 107:
1845 #line 734 "parser.yy"
1846 {
1847                 Meter_change_req *m = new Meter_change_req;
1848                 m->set (yyvsp[-2].i,yyvsp[0].i);
1849                 yyval.request = m;
1850         ;
1851     break;}
1852 case 108:
1853 #line 739 "parser.yy"
1854 {
1855                 Skip_req * skip_p = new Skip_req;
1856                 skip_p->duration_.set_plet (yyvsp[0].moment->num (),
1857                         yyvsp[0].moment->den ());
1858
1859                 delete yyvsp[0].moment;
1860                 yyval.request = skip_p;
1861         ;
1862     break;}
1863 case 109:
1864 #line 747 "parser.yy"
1865 {
1866                 yyval.request = yyvsp[0].tempo;
1867         ;
1868     break;}
1869 case 110:
1870 #line 750 "parser.yy"
1871 {
1872                 yyval.request = new Cadenza_req (yyvsp[0].i);
1873         ;
1874     break;}
1875 case 111:
1876 #line 753 "parser.yy"
1877 {
1878                 yyval.request = new Partial_measure_req (*yyvsp[0].moment);
1879                 delete yyvsp[0].moment;
1880         ;
1881     break;}
1882 case 112:
1883 #line 757 "parser.yy"
1884 {
1885                 yyval.request = new Clef_change_req (*yyvsp[0].string);
1886                 delete yyvsp[0].string;
1887         ;
1888     break;}
1889 case 113:
1890 #line 761 "parser.yy"
1891 {
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;
1896         ;
1897     break;}
1898 case 114:
1899 #line 767 "parser.yy"
1900 {
1901                 yyval.request = get_grouping_req (*yyvsp[0].intvec); delete yyvsp[0].intvec;
1902         ;
1903     break;}
1904 case 115:
1905 #line 773 "parser.yy"
1906 {
1907                 /* something silly happened.  Junk this stuff*/
1908                 if (!THIS->post_reqs.empty ())
1909                 {
1910                         warning ("Junking post-requests");
1911                         THIS->post_reqs.clear ();
1912                 }
1913         ;
1914     break;}
1915 case 116:
1916 #line 781 "parser.yy"
1917 {
1918                 yyvsp[0].request->set_spot (THIS->here_input ());
1919                 THIS->post_reqs.push (yyvsp[0].request);
1920         ;
1921     break;}
1922 case 117:
1923 #line 785 "parser.yy"
1924 {
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);
1929                 delete &r;
1930         ;
1931     break;}
1932 case 120:
1933 #line 800 "parser.yy"
1934 {
1935                 yyval.request = (Request*)yyvsp[0].id->request ();
1936         ;
1937     break;}
1938 case 121:
1939 #line 803 "parser.yy"
1940 {
1941                 yyval.request = yyvsp[0].request;
1942         ;
1943     break;}
1944 case 122:
1945 #line 806 "parser.yy"
1946 {
1947                 Abbreviation_req* a = new Abbreviation_req;
1948                 a->type_i_ = yyvsp[0].i;
1949                 yyval.request = a;
1950         ;
1951     break;}
1952 case 123:
1953 #line 819 "parser.yy"
1954 {
1955                 yyval.melreq = yyvsp[0].melreq->clone ()->musical ()->melodic ();
1956                 yyval.melreq->octave_i_ += THIS->default_octave_i_;
1957         ;
1958     break;}
1959 case 124:
1960 #line 823 "parser.yy"
1961 {
1962                 yyval.melreq-> octave_i_ += yyvsp[0].i;
1963         ;
1964     break;}
1965 case 125:
1966 #line 826 "parser.yy"
1967 {
1968                 yyval.melreq = yyvsp[0].melreq;
1969                 yyvsp[0].melreq-> octave_i_ -= yyvsp[-1].i;
1970         ;
1971     break;}
1972 case 126:
1973 #line 833 "parser.yy"
1974 {
1975                 yyval.notereq = new Note_req;
1976                 * (Melodic_req *) yyval.notereq = *yyvsp[0].melreq;
1977                 delete yyvsp[0].melreq;
1978         ;
1979     break;}
1980 case 127:
1981 #line 838 "parser.yy"
1982 {
1983                 yyval.notereq->forceacc_b_ = ! yyval.notereq->forceacc_b_;
1984         ;
1985     break;}
1986 case 128:
1987 #line 845 "parser.yy"
1988 {/* ugh */
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;
1993         ;
1994     break;}
1995 case 129:
1996 #line 854 "parser.yy"
1997 {
1998                 yyval.duration = new Duration;
1999                 yyval.duration-> durlog_i_ = yyvsp[-2].i;
2000                 yyval.duration-> dots_i_ = yyvsp[-1].i;
2001         ;
2002     break;}
2003 case 130:
2004 #line 862 "parser.yy"
2005 {
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;
2009         ;
2010     break;}
2011 case 131:
2012 #line 867 "parser.yy"
2013 {
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;
2018         ;
2019     break;}
2020 case 132:
2021 #line 876 "parser.yy"
2022 {
2023                 yyval.pair[0] = yyvsp[-2].i;
2024                 yyval.pair[1] = yyvsp[0].i;
2025         ;
2026     break;}
2027 case 133:
2028 #line 881 "parser.yy"
2029 {
2030                 int num = yyvsp[0].i >? 1;
2031                 yyval.pair[0] = guess_plet_a[(num <? GUESS_PLET) - 1];
2032                 yyval.pair[1] = num;
2033         ;
2034     break;}
2035 case 134:
2036 #line 889 "parser.yy"
2037 {
2038                 yyval.i = MAEBTELP;
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];
2043         ;
2044     break;}
2045 case 135:
2046 #line 896 "parser.yy"
2047 {
2048                 yyval.i = TELP;
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;
2053         ;
2054     break;}
2055 case 136:
2056 #line 903 "parser.yy"
2057 {
2058                 yyval.i = TELP;
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];
2063         ;
2064     break;}
2065 case 137:
2066 #line 913 "parser.yy"
2067 {
2068                 yyval.i = '~';
2069         ;
2070     break;}
2071 case 138:
2072 #line 916 "parser.yy"
2073 {
2074                 yyval.i='(';
2075         ;
2076     break;}
2077 case 139:
2078 #line 919 "parser.yy"
2079 {
2080                 yyval.i = ']';
2081         ;
2082     break;}
2083 case 140:
2084 #line 922 "parser.yy"
2085 {
2086                 yyval.i = '<';
2087         ;
2088     break;}
2089 case 141:
2090 #line 925 "parser.yy"
2091 {
2092                 yyval.i = '>';
2093         ;
2094     break;}
2095 case 142:
2096 #line 928 "parser.yy"
2097 {
2098         ;
2099     break;}
2100 case 143:
2101 #line 933 "parser.yy"
2102 {
2103                 yyval.c = '[';
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");
2108                 else
2109                         THIS->set_abbrev_beam (yyvsp[0].i);
2110         ;
2111     break;}
2112 case 144:
2113 #line 945 "parser.yy"
2114 {
2115                 yyval.i = BEAMPLET;
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];
2120         ;
2121     break;}
2122 case 145:
2123 #line 952 "parser.yy"
2124 {
2125                 yyval.i = PLET;
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];
2130         ;
2131     break;}
2132 case 146:
2133 #line 962 "parser.yy"
2134 {
2135                 yyval.i = '!';
2136         ;
2137     break;}
2138 case 147:
2139 #line 965 "parser.yy"
2140 {
2141                 yyval.i=')';
2142         ;
2143     break;}
2144 case 148:
2145 #line 968 "parser.yy"
2146 {
2147                 yyval.i='[';
2148         ;
2149     break;}
2150 case 149:
2151 #line 971 "parser.yy"
2152 {
2153         ;
2154     break;}
2155 case 150:
2156 #line 973 "parser.yy"
2157 {
2158         ;
2159     break;}
2160 case 151:
2161 #line 980 "parser.yy"
2162 { yyval.script = yyvsp[-1].script; ;
2163     break;}
2164 case 152:
2165 #line 984 "parser.yy"
2166 {
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);
2169                 yyval.script  = s;
2170                 delete yyvsp[-5].string;
2171         ;
2172     break;}
2173 case 153:
2174 #line 993 "parser.yy"
2175 {
2176                 Musical_script_req *m = new Musical_script_req;
2177                 yyval.request = m;
2178                 m->scriptdef_p_ = yyvsp[0].script;
2179                 m->set_spot (THIS->here_input ());
2180                 if (!m->dir_)
2181                   m->dir_  = (Direction)yyvsp[-1].i;
2182         ;
2183     break;}
2184 case 154:
2185 #line 1004 "parser.yy"
2186
2187                 yyval.script = yyvsp[0].textdef;
2188                 ((Text_def*) yyval.script)->align_i_ = CENTER; /* UGH */
2189         ;
2190     break;}
2191 case 155:
2192 #line 1008 "parser.yy"
2193
2194                 yyval.script = yyvsp[0].script;
2195                 yyval.script-> set_spot (THIS->here_input ());
2196         ;
2197     break;}
2198 case 156:
2199 #line 1012 "parser.yy"
2200 {
2201                 yyval.script = yyvsp[0].textdef;
2202                 ((Text_def*)yyval.script)->align_i_ = CENTER;
2203         ;
2204     break;}
2205 case 157:
2206 #line 1019 "parser.yy"
2207 {
2208                 Text_def *t  = new Text_def;
2209                 yyval.textdef = t;
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 ());
2214         ;
2215     break;}
2216 case 158:
2217 #line 1030 "parser.yy"
2218 {
2219                 Text_def* t  = new Text_def;
2220                 yyval.textdef = t;
2221                 t->text_str_ = String (yyvsp[0].i);
2222                 t->style_str_ = "finger";
2223                 yyval.textdef->set_spot (THIS->here_input ());
2224         ;
2225     break;}
2226 case 159:
2227 #line 1040 "parser.yy"
2228 { yyval.string = get_scriptdef ('^'); ;
2229     break;}
2230 case 160:
2231 #line 1041 "parser.yy"
2232 { yyval.string = get_scriptdef ('+'); ;
2233     break;}
2234 case 161:
2235 #line 1042 "parser.yy"
2236 { yyval.string = get_scriptdef ('-'); ;
2237     break;}
2238 case 162:
2239 #line 1043 "parser.yy"
2240 { yyval.string = get_scriptdef ('|'); ;
2241     break;}
2242 case 163:
2243 #line 1044 "parser.yy"
2244 { yyval.string = get_scriptdef ('o'); ;
2245     break;}
2246 case 164:
2247 #line 1045 "parser.yy"
2248 { yyval.string = get_scriptdef ('>'); ;
2249     break;}
2250 case 165:
2251 #line 1046 "parser.yy"
2252 {
2253                 yyval.string = get_scriptdef ('.');
2254         ;
2255     break;}
2256 case 166:
2257 #line 1052 "parser.yy"
2258 { yyval.script = yyvsp[0].id->script (); ;
2259     break;}
2260 case 167:
2261 #line 1053 "parser.yy"
2262 { yyval.script = yyvsp[0].script; ;
2263     break;}
2264 case 168:
2265 #line 1054 "parser.yy"
2266 {
2267                 yyval.script = THIS->lexer_p_->lookup_identifier (*yyvsp[0].string)->script ();
2268                 delete yyvsp[0].string;
2269         ;
2270     break;}
2271 case 169:
2272 #line 1061 "parser.yy"
2273 { yyval.i = -1; ;
2274     break;}
2275 case 170:
2276 #line 1062 "parser.yy"
2277 { yyval.i = 1; ;
2278     break;}
2279 case 171:
2280 #line 1063 "parser.yy"
2281 { yyval.i = 0; ;
2282     break;}
2283 case 172:
2284 #line 1067 "parser.yy"
2285 {
2286         ;
2287     break;}
2288 case 173:
2289 #line 1069 "parser.yy"
2290 {
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);
2295                 delete &r;
2296         ;
2297     break;}
2298 case 174:
2299 #line 1079 "parser.yy"
2300 {
2301                 THIS->set_duration_mode (*yyvsp[0].string);
2302                 delete yyvsp[0].string;
2303         ;
2304     break;}
2305 case 175:
2306 #line 1083 "parser.yy"
2307 {
2308                 THIS->set_default_duration (yyvsp[0].duration);
2309                 delete yyvsp[0].duration;
2310         ;
2311     break;}
2312 case 176:
2313 #line 1087 "parser.yy"
2314 {
2315                 /*
2316                         This is weird, but default_octave_i_
2317                         is used in steno_note_req too
2318
2319                         c' -> default_octave_i_ == 1
2320                 */
2321                 /* why can't we have \oct 0 iso \oct{c'}*/
2322                 THIS->default_octave_i_ = 1; ;
2323     break;}
2324 case 177:
2325 #line 1097 "parser.yy"
2326 {
2327                 THIS->default_octave_i_ = yyvsp[0].melreq->octave_i_;
2328                 delete yyvsp[0].melreq;
2329         ;
2330     break;}
2331 case 178:
2332 #line 1101 "parser.yy"
2333 {
2334                 THIS->textstyle_str_ = *yyvsp[0].string;
2335                 delete yyvsp[0].string;
2336         ;
2337     break;}
2338 case 179:
2339 #line 1108 "parser.yy"
2340 {
2341                 yyval.moment = new Moment (0,1);
2342         ;
2343     break;}
2344 case 180:
2345 #line 1111 "parser.yy"
2346 {
2347                 *yyval.moment += yyvsp[0].duration->length ();
2348         ;
2349     break;}
2350 case 181:
2351 #line 1117 "parser.yy"
2352 { yyval.i = 1; ;
2353     break;}
2354 case 182:
2355 #line 1118 "parser.yy"
2356 { yyval.i ++; ;
2357     break;}
2358 case 183:
2359 #line 1122 "parser.yy"
2360 {
2361                 yyval.duration = new Duration (THIS->default_duration_);
2362         ;
2363     break;}
2364 case 184:
2365 #line 1125 "parser.yy"
2366 {
2367                 yyval.duration = new Duration (THIS->default_duration_);
2368                 yyval.duration->dots_i_  = yyvsp[0].i;
2369         ;
2370     break;}
2371 case 185:
2372 #line 1129 "parser.yy"
2373 {
2374                 THIS->set_last_duration (yyvsp[0].duration);
2375                 yyval.duration = yyvsp[0].duration;
2376         ;
2377     break;}
2378 case 186:
2379 #line 1136 "parser.yy"
2380 {
2381                 yyval.duration = yyvsp[0].duration;
2382         ;
2383     break;}
2384 case 187:
2385 #line 1142 "parser.yy"
2386 {
2387                 yyval.duration = new Duration;
2388                 if (!Duration::duration_type_b (yyvsp[0].i))
2389                         THIS->parser_error ("2:Not a duration");
2390                 else {
2391                         yyval.duration->durlog_i_ = Duration_convert::i2_type (yyvsp[0].i);
2392                         yyval.duration->set_plet (THIS->default_duration_);
2393                      }
2394         ;
2395     break;}
2396 case 188:
2397 #line 1151 "parser.yy"
2398 {
2399                 yyval.duration = yyvsp[0].id->duration ();
2400         ;
2401     break;}
2402 case 189:
2403 #line 1154 "parser.yy"
2404 {
2405                 yyval.duration->dots_i_ ++;
2406         ;
2407     break;}
2408 case 190:
2409 #line 1157 "parser.yy"
2410 {
2411                 yyval.duration->plet_.iso_i_ = yyvsp[0].i;
2412         ;
2413     break;}
2414 case 191:
2415 #line 1160 "parser.yy"
2416 {
2417                 yyval.duration->plet_.type_i_ = yyvsp[0].i;
2418         ;
2419     break;}
2420 case 192:
2421 #line 1167 "parser.yy"
2422 {
2423                 yyval.i =0;
2424         ;
2425     break;}
2426 case 193:
2427 #line 1170 "parser.yy"
2428 {
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;
2434         ;
2435     break;}
2436 case 194:
2437 #line 1181 "parser.yy"
2438 {
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);
2444         ;
2445     break;}
2446 case 195:
2447 #line 1188 "parser.yy"
2448 {
2449                 yyval.music = THIS->get_rest_element (*yyvsp[-1].string, yyvsp[0].duration);
2450                 delete yyvsp[-1].string;
2451         ;
2452     break;}
2453 case 196:
2454 #line 1195 "parser.yy"
2455 {
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);
2460
2461         ;
2462     break;}
2463 case 197:
2464 #line 1206 "parser.yy"
2465 {
2466                 yyval.melreqvec = new Array<Melodic_req*>;
2467         ;
2468     break;}
2469 case 198:
2470 #line 1209 "parser.yy"
2471 {
2472                 yyval.melreqvec->push (yyvsp[0].melreq->clone ()->musical ()->melodic ());
2473         ;
2474     break;}
2475 case 199:
2476 #line 1215 "parser.yy"
2477 {
2478                 yyval.i = yyvsp[0].i;
2479         ;
2480     break;}
2481 case 200:
2482 #line 1218 "parser.yy"
2483 {
2484                 yyval.i = yyvsp[0].i;
2485         ;
2486     break;}
2487 case 201:
2488 #line 1223 "parser.yy"
2489 {
2490                 yyval.i = yyvsp[0].i;
2491         ;
2492     break;}
2493 case 202:
2494 #line 1226 "parser.yy"
2495 {
2496                 yyval.i = -yyvsp[0].i;
2497         ;
2498     break;}
2499 case 203:
2500 #line 1229 "parser.yy"
2501 {
2502                 int *i_p = yyvsp[0].id->intid ();
2503                 yyval.i = *i_p;
2504                 delete i_p;
2505         ;
2506     break;}
2507 case 204:
2508 #line 1237 "parser.yy"
2509 {
2510                 yyval.real = yyvsp[0].real;
2511         ;
2512     break;}
2513 case 205:
2514 #line 1240 "parser.yy"
2515 {
2516                 Real *r_p = yyvsp[0].id->real ();
2517                 yyval.real = * r_p;
2518                 delete r_p;
2519         ;
2520     break;}
2521 case 206:
2522 #line 1250 "parser.yy"
2523 { yyval.real = yyvsp[-1].real*yyvsp[0].real; ;
2524     break;}
2525 case 207:
2526 #line 1254 "parser.yy"
2527 { yyval.real = 1 CM; ;
2528     break;}
2529 case 208:
2530 #line 1255 "parser.yy"
2531 { yyval.real = 1 INCH; ;
2532     break;}
2533 case 209:
2534 #line 1256 "parser.yy"
2535 { yyval.real = 1 MM; ;
2536     break;}
2537 case 210:
2538 #line 1257 "parser.yy"
2539 { yyval.real = 1 PT; ;
2540     break;}
2541 case 211:
2542 #line 1264 "parser.yy"
2543 { yyval.lookup = yyvsp[-1].lookup; ;
2544     break;}
2545 case 212:
2546 #line 1268 "parser.yy"
2547 {
2548                 yyval.lookup = new Lookup;
2549         ;
2550     break;}
2551 case 213:
2552 #line 1271 "parser.yy"
2553 {
2554                 yyval.lookup = yyvsp[0].id->lookup ();
2555         ;
2556     break;}
2557 case 214:
2558 #line 1274 "parser.yy"
2559 {
2560                 yyval.lookup->texsetting = *yyvsp[0].string;
2561                 delete yyvsp[0].string;
2562         ;
2563     break;}
2564 case 215:
2565 #line 1278 "parser.yy"
2566 {
2567                 yyval.lookup->add (*yyvsp[-2].string, yyvsp[0].symtable);
2568                 delete yyvsp[-2].string;
2569         ;
2570     break;}
2571 case 216:
2572 #line 1285 "parser.yy"
2573 { yyval.symtable = yyvsp[-1].symtable; ;
2574     break;}
2575 case 217:
2576 #line 1289 "parser.yy"
2577 { yyval.symtable = new Symtable; ;
2578     break;}
2579 case 218:
2580 #line 1290 "parser.yy"
2581 {
2582                 yyval.symtable->add (*yyvsp[-1].string, *yyvsp[0].symbol);
2583                 delete yyvsp[-1].string;
2584                 delete yyvsp[0].symbol;
2585         ;
2586     break;}
2587 case 219:
2588 #line 1298 "parser.yy"
2589 {
2590                 yyval.symbol = new Atom (*yyvsp[-1].string, *yyvsp[0].box);
2591                 delete yyvsp[-1].string;
2592                 delete yyvsp[0].box;
2593         ;
2594     break;}
2595 case 220:
2596 #line 1303 "parser.yy"
2597 {
2598                 Box b (Interval (0,0), Interval (0,0));
2599                 yyval.symbol = new Atom (*yyvsp[0].string, b);
2600                 delete yyvsp[0].string;
2601         ;
2602     break;}
2603 case 221:
2604 #line 1311 "parser.yy"
2605 {
2606                 yyval.box = new Box (*yyvsp[-1].interval, *yyvsp[0].interval);
2607                 delete yyvsp[-1].interval;
2608                 delete yyvsp[0].interval;
2609         ;
2610     break;}
2611 case 222:
2612 #line 1318 "parser.yy"
2613 {
2614                 yyval.interval = new Interval (yyvsp[-1].real, yyvsp[0].real);
2615         ;
2616     break;}
2617 }
2618    /* the action file gets copied in in place of this dollarsign */
2619 #line 498 "/usr/lib/bison.simple"
2620 \f
2621   yyvsp -= yylen;
2622   yyssp -= yylen;
2623 #ifdef YYLSP_NEEDED
2624   yylsp -= yylen;
2625 #endif
2626
2627 #if YYDEBUG != 0
2628   if (yydebug)
2629     {
2630       short *ssp1 = yyss - 1;
2631       fprintf (stderr, "state stack now");
2632       while (ssp1 != yyssp)
2633         fprintf (stderr, " %d", *++ssp1);
2634       fprintf (stderr, "\n");
2635     }
2636 #endif
2637
2638   *++yyvsp = yyval;
2639
2640 #ifdef YYLSP_NEEDED
2641   yylsp++;
2642   if (yylen == 0)
2643     {
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;
2648       yylsp->text = 0;
2649     }
2650   else
2651     {
2652       yylsp->last_line = (yylsp+yylen-1)->last_line;
2653       yylsp->last_column = (yylsp+yylen-1)->last_column;
2654     }
2655 #endif
2656
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.  */
2661
2662   yyn = yyr1[yyn];
2663
2664   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2665   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2666     yystate = yytable[yystate];
2667   else
2668     yystate = yydefgoto[yyn - YYNTBASE];
2669
2670   goto yynewstate;
2671
2672 yyerrlab:   /* here on detecting error */
2673
2674   if (! yyerrstatus)
2675     /* If not already recovering from an error, report this error.  */
2676     {
2677       ++yynerrs;
2678
2679 #ifdef YYERROR_VERBOSE
2680       yyn = yypact[yystate];
2681
2682       if (yyn > YYFLAG && yyn < YYLAST)
2683         {
2684           int size = 0;
2685           char *msg;
2686           int x, count;
2687
2688           count = 0;
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);
2695           if (msg != 0)
2696             {
2697               strcpy(msg, "parse error");
2698
2699               if (count < 5)
2700                 {
2701                   count = 0;
2702                   for (x = (yyn < 0 ? -yyn : 0);
2703                        x < (sizeof(yytname) / sizeof(char *)); x++)
2704                     if (yycheck[x + yyn] == x)
2705                       {
2706                         strcat(msg, count == 0 ? ", expecting `" : " or `");
2707                         strcat(msg, yytname[x]);
2708                         strcat(msg, "'");
2709                         count++;
2710                       }
2711                 }
2712               yyerror(msg);
2713               free(msg);
2714             }
2715           else
2716             yyerror ("parse error; also virtual memory exceeded");
2717         }
2718       else
2719 #endif /* YYERROR_VERBOSE */
2720         yyerror("parse error");
2721     }
2722
2723   goto yyerrlab1;
2724 yyerrlab1:   /* here on error raised explicitly by an action */
2725
2726   if (yyerrstatus == 3)
2727     {
2728       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
2729
2730       /* return failure if at end of input */
2731       if (yychar == YYEOF)
2732         YYABORT;
2733
2734 #if YYDEBUG != 0
2735       if (yydebug)
2736         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2737 #endif
2738
2739       yychar = YYEMPTY;
2740     }
2741
2742   /* Else will try to reuse lookahead token
2743      after shifting the error token.  */
2744
2745   yyerrstatus = 3;              /* Each real token shifted decrements this */
2746
2747   goto yyerrhandle;
2748
2749 yyerrdefault:  /* current state does not do anything special for the error token. */
2750
2751 #if 0
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;
2756 #endif
2757
2758 yyerrpop:   /* pop the current state because it cannot handle the error token */
2759
2760   if (yyssp == yyss) YYABORT;
2761   yyvsp--;
2762   yystate = *--yyssp;
2763 #ifdef YYLSP_NEEDED
2764   yylsp--;
2765 #endif
2766
2767 #if YYDEBUG != 0
2768   if (yydebug)
2769     {
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");
2775     }
2776 #endif
2777
2778 yyerrhandle:
2779
2780   yyn = yypact[yystate];
2781   if (yyn == YYFLAG)
2782     goto yyerrdefault;
2783
2784   yyn += YYTERROR;
2785   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2786     goto yyerrdefault;
2787
2788   yyn = yytable[yyn];
2789   if (yyn < 0)
2790     {
2791       if (yyn == YYFLAG)
2792         goto yyerrpop;
2793       yyn = -yyn;
2794       goto yyreduce;
2795     }
2796   else if (yyn == 0)
2797     goto yyerrpop;
2798
2799   if (yyn == YYFINAL)
2800     YYACCEPT;
2801
2802 #if YYDEBUG != 0
2803   if (yydebug)
2804     fprintf(stderr, "Shifting error token, ");
2805 #endif
2806
2807   *++yyvsp = yylval;
2808 #ifdef YYLSP_NEEDED
2809   *++yylsp = yylloc;
2810 #endif
2811
2812   yystate = yyn;
2813   goto yynewstate;
2814 }
2815 #line 1323 "parser.yy"
2816
2817
2818 void
2819 My_lily_parser::set_yydebug (bool b)
2820 {
2821 #ifdef YYDEBUG
2822         yydebug = b;
2823 #endif
2824 }
2825 void
2826 My_lily_parser::do_yyparse ()
2827 {
2828         yyparse ((void*)this);
2829 }
2830
2831 Paper_def*
2832 My_lily_parser::default_paper ()
2833 {
2834         Identifier *id = lexer_p_->lookup_identifier ("default_paper");
2835         return id ? id->paperdef () : new Paper_def ;
2836 }
2837
2838 Midi_def*
2839 My_lily_parser::default_midi ()
2840 {
2841         Identifier *id = lexer_p_->lookup_identifier ("default_midi");
2842         return id ? id->mididef () : new Midi_def ;
2843 }
2844