]> git.donarmstrong.com Git - lilypond.git/blob - lily/parser.cc
release: 0.1.49
[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 int const GUESS_PLET = 5;
132 int guess_plet_a[GUESS_PLET] =
133
134   1,
135   3,
136   2,
137   3,
138   4
139 };
140
141 #ifndef NDEBUG
142 #define YYDEBUG 1
143 #endif
144
145 #define YYERROR_VERBOSE 1
146
147 #define YYPARSE_PARAM my_lily_parser_l
148 #define YYLEX_PARAM my_lily_parser_l
149 #define THIS ((My_lily_parser *) my_lily_parser_l)
150
151 #define yyerror THIS->parser_error
152
153
154 #line 68 "parser.yy"
155 typedef union {
156     Array<Interval>* intarr;
157     Array<Melodic_req*> *melreqvec;/* should clean up naming */
158     Array<String> * strvec;
159     Array<int> *intvec;
160     Box *box;
161     Chord * chord;
162     Duration *duration;
163     Identifier *id;
164     Translator* trans;
165     Music *music;
166     Music_list *musiclist;
167     Score *score;
168     Header *header;
169     Interval *interval;
170     Lookup*lookup;
171     Melodic_req * melreq;
172     Musical_req* musreq;
173     Music_output_def * outputdef;
174     Midi_def* midi;
175     Moment *moment;
176     Note_req *notereq;
177     Paper_def *paper;
178     Real real;
179     Request * request;
180     General_script_def * script;
181     Scalar *scalar;
182     String *string;
183     Atom * symbol;
184     Symtable * symtable;
185     Symtables * symtables;
186     Text_def * textdef;
187     Tempo_req *tempo;
188     char c;
189     const char *consstr;
190     int i;
191     int pair[2];
192     int ii[10];
193 } YYSTYPE;
194 #line 107 "parser.yy"
195
196
197 int
198 yylex (YYSTYPE *s,  void * v_l)
199 {
200         My_lily_parser   *pars_l = (My_lily_parser*) v_l;
201         My_lily_lexer * lex_l = pars_l->lexer_p_;
202
203         lex_l->lexval_l = (void*) s;
204         return lex_l->yylex ();
205 }
206
207
208 #include <stdio.h>
209
210 #ifndef __cplusplus
211 #ifndef __STDC__
212 #define const
213 #endif
214 #endif
215
216
217
218 #define YYFINAL         353
219 #define YYFLAG          -32768
220 #define YYNTBASE        104
221
222 #define YYTRANSLATE(x) ((unsigned)(x) <= 336 ? yytranslate[x] : 191)
223
224 static const char yytranslate[] = {     0,
225      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
226      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
227      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
228      2,     2,    92,     2,     2,     2,     2,     2,     2,    95,
229     98,    86,   100,     2,   101,    87,    91,     2,     2,     2,
230      2,     2,     2,     2,     2,     2,     2,    97,    82,    88,
231     85,    89,     2,     2,     2,     2,     2,     2,     2,     2,
232      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
233      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
234     96,     2,    93,    99,   103,     2,     2,     2,     2,     2,
235      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
236    102,     2,     2,     2,     2,     2,     2,     2,     2,     2,
237      2,     2,    83,    90,    84,    94,     2,     2,     2,     2,
238      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
239      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
240      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
241      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
242      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
243      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
244      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
245      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
246      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
247      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
248      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
249      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
250      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
251      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
252     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
253     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
254     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
255     46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
256     56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
257     66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
258     76,    77,    78,    79,    80,    81
259 };
260
261 #if YYDEBUG != 0
262 static const short yyprhs[] = {     0,
263      0,     1,     4,     7,    10,    13,    16,    19,    23,    28,
264     29,    32,    37,    38,    44,    49,    50,    53,    54,    59,
265     61,    63,    65,    67,    69,    71,    73,    75,    77,    79,
266     81,    83,    88,    90,    94,   100,   105,   110,   111,   117,
267    118,   120,   123,   126,   129,   132,   134,   136,   137,   142,
268    147,   148,   150,   155,   158,   164,   170,   175,   181,   184,
269    185,   189,   194,   195,   200,   205,   209,   212,   217,   221,
270    222,   225,   227,   231,   237,   239,   241,   243,   245,   248,
271    249,   253,   254,   258,   260,   262,   267,   274,   276,   278,
272    282,   286,   287,   290,   294,   298,   300,   303,   305,   307,
273    309,   311,   314,   316,   318,   321,   323,   328,   331,   333,
274    336,   339,   342,   345,   348,   349,   352,   355,   357,   359,
275    361,   363,   365,   367,   370,   373,   375,   378,   385,   391,
276    396,   402,   406,   409,   412,   414,   417,   419,   421,   423,
277    425,   427,   429,   433,   436,   439,   441,   443,   445,   447,
278    449,   454,   461,   464,   466,   468,   470,   472,   474,   476,
279    478,   480,   482,   484,   486,   488,   490,   492,   494,   496,
280    498,   500,   501,   504,   507,   510,   511,   515,   518,   519,
281    522,   524,   527,   528,   530,   532,   534,   536,   538,   541,
282    545,   549,   551,   554,   557,   560,   563,   564,   567,   569,
283    571,   573,   576,   578,   580,   582,   585,   587,   589,   591,
284    593,   598,   599,   601,   605,   610,   615,   616,   620,   623,
285    625,   628
286 };
287
288 static const short yyrhs[] = {    -1,
289    104,   109,     0,   104,   116,     0,   104,   111,     0,   104,
290      1,     0,   104,   105,     0,   104,   106,     0,    54,    78,
291     82,     0,    30,    83,   107,    84,     0,     0,   107,     9,
292      0,   107,    78,    85,   149,     0,     0,   108,    78,    85,
293    110,    82,     0,    20,    83,   108,    84,     0,     0,   110,
294     78,     0,     0,    78,   112,    85,   113,     0,   116,     0,
295    121,     0,   124,     0,   158,     0,   129,     0,   184,     0,
296    181,     0,   180,     0,   146,     0,   149,     0,   114,     0,
297    150,     0,    19,    83,   115,    84,     0,    70,     0,    49,
298     78,    82,     0,   115,    78,    85,   134,    82,     0,   115,
299     12,    78,    82,     0,   115,    13,    78,    82,     0,     0,
300     38,   117,    83,   118,    84,     0,     0,    72,     0,   118,
301    109,     0,   118,   129,     0,   118,   119,     0,   118,     1,
302      0,   121,     0,   124,     0,     0,   120,   180,    86,   180,
303      0,    33,    83,   122,    84,     0,     0,    74,     0,   122,
304     32,    78,    82,     0,   122,   184,     0,   122,    78,    85,
305    182,    82,     0,   122,    78,    85,   181,    82,     0,   122,
306     78,    85,   114,     0,   122,    40,    85,   123,    82,     0,
307    122,     1,     0,     0,   123,   182,   182,     0,    25,    83,
308    125,    84,     0,     0,   125,    78,    85,   114,     0,   125,
309     32,    78,    82,     0,   125,   126,    82,     0,   125,     1,
310      0,    48,   172,    85,   179,     0,    83,   128,    84,     0,
311      0,   128,   129,     0,   138,     0,    49,    78,   129,     0,
312     49,    78,    85,    78,   129,     0,   127,     0,   135,     0,
313    137,     0,    64,     0,    64,    82,     0,     0,    24,   130,
314    129,     0,     0,    22,   131,   129,     0,   133,     0,   132,
315      0,    19,    78,    85,    78,     0,    53,    78,    87,    78,
316     85,   134,     0,    78,     0,   180,     0,    88,   136,    89,
317      0,    29,   179,   135,     0,     0,   136,   129,     0,    47,
318    147,   129,     0,   167,   139,   144,     0,   140,     0,   168,
319     82,     0,   176,     0,   177,     0,   141,     0,   142,     0,
320    143,    82,     0,    90,     0,    68,     0,     4,    78,     0,
321      7,     0,    27,   179,    91,   179,     0,    41,   170,     0,
322    126,     0,     8,   179,     0,    34,   170,     0,    10,    78,
323      0,    23,   178,     0,    18,   120,     0,     0,   144,   145,
324      0,   144,   154,     0,   160,     0,   146,     0,    66,     0,
325    151,     0,   175,     0,    60,     0,   147,    80,     0,    81,
326    147,     0,   147,     0,   148,    92,     0,    26,    83,   180,
327    180,   180,    84,     0,    15,    83,   180,   179,    84,     0,
328     16,    83,   179,    84,     0,    42,    83,   180,   180,    84,
329      0,   179,    91,   179,     0,    91,   179,     0,    93,   152,
330      0,    36,     0,    36,   152,     0,    94,     0,    95,     0,
331     93,     0,    56,     0,    57,     0,   153,     0,    96,    97,
332    179,     0,    96,   152,     0,    35,   152,     0,    55,     0,
333     98,     0,    96,     0,   155,     0,   156,     0,    39,    83,
334    159,    84,     0,    78,   180,   180,   180,   180,   180,     0,
335    166,   161,     0,   162,     0,   165,     0,   163,     0,    78,
336      0,    59,     0,    99,     0,   100,     0,   101,     0,    90,
337      0,   102,     0,    89,     0,    87,     0,    67,     0,   158,
338      0,   164,     0,   103,     0,    99,     0,   101,     0,     0,
339    167,   157,     0,    15,    78,     0,    15,   172,     0,     0,
340     31,   169,   147,     0,    51,    78,     0,     0,   170,   174,
341      0,    87,     0,   171,    87,     0,     0,   171,     0,   174,
342      0,   172,     0,   179,     0,    61,     0,   174,    87,     0,
343    174,    86,   179,     0,   174,    91,   179,     0,    97,     0,
344     97,   179,     0,   148,   173,     0,    77,   173,     0,   162,
345    173,     0,     0,   178,    60,     0,    79,     0,    59,     0,
346    179,     0,   101,   179,     0,    71,     0,    76,     0,    69,
347      0,   181,   183,     0,    14,     0,    21,     0,    28,     0,
348     37,     0,    45,    83,   185,    84,     0,     0,    62,     0,
349    185,    50,    78,     0,   185,    78,    85,   186,     0,    46,
350     83,   187,    84,     0,     0,   187,    78,   188,     0,    78,
351    189,     0,    78,     0,   190,   190,     0,   182,   182,     0
352 };
353
354 #endif
355
356 #if YYDEBUG != 0
357 static const short yyrline[] = { 0,
358    258,   259,   263,   266,   267,   268,   269,   272,   285,   288,
359    291,   294,   300,   304,   311,   318,   322,   331,   335,   342,
360    347,   351,   355,   359,   363,   367,   371,   374,   377,   381,
361    384,   391,   396,   401,   406,   411,   415,   424,   428,   442,
362    445,   448,   451,   456,   459,   464,   468,   473,   475,   484,
363    489,   493,   496,   500,   501,   504,   507,   511,   515,   520,
364    524,   531,   537,   540,   544,   548,   552,   557,   570,   576,
365    581,   586,   588,   593,   600,   601,   602,   603,   604,   605,
366    608,   610,   613,   614,   615,   618,   631,   645,   647,   651,
367    653,   659,   665,   670,   683,   688,   689,   692,   694,   697,
368    707,   709,   712,   716,   721,   726,   731,   736,   744,   747,
369    750,   754,   758,   764,   769,   778,   782,   791,   793,   796,
370    800,   803,   815,   820,   823,   829,   835,   841,   850,   858,
371    864,   872,   877,   885,   893,   900,   909,   913,   916,   919,
372    922,   925,   929,   941,   949,   958,   962,   965,   968,   970,
373    976,   980,   989,  1000,  1005,  1009,  1015,  1026,  1036,  1038,
374   1039,  1040,  1041,  1042,  1043,  1048,  1050,  1051,  1057,  1059,
375   1060,  1063,  1066,  1075,  1080,  1084,  1094,  1098,  1104,  1108,
376   1113,  1115,  1118,  1122,  1126,  1132,  1138,  1148,  1151,  1154,
377   1157,  1163,  1167,  1177,  1185,  1191,  1203,  1206,  1211,  1215,
378   1219,  1223,  1226,  1233,  1237,  1246,  1251,  1252,  1253,  1254,
379   1260,  1264,  1268,  1271,  1275,  1281,  1285,  1287,  1294,  1300,
380   1307,  1315
381 };
382 #endif
383
384
385 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
386
387 static const char * const yytname[] = {   "$","error","$undefined.","ALIAS",
388 "BAR","BEAMPLET","MAEBTELP","BREAK","CADENZA","CLEAR","CLEF","CONTAINS","CONSISTS",
389 "ACCEPTS","CM_T","DURATION","ABSDYNAMIC","END","GROUPING","TRANSLATOR","HEADER",
390 "IN_T","LYRIC","KEY","MELODIC","MIDI","MELODIC_REQUEST","METER","MM_T","MULTI",
391 "NOTENAMES","OCTAVE","OUTPUT","PAPER","PARTIAL","PLET","TELP","PT_T","SCORE",
392 "SCRIPT","SHAPE","SKIP","SPANDYNAMIC","STAFF","START_T","SYMBOLTABLES","TABLE",
393 "TRANSPOSE","TEMPO","TYPE","TEXID","TEXTSTYLE","TITLE","PROPERTY","VERSION",
394 "E_EXCLAMATION","E_SMALLER","E_BIGGER","E_CHAR","DIGIT","NOTENAME_ID","DURATION_IDENTIFIER",
395 "IDENTIFIER","MELODIC_REQUEST_IDENTIFIER","MUSIC_IDENTIFIER","VOICE_IDENTIFIER",
396 "POST_REQUEST_IDENTIFIER","SCRIPT_IDENTIFIER","COMMAND_IDENTIFIER","REAL_IDENTIFIER",
397 "TRANS_IDENTIFIER","INT_IDENTIFIER","SCORE_IDENTIFIER","MIDI_IDENTIFIER","PAPER_IDENTIFIER",
398 "REQUEST_IDENTIFIER","REAL","RESTNAME","STRING","UNSIGNED","POST_QUOTES","PRE_QUOTES",
399 "';'","'{'","'}'","'='","'*'","'.'","'<'","'>'","'|'","'/'","'!'","']'","'~'",
400 "'('","'['","':'","')'","'^'","'+'","'-'","'o'","'_'","mudela","check_version",
401 "add_notenames","notenames_body","mudela_header_body","mudela_header","concat_strings",
402 "add_declaration","@1","identifier_init","translator_spec","translator_spec_body",
403 "score_block","@2","score_body","output_def","intastint_list","paper_block",
404 "paper_body","shape_array","midi_block","midi_body","tempo_request","Voice",
405 "Voice_body","Music","@3","@4","translator_change","property_def","scalar","Chord",
406 "Chord_body","transposed_music","full_element","simple_element","command_elt",
407 "command_req","abbrev_command_req","verbose_command_req","post_requests","structured_post_request",
408 "post_request","steno_melodic_req","steno_note_req","melodic_request","explicit_duration",
409 "dynamic_req","plet_fraction","close_plet_parens","close_request_parens","open_abbrev_parens",
410 "open_plet_parens","open_request_parens","script_definition","script_body","script_req",
411 "gen_script_def","text_def","finger","script_abbreviation","mudela_script","script_dir",
412 "pre_requests","voice_command","@5","duration_length","dots","entered_notemode_duration",
413 "notemode_duration","explicit_steno_duration","abbrev_type","music_elt","lyrics_elt",
414 "pitch_list","unsigned","int","real","dim","unit","symtables","symtables_body",
415 "symtable","symtable_body","symboldef","box","dinterval", NULL
416 };
417 #endif
418
419 static const short yyr1[] = {     0,
420    104,   104,   104,   104,   104,   104,   104,   105,   106,   107,
421    107,   107,   108,   108,   109,   110,   110,   112,   111,   113,
422    113,   113,   113,   113,   113,   113,   113,   113,   113,   113,
423    113,   114,   115,   115,   115,   115,   115,   117,   116,   118,
424    118,   118,   118,   118,   118,   119,   119,   120,   120,   121,
425    122,   122,   122,   122,   122,   122,   122,   122,   122,   123,
426    123,   124,   125,   125,   125,   125,   125,   126,   127,   128,
427    128,   129,   129,   129,   129,   129,   129,   129,   129,   130,
428    129,   131,   129,   129,   129,   132,   133,   134,   134,   135,
429    135,   136,   136,   137,   138,   138,   138,   139,   139,   140,
430    141,   141,   142,   142,   143,   143,   143,   143,   143,   143,
431    143,   143,   143,   143,   144,   144,   144,   145,   145,   146,
432    146,   146,   147,   147,   147,   148,   148,   149,   150,   151,
433    151,   152,   152,   153,   153,   153,   154,   154,   154,   154,
434    154,   154,   155,   156,   156,   157,   157,   157,   157,   157,
435    158,   159,   160,   161,   161,   161,   162,   163,   164,   164,
436    164,   164,   164,   164,   164,   165,   165,   165,   166,   166,
437    166,   167,   167,   168,   168,   169,   168,   168,   170,   170,
438    171,   171,   172,   172,   172,   173,   174,   174,   174,   174,
439    174,   175,   175,   176,   176,   177,   178,   178,   179,   179,
440    180,   180,   180,   181,   181,   182,   183,   183,   183,   183,
441    184,   185,   185,   185,   185,   186,   187,   187,   188,   188,
442    189,   190
443 };
444
445 static const short yyr2[] = {     0,
446      0,     2,     2,     2,     2,     2,     2,     3,     4,     0,
447      2,     4,     0,     5,     4,     0,     2,     0,     4,     1,
448      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
449      1,     4,     1,     3,     5,     4,     4,     0,     5,     0,
450      1,     2,     2,     2,     2,     1,     1,     0,     4,     4,
451      0,     1,     4,     2,     5,     5,     4,     5,     2,     0,
452      3,     4,     0,     4,     4,     3,     2,     4,     3,     0,
453      2,     1,     3,     5,     1,     1,     1,     1,     2,     0,
454      3,     0,     3,     1,     1,     4,     6,     1,     1,     3,
455      3,     0,     2,     3,     3,     1,     2,     1,     1,     1,
456      1,     2,     1,     1,     2,     1,     4,     2,     1,     2,
457      2,     2,     2,     2,     0,     2,     2,     1,     1,     1,
458      1,     1,     1,     2,     2,     1,     2,     6,     5,     4,
459      5,     3,     2,     2,     1,     2,     1,     1,     1,     1,
460      1,     1,     3,     2,     2,     1,     1,     1,     1,     1,
461      4,     6,     2,     1,     1,     1,     1,     1,     1,     1,
462      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
463      1,     0,     2,     2,     2,     0,     3,     2,     0,     2,
464      1,     2,     0,     1,     1,     1,     1,     1,     2,     3,
465      3,     1,     2,     2,     2,     2,     0,     2,     1,     1,
466      1,     2,     1,     1,     1,     2,     1,     1,     1,     1,
467      4,     0,     1,     3,     4,     4,     0,     3,     2,     1,
468      2,     2
469 };
470
471 static const short yydefact[] = {     1,
472      0,     5,     0,     0,    38,     0,    18,     6,     7,     2,
473      4,     3,    13,    10,     0,     0,     0,     0,     0,    40,
474      8,   172,     0,    15,    11,     0,     9,    41,     0,     0,
475    106,     0,     0,   183,     0,    48,     0,    82,   197,    80,
476      0,     0,     0,     0,   176,     0,   179,     0,   179,     0,
477      0,     0,   183,     0,     0,     0,   200,    78,   120,   104,
478    205,   203,   204,   199,    70,    92,   103,   192,     0,    19,
479     30,    20,    21,    22,   109,    75,    24,    85,    84,    76,
480     77,    72,    96,   100,   101,     0,    28,    29,    31,   121,
481     23,     0,     0,   122,   201,    27,    26,    25,    16,     0,
482     45,   183,     0,    39,    42,    44,    46,    47,    43,   105,
483    110,   112,   188,   174,     0,   181,   184,   175,   185,   187,
484      0,   114,     0,     0,   172,   113,   172,    63,     0,     0,
485      0,     0,    51,   111,     0,   108,     0,   212,   123,     0,
486    172,     0,   172,   178,     0,    79,   172,   172,   193,   202,
487    102,     0,   146,   183,   157,   148,   147,   115,   126,   183,
488    149,   150,   173,   183,    98,    99,    97,     0,    12,     0,
489    182,     0,   189,     0,     0,     0,     0,     0,    33,     0,
490     83,   198,    81,     0,     0,     0,    91,   177,    52,     0,
491    180,     0,     0,     0,   213,     0,   125,   124,    94,     0,
492      0,    73,     0,    69,    71,    90,    93,     0,   145,     0,
493    186,   195,     0,   144,    95,   127,   194,   196,    17,    14,
494      0,   190,   191,   130,     0,    86,     0,     0,     0,     0,
495     32,    67,     0,     0,    62,     0,     0,   107,    59,     0,
496      0,     0,    50,    54,     0,   151,     0,     0,     0,   211,
497     68,   172,     0,   133,     0,   143,   135,   140,   141,   139,
498    137,   138,   170,   171,   169,   116,   119,   142,   117,   118,
499      0,   129,    49,    34,     0,     0,     0,     0,     0,    66,
500      0,     0,    60,     0,     0,   131,   214,     0,    74,     0,
501    132,   136,   134,   158,   166,   165,   164,   162,   159,   160,
502    161,   163,   167,   153,   154,   156,   168,   155,    36,    37,
503     88,     0,    89,    65,     0,    64,   128,    53,     0,    57,
504      0,     0,     0,     0,   215,    87,    35,    58,     0,     0,
505    207,   208,   209,   210,    56,   206,    55,     0,   217,    61,
506    152,     0,     0,   216,   220,   218,     0,   219,     0,   222,
507    221,     0,     0
508 };
509
510 static const short yydefgoto[] = {     1,
511      8,     9,    19,    18,    10,   168,    11,    17,    70,    71,
512    180,    12,    15,    29,   106,   122,    73,   190,   319,    74,
513    184,    75,    76,   147,    77,   127,   125,    78,    79,   312,
514     80,   148,    81,    82,   158,    83,    84,    85,    86,   215,
515    266,    87,   141,   160,    88,    89,    90,   209,   268,   269,
516    161,   162,   163,    91,   193,   270,   304,   164,   306,   307,
517    308,   271,    92,    93,   132,   134,   117,   211,   212,   119,
518     94,   165,   166,   126,    95,   313,   329,   347,   336,    98,
519    196,   325,   342,   346,   348,   349
520 };
521
522 static const short yypact[] = {-32768,
523     19,-32768,   -66,   -47,-32768,   -18,-32768,-32768,-32768,-32768,
524 -32768,-32768,-32768,-32768,   -14,    -6,    28,    50,    -4,    12,
525 -32768,   243,    46,-32768,-32768,    53,-32768,-32768,   328,    62,
526 -32768,    51,    71,   134,    68,-32768,   -52,-32768,-32768,-32768,
527     91,    92,    51,    51,-32768,    97,-32768,   100,-32768,   114,
528    118,   -46,   141,   126,   127,   128,-32768,    54,-32768,-32768,
529 -32768,-32768,-32768,-32768,-32768,-32768,-32768,    51,    51,-32768,
530 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
531 -32768,-32768,-32768,-32768,-32768,   132,-32768,-32768,-32768,-32768,
532 -32768,   113,   136,-32768,-32768,-32768,-32768,-32768,-32768,   170,
533 -32768,   120,   138,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
534 -32768,-32768,-32768,-32768,   107,-32768,   123,-32768,   101,-32768,
535     51,   107,   137,     7,   608,   159,   608,-32768,   107,   142,
536    -23,   -46,   151,   -36,   149,   -36,   107,   168,-32768,   -46,
537    413,   147,   461,-32768,   148,-32768,   509,   557,-32768,-32768,
538 -32768,    73,-32768,   141,-32768,   -27,-32768,-32768,   154,    58,
539 -32768,-32768,-32768,   141,-32768,-32768,-32768,    20,-32768,    51,
540 -32768,    51,-32768,    51,   152,   153,   160,   162,-32768,    34,
541 -32768,-32768,-32768,    10,   107,    51,-32768,   154,-32768,     8,
542    101,   107,   157,   107,-32768,   -17,   154,-32768,-32768,    51,
543    164,-32768,   165,-32768,-32768,-32768,-32768,    51,-32768,   146,
544 -32768,-32768,    51,-32768,   -12,-32768,-32768,-32768,-32768,-32768,
545    161,-32768,-32768,-32768,   107,-32768,   166,   171,   174,   169,
546 -32768,-32768,   177,   172,-32768,   178,   107,-32768,-32768,   193,
547    188,   190,-32768,-32768,   107,-32768,   194,   201,   195,-32768,
548 -32768,   608,   198,-32768,    51,-32768,    73,-32768,-32768,    73,
549 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
550     57,-32768,-32768,-32768,   204,   205,    83,   207,   225,-32768,
551    209,   213,-32768,    -1,   107,-32768,-32768,   200,-32768,    83,
552 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
553 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
554 -32768,   215,-32768,-32768,   173,-32768,-32768,-32768,   -10,-32768,
555     13,   216,   107,   217,-32768,-32768,-32768,-32768,   139,   -48,
556 -32768,-32768,-32768,-32768,-32768,-32768,-32768,   107,-32768,-32768,
557 -32768,    87,   221,-32768,   -48,-32768,   -48,-32768,   -48,-32768,
558 -32768,   303,-32768
559 };
560
561 static const short yypgoto[] = {-32768,
562 -32768,-32768,-32768,-32768,   275,-32768,-32768,-32768,-32768,  -170,
563 -32768,   283,-32768,-32768,-32768,-32768,   277,-32768,-32768,   279,
564 -32768,   129,-32768,-32768,   -21,-32768,-32768,-32768,-32768,    27,
565    179,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
566 -32768,   103,   -77,-32768,   220,-32768,-32768,  -149,-32768,-32768,
567 -32768,-32768,-32768,    44,-32768,-32768,-32768,    52,-32768,-32768,
568 -32768,-32768,-32768,-32768,-32768,   272,-32768,   -24,    25,   -35,
569 -32768,-32768,-32768,-32768,   -31,   -22,   -20,  -268,-32768,   135,
570 -32768,-32768,-32768,-32768,-32768,   -25
571 };
572
573
574 #define YYLAST          698
575
576
577 static const short yytable[] = {    96,
578    111,    97,   120,    35,    25,    44,   214,   109,   239,   118,
579    232,   130,   131,   139,   159,   322,    13,   315,   352,     2,
580     61,   120,    57,   257,   113,   123,   331,    63,   142,    50,
581    124,    57,   248,   332,   140,    14,   149,   150,     3,   240,
582    333,   233,    64,   258,   259,   228,   229,   241,     4,   334,
583    330,    64,    51,    59,   188,   178,     5,    53,    61,    16,
584    249,   340,   197,   208,    66,    63,   250,    61,    20,   213,
585    120,   328,     6,    26,    63,    21,   179,   118,   350,    27,
586    260,   261,   262,    28,    68,   242,   263,   234,   264,   175,
587    265,   243,   170,   235,   335,    48,     7,   219,   191,   176,
588    191,   220,   120,   181,   120,   183,   185,   292,   316,    57,
589    293,   230,    22,   320,   194,   294,    57,   231,   113,   199,
590    210,   202,   120,   295,   210,   205,   207,    23,   120,    64,
591     99,    57,   120,    24,   155,   146,    64,   100,   221,   110,
592    222,    57,   223,   296,   116,   297,   298,   152,   112,   216,
593    121,    64,   331,    62,   238,   299,   300,   301,   302,   332,
594    311,    64,   237,   208,   343,    57,   333,   153,   251,   245,
595    344,   247,   139,   128,   129,   334,   254,    62,    57,   133,
596    113,   256,   135,    69,   217,    64,   172,   173,   218,   154,
597    155,   174,    57,   140,   113,    42,   137,   114,    64,    57,
598    138,   113,   273,   143,   144,   145,   116,    69,   156,   171,
599    157,   114,    64,   151,   281,   123,   115,   167,   182,    64,
600    116,   177,   285,   291,   189,   210,   192,   116,   210,   195,
601    289,   200,   186,   198,   203,   224,   255,   226,   225,   227,
602    246,   252,   253,   315,   272,   324,    30,   274,   275,    31,
603     32,   276,    33,   277,   278,   124,   279,    34,    35,   280,
604     36,    37,   323,   321,    38,    39,    40,    41,    42,    43,
605    282,    44,   283,    45,   284,    46,    47,   286,   287,   288,
606      5,    48,   290,    49,    50,   309,   310,    51,   314,    52,
607     53,    54,   317,    55,   318,    56,   327,   337,   345,   339,
608    338,    57,   353,   105,    72,   107,    58,   108,    59,   187,
609     60,    61,   236,    62,   303,   341,   326,   267,    63,   169,
610    136,    64,   305,   351,   244,    65,     0,     0,   101,     0,
611     66,    30,    67,     0,    31,    32,     0,    33,     0,    68,
612      0,     0,   102,    69,     0,    36,   103,     3,     0,    38,
613     39,    40,    41,     0,    43,     0,    44,     0,    45,     0,
614     46,    47,  -172,     0,     0,     0,     0,     0,    49,     0,
615      0,     0,     0,     0,    52,    53,    54,     0,    55,     0,
616     56,     0,  -172,     0,     0,     0,     0,  -172,     0,     0,
617      0,    58,     0,     0,     0,    60,     0,     0,     0,     0,
618      0,     0,     0,     0,  -172,  -172,     0,     0,  -172,     0,
619     65,   104,     0,     0,     0,    66,    30,    67,     0,    31,
620     32,     0,    33,  -172,     0,  -172,     0,   102,     0,     0,
621     36,   103,     0,     0,    38,    39,    40,     0,     0,    43,
622      0,    44,     0,    45,     0,     0,    47,     0,     0,     0,
623      0,     0,     0,    49,     0,     0,     0,     0,     0,    52,
624     53,    54,     0,    55,    30,    56,     0,    31,    32,     0,
625     33,     0,     0,     0,     0,   102,    58,     0,    36,   103,
626     60,     0,    38,    39,    40,     0,     0,    43,     0,    44,
627      0,    45,   198,     0,    47,    65,     0,     0,     0,     0,
628     66,    49,    67,     0,     0,     0,     0,    52,    53,    54,
629      0,    55,    30,    56,     0,    31,    32,     0,    33,     0,
630      0,     0,     0,   102,    58,     0,    36,   103,    60,     0,
631     38,    39,    40,     0,     0,    43,     0,    44,     0,    45,
632      0,     0,    47,    65,     0,   201,     0,     0,    66,    49,
633     67,     0,     0,     0,     0,    52,    53,    54,     0,    55,
634     30,    56,     0,    31,    32,     0,    33,     0,     0,     0,
635      0,   102,    58,     0,    36,   103,    60,     0,    38,    39,
636     40,     0,     0,    43,     0,    44,     0,    45,     0,     0,
637     47,    65,   204,     0,     0,     0,    66,    49,    67,     0,
638      0,     0,     0,    52,    53,    54,     0,    55,     0,    56,
639      0,    30,     0,     0,    31,    32,     0,    33,     0,     0,
640     58,     0,   102,     0,    60,    36,   103,     0,     0,    38,
641     39,    40,     0,     0,    43,     0,    44,     0,    45,    65,
642      0,    47,     0,     0,    66,   206,    67,     0,    49,     0,
643      0,     0,     0,     0,    52,    53,    54,     0,    55,     0,
644     56,     0,     0,     0,     0,     0,     0,     0,     0,     0,
645      0,    58,     0,     0,     0,    60,     0,     0,     0,     0,
646      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
647     65,     0,     0,     0,     0,    66,     0,    67
648 };
649
650 static const short yycheck[] = {    22,
651     32,    22,    34,    16,     9,    29,   156,    29,     1,    34,
652      1,    43,    44,    60,    92,   284,    83,    19,     0,     1,
653     69,    53,    59,    36,    61,    78,    14,    76,    53,    42,
654     83,    59,    50,    21,    81,    83,    68,    69,    20,    32,
655     28,    32,    79,    56,    57,    12,    13,    40,    30,    37,
656    319,    79,    45,    66,   132,    49,    38,    48,    69,    78,
657     78,   330,   140,    91,    88,    76,    84,    69,    83,    97,
658    102,    82,    54,    78,    76,    82,    70,   102,   347,    84,
659     93,    94,    95,    72,    97,    78,    99,    78,   101,   121,
660    103,    84,   115,    84,    82,    39,    78,    78,   134,   122,
661    136,    82,   134,   125,   136,   127,   129,   257,   279,    59,
662    260,    78,    85,   284,   137,    59,    59,    84,    61,   141,
663    152,   143,   154,    67,   156,   147,   148,    78,   160,    79,
664     85,    59,   164,    84,    78,    82,    79,    85,   170,    78,
665    172,    59,   174,    87,    87,    89,    90,    35,    78,    92,
666     83,    79,    14,    71,   186,    99,   100,   101,   102,    21,
667     78,    79,   185,    91,    78,    59,    28,    55,   200,   192,
668     84,   194,    60,    83,    83,    37,   208,    71,    59,    83,
669     61,   213,    83,   101,   160,    79,    86,    87,   164,    77,
670     78,    91,    59,    81,    61,    26,    83,    78,    79,    59,
671     83,    61,   225,    78,    78,    78,    87,   101,    96,    87,
672     98,    78,    79,    82,   237,    78,    83,    82,    60,    79,
673     87,    85,   245,   255,    74,   257,    78,    87,   260,    62,
674    252,    85,    91,    80,    87,    84,    91,    78,    86,    78,
675     84,    78,    78,    19,    84,    46,     4,    82,    78,     7,
676      8,    78,    10,    85,    78,    83,    85,    15,    16,    82,
677     18,    19,   285,   284,    22,    23,    24,    25,    26,    27,
678     78,    29,    85,    31,    85,    33,    34,    84,    78,    85,
679     38,    39,    85,    41,    42,    82,    82,    45,    82,    47,
680     48,    49,    84,    51,    82,    53,    82,    82,    78,    83,
681    323,    59,     0,    29,    22,    29,    64,    29,    66,   131,
682     68,    69,   184,    71,   271,   338,   290,   215,    76,   100,
683     49,    79,   271,   349,   190,    83,    -1,    -1,     1,    -1,
684     88,     4,    90,    -1,     7,     8,    -1,    10,    -1,    97,
685     -1,    -1,    15,   101,    -1,    18,    19,    20,    -1,    22,
686     23,    24,    25,    -1,    27,    -1,    29,    -1,    31,    -1,
687     33,    34,    35,    -1,    -1,    -1,    -1,    -1,    41,    -1,
688     -1,    -1,    -1,    -1,    47,    48,    49,    -1,    51,    -1,
689     53,    -1,    55,    -1,    -1,    -1,    -1,    60,    -1,    -1,
690     -1,    64,    -1,    -1,    -1,    68,    -1,    -1,    -1,    -1,
691     -1,    -1,    -1,    -1,    77,    78,    -1,    -1,    81,    -1,
692     83,    84,    -1,    -1,    -1,    88,     4,    90,    -1,     7,
693      8,    -1,    10,    96,    -1,    98,    -1,    15,    -1,    -1,
694     18,    19,    -1,    -1,    22,    23,    24,    -1,    -1,    27,
695     -1,    29,    -1,    31,    -1,    -1,    34,    -1,    -1,    -1,
696     -1,    -1,    -1,    41,    -1,    -1,    -1,    -1,    -1,    47,
697     48,    49,    -1,    51,     4,    53,    -1,     7,     8,    -1,
698     10,    -1,    -1,    -1,    -1,    15,    64,    -1,    18,    19,
699     68,    -1,    22,    23,    24,    -1,    -1,    27,    -1,    29,
700     -1,    31,    80,    -1,    34,    83,    -1,    -1,    -1,    -1,
701     88,    41,    90,    -1,    -1,    -1,    -1,    47,    48,    49,
702     -1,    51,     4,    53,    -1,     7,     8,    -1,    10,    -1,
703     -1,    -1,    -1,    15,    64,    -1,    18,    19,    68,    -1,
704     22,    23,    24,    -1,    -1,    27,    -1,    29,    -1,    31,
705     -1,    -1,    34,    83,    -1,    85,    -1,    -1,    88,    41,
706     90,    -1,    -1,    -1,    -1,    47,    48,    49,    -1,    51,
707      4,    53,    -1,     7,     8,    -1,    10,    -1,    -1,    -1,
708     -1,    15,    64,    -1,    18,    19,    68,    -1,    22,    23,
709     24,    -1,    -1,    27,    -1,    29,    -1,    31,    -1,    -1,
710     34,    83,    84,    -1,    -1,    -1,    88,    41,    90,    -1,
711     -1,    -1,    -1,    47,    48,    49,    -1,    51,    -1,    53,
712     -1,     4,    -1,    -1,     7,     8,    -1,    10,    -1,    -1,
713     64,    -1,    15,    -1,    68,    18,    19,    -1,    -1,    22,
714     23,    24,    -1,    -1,    27,    -1,    29,    -1,    31,    83,
715     -1,    34,    -1,    -1,    88,    89,    90,    -1,    41,    -1,
716     -1,    -1,    -1,    -1,    47,    48,    49,    -1,    51,    -1,
717     53,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
718     -1,    64,    -1,    -1,    -1,    68,    -1,    -1,    -1,    -1,
719     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
720     83,    -1,    -1,    -1,    -1,    88,    -1,    90
721 };
722 #define YYPURE 1
723
724 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
725 #line 3 "/usr/lib/bison.simple"
726
727 /* Skeleton output parser for bison,
728    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
729
730    This program is free software; you can redistribute it and/or modify
731    it under the terms of the GNU General Public License as published by
732    the Free Software Foundation; either version 2, or (at your option)
733    any later version.
734
735    This program is distributed in the hope that it will be useful,
736    but WITHOUT ANY WARRANTY; without even the implied warranty of
737    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
738    GNU General Public License for more details.
739
740    You should have received a copy of the GNU General Public License
741    along with this program; if not, write to the Free Software
742    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
743
744 /* As a special exception, when this file is copied by Bison into a
745    Bison output file, you may use that output file without restriction.
746    This special exception was added by the Free Software Foundation
747    in version 1.24 of Bison.  */
748
749 #ifndef alloca
750 #ifdef __GNUC__
751 #define alloca __builtin_alloca
752 #else /* not GNU C.  */
753 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
754 #include <alloca.h>
755 #else /* not sparc */
756 #if defined (MSDOS) && !defined (__TURBOC__)
757 #include <malloc.h>
758 #else /* not MSDOS, or __TURBOC__ */
759 #if defined(_AIX)
760 #include <malloc.h>
761  #pragma alloca
762 #else /* not MSDOS, __TURBOC__, or _AIX */
763 #ifdef __hpux
764 #ifdef __cplusplus
765 extern "C" {
766 void *alloca (unsigned int);
767 };
768 #else /* not __cplusplus */
769 void *alloca ();
770 #endif /* not __cplusplus */
771 #endif /* __hpux */
772 #endif /* not _AIX */
773 #endif /* not MSDOS, or __TURBOC__ */
774 #endif /* not sparc.  */
775 #endif /* not GNU C.  */
776 #endif /* alloca not defined.  */
777
778 /* This is the parser code that is written into each bison parser
779   when the %semantic_parser declaration is not specified in the grammar.
780   It was written by Richard Stallman by simplifying the hairy parser
781   used when %semantic_parser is specified.  */
782
783 /* Note: there must be only one dollar sign in this file.
784    It is replaced by the list of actions, each action
785    as one case of the switch.  */
786
787 #define yyerrok         (yyerrstatus = 0)
788 #define yyclearin       (yychar = YYEMPTY)
789 #define YYEMPTY         -2
790 #define YYEOF           0
791 #define YYACCEPT        return(0)
792 #define YYABORT         return(1)
793 #define YYERROR         goto yyerrlab1
794 /* Like YYERROR except do call yyerror.
795    This remains here temporarily to ease the
796    transition to the new meaning of YYERROR, for GCC.
797    Once GCC version 2 has supplanted version 1, this can go.  */
798 #define YYFAIL          goto yyerrlab
799 #define YYRECOVERING()  (!!yyerrstatus)
800 #define YYBACKUP(token, value) \
801 do                                                              \
802   if (yychar == YYEMPTY && yylen == 1)                          \
803     { yychar = (token), yylval = (value);                       \
804       yychar1 = YYTRANSLATE (yychar);                           \
805       YYPOPSTACK;                                               \
806       goto yybackup;                                            \
807     }                                                           \
808   else                                                          \
809     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
810 while (0)
811
812 #define YYTERROR        1
813 #define YYERRCODE       256
814
815 #ifndef YYPURE
816 #define YYLEX           yylex()
817 #endif
818
819 #ifdef YYPURE
820 #ifdef YYLSP_NEEDED
821 #ifdef YYLEX_PARAM
822 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
823 #else
824 #define YYLEX           yylex(&yylval, &yylloc)
825 #endif
826 #else /* not YYLSP_NEEDED */
827 #ifdef YYLEX_PARAM
828 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
829 #else
830 #define YYLEX           yylex(&yylval)
831 #endif
832 #endif /* not YYLSP_NEEDED */
833 #endif
834
835 /* If nonreentrant, generate the variables here */
836
837 #ifndef YYPURE
838
839 int     yychar;                 /*  the lookahead symbol                */
840 YYSTYPE yylval;                 /*  the semantic value of the           */
841                                 /*  lookahead symbol                    */
842
843 #ifdef YYLSP_NEEDED
844 YYLTYPE yylloc;                 /*  location data for the lookahead     */
845                                 /*  symbol                              */
846 #endif
847
848 int yynerrs;                    /*  number of parse errors so far       */
849 #endif  /* not YYPURE */
850
851 #if YYDEBUG != 0
852 int yydebug;                    /*  nonzero means print parse trace     */
853 /* Since this is uninitialized, it does not stop multiple parsers
854    from coexisting.  */
855 #endif
856
857 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
858
859 #ifndef YYINITDEPTH
860 #define YYINITDEPTH 200
861 #endif
862
863 /*  YYMAXDEPTH is the maximum size the stacks can grow to
864     (effective only if the built-in stack extension method is used).  */
865
866 #if YYMAXDEPTH == 0
867 #undef YYMAXDEPTH
868 #endif
869
870 #ifndef YYMAXDEPTH
871 #define YYMAXDEPTH 10000
872 #endif
873
874 /* Prevent warning if -Wstrict-prototypes.  */
875 #ifdef __GNUC__
876 int yyparse (void);
877 #endif
878 \f
879 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
880 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
881 #else                           /* not GNU C or C++ */
882 #ifndef __cplusplus
883
884 /* This is the most reliable way to avoid incompatibilities
885    in available built-in functions on various systems.  */
886 static void
887 __yy_memcpy (to, from, count)
888      char *to;
889      char *from;
890      int count;
891 {
892   register char *f = from;
893   register char *t = to;
894   register int i = count;
895
896   while (i-- > 0)
897     *t++ = *f++;
898 }
899
900 #else /* __cplusplus */
901
902 /* This is the most reliable way to avoid incompatibilities
903    in available built-in functions on various systems.  */
904 static void
905 __yy_memcpy (char *to, char *from, int count)
906 {
907   register char *f = from;
908   register char *t = to;
909   register int i = count;
910
911   while (i-- > 0)
912     *t++ = *f++;
913 }
914
915 #endif
916 #endif
917 \f
918 #line 196 "/usr/lib/bison.simple"
919
920 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
921    into yyparse.  The argument should have type void *.
922    It should actually point to an object.
923    Grammar actions can access the variable by casting it
924    to the proper pointer type.  */
925
926 #ifdef YYPARSE_PARAM
927 #ifdef __cplusplus
928 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
929 #define YYPARSE_PARAM_DECL
930 #else /* not __cplusplus */
931 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
932 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
933 #endif /* not __cplusplus */
934 #else /* not YYPARSE_PARAM */
935 #define YYPARSE_PARAM_ARG
936 #define YYPARSE_PARAM_DECL
937 #endif /* not YYPARSE_PARAM */
938
939 int
940 yyparse(YYPARSE_PARAM_ARG)
941      YYPARSE_PARAM_DECL
942 {
943   register int yystate;
944   register int yyn;
945   register short *yyssp;
946   register YYSTYPE *yyvsp;
947   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
948   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
949
950   short yyssa[YYINITDEPTH];     /*  the state stack                     */
951   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
952
953   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
954   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
955
956 #ifdef YYLSP_NEEDED
957   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
958   YYLTYPE *yyls = yylsa;
959   YYLTYPE *yylsp;
960
961 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
962 #else
963 #define YYPOPSTACK   (yyvsp--, yyssp--)
964 #endif
965
966   int yystacksize = YYINITDEPTH;
967
968 #ifdef YYPURE
969   int yychar;
970   YYSTYPE yylval;
971   int yynerrs;
972 #ifdef YYLSP_NEEDED
973   YYLTYPE yylloc;
974 #endif
975 #endif
976
977   YYSTYPE yyval;                /*  the variable used to return         */
978                                 /*  semantic values from the action     */
979                                 /*  routines                            */
980
981   int yylen;
982
983 #if YYDEBUG != 0
984   if (yydebug)
985     fprintf(stderr, "Starting parse\n");
986 #endif
987
988   yystate = 0;
989   yyerrstatus = 0;
990   yynerrs = 0;
991   yychar = YYEMPTY;             /* Cause a token to be read.  */
992
993   /* Initialize stack pointers.
994      Waste one element of value and location stack
995      so that they stay on the same level as the state stack.
996      The wasted elements are never initialized.  */
997
998   yyssp = yyss - 1;
999   yyvsp = yyvs;
1000 #ifdef YYLSP_NEEDED
1001   yylsp = yyls;
1002 #endif
1003
1004 /* Push a new state, which is found in  yystate  .  */
1005 /* In all cases, when you get here, the value and location stacks
1006    have just been pushed. so pushing a state here evens the stacks.  */
1007 yynewstate:
1008
1009   *++yyssp = yystate;
1010
1011   if (yyssp >= yyss + yystacksize - 1)
1012     {
1013       /* Give user a chance to reallocate the stack */
1014       /* Use copies of these so that the &'s don't force the real ones into memory. */
1015       YYSTYPE *yyvs1 = yyvs;
1016       short *yyss1 = yyss;
1017 #ifdef YYLSP_NEEDED
1018       YYLTYPE *yyls1 = yyls;
1019 #endif
1020
1021       /* Get the current used size of the three stacks, in elements.  */
1022       int size = yyssp - yyss + 1;
1023
1024 #ifdef yyoverflow
1025       /* Each stack pointer address is followed by the size of
1026          the data in use in that stack, in bytes.  */
1027 #ifdef YYLSP_NEEDED
1028       /* This used to be a conditional around just the two extra args,
1029          but that might be undefined if yyoverflow is a macro.  */
1030       yyoverflow("parser stack overflow",
1031                  &yyss1, size * sizeof (*yyssp),
1032                  &yyvs1, size * sizeof (*yyvsp),
1033                  &yyls1, size * sizeof (*yylsp),
1034                  &yystacksize);
1035 #else
1036       yyoverflow("parser stack overflow",
1037                  &yyss1, size * sizeof (*yyssp),
1038                  &yyvs1, size * sizeof (*yyvsp),
1039                  &yystacksize);
1040 #endif
1041
1042       yyss = yyss1; yyvs = yyvs1;
1043 #ifdef YYLSP_NEEDED
1044       yyls = yyls1;
1045 #endif
1046 #else /* no yyoverflow */
1047       /* Extend the stack our own way.  */
1048       if (yystacksize >= YYMAXDEPTH)
1049         {
1050           yyerror("parser stack overflow");
1051           return 2;
1052         }
1053       yystacksize *= 2;
1054       if (yystacksize > YYMAXDEPTH)
1055         yystacksize = YYMAXDEPTH;
1056       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
1057       __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
1058       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
1059       __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
1060 #ifdef YYLSP_NEEDED
1061       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
1062       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
1063 #endif
1064 #endif /* no yyoverflow */
1065
1066       yyssp = yyss + size - 1;
1067       yyvsp = yyvs + size - 1;
1068 #ifdef YYLSP_NEEDED
1069       yylsp = yyls + size - 1;
1070 #endif
1071
1072 #if YYDEBUG != 0
1073       if (yydebug)
1074         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1075 #endif
1076
1077       if (yyssp >= yyss + yystacksize - 1)
1078         YYABORT;
1079     }
1080
1081 #if YYDEBUG != 0
1082   if (yydebug)
1083     fprintf(stderr, "Entering state %d\n", yystate);
1084 #endif
1085
1086   goto yybackup;
1087  yybackup:
1088
1089 /* Do appropriate processing given the current state.  */
1090 /* Read a lookahead token if we need one and don't already have one.  */
1091 /* yyresume: */
1092
1093   /* First try to decide what to do without reference to lookahead token.  */
1094
1095   yyn = yypact[yystate];
1096   if (yyn == YYFLAG)
1097     goto yydefault;
1098
1099   /* Not known => get a lookahead token if don't already have one.  */
1100
1101   /* yychar is either YYEMPTY or YYEOF
1102      or a valid token in external form.  */
1103
1104   if (yychar == YYEMPTY)
1105     {
1106 #if YYDEBUG != 0
1107       if (yydebug)
1108         fprintf(stderr, "Reading a token: ");
1109 #endif
1110       yychar = YYLEX;
1111     }
1112
1113   /* Convert token to internal form (in yychar1) for indexing tables with */
1114
1115   if (yychar <= 0)              /* This means end of input. */
1116     {
1117       yychar1 = 0;
1118       yychar = YYEOF;           /* Don't call YYLEX any more */
1119
1120 #if YYDEBUG != 0
1121       if (yydebug)
1122         fprintf(stderr, "Now at end of input.\n");
1123 #endif
1124     }
1125   else
1126     {
1127       yychar1 = YYTRANSLATE(yychar);
1128
1129 #if YYDEBUG != 0
1130       if (yydebug)
1131         {
1132           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1133           /* Give the individual parser a way to print the precise meaning
1134              of a token, for further debugging info.  */
1135 #ifdef YYPRINT
1136           YYPRINT (stderr, yychar, yylval);
1137 #endif
1138           fprintf (stderr, ")\n");
1139         }
1140 #endif
1141     }
1142
1143   yyn += yychar1;
1144   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1145     goto yydefault;
1146
1147   yyn = yytable[yyn];
1148
1149   /* yyn is what to do for this token type in this state.
1150      Negative => reduce, -yyn is rule number.
1151      Positive => shift, yyn is new state.
1152        New state is final state => don't bother to shift,
1153        just return success.
1154      0, or most negative number => error.  */
1155
1156   if (yyn < 0)
1157     {
1158       if (yyn == YYFLAG)
1159         goto yyerrlab;
1160       yyn = -yyn;
1161       goto yyreduce;
1162     }
1163   else if (yyn == 0)
1164     goto yyerrlab;
1165
1166   if (yyn == YYFINAL)
1167     YYACCEPT;
1168
1169   /* Shift the lookahead token.  */
1170
1171 #if YYDEBUG != 0
1172   if (yydebug)
1173     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1174 #endif
1175
1176   /* Discard the token being shifted unless it is eof.  */
1177   if (yychar != YYEOF)
1178     yychar = YYEMPTY;
1179
1180   *++yyvsp = yylval;
1181 #ifdef YYLSP_NEEDED
1182   *++yylsp = yylloc;
1183 #endif
1184
1185   /* count tokens shifted since error; after three, turn off error status.  */
1186   if (yyerrstatus) yyerrstatus--;
1187
1188   yystate = yyn;
1189   goto yynewstate;
1190
1191 /* Do the default action for the current state.  */
1192 yydefault:
1193
1194   yyn = yydefact[yystate];
1195   if (yyn == 0)
1196     goto yyerrlab;
1197
1198 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
1199 yyreduce:
1200   yylen = yyr2[yyn];
1201   if (yylen > 0)
1202     yyval = yyvsp[1-yylen]; /* implement default value of the action */
1203
1204 #if YYDEBUG != 0
1205   if (yydebug)
1206     {
1207       int i;
1208
1209       fprintf (stderr, "Reducing via rule %d (line %d), ",
1210                yyn, yyrline[yyn]);
1211
1212       /* Print the symbols being reduced, and their result.  */
1213       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1214         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1215       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1216     }
1217 #endif
1218
1219
1220   switch (yyn) {
1221
1222 case 2:
1223 #line 259 "parser.yy"
1224 {
1225                 delete THIS->default_header_p_ ;
1226                 THIS->default_header_p_ = yyvsp[0].header;
1227         ;
1228     break;}
1229 case 3:
1230 #line 263 "parser.yy"
1231 {
1232                 add_score (yyvsp[0].score);
1233         ;
1234     break;}
1235 case 4:
1236 #line 266 "parser.yy"
1237 { ;
1238     break;}
1239 case 6:
1240 #line 268 "parser.yy"
1241 { ;
1242     break;}
1243 case 7:
1244 #line 269 "parser.yy"
1245 { ;
1246     break;}
1247 case 8:
1248 #line 273 "parser.yy"
1249 {
1250                 if (String (*yyvsp[-1].string) != MUDELA_VERSION) {
1251                         if (THIS->ignore_version_b_) {
1252                                 THIS->here_input ().error ("Incorrect mudela version");
1253                         } else {
1254                                 THIS->fatal_error_i_ = 1;
1255                                 THIS->parser_error ("Incorrect mudela version");
1256                         }
1257                 }
1258         ;
1259     break;}
1260 case 10:
1261 #line 289 "parser.yy"
1262 {
1263         ;
1264     break;}
1265 case 11:
1266 #line 291 "parser.yy"
1267 {
1268                 THIS->clear_notenames ();
1269         ;
1270     break;}
1271 case 12:
1272 #line 294 "parser.yy"
1273 {
1274                 THIS->add_notename (*yyvsp[-2].string, yyvsp[0].melreq);
1275                 delete yyvsp[-2].string;
1276         ;
1277     break;}
1278 case 13:
1279 #line 301 "parser.yy"
1280 {
1281                 yyval.header = new Header;
1282         ;
1283     break;}
1284 case 14:
1285 #line 304 "parser.yy"
1286 {
1287                 (*yyval.header)[*yyvsp[-3].string] = *yyvsp[-1].string;
1288                 delete yyvsp[-3].string;
1289                 delete yyvsp[-1].string;
1290         ;
1291     break;}
1292 case 15:
1293 #line 312 "parser.yy"
1294 {
1295                 yyval.header = yyvsp[-1].header;
1296         ;
1297     break;}
1298 case 16:
1299 #line 319 "parser.yy"
1300 {
1301                 yyval.string = new String;
1302         ;
1303     break;}
1304 case 17:
1305 #line 322 "parser.yy"
1306 {
1307                 *yyval.string += *yyvsp[0].string;
1308         ;
1309     break;}
1310 case 18:
1311 #line 332 "parser.yy"
1312 {
1313                 THIS->remember_spot ();
1314         ;
1315     break;}
1316 case 19:
1317 #line 335 "parser.yy"
1318 {
1319             THIS->lexer_p_->set_identifier (*yyvsp[-3].string, yyvsp[0].id);
1320             yyvsp[0].id->init_b_ = THIS->init_parse_b_;
1321             yyvsp[0].id->set_spot (THIS->pop_spot ());
1322         ;
1323     break;}
1324 case 20:
1325 #line 343 "parser.yy"
1326 {
1327                 yyval.id = new Score_id (yyvsp[0].score, SCORE_IDENTIFIER);
1328
1329         ;
1330     break;}
1331 case 21:
1332 #line 347 "parser.yy"
1333 {
1334                 yyval.id = new Paper_def_id (yyvsp[0].paper, PAPER_IDENTIFIER);
1335
1336         ;
1337     break;}
1338 case 22:
1339 #line 351 "parser.yy"
1340 {
1341                 yyval.id = new Midi_def_id (yyvsp[0].midi, MIDI_IDENTIFIER);
1342
1343         ;
1344     break;}
1345 case 23:
1346 #line 355 "parser.yy"
1347 {
1348                 yyval.id = new Script_id (yyvsp[0].script, SCRIPT_IDENTIFIER);
1349
1350         ;
1351     break;}
1352 case 24:
1353 #line 359 "parser.yy"
1354 {
1355                 yyval.id = new Music_id (yyvsp[0].music, MUSIC_IDENTIFIER);
1356
1357         ;
1358     break;}
1359 case 25:
1360 #line 363 "parser.yy"
1361 {
1362                 yyval.id = new Lookup_id (yyvsp[0].lookup, IDENTIFIER);
1363
1364         ;
1365     break;}
1366 case 26:
1367 #line 367 "parser.yy"
1368 {
1369                 yyval.id = new Real_id (new Real (yyvsp[0].real), REAL_IDENTIFIER);
1370
1371         ;
1372     break;}
1373 case 27:
1374 #line 371 "parser.yy"
1375 {
1376                 yyval.id = new Int_id (new int (yyvsp[0].i), INT_IDENTIFIER);
1377         ;
1378     break;}
1379 case 28:
1380 #line 374 "parser.yy"
1381 {
1382                 yyval.id = new Request_id (yyvsp[0].request, POST_REQUEST_IDENTIFIER);
1383         ;
1384     break;}
1385 case 29:
1386 #line 377 "parser.yy"
1387 {
1388                 yyval.id = new Request_id (yyvsp[0].melreq, MELODIC_REQUEST_IDENTIFIER);
1389
1390         ;
1391     break;}
1392 case 30:
1393 #line 381 "parser.yy"
1394 {
1395                 yyval.id = new Translator_id (yyvsp[0].trans, TRANS_IDENTIFIER);
1396         ;
1397     break;}
1398 case 31:
1399 #line 384 "parser.yy"
1400 {
1401                 yyval.id = new Duration_id (yyvsp[0].duration, DURATION_IDENTIFIER);
1402         ;
1403     break;}
1404 case 32:
1405 #line 393 "parser.yy"
1406 { yyval.trans = yyvsp[-1].trans; ;
1407     break;}
1408 case 33:
1409 #line 397 "parser.yy"
1410 {
1411                 yyval.trans = yyvsp[0].id->translator ();
1412                 yyval.trans-> set_spot (THIS->here_input ());
1413         ;
1414     break;}
1415 case 34:
1416 #line 401 "parser.yy"
1417 {
1418                 yyval.trans = get_translator_l (*yyvsp[-1].string)->clone ();
1419                 yyval.trans->set_spot (THIS->here_input ());
1420                 delete yyvsp[-1].string;
1421         ;
1422     break;}
1423 case 35:
1424 #line 406 "parser.yy"
1425 {
1426                 yyval.trans-> set_property (*yyvsp[-3].string, *yyvsp[-1].scalar);
1427                 delete yyvsp[-3].string;
1428                 delete yyvsp[-1].scalar;
1429         ;
1430     break;}
1431 case 36:
1432 #line 411 "parser.yy"
1433 {
1434                 yyval.trans->group_l ()->consists_str_arr_.push (*yyvsp[-1].string);
1435                 delete yyvsp[-1].string;
1436         ;
1437     break;}
1438 case 37:
1439 #line 415 "parser.yy"
1440 {
1441                 yyval.trans->group_l ()->accepts_str_arr_.push (*yyvsp[-1].string);
1442                 delete yyvsp[-1].string;
1443         ;
1444     break;}
1445 case 38:
1446 #line 425 "parser.yy"
1447 { THIS->remember_spot ();
1448                 THIS->error_level_i_ =0;
1449         ;
1450     break;}
1451 case 39:
1452 #line 428 "parser.yy"
1453 {
1454                 yyval.score = yyvsp[-1].score;
1455                 yyval.score->set_spot (THIS->pop_spot ());
1456                 if (!yyval.score->def_p_arr_.size ())
1457                         yyval.score->add (THIS->default_paper ());
1458
1459                 /* handle error levels. */
1460                 yyval.score->errorlevel_i_ = THIS->error_level_i_;
1461                 THIS->error_level_i_ = 0;
1462                 if (!yyval.score->header_p_ && THIS->default_header_p_)
1463                         yyval.score->header_p_ = new Header (*THIS->default_header_p_);
1464         ;
1465     break;}
1466 case 40:
1467 #line 442 "parser.yy"
1468 {
1469                 yyval.score = new Score;
1470         ;
1471     break;}
1472 case 41:
1473 #line 445 "parser.yy"
1474 {
1475                 yyval.score = yyvsp[0].id->score ();
1476         ;
1477     break;}
1478 case 42:
1479 #line 448 "parser.yy"
1480 {
1481                 yyval.score->header_p_ = yyvsp[0].header;
1482         ;
1483     break;}
1484 case 43:
1485 #line 451 "parser.yy"
1486 {
1487                 if (yyval.score->music_p_)
1488                         yyvsp[0].music->warning ("More than one music block");  
1489                 yyval.score->music_p_ = yyvsp[0].music;
1490         ;
1491     break;}
1492 case 44:
1493 #line 456 "parser.yy"
1494 {
1495                 yyval.score->add (yyvsp[0].outputdef);
1496         ;
1497     break;}
1498 case 45:
1499 #line 459 "parser.yy"
1500 {
1501
1502         ;
1503     break;}
1504 case 46:
1505 #line 465 "parser.yy"
1506 {
1507                 yyval.outputdef = yyvsp[0].paper;
1508         ;
1509     break;}
1510 case 47:
1511 #line 468 "parser.yy"
1512 {
1513                 yyval.outputdef= yyvsp[0].midi;
1514         ;
1515     break;}
1516 case 48:
1517 #line 474 "parser.yy"
1518 { yyval.intvec =new Array<int>; ;
1519     break;}
1520 case 49:
1521 #line 475 "parser.yy"
1522 {
1523                 yyval.intvec->push (yyvsp[-2].i); yyval.intvec->push (yyvsp[0].i);
1524         ;
1525     break;}
1526 case 50:
1527 #line 486 "parser.yy"
1528 { yyval.paper = yyvsp[-1].paper; ;
1529     break;}
1530 case 51:
1531 #line 490 "parser.yy"
1532 {
1533                 yyval.paper = THIS->default_paper ();
1534         ;
1535     break;}
1536 case 52:
1537 #line 493 "parser.yy"
1538 {
1539                 yyval.paper = yyvsp[0].id->paperdef ();
1540         ;
1541     break;}
1542 case 53:
1543 #line 496 "parser.yy"
1544
1545                 yyval.paper->outfile_str_ = *yyvsp[-1].string;
1546                 delete yyvsp[-1].string;
1547         ;
1548     break;}
1549 case 54:
1550 #line 500 "parser.yy"
1551 { yyval.paper->set (yyvsp[0].lookup); ;
1552     break;}
1553 case 55:
1554 #line 501 "parser.yy"
1555 {
1556                 yyval.paper->set_var (*yyvsp[-3].string, yyvsp[-1].real);
1557         ;
1558     break;}
1559 case 56:
1560 #line 504 "parser.yy"
1561 {
1562                 yyval.paper->set_var (*yyvsp[-3].string, yyvsp[-1].real);
1563         ;
1564     break;}
1565 case 57:
1566 #line 507 "parser.yy"
1567 {
1568                 yyval.paper-> assign_translator (*yyvsp[-2].string, yyvsp[0].trans);
1569                 delete yyvsp[-2].string;
1570         ;
1571     break;}
1572 case 58:
1573 #line 511 "parser.yy"
1574 {
1575                 yyval.paper->shape_int_a_ = *yyvsp[-1].intarr;
1576                 delete yyvsp[-1].intarr;
1577         ;
1578     break;}
1579 case 59:
1580 #line 515 "parser.yy"
1581 {
1582
1583         ;
1584     break;}
1585 case 60:
1586 #line 521 "parser.yy"
1587 {
1588                 yyval.intarr = new Array<Interval>;
1589         ;
1590     break;}
1591 case 61:
1592 #line 524 "parser.yy"
1593 {
1594                 yyval.intarr->push(Interval(yyvsp[-1].real, yyvsp[-1].real + yyvsp[0].real));
1595         ;
1596     break;}
1597 case 62:
1598 #line 534 "parser.yy"
1599 { yyval.midi = yyvsp[-1].midi; ;
1600     break;}
1601 case 63:
1602 #line 537 "parser.yy"
1603 {
1604                 yyval.midi = THIS->default_midi ();
1605         ;
1606     break;}
1607 case 64:
1608 #line 540 "parser.yy"
1609 {
1610                 yyval.midi-> assign_translator (*yyvsp[-2].string, yyvsp[0].trans);
1611                 delete yyvsp[-2].string;
1612         ;
1613     break;}
1614 case 65:
1615 #line 544 "parser.yy"
1616 {
1617                 yyval.midi->outfile_str_ = *yyvsp[-1].string;
1618                 delete yyvsp[-1].string;
1619         ;
1620     break;}
1621 case 66:
1622 #line 548 "parser.yy"
1623 {
1624                 yyval.midi->set_tempo (yyvsp[-1].tempo->dur_.length (), yyvsp[-1].tempo->metronome_i_);
1625                 delete yyvsp[-1].tempo;
1626         ;
1627     break;}
1628 case 67:
1629 #line 552 "parser.yy"
1630 {
1631
1632         ;
1633     break;}
1634 case 68:
1635 #line 558 "parser.yy"
1636 {
1637                 yyval.tempo = new Tempo_req;
1638                 yyval.tempo->dur_ = *yyvsp[-2].duration;
1639                 delete yyvsp[-2].duration;
1640                 yyval.tempo-> metronome_i_ = yyvsp[0].i;
1641         ;
1642     break;}
1643 case 69:
1644 #line 571 "parser.yy"
1645 {
1646                 yyval.musiclist = yyvsp[-1].musiclist;
1647         ;
1648     break;}
1649 case 70:
1650 #line 577 "parser.yy"
1651 {
1652                 yyval.musiclist = new Voice;
1653                 yyval.musiclist->set_spot (THIS->here_input ());
1654         ;
1655     break;}
1656 case 71:
1657 #line 581 "parser.yy"
1658 {
1659                 yyval.musiclist->add (yyvsp[0].music);
1660         ;
1661     break;}
1662 case 72:
1663 #line 587 "parser.yy"
1664 { yyval.music = yyvsp[0].music; ;
1665     break;}
1666 case 73:
1667 #line 588 "parser.yy"
1668 {
1669                 yyval.music = yyvsp[0].music;
1670                 yyval.music->translator_type_str_ = *yyvsp[-1].string;
1671                 delete yyvsp[-1].string;
1672         ;
1673     break;}
1674 case 74:
1675 #line 593 "parser.yy"
1676 {
1677                 yyval.music = yyvsp[0].music;
1678                 yyval.music->translator_type_str_ = *yyvsp[-3].string;
1679                 yyval.music->translator_id_str_ = *yyvsp[-1].string;
1680                 delete yyvsp[-3].string;
1681                 delete yyvsp[-1].string;
1682         ;
1683     break;}
1684 case 75:
1685 #line 600 "parser.yy"
1686 { yyval.music = yyvsp[0].musiclist; ;
1687     break;}
1688 case 76:
1689 #line 601 "parser.yy"
1690 { yyval.music = yyvsp[0].chord; ;
1691     break;}
1692 case 77:
1693 #line 602 "parser.yy"
1694 { yyval.music = yyvsp[0].music; ;
1695     break;}
1696 case 78:
1697 #line 603 "parser.yy"
1698 { yyval.music = yyvsp[0].id->music (); ;
1699     break;}
1700 case 79:
1701 #line 604 "parser.yy"
1702 { yyval.music = yyvsp[-1].id->music (); ;
1703     break;}
1704 case 80:
1705 #line 606 "parser.yy"
1706 { THIS->lexer_p_->push_note_state (); ;
1707     break;}
1708 case 81:
1709 #line 608 "parser.yy"
1710 { yyval.music=yyvsp[0].music; THIS->lexer_p_->pop_state (); ;
1711     break;}
1712 case 82:
1713 #line 611 "parser.yy"
1714 { THIS->lexer_p_->push_lyric_state (); ;
1715     break;}
1716 case 83:
1717 #line 613 "parser.yy"
1718 { yyval.music = yyvsp[0].music; THIS->lexer_p_->pop_state (); ;
1719     break;}
1720 case 86:
1721 #line 619 "parser.yy"
1722 {
1723                 Change_translator * t = new Change_translator;
1724                 t-> change_to_type_str_ = *yyvsp[-2].string;
1725                 t-> change_to_id_str_ = *yyvsp[0].string;
1726
1727                 yyval.music = t;
1728                 yyval.music->set_spot (THIS->here_input ());
1729                 delete yyvsp[-2].string;
1730                 delete yyvsp[0].string;
1731         ;
1732     break;}
1733 case 87:
1734 #line 632 "parser.yy"
1735 {
1736                 Translation_property *t = new Translation_property;
1737                 t-> translator_type_str_ = *yyvsp[-4].string;
1738                 t-> var_str_ = *yyvsp[-2].string;
1739                 t-> value_ = *yyvsp[0].scalar;
1740                 yyval.music = t;
1741                 yyval.music->set_spot (THIS->here_input ());
1742                 delete yyvsp[-4].string;
1743                 delete yyvsp[-2].string;
1744                 delete yyvsp[0].scalar;
1745         ;
1746     break;}
1747 case 88:
1748 #line 646 "parser.yy"
1749 { yyval.scalar = new Scalar (*yyvsp[0].string); delete yyvsp[0].string; ;
1750     break;}
1751 case 89:
1752 #line 647 "parser.yy"
1753 { yyval.scalar = new Scalar (yyvsp[0].i); ;
1754     break;}
1755 case 90:
1756 #line 652 "parser.yy"
1757 { yyval.chord  = yyvsp[-1].chord; ;
1758     break;}
1759 case 91:
1760 #line 653 "parser.yy"
1761 {
1762                 yyval.chord = yyvsp[0].chord;
1763                 yyval.chord->multi_level_i_=yyvsp[-1].i;
1764         ;
1765     break;}
1766 case 92:
1767 #line 660 "parser.yy"
1768 {
1769                 yyval.chord = new Chord;
1770                 yyval.chord-> multi_level_i_ = 1;
1771                 yyval.chord->set_spot (THIS->here_input ());
1772         ;
1773     break;}
1774 case 93:
1775 #line 665 "parser.yy"
1776 {
1777                 yyval.chord->add (yyvsp[0].music);
1778         ;
1779     break;}
1780 case 94:
1781 #line 671 "parser.yy"
1782 {
1783                 yyval.music = yyvsp[0].music;
1784                 yyval.music -> transpose (yyvsp[-1].melreq);
1785
1786                 delete yyvsp[-1].melreq;
1787         ;
1788     break;}
1789 case 95:
1790 #line 684 "parser.yy"
1791 {
1792                 THIS->add_requests ((Chord*)yyvsp[-1].music);//ugh
1793                 yyval.music = yyvsp[-1].music;
1794         ;
1795     break;}
1796 case 97:
1797 #line 689 "parser.yy"
1798 { yyval.music = 0; ;
1799     break;}
1800 case 100:
1801 #line 698 "parser.yy"
1802 {
1803                 yyval.music = new Request_chord;
1804                 yyval.music-> set_spot (THIS->here_input ());
1805                 yyvsp[0].request-> set_spot (THIS->here_input ());
1806                 ((Chord*)yyval.music) ->add (yyvsp[0].request);//ugh
1807
1808         ;
1809     break;}
1810 case 102:
1811 #line 709 "parser.yy"
1812 { yyval.request = yyvsp[-1].request; ;
1813     break;}
1814 case 103:
1815 #line 713 "parser.yy"
1816 {
1817                 yyval.request = new Barcheck_req;
1818         ;
1819     break;}
1820 case 104:
1821 #line 716 "parser.yy"
1822 {
1823                 yyval.request = yyvsp[0].id->request ();
1824         ;
1825     break;}
1826 case 105:
1827 #line 722 "parser.yy"
1828 {
1829                 yyval.request = new Bar_req (*yyvsp[0].string);
1830                 delete yyvsp[0].string;
1831         ;
1832     break;}
1833 case 106:
1834 #line 726 "parser.yy"
1835 {
1836                 Break_force_req * f = new Break_force_req;
1837                 f-> set_spot (THIS->here_input ());
1838                 yyval.request = f;
1839         ;
1840     break;}
1841 case 107:
1842 #line 731 "parser.yy"
1843 {
1844                 Meter_change_req *m = new Meter_change_req;
1845                 m->set (yyvsp[-2].i,yyvsp[0].i);
1846                 yyval.request = m;
1847         ;
1848     break;}
1849 case 108:
1850 #line 736 "parser.yy"
1851 {
1852                 Skip_req * skip_p = new Skip_req;
1853                 skip_p->duration_.set_plet (yyvsp[0].moment->num (),
1854                         yyvsp[0].moment->den ());
1855
1856                 delete yyvsp[0].moment;
1857                 yyval.request = skip_p;
1858         ;
1859     break;}
1860 case 109:
1861 #line 744 "parser.yy"
1862 {
1863                 yyval.request = yyvsp[0].tempo;
1864         ;
1865     break;}
1866 case 110:
1867 #line 747 "parser.yy"
1868 {
1869                 yyval.request = new Cadenza_req (yyvsp[0].i);
1870         ;
1871     break;}
1872 case 111:
1873 #line 750 "parser.yy"
1874 {
1875                 yyval.request = new Partial_measure_req (*yyvsp[0].moment);
1876                 delete yyvsp[0].moment;
1877         ;
1878     break;}
1879 case 112:
1880 #line 754 "parser.yy"
1881 {
1882                 yyval.request = new Clef_change_req (*yyvsp[0].string);
1883                 delete yyvsp[0].string;
1884         ;
1885     break;}
1886 case 113:
1887 #line 758 "parser.yy"
1888 {
1889                 Key_change_req *key_p= new Key_change_req;
1890                 key_p->melodic_p_arr_ = *yyvsp[0].melreqvec;
1891                 yyval.request = key_p;
1892                 delete yyvsp[0].melreqvec;
1893         ;
1894     break;}
1895 case 114:
1896 #line 764 "parser.yy"
1897 {
1898                 yyval.request = get_grouping_req (*yyvsp[0].intvec); delete yyvsp[0].intvec;
1899         ;
1900     break;}
1901 case 115:
1902 #line 770 "parser.yy"
1903 {
1904                 /* something silly happened.  Junk this stuff*/
1905                 if (!THIS->post_reqs.empty ())
1906                 {
1907                         warning ("Junking post-requests");
1908                         THIS->post_reqs.clear ();
1909                 }
1910         ;
1911     break;}
1912 case 116:
1913 #line 778 "parser.yy"
1914 {
1915                 yyvsp[0].request->set_spot (THIS->here_input ());
1916                 THIS->post_reqs.push (yyvsp[0].request);
1917         ;
1918     break;}
1919 case 117:
1920 #line 782 "parser.yy"
1921 {
1922                 Array<Request*>& r = *THIS->get_parens_request (yyvsp[0].i);
1923                 for (int i = 0; i < r.size (); i++ )
1924                         r[i]->set_spot (THIS->here_input ());
1925                 THIS->post_reqs.concat (r);
1926                 delete &r;
1927         ;
1928     break;}
1929 case 120:
1930 #line 797 "parser.yy"
1931 {
1932                 yyval.request = (Request*)yyvsp[0].id->request ();
1933         ;
1934     break;}
1935 case 121:
1936 #line 800 "parser.yy"
1937 {
1938                 yyval.request = yyvsp[0].request;
1939         ;
1940     break;}
1941 case 122:
1942 #line 803 "parser.yy"
1943 {
1944                 Abbreviation_req* a = new Abbreviation_req;
1945                 a->type_i_ = yyvsp[0].i;
1946                 yyval.request = a;
1947         ;
1948     break;}
1949 case 123:
1950 #line 816 "parser.yy"
1951 {
1952                 yyval.melreq = yyvsp[0].melreq->clone ()->musical ()->melodic ();
1953                 yyval.melreq->octave_i_ += THIS->default_octave_i_;
1954         ;
1955     break;}
1956 case 124:
1957 #line 820 "parser.yy"
1958 {
1959                 yyval.melreq-> octave_i_ += yyvsp[0].i;
1960         ;
1961     break;}
1962 case 125:
1963 #line 823 "parser.yy"
1964 {
1965                 yyval.melreq = yyvsp[0].melreq;
1966                 yyvsp[0].melreq-> octave_i_ -= yyvsp[-1].i;
1967         ;
1968     break;}
1969 case 126:
1970 #line 830 "parser.yy"
1971 {
1972                 yyval.notereq = new Note_req;
1973                 * (Melodic_req *) yyval.notereq = *yyvsp[0].melreq;
1974                 delete yyvsp[0].melreq;
1975         ;
1976     break;}
1977 case 127:
1978 #line 835 "parser.yy"
1979 {
1980                 yyval.notereq->forceacc_b_ = ! yyval.notereq->forceacc_b_;
1981         ;
1982     break;}
1983 case 128:
1984 #line 842 "parser.yy"
1985 {/* ugh */
1986                 yyval.melreq = new Melodic_req;
1987                 yyval.melreq->octave_i_ = yyvsp[-3].i;
1988                 yyval.melreq->notename_i_ = yyvsp[-2].i;
1989                 yyval.melreq->accidental_i_ = yyvsp[-1].i;
1990         ;
1991     break;}
1992 case 129:
1993 #line 851 "parser.yy"
1994 {
1995                 yyval.duration = new Duration;
1996                 yyval.duration-> durlog_i_ = yyvsp[-2].i;
1997                 yyval.duration-> dots_i_ = yyvsp[-1].i;
1998         ;
1999     break;}
2000 case 130:
2001 #line 859 "parser.yy"
2002 {
2003                 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
2004                 ad_p ->loudness_ = (Dynamic_req::Loudness)yyvsp[-1].i;
2005                 yyval.request =ad_p;
2006         ;
2007     break;}
2008 case 131:
2009 #line 864 "parser.yy"
2010 {
2011                 Span_dynamic_req * sp_p = new Span_dynamic_req;
2012                 sp_p->spantype = yyvsp[-1].i;
2013                 sp_p-> dynamic_dir_  = yyvsp[-2].i;
2014                 yyval.request = sp_p;
2015         ;
2016     break;}
2017 case 132:
2018 #line 873 "parser.yy"
2019 {
2020                 yyval.pair[0] = yyvsp[-2].i;
2021                 yyval.pair[1] = yyvsp[0].i;
2022         ;
2023     break;}
2024 case 133:
2025 #line 878 "parser.yy"
2026 {
2027                 int num = yyvsp[0].i >? 1;
2028                 yyval.pair[0] = guess_plet_a[(num <? GUESS_PLET) - 1];
2029                 yyval.pair[1] = num;
2030         ;
2031     break;}
2032 case 134:
2033 #line 886 "parser.yy"
2034 {
2035                 yyval.i = MAEBTELP;
2036                 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2037                 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2038                 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2039                 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2040         ;
2041     break;}
2042 case 135:
2043 #line 893 "parser.yy"
2044 {
2045                 yyval.i = TELP;
2046                 THIS->plet_.type_i_ = 1;
2047                 THIS->plet_.iso_i_ = 1;
2048                 THIS->default_duration_.plet_.iso_i_ = 1;
2049                 THIS->default_duration_.plet_.type_i_ = 1;
2050         ;
2051     break;}
2052 case 136:
2053 #line 900 "parser.yy"
2054 {
2055                 yyval.i = TELP;
2056                 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2057                 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2058                 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2059                 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2060         ;
2061     break;}
2062 case 137:
2063 #line 910 "parser.yy"
2064 {
2065                 yyval.i = '~';
2066         ;
2067     break;}
2068 case 138:
2069 #line 913 "parser.yy"
2070 {
2071                 yyval.i='(';
2072         ;
2073     break;}
2074 case 139:
2075 #line 916 "parser.yy"
2076 {
2077                 yyval.i = ']';
2078         ;
2079     break;}
2080 case 140:
2081 #line 919 "parser.yy"
2082 {
2083                 yyval.i = '<';
2084         ;
2085     break;}
2086 case 141:
2087 #line 922 "parser.yy"
2088 {
2089                 yyval.i = '>';
2090         ;
2091     break;}
2092 case 142:
2093 #line 925 "parser.yy"
2094 {
2095         ;
2096     break;}
2097 case 143:
2098 #line 930 "parser.yy"
2099 {
2100                 yyval.c = '[';
2101                 if (!Duration::duration_type_b (yyvsp[0].i))
2102                         THIS->parser_error ("1:Not a duration");
2103                 else if (yyvsp[0].i < 8)
2104                         THIS->parser_error ("Can't abbreviate");
2105                 else
2106                         THIS->set_abbrev_beam (yyvsp[0].i);
2107         ;
2108     break;}
2109 case 144:
2110 #line 942 "parser.yy"
2111 {
2112                 yyval.i = BEAMPLET;
2113                 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2114                 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2115                 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2116                 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2117         ;
2118     break;}
2119 case 145:
2120 #line 949 "parser.yy"
2121 {
2122                 yyval.i = PLET;
2123                 THIS->plet_.type_i_ = yyvsp[0].pair[1];
2124                 THIS->plet_.iso_i_ = yyvsp[0].pair[0];
2125                 THIS->default_duration_.plet_.type_i_ = yyvsp[0].pair[1];
2126                 THIS->default_duration_.plet_.iso_i_ = yyvsp[0].pair[0];
2127         ;
2128     break;}
2129 case 146:
2130 #line 959 "parser.yy"
2131 {
2132                 yyval.i = '!';
2133         ;
2134     break;}
2135 case 147:
2136 #line 962 "parser.yy"
2137 {
2138                 yyval.i=')';
2139         ;
2140     break;}
2141 case 148:
2142 #line 965 "parser.yy"
2143 {
2144                 yyval.i='[';
2145         ;
2146     break;}
2147 case 149:
2148 #line 968 "parser.yy"
2149 {
2150         ;
2151     break;}
2152 case 150:
2153 #line 970 "parser.yy"
2154 {
2155         ;
2156     break;}
2157 case 151:
2158 #line 977 "parser.yy"
2159 { yyval.script = yyvsp[-1].script; ;
2160     break;}
2161 case 152:
2162 #line 981 "parser.yy"
2163 {
2164                 Script_def *s = new Script_def;
2165                 s->set_from_input (*yyvsp[-5].string,yyvsp[-4].i, yyvsp[-3].i,yyvsp[-2].i,yyvsp[-1].i, yyvsp[0].i);
2166                 yyval.script  = s;
2167                 delete yyvsp[-5].string;
2168         ;
2169     break;}
2170 case 153:
2171 #line 990 "parser.yy"
2172 {
2173                 Musical_script_req *m = new Musical_script_req;
2174                 yyval.request = m;
2175                 m->scriptdef_p_ = yyvsp[0].script;
2176                 m->set_spot (THIS->here_input ());
2177                 if (!m->dir_)
2178                   m->dir_  = yyvsp[-1].i;
2179         ;
2180     break;}
2181 case 154:
2182 #line 1001 "parser.yy"
2183
2184                 yyval.script = yyvsp[0].textdef;
2185                 ((Text_def*) yyval.script)->align_i_ = CENTER; /* UGH */
2186         ;
2187     break;}
2188 case 155:
2189 #line 1005 "parser.yy"
2190
2191                 yyval.script = yyvsp[0].script;
2192                 yyval.script-> set_spot (THIS->here_input ());
2193         ;
2194     break;}
2195 case 156:
2196 #line 1009 "parser.yy"
2197 {
2198                 yyval.script = yyvsp[0].textdef;
2199                 ((Text_def*)yyval.script)->align_i_ = CENTER;
2200         ;
2201     break;}
2202 case 157:
2203 #line 1016 "parser.yy"
2204 {
2205                 Text_def *t  = new Text_def;
2206                 yyval.textdef = t;
2207                 t->text_str_ = *yyvsp[0].string;
2208                 delete yyvsp[0].string;
2209                 t->style_str_ = THIS->textstyle_str_;
2210                 yyval.textdef->set_spot (THIS->here_input ());
2211         ;
2212     break;}
2213 case 158:
2214 #line 1027 "parser.yy"
2215 {
2216                 Text_def* t  = new Text_def;
2217                 yyval.textdef = t;
2218                 t->text_str_ = String (yyvsp[0].i);
2219                 t->style_str_ = "finger";
2220                 yyval.textdef->set_spot (THIS->here_input ());
2221         ;
2222     break;}
2223 case 159:
2224 #line 1037 "parser.yy"
2225 { yyval.string = get_scriptdef ('^'); ;
2226     break;}
2227 case 160:
2228 #line 1038 "parser.yy"
2229 { yyval.string = get_scriptdef ('+'); ;
2230     break;}
2231 case 161:
2232 #line 1039 "parser.yy"
2233 { yyval.string = get_scriptdef ('-'); ;
2234     break;}
2235 case 162:
2236 #line 1040 "parser.yy"
2237 { yyval.string = get_scriptdef ('|'); ;
2238     break;}
2239 case 163:
2240 #line 1041 "parser.yy"
2241 { yyval.string = get_scriptdef ('o'); ;
2242     break;}
2243 case 164:
2244 #line 1042 "parser.yy"
2245 { yyval.string = get_scriptdef ('>'); ;
2246     break;}
2247 case 165:
2248 #line 1043 "parser.yy"
2249 {
2250                 yyval.string = get_scriptdef ('.');
2251         ;
2252     break;}
2253 case 166:
2254 #line 1049 "parser.yy"
2255 { yyval.script = yyvsp[0].id->script (); ;
2256     break;}
2257 case 167:
2258 #line 1050 "parser.yy"
2259 { yyval.script = yyvsp[0].script; ;
2260     break;}
2261 case 168:
2262 #line 1051 "parser.yy"
2263 {
2264                 yyval.script = THIS->lexer_p_->lookup_identifier (*yyvsp[0].string)->script ();
2265                 delete yyvsp[0].string;
2266         ;
2267     break;}
2268 case 169:
2269 #line 1058 "parser.yy"
2270 { yyval.i = -1; ;
2271     break;}
2272 case 170:
2273 #line 1059 "parser.yy"
2274 { yyval.i = 1; ;
2275     break;}
2276 case 171:
2277 #line 1060 "parser.yy"
2278 { yyval.i = 0; ;
2279     break;}
2280 case 172:
2281 #line 1064 "parser.yy"
2282 {
2283         ;
2284     break;}
2285 case 173:
2286 #line 1066 "parser.yy"
2287 {
2288                 Array<Request*>& r = *THIS->get_parens_request (yyvsp[0].i);
2289                 for (int i = 0; i < r.size (); i++ )
2290                         r[i]->set_spot (THIS->here_input ());
2291                 THIS->pre_reqs.concat (r);
2292                 delete &r;
2293         ;
2294     break;}
2295 case 174:
2296 #line 1076 "parser.yy"
2297 {
2298                 THIS->set_duration_mode (*yyvsp[0].string);
2299                 delete yyvsp[0].string;
2300         ;
2301     break;}
2302 case 175:
2303 #line 1080 "parser.yy"
2304 {
2305                 THIS->set_default_duration (yyvsp[0].duration);
2306                 delete yyvsp[0].duration;
2307         ;
2308     break;}
2309 case 176:
2310 #line 1084 "parser.yy"
2311 {
2312                 /*
2313                         This is weird, but default_octave_i_
2314                         is used in steno_note_req too
2315
2316                         c' -> default_octave_i_ == 1
2317                 */
2318                 /* why can't we have \oct 0 iso \oct{c'}*/
2319                 THIS->default_octave_i_ = 1; ;
2320     break;}
2321 case 177:
2322 #line 1094 "parser.yy"
2323 {
2324                 THIS->default_octave_i_ = yyvsp[0].melreq->octave_i_;
2325                 delete yyvsp[0].melreq;
2326         ;
2327     break;}
2328 case 178:
2329 #line 1098 "parser.yy"
2330 {
2331                 THIS->textstyle_str_ = *yyvsp[0].string;
2332                 delete yyvsp[0].string;
2333         ;
2334     break;}
2335 case 179:
2336 #line 1105 "parser.yy"
2337 {
2338                 yyval.moment = new Moment (0,1);
2339         ;
2340     break;}
2341 case 180:
2342 #line 1108 "parser.yy"
2343 {
2344                 *yyval.moment += yyvsp[0].duration->length ();
2345         ;
2346     break;}
2347 case 181:
2348 #line 1114 "parser.yy"
2349 { yyval.i = 1; ;
2350     break;}
2351 case 182:
2352 #line 1115 "parser.yy"
2353 { yyval.i ++; ;
2354     break;}
2355 case 183:
2356 #line 1119 "parser.yy"
2357 {
2358                 yyval.duration = new Duration (THIS->default_duration_);
2359         ;
2360     break;}
2361 case 184:
2362 #line 1122 "parser.yy"
2363 {
2364                 yyval.duration = new Duration (THIS->default_duration_);
2365                 yyval.duration->dots_i_  = yyvsp[0].i;
2366         ;
2367     break;}
2368 case 185:
2369 #line 1126 "parser.yy"
2370 {
2371                 THIS->set_last_duration (yyvsp[0].duration);
2372                 yyval.duration = yyvsp[0].duration;
2373         ;
2374     break;}
2375 case 186:
2376 #line 1133 "parser.yy"
2377 {
2378                 yyval.duration = yyvsp[0].duration;
2379         ;
2380     break;}
2381 case 187:
2382 #line 1139 "parser.yy"
2383 {
2384                 yyval.duration = new Duration;
2385                 if (!Duration::duration_type_b (yyvsp[0].i))
2386                         THIS->parser_error ("2:Not a duration");
2387                 else {
2388                         yyval.duration->durlog_i_ = Duration_convert::i2_type (yyvsp[0].i);
2389                         yyval.duration->set_plet (THIS->default_duration_);
2390                      }
2391         ;
2392     break;}
2393 case 188:
2394 #line 1148 "parser.yy"
2395 {
2396                 yyval.duration = yyvsp[0].id->duration ();
2397         ;
2398     break;}
2399 case 189:
2400 #line 1151 "parser.yy"
2401 {
2402                 yyval.duration->dots_i_ ++;
2403         ;
2404     break;}
2405 case 190:
2406 #line 1154 "parser.yy"
2407 {
2408                 yyval.duration->plet_.iso_i_ = yyvsp[0].i;
2409         ;
2410     break;}
2411 case 191:
2412 #line 1157 "parser.yy"
2413 {
2414                 yyval.duration->plet_.type_i_ = yyvsp[0].i;
2415         ;
2416     break;}
2417 case 192:
2418 #line 1164 "parser.yy"
2419 {
2420                 yyval.i =0;
2421         ;
2422     break;}
2423 case 193:
2424 #line 1167 "parser.yy"
2425 {
2426                 if (!Duration::duration_type_b (yyvsp[0].i))
2427                         THIS->parser_error ("3:Not a duration");
2428                 else if (yyvsp[0].i < 8)
2429                         THIS->parser_error ("Can't abbreviate");
2430                 yyval.i = yyvsp[0].i;
2431         ;
2432     break;}
2433 case 194:
2434 #line 1178 "parser.yy"
2435 {
2436                 if (!THIS->lexer_p_->note_state_b ())
2437                         THIS->parser_error ("have to be in Note mode for notes");
2438                 yyvsp[-1].notereq->set_duration (*yyvsp[0].duration);
2439                 int durlog_i = yyvsp[0].duration->durlog_i_;
2440                 yyval.music = THIS->get_note_element (yyvsp[-1].notereq, yyvsp[0].duration);
2441         ;
2442     break;}
2443 case 195:
2444 #line 1185 "parser.yy"
2445 {
2446                 yyval.music = THIS->get_rest_element (*yyvsp[-1].string, yyvsp[0].duration);
2447                 delete yyvsp[-1].string;
2448         ;
2449     break;}
2450 case 196:
2451 #line 1192 "parser.yy"
2452 {
2453         /* this sux! text-def should be feature of lyric-engraver. */
2454                 if (!THIS->lexer_p_->lyric_state_b ())
2455                         THIS->parser_error ("Have to be in Lyric mode for lyrics");
2456                 yyval.music = THIS->get_word_element (yyvsp[-1].textdef, yyvsp[0].duration);
2457
2458         ;
2459     break;}
2460 case 197:
2461 #line 1203 "parser.yy"
2462 {
2463                 yyval.melreqvec = new Array<Melodic_req*>;
2464         ;
2465     break;}
2466 case 198:
2467 #line 1206 "parser.yy"
2468 {
2469                 yyval.melreqvec->push (yyvsp[0].melreq->clone ()->musical ()->melodic ());
2470         ;
2471     break;}
2472 case 199:
2473 #line 1212 "parser.yy"
2474 {
2475                 yyval.i = yyvsp[0].i;
2476         ;
2477     break;}
2478 case 200:
2479 #line 1215 "parser.yy"
2480 {
2481                 yyval.i = yyvsp[0].i;
2482         ;
2483     break;}
2484 case 201:
2485 #line 1220 "parser.yy"
2486 {
2487                 yyval.i = yyvsp[0].i;
2488         ;
2489     break;}
2490 case 202:
2491 #line 1223 "parser.yy"
2492 {
2493                 yyval.i = -yyvsp[0].i;
2494         ;
2495     break;}
2496 case 203:
2497 #line 1226 "parser.yy"
2498 {
2499                 int *i_p = yyvsp[0].id->intid ();
2500                 yyval.i = *i_p;
2501                 delete i_p;
2502         ;
2503     break;}
2504 case 204:
2505 #line 1234 "parser.yy"
2506 {
2507                 yyval.real = yyvsp[0].real;
2508         ;
2509     break;}
2510 case 205:
2511 #line 1237 "parser.yy"
2512 {
2513                 Real *r_p = yyvsp[0].id->real ();
2514                 yyval.real = * r_p;
2515                 delete r_p;
2516         ;
2517     break;}
2518 case 206:
2519 #line 1247 "parser.yy"
2520 { yyval.real = yyvsp[-1].real*yyvsp[0].real; ;
2521     break;}
2522 case 207:
2523 #line 1251 "parser.yy"
2524 { yyval.real = 1 CM; ;
2525     break;}
2526 case 208:
2527 #line 1252 "parser.yy"
2528 { yyval.real = 1 INCH; ;
2529     break;}
2530 case 209:
2531 #line 1253 "parser.yy"
2532 { yyval.real = 1 MM; ;
2533     break;}
2534 case 210:
2535 #line 1254 "parser.yy"
2536 { yyval.real = 1 PT; ;
2537     break;}
2538 case 211:
2539 #line 1261 "parser.yy"
2540 { yyval.lookup = yyvsp[-1].lookup; ;
2541     break;}
2542 case 212:
2543 #line 1265 "parser.yy"
2544 {
2545                 yyval.lookup = new Lookup;
2546         ;
2547     break;}
2548 case 213:
2549 #line 1268 "parser.yy"
2550 {
2551                 yyval.lookup = yyvsp[0].id->lookup ();
2552         ;
2553     break;}
2554 case 214:
2555 #line 1271 "parser.yy"
2556 {
2557                 yyval.lookup->texsetting = *yyvsp[0].string;
2558                 delete yyvsp[0].string;
2559         ;
2560     break;}
2561 case 215:
2562 #line 1275 "parser.yy"
2563 {
2564                 yyval.lookup->add (*yyvsp[-2].string, yyvsp[0].symtable);
2565                 delete yyvsp[-2].string;
2566         ;
2567     break;}
2568 case 216:
2569 #line 1282 "parser.yy"
2570 { yyval.symtable = yyvsp[-1].symtable; ;
2571     break;}
2572 case 217:
2573 #line 1286 "parser.yy"
2574 { yyval.symtable = new Symtable; ;
2575     break;}
2576 case 218:
2577 #line 1287 "parser.yy"
2578 {
2579                 yyval.symtable->add (*yyvsp[-1].string, *yyvsp[0].symbol);
2580                 delete yyvsp[-1].string;
2581                 delete yyvsp[0].symbol;
2582         ;
2583     break;}
2584 case 219:
2585 #line 1295 "parser.yy"
2586 {
2587                 yyval.symbol = new Atom (*yyvsp[-1].string, *yyvsp[0].box);
2588                 delete yyvsp[-1].string;
2589                 delete yyvsp[0].box;
2590         ;
2591     break;}
2592 case 220:
2593 #line 1300 "parser.yy"
2594 {
2595                 Box b (Interval (0,0), Interval (0,0));
2596                 yyval.symbol = new Atom (*yyvsp[0].string, b);
2597                 delete yyvsp[0].string;
2598         ;
2599     break;}
2600 case 221:
2601 #line 1308 "parser.yy"
2602 {
2603                 yyval.box = new Box (*yyvsp[-1].interval, *yyvsp[0].interval);
2604                 delete yyvsp[-1].interval;
2605                 delete yyvsp[0].interval;
2606         ;
2607     break;}
2608 case 222:
2609 #line 1315 "parser.yy"
2610 {
2611                 yyval.interval = new Interval (yyvsp[-1].real, yyvsp[0].real);
2612         ;
2613     break;}
2614 }
2615    /* the action file gets copied in in place of this dollarsign */
2616 #line 498 "/usr/lib/bison.simple"
2617 \f
2618   yyvsp -= yylen;
2619   yyssp -= yylen;
2620 #ifdef YYLSP_NEEDED
2621   yylsp -= yylen;
2622 #endif
2623
2624 #if YYDEBUG != 0
2625   if (yydebug)
2626     {
2627       short *ssp1 = yyss - 1;
2628       fprintf (stderr, "state stack now");
2629       while (ssp1 != yyssp)
2630         fprintf (stderr, " %d", *++ssp1);
2631       fprintf (stderr, "\n");
2632     }
2633 #endif
2634
2635   *++yyvsp = yyval;
2636
2637 #ifdef YYLSP_NEEDED
2638   yylsp++;
2639   if (yylen == 0)
2640     {
2641       yylsp->first_line = yylloc.first_line;
2642       yylsp->first_column = yylloc.first_column;
2643       yylsp->last_line = (yylsp-1)->last_line;
2644       yylsp->last_column = (yylsp-1)->last_column;
2645       yylsp->text = 0;
2646     }
2647   else
2648     {
2649       yylsp->last_line = (yylsp+yylen-1)->last_line;
2650       yylsp->last_column = (yylsp+yylen-1)->last_column;
2651     }
2652 #endif
2653
2654   /* Now "shift" the result of the reduction.
2655      Determine what state that goes to,
2656      based on the state we popped back to
2657      and the rule number reduced by.  */
2658
2659   yyn = yyr1[yyn];
2660
2661   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2662   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2663     yystate = yytable[yystate];
2664   else
2665     yystate = yydefgoto[yyn - YYNTBASE];
2666
2667   goto yynewstate;
2668
2669 yyerrlab:   /* here on detecting error */
2670
2671   if (! yyerrstatus)
2672     /* If not already recovering from an error, report this error.  */
2673     {
2674       ++yynerrs;
2675
2676 #ifdef YYERROR_VERBOSE
2677       yyn = yypact[yystate];
2678
2679       if (yyn > YYFLAG && yyn < YYLAST)
2680         {
2681           int size = 0;
2682           char *msg;
2683           int x, count;
2684
2685           count = 0;
2686           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
2687           for (x = (yyn < 0 ? -yyn : 0);
2688                x < (sizeof(yytname) / sizeof(char *)); x++)
2689             if (yycheck[x + yyn] == x)
2690               size += strlen(yytname[x]) + 15, count++;
2691           msg = (char *) malloc(size + 15);
2692           if (msg != 0)
2693             {
2694               strcpy(msg, "parse error");
2695
2696               if (count < 5)
2697                 {
2698                   count = 0;
2699                   for (x = (yyn < 0 ? -yyn : 0);
2700                        x < (sizeof(yytname) / sizeof(char *)); x++)
2701                     if (yycheck[x + yyn] == x)
2702                       {
2703                         strcat(msg, count == 0 ? ", expecting `" : " or `");
2704                         strcat(msg, yytname[x]);
2705                         strcat(msg, "'");
2706                         count++;
2707                       }
2708                 }
2709               yyerror(msg);
2710               free(msg);
2711             }
2712           else
2713             yyerror ("parse error; also virtual memory exceeded");
2714         }
2715       else
2716 #endif /* YYERROR_VERBOSE */
2717         yyerror("parse error");
2718     }
2719
2720   goto yyerrlab1;
2721 yyerrlab1:   /* here on error raised explicitly by an action */
2722
2723   if (yyerrstatus == 3)
2724     {
2725       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
2726
2727       /* return failure if at end of input */
2728       if (yychar == YYEOF)
2729         YYABORT;
2730
2731 #if YYDEBUG != 0
2732       if (yydebug)
2733         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2734 #endif
2735
2736       yychar = YYEMPTY;
2737     }
2738
2739   /* Else will try to reuse lookahead token
2740      after shifting the error token.  */
2741
2742   yyerrstatus = 3;              /* Each real token shifted decrements this */
2743
2744   goto yyerrhandle;
2745
2746 yyerrdefault:  /* current state does not do anything special for the error token. */
2747
2748 #if 0
2749   /* This is wrong; only states that explicitly want error tokens
2750      should shift them.  */
2751   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
2752   if (yyn) goto yydefault;
2753 #endif
2754
2755 yyerrpop:   /* pop the current state because it cannot handle the error token */
2756
2757   if (yyssp == yyss) YYABORT;
2758   yyvsp--;
2759   yystate = *--yyssp;
2760 #ifdef YYLSP_NEEDED
2761   yylsp--;
2762 #endif
2763
2764 #if YYDEBUG != 0
2765   if (yydebug)
2766     {
2767       short *ssp1 = yyss - 1;
2768       fprintf (stderr, "Error: state stack now");
2769       while (ssp1 != yyssp)
2770         fprintf (stderr, " %d", *++ssp1);
2771       fprintf (stderr, "\n");
2772     }
2773 #endif
2774
2775 yyerrhandle:
2776
2777   yyn = yypact[yystate];
2778   if (yyn == YYFLAG)
2779     goto yyerrdefault;
2780
2781   yyn += YYTERROR;
2782   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2783     goto yyerrdefault;
2784
2785   yyn = yytable[yyn];
2786   if (yyn < 0)
2787     {
2788       if (yyn == YYFLAG)
2789         goto yyerrpop;
2790       yyn = -yyn;
2791       goto yyreduce;
2792     }
2793   else if (yyn == 0)
2794     goto yyerrpop;
2795
2796   if (yyn == YYFINAL)
2797     YYACCEPT;
2798
2799 #if YYDEBUG != 0
2800   if (yydebug)
2801     fprintf(stderr, "Shifting error token, ");
2802 #endif
2803
2804   *++yyvsp = yylval;
2805 #ifdef YYLSP_NEEDED
2806   *++yylsp = yylloc;
2807 #endif
2808
2809   yystate = yyn;
2810   goto yynewstate;
2811 }
2812 #line 1320 "parser.yy"
2813
2814
2815 void
2816 My_lily_parser::set_yydebug (bool b)
2817 {
2818 #ifdef YYDEBUG
2819         yydebug = b;
2820 #endif
2821 }
2822 void
2823 My_lily_parser::do_yyparse ()
2824 {
2825         yyparse ((void*)this);
2826 }
2827
2828 Paper_def*
2829 My_lily_parser::default_paper ()
2830 {
2831         Identifier *id = lexer_p_->lookup_identifier ("default_paper");
2832         return id ? id->paperdef () : new Paper_def ;
2833 }
2834
2835 Midi_def*
2836 My_lily_parser::default_midi ()
2837 {
2838         Identifier *id = lexer_p_->lookup_identifier ("default_midi");
2839         return id ? id->mididef () : new Midi_def ;
2840 }
2841