/[svn]/linuxsampler/trunk/src/network/lscpparser.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/network/lscpparser.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 170 - (show annotations) (download)
Sat Jul 3 20:08:07 2004 UTC (19 years, 8 months ago) by senkov
File size: 63504 byte(s)
* moved ToString to common
* Implemented handling of multiple connections
* Implemented guts for event subscription/unsubscription
* Illustrated event notification sending by sending MISC events
when connections are established or terminated.

1 /* A Bison parser, made by GNU Bison 1.875. */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36 /* Identify Bison output. */
37 #define YYBISON 1
38
39 /* Skeleton name. */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers. */
43 #define YYPURE 1
44
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
47
48
49
50 /* Tokens. */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum yytokentype {
56 CHAR = 258,
57 DOTNUM = 259,
58 NUMBER = 260,
59 STRINGVAL = 261,
60 SP = 262,
61 LF = 263,
62 CR = 264,
63 HASH = 265,
64 EQ = 266,
65 ADD = 267,
66 GET = 268,
67 CREATE = 269,
68 DESTROY = 270,
69 LIST = 271,
70 LOAD = 272,
71 NON_MODAL = 273,
72 REMOVE = 274,
73 SET = 275,
74 SUBSCRIBE = 276,
75 UNSUBSCRIBE = 277,
76 RESET = 278,
77 QUIT = 279,
78 CHANNEL = 280,
79 NOTIFICATION = 281,
80 AVAILABLE_ENGINES = 282,
81 AVAILABLE_AUDIO_OUTPUT_DRIVERS = 283,
82 CHANNELS = 284,
83 INFO = 285,
84 BUFFER_FILL = 286,
85 STREAM_COUNT = 287,
86 VOICE_COUNT = 288,
87 INSTRUMENT = 289,
88 ENGINE = 290,
89 AUDIO_OUTPUT_CHANNEL = 291,
90 AUDIO_OUTPUT_CHANNEL_PARAMETER = 292,
91 AUDIO_OUTPUT_DEVICE = 293,
92 AUDIO_OUTPUT_DEVICES = 294,
93 AUDIO_OUTPUT_DEVICE_PARAMETER = 295,
94 AUDIO_OUTPUT_DRIVER = 296,
95 AUDIO_OUTPUT_DRIVER_PARAMETER = 297,
96 AUDIO_OUTPUT_TYPE = 298,
97 MIDI_INPUT = 299,
98 MIDI_INPUT_TYPE = 300,
99 MIDI_INPUT_PORT = 301,
100 MIDI_INPUT_CHANNEL = 302,
101 VOLUME = 303,
102 MIDI_INPUT_DRIVER = 304,
103 MIDI_INPUT_DRIVER_PARAMETER = 305,
104 AVAILABLE_MIDI_INPUT_DRIVERS = 306,
105 MIDI_INPUT_DEVICE = 307,
106 MIDI_INPUT_DEVICES = 308,
107 MIDI_INPUT_DEVICE_PARAMETER = 309,
108 MIDI_INPUT_PORT_PARAMETER = 310,
109 BYTES = 311,
110 PERCENTAGE = 312,
111 MISCELLANEOUS = 313
112 };
113 #endif
114 #define CHAR 258
115 #define DOTNUM 259
116 #define NUMBER 260
117 #define STRINGVAL 261
118 #define SP 262
119 #define LF 263
120 #define CR 264
121 #define HASH 265
122 #define EQ 266
123 #define ADD 267
124 #define GET 268
125 #define CREATE 269
126 #define DESTROY 270
127 #define LIST 271
128 #define LOAD 272
129 #define NON_MODAL 273
130 #define REMOVE 274
131 #define SET 275
132 #define SUBSCRIBE 276
133 #define UNSUBSCRIBE 277
134 #define RESET 278
135 #define QUIT 279
136 #define CHANNEL 280
137 #define NOTIFICATION 281
138 #define AVAILABLE_ENGINES 282
139 #define AVAILABLE_AUDIO_OUTPUT_DRIVERS 283
140 #define CHANNELS 284
141 #define INFO 285
142 #define BUFFER_FILL 286
143 #define STREAM_COUNT 287
144 #define VOICE_COUNT 288
145 #define INSTRUMENT 289
146 #define ENGINE 290
147 #define AUDIO_OUTPUT_CHANNEL 291
148 #define AUDIO_OUTPUT_CHANNEL_PARAMETER 292
149 #define AUDIO_OUTPUT_DEVICE 293
150 #define AUDIO_OUTPUT_DEVICES 294
151 #define AUDIO_OUTPUT_DEVICE_PARAMETER 295
152 #define AUDIO_OUTPUT_DRIVER 296
153 #define AUDIO_OUTPUT_DRIVER_PARAMETER 297
154 #define AUDIO_OUTPUT_TYPE 298
155 #define MIDI_INPUT 299
156 #define MIDI_INPUT_TYPE 300
157 #define MIDI_INPUT_PORT 301
158 #define MIDI_INPUT_CHANNEL 302
159 #define VOLUME 303
160 #define MIDI_INPUT_DRIVER 304
161 #define MIDI_INPUT_DRIVER_PARAMETER 305
162 #define AVAILABLE_MIDI_INPUT_DRIVERS 306
163 #define MIDI_INPUT_DEVICE 307
164 #define MIDI_INPUT_DEVICES 308
165 #define MIDI_INPUT_DEVICE_PARAMETER 309
166 #define MIDI_INPUT_PORT_PARAMETER 310
167 #define BYTES 311
168 #define PERCENTAGE 312
169 #define MISCELLANEOUS 313
170
171
172
173
174 /* Copy the first part of user declarations. */
175 #line 23 "lscp.y"
176
177
178 #include "lscpparser.h"
179 #include "lscpserver.h"
180 #include "lscpevent.h"
181
182 // as we need an reentrant scanner, we have to pass the pointer to the scanner with each yylex() call
183 #define YYLEX_PARAM ((yyparse_param_t*) yyparse_param)->pScanner
184
185 // to save us typing work in the rules action definitions
186 #define LSCPSERVER ((yyparse_param_t*) yyparse_param)->pServer
187
188 // clears input buffer and restarts scanner.
189 void restart(yyparse_param_t* pparam, int& yychar);
190 #define RESTART restart((yyparse_param_t*) YYPARSE_PARAM, yychar)
191
192 // external reference to the main scanner function yylex()
193 extern YY_DECL;
194
195 // external reference to restart the lex scanner
196 extern void yyrestart(FILE* input_file, yyscan_t yyscanner);
197
198 // we provide our own version of yyerror() so we don't have to link against the yacc library
199 void yyerror(const char* s);
200
201
202
203 /* Enabling traces. */
204 #ifndef YYDEBUG
205 # define YYDEBUG 0
206 #endif
207
208 /* Enabling verbose error messages. */
209 #ifdef YYERROR_VERBOSE
210 # undef YYERROR_VERBOSE
211 # define YYERROR_VERBOSE 1
212 #else
213 # define YYERROR_VERBOSE 0
214 #endif
215
216 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
217 typedef int YYSTYPE;
218 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
219 # define YYSTYPE_IS_DECLARED 1
220 # define YYSTYPE_IS_TRIVIAL 1
221 #endif
222
223
224
225 /* Copy the second part of user declarations. */
226
227
228 /* Line 214 of yacc.c. */
229 #line 229 "y.tab.c"
230
231 #if ! defined (yyoverflow) || YYERROR_VERBOSE
232
233 /* The parser invokes alloca or malloc; define the necessary symbols. */
234
235 # if YYSTACK_USE_ALLOCA
236 # define YYSTACK_ALLOC alloca
237 # else
238 # ifndef YYSTACK_USE_ALLOCA
239 # if defined (alloca) || defined (_ALLOCA_H)
240 # define YYSTACK_ALLOC alloca
241 # else
242 # ifdef __GNUC__
243 # define YYSTACK_ALLOC __builtin_alloca
244 # endif
245 # endif
246 # endif
247 # endif
248
249 # ifdef YYSTACK_ALLOC
250 /* Pacify GCC's `empty if-body' warning. */
251 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
252 # else
253 # if defined (__STDC__) || defined (__cplusplus)
254 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
255 # define YYSIZE_T size_t
256 # endif
257 # define YYSTACK_ALLOC malloc
258 # define YYSTACK_FREE free
259 # endif
260 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
261
262
263 #if (! defined (yyoverflow) \
264 && (! defined (__cplusplus) \
265 || (YYSTYPE_IS_TRIVIAL)))
266
267 /* A type that is properly aligned for any stack member. */
268 union yyalloc
269 {
270 short yyss;
271 YYSTYPE yyvs;
272 };
273
274 /* The size of the maximum gap between one aligned stack and the next. */
275 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
276
277 /* The size of an array large to enough to hold all stacks, each with
278 N elements. */
279 # define YYSTACK_BYTES(N) \
280 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
281 + YYSTACK_GAP_MAXIMUM)
282
283 /* Copy COUNT objects from FROM to TO. The source and destination do
284 not overlap. */
285 # ifndef YYCOPY
286 # if 1 < __GNUC__
287 # define YYCOPY(To, From, Count) \
288 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
289 # else
290 # define YYCOPY(To, From, Count) \
291 do \
292 { \
293 register YYSIZE_T yyi; \
294 for (yyi = 0; yyi < (Count); yyi++) \
295 (To)[yyi] = (From)[yyi]; \
296 } \
297 while (0)
298 # endif
299 # endif
300
301 /* Relocate STACK from its old location to the new one. The
302 local variables YYSIZE and YYSTACKSIZE give the old and new number of
303 elements in the stack, and YYPTR gives the new location of the
304 stack. Advance YYPTR to a properly aligned location for the next
305 stack. */
306 # define YYSTACK_RELOCATE(Stack) \
307 do \
308 { \
309 YYSIZE_T yynewbytes; \
310 YYCOPY (&yyptr->Stack, Stack, yysize); \
311 Stack = &yyptr->Stack; \
312 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
313 yyptr += yynewbytes / sizeof (*yyptr); \
314 } \
315 while (0)
316
317 #endif
318
319 #if defined (__STDC__) || defined (__cplusplus)
320 typedef signed char yysigned_char;
321 #else
322 typedef short yysigned_char;
323 #endif
324
325 /* YYFINAL -- State number of the termination state. */
326 #define YYFINAL 30
327 /* YYLAST -- Last index in YYTABLE. */
328 #define YYLAST 287
329
330 /* YYNTOKENS -- Number of terminals. */
331 #define YYNTOKENS 59
332 /* YYNNTS -- Number of nonterminals. */
333 #define YYNNTS 32
334 /* YYNRULES -- Number of rules. */
335 #define YYNRULES 106
336 /* YYNRULES -- Number of states. */
337 #define YYNSTATES 303
338
339 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
340 #define YYUNDEFTOK 2
341 #define YYMAXUTOK 313
342
343 #define YYTRANSLATE(YYX) \
344 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
345
346 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
347 static const unsigned char yytranslate[] =
348 {
349 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
350 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
351 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
352 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
353 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
354 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
355 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
356 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
357 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
358 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
359 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
360 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
361 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
362 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
363 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
364 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
365 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
366 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
367 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
368 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
369 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
374 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
375 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
376 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
377 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
378 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
379 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
380 55, 56, 57, 58
381 };
382
383 #if YYDEBUG
384 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
385 YYRHS. */
386 static const unsigned short yyprhs[] =
387 {
388 0, 0, 3, 6, 7, 9, 11, 13, 15, 18,
389 21, 24, 27, 31, 35, 39, 43, 47, 51, 57,
390 61, 65, 69, 75, 77, 79, 81, 83, 85, 87,
391 89, 91, 93, 95, 97, 99, 101, 103, 105, 111,
392 119, 129, 131, 137, 145, 155, 157, 159, 165, 171,
393 179, 187, 197, 199, 205, 213, 219, 225, 231, 239,
394 249, 257, 267, 271, 277, 281, 287, 291, 295, 299,
395 303, 307, 313, 321, 327, 337, 343, 349, 355, 361,
396 367, 371, 377, 379, 381, 383, 385, 391, 399, 403,
397 405, 407, 409, 411, 413, 415, 417, 419, 421, 423,
398 425, 427, 429, 431, 433, 435, 437
399 };
400
401 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
402 static const yysigned_char yyrhs[] =
403 {
404 60, 0, -1, 61, 8, -1, -1, 62, -1, 63,
405 -1, 1, -1, 10, -1, 62, 10, -1, 62, 7,
406 -1, 62, 5, -1, 62, 90, -1, 12, 7, 25,
407 -1, 13, 7, 66, -1, 14, 7, 68, -1, 15,
408 7, 69, -1, 16, 7, 74, -1, 17, 7, 70,
409 -1, 19, 7, 25, 7, 85, -1, 20, 7, 67,
410 -1, 21, 7, 64, -1, 22, 7, 65, -1, 23,
411 7, 25, 7, 85, -1, 24, -1, 29, -1, 33,
412 -1, 32, -1, 31, -1, 30, -1, 58, -1, 29,
413 -1, 33, -1, 32, -1, 31, -1, 30, -1, 58,
414 -1, 27, -1, 51, -1, 49, 7, 30, 7, 90,
415 -1, 50, 7, 30, 7, 90, 7, 90, -1, 50,
416 7, 30, 7, 90, 7, 90, 7, 72, -1, 28,
417 -1, 41, 7, 30, 7, 90, -1, 42, 7, 30,
418 7, 90, 7, 90, -1, 42, 7, 30, 7, 90,
419 7, 90, 7, 72, -1, 39, -1, 53, -1, 38,
420 7, 30, 7, 5, -1, 52, 7, 30, 7, 5,
421 -1, 46, 7, 30, 7, 5, 7, 5, -1, 36,
422 7, 30, 7, 5, 7, 5, -1, 37, 7, 30,
423 7, 5, 7, 5, 7, 90, -1, 29, -1, 25,
424 7, 30, 7, 85, -1, 25, 7, 31, 7, 73,
425 7, 85, -1, 25, 7, 32, 7, 85, -1, 25,
426 7, 33, 7, 85, -1, 35, 7, 30, 7, 87,
427 -1, 40, 7, 5, 7, 90, 11, 89, -1, 37,
428 7, 5, 7, 5, 7, 90, 11, 89, -1, 54,
429 7, 5, 7, 90, 11, 89, -1, 55, 7, 5,
430 7, 5, 7, 90, 11, 89, -1, 25, 7, 71,
431 -1, 38, 7, 90, 7, 72, -1, 38, 7, 90,
432 -1, 52, 7, 90, 7, 72, -1, 52, 7, 90,
433 -1, 38, 7, 5, -1, 52, 7, 5, -1, 34,
434 7, 75, -1, 35, 7, 76, -1, 38, 7, 85,
435 7, 77, -1, 36, 7, 85, 7, 78, 7, 78,
436 -1, 43, 7, 85, 7, 79, -1, 44, 7, 85,
437 7, 80, 7, 81, 7, 82, -1, 52, 7, 85,
438 7, 80, -1, 46, 7, 85, 7, 81, -1, 47,
439 7, 85, 7, 82, -1, 45, 7, 85, 7, 83,
440 -1, 48, 7, 85, 7, 84, -1, 90, 11, 89,
441 -1, 72, 7, 90, 11, 89, -1, 56, -1, 57,
442 -1, 39, -1, 53, -1, 88, 7, 86, 7, 85,
443 -1, 18, 7, 88, 7, 86, 7, 85, -1, 87,
444 7, 85, -1, 5, -1, 5, -1, 90, -1, 5,
445 -1, 5, -1, 5, -1, 90, -1, 4, -1, 5,
446 -1, 5, -1, 5, -1, 90, -1, 6, -1, 6,
447 -1, 5, -1, 4, -1, 3, -1, 90, 3, -1
448 };
449
450 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
451 static const unsigned char yyrline[] =
452 {
453 0, 79, 79, 81, 82, 83, 84, 87, 88, 89,
454 90, 91, 94, 95, 96, 97, 98, 99, 100, 101,
455 102, 103, 104, 105, 108, 109, 110, 111, 112, 113,
456 116, 117, 118, 119, 120, 121, 124, 125, 126, 127,
457 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
458 138, 139, 140, 141, 142, 143, 144, 145, 148, 149,
459 150, 151, 152, 155, 156, 157, 158, 161, 162, 165,
460 166, 169, 170, 171, 172, 173, 174, 175, 176, 177,
461 180, 181, 184, 185, 188, 189, 192, 193, 196, 199,
462 202, 205, 208, 211, 214, 217, 220, 221, 224, 227,
463 230, 233, 236, 237, 238, 241, 242
464 };
465 #endif
466
467 #if YYDEBUG || YYERROR_VERBOSE
468 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
469 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
470 static const char *const yytname[] =
471 {
472 "$end", "error", "$undefined", "CHAR", "DOTNUM", "NUMBER", "STRINGVAL",
473 "SP", "LF", "CR", "HASH", "EQ", "ADD", "GET", "CREATE", "DESTROY",
474 "LIST", "LOAD", "NON_MODAL", "REMOVE", "SET", "SUBSCRIBE",
475 "UNSUBSCRIBE", "RESET", "QUIT", "CHANNEL", "NOTIFICATION",
476 "AVAILABLE_ENGINES", "AVAILABLE_AUDIO_OUTPUT_DRIVERS", "CHANNELS",
477 "INFO", "BUFFER_FILL", "STREAM_COUNT", "VOICE_COUNT", "INSTRUMENT",
478 "ENGINE", "AUDIO_OUTPUT_CHANNEL", "AUDIO_OUTPUT_CHANNEL_PARAMETER",
479 "AUDIO_OUTPUT_DEVICE", "AUDIO_OUTPUT_DEVICES",
480 "AUDIO_OUTPUT_DEVICE_PARAMETER", "AUDIO_OUTPUT_DRIVER",
481 "AUDIO_OUTPUT_DRIVER_PARAMETER", "AUDIO_OUTPUT_TYPE", "MIDI_INPUT",
482 "MIDI_INPUT_TYPE", "MIDI_INPUT_PORT", "MIDI_INPUT_CHANNEL", "VOLUME",
483 "MIDI_INPUT_DRIVER", "MIDI_INPUT_DRIVER_PARAMETER",
484 "AVAILABLE_MIDI_INPUT_DRIVERS", "MIDI_INPUT_DEVICE",
485 "MIDI_INPUT_DEVICES", "MIDI_INPUT_DEVICE_PARAMETER",
486 "MIDI_INPUT_PORT_PARAMETER", "BYTES", "PERCENTAGE", "MISCELLANEOUS",
487 "$accept", "input", "line", "comment", "command", "subscribe_event",
488 "unsubscribe_event", "get_instruction", "set_instruction",
489 "create_instruction", "destroy_instruction", "load_instruction",
490 "set_chan_instruction", "key_val_list", "buffer_size_type",
491 "list_instruction", "load_instr_args", "load_engine_args",
492 "audio_output_device", "audio_output_channel", "audio_output_type",
493 "midi_input_device", "midi_input_port", "midi_input_channel",
494 "midi_input_type", "volume", "sampler_channel", "instrument_index",
495 "engine_name", "filename", "param_val", "string", 0
496 };
497 #endif
498
499 # ifdef YYPRINT
500 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
501 token YYLEX-NUM. */
502 static const unsigned short yytoknum[] =
503 {
504 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
505 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
506 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
507 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
508 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
509 305, 306, 307, 308, 309, 310, 311, 312, 313
510 };
511 # endif
512
513 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
514 static const unsigned char yyr1[] =
515 {
516 0, 59, 60, 61, 61, 61, 61, 62, 62, 62,
517 62, 62, 63, 63, 63, 63, 63, 63, 63, 63,
518 63, 63, 63, 63, 64, 64, 64, 64, 64, 64,
519 65, 65, 65, 65, 65, 65, 66, 66, 66, 66,
520 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
521 66, 66, 66, 66, 66, 66, 66, 66, 67, 67,
522 67, 67, 67, 68, 68, 68, 68, 69, 69, 70,
523 70, 71, 71, 71, 71, 71, 71, 71, 71, 71,
524 72, 72, 73, 73, 74, 74, 75, 75, 76, 77,
525 78, 79, 80, 81, 82, 83, 84, 84, 85, 86,
526 87, 88, 89, 89, 89, 90, 90
527 };
528
529 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
530 static const unsigned char yyr2[] =
531 {
532 0, 2, 2, 0, 1, 1, 1, 1, 2, 2,
533 2, 2, 3, 3, 3, 3, 3, 3, 5, 3,
534 3, 3, 5, 1, 1, 1, 1, 1, 1, 1,
535 1, 1, 1, 1, 1, 1, 1, 1, 5, 7,
536 9, 1, 5, 7, 9, 1, 1, 5, 5, 7,
537 7, 9, 1, 5, 7, 5, 5, 5, 7, 9,
538 7, 9, 3, 5, 3, 5, 3, 3, 3, 3,
539 3, 5, 7, 5, 9, 5, 5, 5, 5, 5,
540 3, 5, 1, 1, 1, 1, 5, 7, 3, 1,
541 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
542 1, 1, 1, 1, 1, 1, 2
543 };
544
545 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
546 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
547 means the default is an error. */
548 static const unsigned char yydefact[] =
549 {
550 0, 6, 7, 0, 0, 0, 0, 0, 0, 0,
551 0, 0, 0, 0, 23, 0, 0, 4, 5, 0,
552 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
553 1, 2, 105, 10, 9, 8, 11, 12, 0, 36,
554 41, 52, 0, 0, 0, 0, 45, 0, 0, 0,
555 0, 0, 37, 0, 46, 13, 0, 0, 14, 0,
556 0, 15, 84, 85, 16, 0, 0, 17, 0, 0,
557 0, 0, 0, 0, 19, 24, 28, 27, 26, 25,
558 29, 20, 30, 34, 33, 32, 31, 35, 21, 0,
559 106, 0, 0, 0, 0, 0, 0, 0, 0, 0,
560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
561 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
562 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,
563 66, 67, 68, 101, 0, 69, 0, 70, 0, 100,
564 98, 18, 0, 0, 0, 0, 0, 0, 0, 0,
565 0, 62, 0, 0, 0, 0, 22, 0, 0, 0,
566 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
567 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
568 0, 0, 0, 0, 0, 0, 0, 0, 0, 53,
569 82, 83, 0, 55, 56, 57, 0, 0, 47, 42,
570 0, 0, 38, 0, 48, 63, 0, 65, 0, 99,
571 0, 88, 0, 0, 0, 0, 0, 0, 0, 0,
572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
574 0, 0, 0, 0, 0, 0, 0, 0, 54, 50,
575 0, 43, 49, 39, 0, 104, 103, 102, 80, 0,
576 86, 90, 0, 89, 71, 73, 91, 92, 0, 78,
577 95, 93, 76, 94, 77, 96, 97, 79, 75, 0,
578 58, 60, 0, 0, 0, 0, 0, 0, 0, 0,
579 0, 0, 51, 44, 40, 81, 87, 72, 0, 59,
580 61, 0, 74
581 };
582
583 /* YYDEFGOTO[NTERM-NUM]. */
584 static const short yydefgoto[] =
585 {
586 -1, 15, 16, 17, 18, 81, 88, 55, 74, 58,
587 61, 67, 151, 205, 192, 64, 135, 137, 264, 262,
588 265, 268, 272, 274, 269, 277, 141, 210, 138, 136,
589 258, 206
590 };
591
592 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
593 STATE-NUM. */
594 #define YYPACT_NINF -242
595 static const short yypact[] =
596 {
597 163, -242, -242, 6, 20, 71, 82, 86, 90, 100,
598 120, 122, 123, 124, -242, 128, 125, 51, -242, 107,
599 67, -27, -26, -25, 41, 109, -22, -23, -10, 110,
600 -242, -242, -242, -242, -242, -242, 133, -242, 130, -242,
601 -242, -242, 131, 132, 134, 135, -242, 136, 138, 139,
602 140, 143, -242, 146, -242, -242, 147, 148, -242, 149,
603 150, -242, -242, -242, -242, 151, 152, -242, 153, 154,
604 155, 156, 158, 159, -242, -242, -242, -242, -242, -242,
605 -242, -242, -242, -242, -242, -242, -242, -242, -242, 160,
606 -242, 68, 142, 161, 162, 164, 165, 166, 167, 168,
607 169, 170, 137, 137, 176, 183, 11, 137, 184, 36,
608 185, 188, 196, 197, 184, 198, 199, 200, 201, 202,
609 203, 205, 208, 209, 210, 211, 212, 214, 216, 33,
610 34, -242, -242, -242, 217, -242, 218, -242, 219, 133,
611 -242, -242, 221, 222, 224, 225, 226, 227, 228, 229,
612 230, -242, 231, 232, 233, 234, -242, 184, 54, 184,
613 184, 137, 237, 238, 239, 137, 137, 240, 137, 137,
614 241, 137, 137, 242, 244, 184, 184, 184, 184, 184,
615 184, 184, 184, 184, 184, 245, 137, 137, 246, -242,
616 -242, -242, 247, -242, -242, -242, 248, 249, -242, 133,
617 50, 250, 133, 52, -242, 251, 13, 251, 252, -242,
618 253, -242, 254, 255, 256, 257, 258, 260, 261, 262,
619 263, 264, 27, 28, 265, 184, 268, 269, 137, 270,
620 137, 137, 118, 244, 184, 271, 272, 137, 273, 137,
621 274, 275, 121, 273, 137, 118, 118, 137, -242, -242,
622 276, 70, -242, 84, 31, -242, -242, -242, -242, 277,
623 -242, -242, 278, -242, -242, -242, 133, -242, 279, -242,
624 133, -242, -242, -242, -242, -242, -242, -242, -242, 40,
625 -242, -242, 49, 137, 137, 137, 118, 184, 271, 274,
626 118, 118, 133, 251, 251, -242, -242, -242, 280, -242,
627 -242, 275, -242
628 };
629
630 /* YYPGOTO[NTERM-NUM]. */
631 static const short yypgoto[] =
632 {
633 -242, -242, -242, -242, -242, -242, -242, -242, -242, -242,
634 -242, -242, -242, -170, -242, -242, -242, -242, -242, -120,
635 -242, -40, -85, -54, -242, -242, -113, 19, 92, 108,
636 -241, -17
637 };
638
639 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
640 positive, shift that token. If negative, reduce the rule which
641 number is the opposite. If zero, do what YYDEFACT says.
642 If YYTABLE_NINF, syntax error. */
643 #define YYTABLE_NINF -4
644 static const short yytable[] =
645 {
646 36, 156, 207, 69, 280, 281, 75, 76, 77, 78,
647 79, 56, 59, 19, 62, 70, 90, 133, 71, 82,
648 83, 84, 85, 86, 232, 57, 60, 20, 63, 134,
649 90, 90, 72, 73, 90, 80, 90, 90, 245, 246,
650 171, 172, 286, 90, 189, 295, 193, 194, 87, 299,
651 300, 290, 90, 90, 32, 90, 33, 228, 34, 230,
652 291, 35, 211, 212, 213, 214, 215, 216, 217, 218,
653 219, 220, 142, 90, 143, 65, 66, 284, 21, 144,
654 145, 146, 147, 148, 149, 129, 130, 90, 150, 22,
655 139, 285, 38, 23, 39, 40, 41, 24, 115, 116,
656 117, 118, 42, 43, 44, 45, 46, 25, 47, 48,
657 190, 191, 248, 49, 293, 294, 50, 51, 52, 53,
658 54, 260, 255, 256, 257, 275, 276, 26, 30, 27,
659 28, 29, 37, 31, 68, 89, 90, 91, 92, 93,
660 32, 94, 95, 96, 139, 97, 98, 99, 199, 200,
661 100, 202, 203, 101, 102, 103, 104, 105, 106, 107,
662 108, 109, 110, 111, 1, 112, 113, 114, 297, 222,
663 223, -3, 119, 2, 296, 3, 4, 5, 6, 7,
664 8, 131, 9, 10, 11, 12, 13, 14, 132, 140,
665 152, 120, 121, 153, 122, 123, 124, 125, 126, 127,
666 128, 154, 155, 278, 298, 157, 158, 159, 160, 161,
667 162, 251, 163, 253, 254, 164, 165, 166, 167, 168,
668 266, 169, 270, 170, 173, 174, 175, 279, 176, 177,
669 282, 178, 179, 180, 181, 182, 183, 184, 185, 186,
670 187, 188, 196, 197, 198, 201, 204, 302, 133, 209,
671 221, 224, 259, 195, 225, 226, 227, 229, 231, 233,
672 234, 235, 236, 237, 238, 239, 292, 240, 241, 242,
673 243, 244, 247, 249, 250, 252, 261, 263, 267, 271,
674 273, 208, 0, 283, 287, 288, 289, 301
675 };
676
677 static const short yycheck[] =
678 {
679 17, 114, 172, 25, 245, 246, 29, 30, 31, 32,
680 33, 38, 38, 7, 39, 37, 3, 6, 40, 29,
681 30, 31, 32, 33, 11, 52, 52, 7, 53, 18,
682 3, 3, 54, 55, 3, 58, 3, 3, 11, 11,
683 7, 7, 11, 3, 157, 286, 159, 160, 58, 290,
684 291, 11, 3, 3, 3, 3, 5, 7, 7, 7,
685 11, 10, 175, 176, 177, 178, 179, 180, 181, 182,
686 183, 184, 36, 3, 38, 34, 35, 7, 7, 43,
687 44, 45, 46, 47, 48, 102, 103, 3, 52, 7,
688 107, 7, 25, 7, 27, 28, 29, 7, 30, 31,
689 32, 33, 35, 36, 37, 38, 39, 7, 41, 42,
690 56, 57, 225, 46, 284, 285, 49, 50, 51, 52,
691 53, 234, 4, 5, 6, 4, 5, 7, 0, 7,
692 7, 7, 25, 8, 25, 25, 3, 7, 7, 7,
693 3, 7, 7, 7, 161, 7, 7, 7, 165, 166,
694 7, 168, 169, 7, 7, 7, 7, 7, 7, 7,
695 7, 7, 7, 7, 1, 7, 7, 7, 288, 186,
696 187, 8, 30, 10, 287, 12, 13, 14, 15, 16,
697 17, 5, 19, 20, 21, 22, 23, 24, 5, 5,
698 5, 30, 30, 5, 30, 30, 30, 30, 30, 30,
699 30, 5, 5, 243, 289, 7, 7, 7, 7, 7,
700 7, 228, 7, 230, 231, 7, 7, 7, 7, 7,
701 237, 7, 239, 7, 7, 7, 7, 244, 7, 7,
702 247, 7, 7, 7, 7, 7, 7, 7, 7, 7,
703 7, 7, 5, 5, 5, 5, 5, 301, 6, 5,
704 5, 5, 233, 161, 7, 7, 7, 7, 7, 7,
705 7, 7, 7, 7, 7, 7, 283, 7, 7, 7,
706 7, 7, 7, 5, 5, 5, 5, 5, 5, 5,
707 5, 173, -1, 7, 7, 7, 7, 7
708 };
709
710 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
711 symbol of state STATE-NUM. */
712 static const unsigned char yystos[] =
713 {
714 0, 1, 10, 12, 13, 14, 15, 16, 17, 19,
715 20, 21, 22, 23, 24, 60, 61, 62, 63, 7,
716 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
717 0, 8, 3, 5, 7, 10, 90, 25, 25, 27,
718 28, 29, 35, 36, 37, 38, 39, 41, 42, 46,
719 49, 50, 51, 52, 53, 66, 38, 52, 68, 38,
720 52, 69, 39, 53, 74, 34, 35, 70, 25, 25,
721 37, 40, 54, 55, 67, 29, 30, 31, 32, 33,
722 58, 64, 29, 30, 31, 32, 33, 58, 65, 25,
723 3, 7, 7, 7, 7, 7, 7, 7, 7, 7,
724 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
725 7, 7, 7, 7, 7, 30, 31, 32, 33, 30,
726 30, 30, 30, 30, 30, 30, 30, 30, 30, 90,
727 90, 5, 5, 6, 18, 75, 88, 76, 87, 90,
728 5, 85, 36, 38, 43, 44, 45, 46, 47, 48,
729 52, 71, 5, 5, 5, 5, 85, 7, 7, 7,
730 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
731 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
732 7, 7, 7, 7, 7, 7, 7, 7, 7, 85,
733 56, 57, 73, 85, 85, 87, 5, 5, 5, 90,
734 90, 5, 90, 90, 5, 72, 90, 72, 88, 5,
735 86, 85, 85, 85, 85, 85, 85, 85, 85, 85,
736 85, 5, 90, 90, 5, 7, 7, 7, 7, 7,
737 7, 7, 11, 7, 7, 7, 7, 7, 7, 7,
738 7, 7, 7, 7, 7, 11, 11, 7, 85, 5,
739 5, 90, 5, 90, 90, 4, 5, 6, 89, 86,
740 85, 5, 78, 5, 77, 79, 90, 5, 80, 83,
741 90, 5, 81, 5, 82, 4, 5, 84, 80, 90,
742 89, 89, 90, 7, 7, 7, 11, 7, 7, 7,
743 11, 11, 90, 72, 72, 89, 85, 78, 81, 89,
744 89, 7, 82
745 };
746
747 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
748 # define YYSIZE_T __SIZE_TYPE__
749 #endif
750 #if ! defined (YYSIZE_T) && defined (size_t)
751 # define YYSIZE_T size_t
752 #endif
753 #if ! defined (YYSIZE_T)
754 # if defined (__STDC__) || defined (__cplusplus)
755 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
756 # define YYSIZE_T size_t
757 # endif
758 #endif
759 #if ! defined (YYSIZE_T)
760 # define YYSIZE_T unsigned int
761 #endif
762
763 #define yyerrok (yyerrstatus = 0)
764 #define yyclearin (yychar = YYEMPTY)
765 #define YYEMPTY (-2)
766 #define YYEOF 0
767
768 #define YYACCEPT goto yyacceptlab
769 #define YYABORT goto yyabortlab
770 #define YYERROR goto yyerrlab1
771
772
773 /* Like YYERROR except do call yyerror. This remains here temporarily
774 to ease the transition to the new meaning of YYERROR, for GCC.
775 Once GCC version 2 has supplanted version 1, this can go. */
776
777 #define YYFAIL goto yyerrlab
778
779 #define YYRECOVERING() (!!yyerrstatus)
780
781 #define YYBACKUP(Token, Value) \
782 do \
783 if (yychar == YYEMPTY && yylen == 1) \
784 { \
785 yychar = (Token); \
786 yylval = (Value); \
787 yytoken = YYTRANSLATE (yychar); \
788 YYPOPSTACK; \
789 goto yybackup; \
790 } \
791 else \
792 { \
793 yyerror ("syntax error: cannot back up");\
794 YYERROR; \
795 } \
796 while (0)
797
798 #define YYTERROR 1
799 #define YYERRCODE 256
800
801 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
802 are run). */
803
804 #ifndef YYLLOC_DEFAULT
805 # define YYLLOC_DEFAULT(Current, Rhs, N) \
806 Current.first_line = Rhs[1].first_line; \
807 Current.first_column = Rhs[1].first_column; \
808 Current.last_line = Rhs[N].last_line; \
809 Current.last_column = Rhs[N].last_column;
810 #endif
811
812 /* YYLEX -- calling `yylex' with the right arguments. */
813
814 #ifdef YYLEX_PARAM
815 # define YYLEX yylex (&yylval, YYLEX_PARAM)
816 #else
817 # define YYLEX yylex (&yylval)
818 #endif
819
820 /* Enable debugging if requested. */
821 #if YYDEBUG
822
823 # ifndef YYFPRINTF
824 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
825 # define YYFPRINTF fprintf
826 # endif
827
828 # define YYDPRINTF(Args) \
829 do { \
830 if (yydebug) \
831 YYFPRINTF Args; \
832 } while (0)
833
834 # define YYDSYMPRINT(Args) \
835 do { \
836 if (yydebug) \
837 yysymprint Args; \
838 } while (0)
839
840 # define YYDSYMPRINTF(Title, Token, Value, Location) \
841 do { \
842 if (yydebug) \
843 { \
844 YYFPRINTF (stderr, "%s ", Title); \
845 yysymprint (stderr, \
846 Token, Value); \
847 YYFPRINTF (stderr, "\n"); \
848 } \
849 } while (0)
850
851 /*------------------------------------------------------------------.
852 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
853 | TOP (cinluded). |
854 `------------------------------------------------------------------*/
855
856 #if defined (__STDC__) || defined (__cplusplus)
857 static void
858 yy_stack_print (short *bottom, short *top)
859 #else
860 static void
861 yy_stack_print (bottom, top)
862 short *bottom;
863 short *top;
864 #endif
865 {
866 YYFPRINTF (stderr, "Stack now");
867 for (/* Nothing. */; bottom <= top; ++bottom)
868 YYFPRINTF (stderr, " %d", *bottom);
869 YYFPRINTF (stderr, "\n");
870 }
871
872 # define YY_STACK_PRINT(Bottom, Top) \
873 do { \
874 if (yydebug) \
875 yy_stack_print ((Bottom), (Top)); \
876 } while (0)
877
878
879 /*------------------------------------------------.
880 | Report that the YYRULE is going to be reduced. |
881 `------------------------------------------------*/
882
883 #if defined (__STDC__) || defined (__cplusplus)
884 static void
885 yy_reduce_print (int yyrule)
886 #else
887 static void
888 yy_reduce_print (yyrule)
889 int yyrule;
890 #endif
891 {
892 int yyi;
893 unsigned int yylineno = yyrline[yyrule];
894 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
895 yyrule - 1, yylineno);
896 /* Print the symbols being reduced, and their result. */
897 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
898 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
899 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
900 }
901
902 # define YY_REDUCE_PRINT(Rule) \
903 do { \
904 if (yydebug) \
905 yy_reduce_print (Rule); \
906 } while (0)
907
908 /* Nonzero means print parse trace. It is left uninitialized so that
909 multiple parsers can coexist. */
910 int yydebug;
911 #else /* !YYDEBUG */
912 # define YYDPRINTF(Args)
913 # define YYDSYMPRINT(Args)
914 # define YYDSYMPRINTF(Title, Token, Value, Location)
915 # define YY_STACK_PRINT(Bottom, Top)
916 # define YY_REDUCE_PRINT(Rule)
917 #endif /* !YYDEBUG */
918
919
920 /* YYINITDEPTH -- initial size of the parser's stacks. */
921 #ifndef YYINITDEPTH
922 # define YYINITDEPTH 200
923 #endif
924
925 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
926 if the built-in stack extension method is used).
927
928 Do not make this value too large; the results are undefined if
929 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
930 evaluated with infinite-precision integer arithmetic. */
931
932 #if YYMAXDEPTH == 0
933 # undef YYMAXDEPTH
934 #endif
935
936 #ifndef YYMAXDEPTH
937 # define YYMAXDEPTH 10000
938 #endif
939
940
941
942 #if YYERROR_VERBOSE
943
944 # ifndef yystrlen
945 # if defined (__GLIBC__) && defined (_STRING_H)
946 # define yystrlen strlen
947 # else
948 /* Return the length of YYSTR. */
949 static YYSIZE_T
950 # if defined (__STDC__) || defined (__cplusplus)
951 yystrlen (const char *yystr)
952 # else
953 yystrlen (yystr)
954 const char *yystr;
955 # endif
956 {
957 register const char *yys = yystr;
958
959 while (*yys++ != '\0')
960 continue;
961
962 return yys - yystr - 1;
963 }
964 # endif
965 # endif
966
967 # ifndef yystpcpy
968 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
969 # define yystpcpy stpcpy
970 # else
971 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
972 YYDEST. */
973 static char *
974 # if defined (__STDC__) || defined (__cplusplus)
975 yystpcpy (char *yydest, const char *yysrc)
976 # else
977 yystpcpy (yydest, yysrc)
978 char *yydest;
979 const char *yysrc;
980 # endif
981 {
982 register char *yyd = yydest;
983 register const char *yys = yysrc;
984
985 while ((*yyd++ = *yys++) != '\0')
986 continue;
987
988 return yyd - 1;
989 }
990 # endif
991 # endif
992
993 #endif /* !YYERROR_VERBOSE */
994
995
996
997 #if YYDEBUG
998 /*--------------------------------.
999 | Print this symbol on YYOUTPUT. |
1000 `--------------------------------*/
1001
1002 #if defined (__STDC__) || defined (__cplusplus)
1003 static void
1004 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1005 #else
1006 static void
1007 yysymprint (yyoutput, yytype, yyvaluep)
1008 FILE *yyoutput;
1009 int yytype;
1010 YYSTYPE *yyvaluep;
1011 #endif
1012 {
1013 /* Pacify ``unused variable'' warnings. */
1014 (void) yyvaluep;
1015
1016 if (yytype < YYNTOKENS)
1017 {
1018 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1019 # ifdef YYPRINT
1020 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1021 # endif
1022 }
1023 else
1024 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1025
1026 switch (yytype)
1027 {
1028 default:
1029 break;
1030 }
1031 YYFPRINTF (yyoutput, ")");
1032 }
1033
1034 #endif /* ! YYDEBUG */
1035 /*-----------------------------------------------.
1036 | Release the memory associated to this symbol. |
1037 `-----------------------------------------------*/
1038
1039 #if defined (__STDC__) || defined (__cplusplus)
1040 static void
1041 yydestruct (int yytype, YYSTYPE *yyvaluep)
1042 #else
1043 static void
1044 yydestruct (yytype, yyvaluep)
1045 int yytype;
1046 YYSTYPE *yyvaluep;
1047 #endif
1048 {
1049 /* Pacify ``unused variable'' warnings. */
1050 (void) yyvaluep;
1051
1052 switch (yytype)
1053 {
1054
1055 default:
1056 break;
1057 }
1058 }
1059
1060
1061 /* Prevent warnings from -Wmissing-prototypes. */
1062
1063 #ifdef YYPARSE_PARAM
1064 # if defined (__STDC__) || defined (__cplusplus)
1065 int yyparse (void *YYPARSE_PARAM);
1066 # else
1067 int yyparse ();
1068 # endif
1069 #else /* ! YYPARSE_PARAM */
1070 #if defined (__STDC__) || defined (__cplusplus)
1071 int yyparse (void);
1072 #else
1073 int yyparse ();
1074 #endif
1075 #endif /* ! YYPARSE_PARAM */
1076
1077
1078
1079
1080
1081
1082 /*----------.
1083 | yyparse. |
1084 `----------*/
1085
1086 #ifdef YYPARSE_PARAM
1087 # if defined (__STDC__) || defined (__cplusplus)
1088 int yyparse (void *YYPARSE_PARAM)
1089 # else
1090 int yyparse (YYPARSE_PARAM)
1091 void *YYPARSE_PARAM;
1092 # endif
1093 #else /* ! YYPARSE_PARAM */
1094 #if defined (__STDC__) || defined (__cplusplus)
1095 int
1096 yyparse (void)
1097 #else
1098 int
1099 yyparse ()
1100
1101 #endif
1102 #endif
1103 {
1104 /* The lookahead symbol. */
1105 int yychar;
1106
1107 /* The semantic value of the lookahead symbol. */
1108 YYSTYPE yylval;
1109
1110 /* Number of syntax errors so far. */
1111 int yynerrs;
1112
1113 register int yystate;
1114 register int yyn;
1115 int yyresult;
1116 /* Number of tokens to shift before error messages enabled. */
1117 int yyerrstatus;
1118 /* Lookahead token as an internal (translated) token number. */
1119 int yytoken = 0;
1120
1121 /* Three stacks and their tools:
1122 `yyss': related to states,
1123 `yyvs': related to semantic values,
1124 `yyls': related to locations.
1125
1126 Refer to the stacks thru separate pointers, to allow yyoverflow
1127 to reallocate them elsewhere. */
1128
1129 /* The state stack. */
1130 short yyssa[YYINITDEPTH];
1131 short *yyss = yyssa;
1132 register short *yyssp;
1133
1134 /* The semantic value stack. */
1135 YYSTYPE yyvsa[YYINITDEPTH];
1136 YYSTYPE *yyvs = yyvsa;
1137 register YYSTYPE *yyvsp;
1138
1139
1140
1141 #define YYPOPSTACK (yyvsp--, yyssp--)
1142
1143 YYSIZE_T yystacksize = YYINITDEPTH;
1144
1145 /* The variables used to return semantic value and location from the
1146 action routines. */
1147 YYSTYPE yyval;
1148
1149
1150 /* When reducing, the number of symbols on the RHS of the reduced
1151 rule. */
1152 int yylen;
1153
1154 YYDPRINTF ((stderr, "Starting parse\n"));
1155
1156 yystate = 0;
1157 yyerrstatus = 0;
1158 yynerrs = 0;
1159 yychar = YYEMPTY; /* Cause a token to be read. */
1160
1161 /* Initialize stack pointers.
1162 Waste one element of value and location stack
1163 so that they stay on the same level as the state stack.
1164 The wasted elements are never initialized. */
1165
1166 yyssp = yyss;
1167 yyvsp = yyvs;
1168
1169 goto yysetstate;
1170
1171 /*------------------------------------------------------------.
1172 | yynewstate -- Push a new state, which is found in yystate. |
1173 `------------------------------------------------------------*/
1174 yynewstate:
1175 /* In all cases, when you get here, the value and location stacks
1176 have just been pushed. so pushing a state here evens the stacks.
1177 */
1178 yyssp++;
1179
1180 yysetstate:
1181 *yyssp = yystate;
1182
1183 if (yyss + yystacksize - 1 <= yyssp)
1184 {
1185 /* Get the current used size of the three stacks, in elements. */
1186 YYSIZE_T yysize = yyssp - yyss + 1;
1187
1188 #ifdef yyoverflow
1189 {
1190 /* Give user a chance to reallocate the stack. Use copies of
1191 these so that the &'s don't force the real ones into
1192 memory. */
1193 YYSTYPE *yyvs1 = yyvs;
1194 short *yyss1 = yyss;
1195
1196
1197 /* Each stack pointer address is followed by the size of the
1198 data in use in that stack, in bytes. This used to be a
1199 conditional around just the two extra args, but that might
1200 be undefined if yyoverflow is a macro. */
1201 yyoverflow ("parser stack overflow",
1202 &yyss1, yysize * sizeof (*yyssp),
1203 &yyvs1, yysize * sizeof (*yyvsp),
1204
1205 &yystacksize);
1206
1207 yyss = yyss1;
1208 yyvs = yyvs1;
1209 }
1210 #else /* no yyoverflow */
1211 # ifndef YYSTACK_RELOCATE
1212 goto yyoverflowlab;
1213 # else
1214 /* Extend the stack our own way. */
1215 if (YYMAXDEPTH <= yystacksize)
1216 goto yyoverflowlab;
1217 yystacksize *= 2;
1218 if (YYMAXDEPTH < yystacksize)
1219 yystacksize = YYMAXDEPTH;
1220
1221 {
1222 short *yyss1 = yyss;
1223 union yyalloc *yyptr =
1224 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1225 if (! yyptr)
1226 goto yyoverflowlab;
1227 YYSTACK_RELOCATE (yyss);
1228 YYSTACK_RELOCATE (yyvs);
1229
1230 # undef YYSTACK_RELOCATE
1231 if (yyss1 != yyssa)
1232 YYSTACK_FREE (yyss1);
1233 }
1234 # endif
1235 #endif /* no yyoverflow */
1236
1237 yyssp = yyss + yysize - 1;
1238 yyvsp = yyvs + yysize - 1;
1239
1240
1241 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1242 (unsigned long int) yystacksize));
1243
1244 if (yyss + yystacksize - 1 <= yyssp)
1245 YYABORT;
1246 }
1247
1248 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1249
1250 goto yybackup;
1251
1252 /*-----------.
1253 | yybackup. |
1254 `-----------*/
1255 yybackup:
1256
1257 /* Do appropriate processing given the current state. */
1258 /* Read a lookahead token if we need one and don't already have one. */
1259 /* yyresume: */
1260
1261 /* First try to decide what to do without reference to lookahead token. */
1262
1263 yyn = yypact[yystate];
1264 if (yyn == YYPACT_NINF)
1265 goto yydefault;
1266
1267 /* Not known => get a lookahead token if don't already have one. */
1268
1269 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1270 if (yychar == YYEMPTY)
1271 {
1272 YYDPRINTF ((stderr, "Reading a token: "));
1273 yychar = YYLEX;
1274 }
1275
1276 if (yychar <= YYEOF)
1277 {
1278 yychar = yytoken = YYEOF;
1279 YYDPRINTF ((stderr, "Now at end of input.\n"));
1280 }
1281 else
1282 {
1283 yytoken = YYTRANSLATE (yychar);
1284 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1285 }
1286
1287 /* If the proper action on seeing token YYTOKEN is to reduce or to
1288 detect an error, take that action. */
1289 yyn += yytoken;
1290 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1291 goto yydefault;
1292 yyn = yytable[yyn];
1293 if (yyn <= 0)
1294 {
1295 if (yyn == 0 || yyn == YYTABLE_NINF)
1296 goto yyerrlab;
1297 yyn = -yyn;
1298 goto yyreduce;
1299 }
1300
1301 if (yyn == YYFINAL)
1302 YYACCEPT;
1303
1304 /* Shift the lookahead token. */
1305 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1306
1307 /* Discard the token being shifted unless it is eof. */
1308 if (yychar != YYEOF)
1309 yychar = YYEMPTY;
1310
1311 *++yyvsp = yylval;
1312
1313
1314 /* Count tokens shifted since error; after three, turn off error
1315 status. */
1316 if (yyerrstatus)
1317 yyerrstatus--;
1318
1319 yystate = yyn;
1320 goto yynewstate;
1321
1322
1323 /*-----------------------------------------------------------.
1324 | yydefault -- do the default action for the current state. |
1325 `-----------------------------------------------------------*/
1326 yydefault:
1327 yyn = yydefact[yystate];
1328 if (yyn == 0)
1329 goto yyerrlab;
1330 goto yyreduce;
1331
1332
1333 /*-----------------------------.
1334 | yyreduce -- Do a reduction. |
1335 `-----------------------------*/
1336 yyreduce:
1337 /* yyn is the number of a rule to reduce with. */
1338 yylen = yyr2[yyn];
1339
1340 /* If YYLEN is nonzero, implement the default value of the action:
1341 `$$ = $1'.
1342
1343 Otherwise, the following line sets YYVAL to garbage.
1344 This behavior is undocumented and Bison
1345 users should not rely upon it. Assigning to YYVAL
1346 unconditionally makes the parser a bit smaller, and it avoids a
1347 GCC warning that YYVAL may be used uninitialized. */
1348 yyval = yyvsp[1-yylen];
1349
1350
1351 YY_REDUCE_PRINT (yyn);
1352 switch (yyn)
1353 {
1354 case 3:
1355 #line 81 "lscp.y"
1356 { return LSCP_DONE; }
1357 break;
1358
1359 case 4:
1360 #line 82 "lscp.y"
1361 { return LSCP_DONE; }
1362 break;
1363
1364 case 5:
1365 #line 83 "lscp.y"
1366 { LSCPSERVER->AnswerClient(yyvsp[0].String); return LSCP_DONE; }
1367 break;
1368
1369 case 6:
1370 #line 84 "lscp.y"
1371 { LSCPSERVER->AnswerClient("Err:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; }
1372 break;
1373
1374 case 12:
1375 #line 94 "lscp.y"
1376 { yyval.String = LSCPSERVER->AddChannel(); }
1377 break;
1378
1379 case 13:
1380 #line 95 "lscp.y"
1381 { yyval.String = yyvsp[0].String; }
1382 break;
1383
1384 case 14:
1385 #line 96 "lscp.y"
1386 { yyval.String = yyvsp[0].String; }
1387 break;
1388
1389 case 15:
1390 #line 97 "lscp.y"
1391 { yyval.String = yyvsp[0].String; }
1392 break;
1393
1394 case 16:
1395 #line 98 "lscp.y"
1396 { yyval.String = yyvsp[0].String; }
1397 break;
1398
1399 case 17:
1400 #line 99 "lscp.y"
1401 { yyval.String = yyvsp[0].String; }
1402 break;
1403
1404 case 18:
1405 #line 100 "lscp.y"
1406 { yyval.String = LSCPSERVER->RemoveChannel(yyvsp[0].Number); }
1407 break;
1408
1409 case 19:
1410 #line 101 "lscp.y"
1411 { yyval.String = yyvsp[0].String; }
1412 break;
1413
1414 case 20:
1415 #line 102 "lscp.y"
1416 { yyval.String = yyvsp[0].String; }
1417 break;
1418
1419 case 21:
1420 #line 103 "lscp.y"
1421 { yyval.String = yyvsp[0].String; }
1422 break;
1423
1424 case 22:
1425 #line 104 "lscp.y"
1426 { yyval.String = LSCPSERVER->ResetChannel(yyvsp[0].Number); }
1427 break;
1428
1429 case 23:
1430 #line 105 "lscp.y"
1431 { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; }
1432 break;
1433
1434 case 24:
1435 #line 108 "lscp.y"
1436 { yyval.String = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channels); }
1437 break;
1438
1439 case 25:
1440 #line 109 "lscp.y"
1441 { yyval.String = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); }
1442 break;
1443
1444 case 26:
1445 #line 110 "lscp.y"
1446 { yyval.String = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); }
1447 break;
1448
1449 case 27:
1450 #line 111 "lscp.y"
1451 { yyval.String = LSCPSERVER->SubscribeNotification(LSCPEvent::event_buffer_fill); }
1452 break;
1453
1454 case 28:
1455 #line 112 "lscp.y"
1456 { yyval.String = LSCPSERVER->SubscribeNotification(LSCPEvent::event_info); }
1457 break;
1458
1459 case 29:
1460 #line 113 "lscp.y"
1461 { yyval.String = LSCPSERVER->SubscribeNotification(LSCPEvent::event_misc); }
1462 break;
1463
1464 case 30:
1465 #line 116 "lscp.y"
1466 { yyval.String = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channels); }
1467 break;
1468
1469 case 31:
1470 #line 117 "lscp.y"
1471 { yyval.String = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_voice_count); }
1472 break;
1473
1474 case 32:
1475 #line 118 "lscp.y"
1476 { yyval.String = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_stream_count); }
1477 break;
1478
1479 case 33:
1480 #line 119 "lscp.y"
1481 { yyval.String = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_buffer_fill); }
1482 break;
1483
1484 case 34:
1485 #line 120 "lscp.y"
1486 { yyval.String = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_info); }
1487 break;
1488
1489 case 35:
1490 #line 121 "lscp.y"
1491 { yyval.String = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_misc); }
1492 break;
1493
1494 case 36:
1495 #line 124 "lscp.y"
1496 { yyval.String = LSCPSERVER->GetAvailableEngines(); }
1497 break;
1498
1499 case 37:
1500 #line 125 "lscp.y"
1501 { yyval.String = LSCPSERVER->GetAvailableMidiInputDrivers(); }
1502 break;
1503
1504 case 38:
1505 #line 126 "lscp.y"
1506 { yyval.String = LSCPSERVER->GetMidiInputDriverInfo(yyvsp[0].String); }
1507 break;
1508
1509 case 39:
1510 #line 127 "lscp.y"
1511 { yyval.String = LSCPSERVER->GetMidiInputDriverParameterInfo(yyvsp[-2].String, yyvsp[0].String); }
1512 break;
1513
1514 case 40:
1515 #line 128 "lscp.y"
1516 { yyval.String = LSCPSERVER->GetMidiInputDriverParameterInfo(yyvsp[-4].String, yyvsp[-2].String, yyvsp[0].KeyValList); }
1517 break;
1518
1519 case 41:
1520 #line 129 "lscp.y"
1521 { yyval.String = LSCPSERVER->GetAvailableAudioOutputDrivers(); }
1522 break;
1523
1524 case 42:
1525 #line 130 "lscp.y"
1526 { yyval.String = LSCPSERVER->GetAudioOutputDriverInfo(yyvsp[0].String); }
1527 break;
1528
1529 case 43:
1530 #line 131 "lscp.y"
1531 { yyval.String = LSCPSERVER->GetAudioOutputDriverParameterInfo(yyvsp[-2].String, yyvsp[0].String); }
1532 break;
1533
1534 case 44:
1535 #line 132 "lscp.y"
1536 { yyval.String = LSCPSERVER->GetAudioOutputDriverParameterInfo(yyvsp[-4].String, yyvsp[-2].String, yyvsp[0].KeyValList); }
1537 break;
1538
1539 case 45:
1540 #line 133 "lscp.y"
1541 { yyval.String = LSCPSERVER->GetAudioOutputDeviceCount(); }
1542 break;
1543
1544 case 46:
1545 #line 134 "lscp.y"
1546 { yyval.String = LSCPSERVER->GetMidiInputDeviceCount(); }
1547 break;
1548
1549 case 47:
1550 #line 135 "lscp.y"
1551 { yyval.String = LSCPSERVER->GetAudioOutputDeviceInfo(yyvsp[0].Number); }
1552 break;
1553
1554 case 48:
1555 #line 136 "lscp.y"
1556 { yyval.String = LSCPSERVER->GetMidiInputDeviceInfo(yyvsp[0].Number); }
1557 break;
1558
1559 case 49:
1560 #line 137 "lscp.y"
1561 { yyval.String = LSCPSERVER->GetMidiInputPortInfo(yyvsp[-2].Number, yyvsp[0].Number); }
1562 break;
1563
1564 case 50:
1565 #line 138 "lscp.y"
1566 { yyval.String = LSCPSERVER->GetAudioOutputChannelInfo(yyvsp[-2].Number, yyvsp[0].Number); }
1567 break;
1568
1569 case 51:
1570 #line 139 "lscp.y"
1571 { yyval.String = LSCPSERVER->GetAudioOutputChannelParameterInfo(yyvsp[-4].Number, yyvsp[-2].Number, yyvsp[0].String); }
1572 break;
1573
1574 case 52:
1575 #line 140 "lscp.y"
1576 { yyval.String = LSCPSERVER->GetChannels(); }
1577 break;
1578
1579 case 53:
1580 #line 141 "lscp.y"
1581 { yyval.String = LSCPSERVER->GetChannelInfo(yyvsp[0].Number); }
1582 break;
1583
1584 case 54:
1585 #line 142 "lscp.y"
1586 { yyval.String = LSCPSERVER->GetBufferFill(yyvsp[-2].FillResponse, yyvsp[0].Number); }
1587 break;
1588
1589 case 55:
1590 #line 143 "lscp.y"
1591 { yyval.String = LSCPSERVER->GetStreamCount(yyvsp[0].Number); }
1592 break;
1593
1594 case 56:
1595 #line 144 "lscp.y"
1596 { yyval.String = LSCPSERVER->GetVoiceCount(yyvsp[0].Number); }
1597 break;
1598
1599 case 57:
1600 #line 145 "lscp.y"
1601 { yyval.String = LSCPSERVER->GetEngineInfo(yyvsp[0].String); }
1602 break;
1603
1604 case 58:
1605 #line 148 "lscp.y"
1606 { yyval.String = LSCPSERVER->SetAudioOutputDeviceParameter(yyvsp[-4].Number, yyvsp[-2].String, yyvsp[0].String); }
1607 break;
1608
1609 case 59:
1610 #line 149 "lscp.y"
1611 { yyval.String = LSCPSERVER->SetAudioOutputChannelParameter(yyvsp[-6].Number, yyvsp[-4].Number, yyvsp[-2].String, yyvsp[0].String); }
1612 break;
1613
1614 case 60:
1615 #line 150 "lscp.y"
1616 { yyval.String = LSCPSERVER->SetMidiInputDeviceParameter(yyvsp[-4].Number, yyvsp[-2].String, yyvsp[0].String); }
1617 break;
1618
1619 case 61:
1620 #line 151 "lscp.y"
1621 { yyval.String = LSCPSERVER->SetMidiInputPortParameter(yyvsp[-6].Number, yyvsp[-4].Number, yyvsp[-2].String, yyvsp[0].String); }
1622 break;
1623
1624 case 62:
1625 #line 152 "lscp.y"
1626 { yyval.String = yyvsp[0].String; }
1627 break;
1628
1629 case 63:
1630 #line 155 "lscp.y"
1631 { yyval.String = LSCPSERVER->CreateAudioOutputDevice(yyvsp[-2].String,yyvsp[0].KeyValList); }
1632 break;
1633
1634 case 64:
1635 #line 156 "lscp.y"
1636 { yyval.String = LSCPSERVER->CreateAudioOutputDevice(yyvsp[0].String); }
1637 break;
1638
1639 case 65:
1640 #line 157 "lscp.y"
1641 { yyval.String = LSCPSERVER->CreateMidiInputDevice(yyvsp[-2].String,yyvsp[0].KeyValList); }
1642 break;
1643
1644 case 66:
1645 #line 158 "lscp.y"
1646 { yyval.String = LSCPSERVER->CreateMidiInputDevice(yyvsp[0].String); }
1647 break;
1648
1649 case 67:
1650 #line 161 "lscp.y"
1651 { yyval.String = LSCPSERVER->DestroyAudioOutputDevice(yyvsp[0].Number); }
1652 break;
1653
1654 case 68:
1655 #line 162 "lscp.y"
1656 { yyval.String = LSCPSERVER->DestroyMidiInputDevice(yyvsp[0].Number); }
1657 break;
1658
1659 case 69:
1660 #line 165 "lscp.y"
1661 { yyval.String = yyvsp[0].String; }
1662 break;
1663
1664 case 70:
1665 #line 166 "lscp.y"
1666 { yyval.String = yyvsp[0].String; }
1667 break;
1668
1669 case 71:
1670 #line 169 "lscp.y"
1671 { yyval.String = LSCPSERVER->SetAudioOutputDevice(yyvsp[0].Number, yyvsp[-2].Number); }
1672 break;
1673
1674 case 72:
1675 #line 170 "lscp.y"
1676 { yyval.String = LSCPSERVER->SetAudioOutputChannel(yyvsp[-2].Number, yyvsp[0].Number, yyvsp[-4].Number); }
1677 break;
1678
1679 case 73:
1680 #line 171 "lscp.y"
1681 { yyval.String = LSCPSERVER->SetAudioOutputType(yyvsp[0].String, yyvsp[-2].Number); }
1682 break;
1683
1684 case 74:
1685 #line 172 "lscp.y"
1686 { yyval.String = LSCPSERVER->SetMIDIInput(yyvsp[-4].Number, yyvsp[-2].Number, yyvsp[0].Number, yyvsp[-6].Number); }
1687 break;
1688
1689 case 75:
1690 #line 173 "lscp.y"
1691 { yyval.String = LSCPSERVER->SetMIDIInputDevice(yyvsp[0].Number, yyvsp[-2].Number); }
1692 break;
1693
1694 case 76:
1695 #line 174 "lscp.y"
1696 { yyval.String = LSCPSERVER->SetMIDIInputPort(yyvsp[0].Number, yyvsp[-2].Number); }
1697 break;
1698
1699 case 77:
1700 #line 175 "lscp.y"
1701 { yyval.String = LSCPSERVER->SetMIDIInputChannel(yyvsp[0].Number, yyvsp[-2].Number); }
1702 break;
1703
1704 case 78:
1705 #line 176 "lscp.y"
1706 { yyval.String = LSCPSERVER->SetMIDIInputType(yyvsp[0].String, yyvsp[-2].Number); }
1707 break;
1708
1709 case 79:
1710 #line 177 "lscp.y"
1711 { yyval.String = LSCPSERVER->SetVolume(yyvsp[0].Dotnum, yyvsp[-2].Number); }
1712 break;
1713
1714 case 80:
1715 #line 180 "lscp.y"
1716 { yyval.KeyValList[yyvsp[-2].String] = yyvsp[0].String; }
1717 break;
1718
1719 case 81:
1720 #line 181 "lscp.y"
1721 { yyval.KeyValList = yyvsp[-4].KeyValList; yyval.KeyValList[yyvsp[-2].String] = yyvsp[0].String; }
1722 break;
1723
1724 case 82:
1725 #line 184 "lscp.y"
1726 { yyval.FillResponse = fill_response_bytes; }
1727 break;
1728
1729 case 83:
1730 #line 185 "lscp.y"
1731 { yyval.FillResponse = fill_response_percentage; }
1732 break;
1733
1734 case 84:
1735 #line 188 "lscp.y"
1736 { yyval.String = LSCPSERVER->GetAudioOutputDevices(); }
1737 break;
1738
1739 case 85:
1740 #line 189 "lscp.y"
1741 { yyval.String = LSCPSERVER->GetMidiInputDevices(); }
1742 break;
1743
1744 case 86:
1745 #line 192 "lscp.y"
1746 { yyval.String = LSCPSERVER->LoadInstrument(yyvsp[-4].String, yyvsp[-2].Number, yyvsp[0].Number); }
1747 break;
1748
1749 case 87:
1750 #line 193 "lscp.y"
1751 { yyval.String = LSCPSERVER->LoadInstrument(yyvsp[-4].String, yyvsp[-2].Number, yyvsp[0].Number, true); }
1752 break;
1753
1754 case 88:
1755 #line 196 "lscp.y"
1756 { yyval.String = LSCPSERVER->LoadEngine(yyvsp[-2].String, yyvsp[0].Number); }
1757 break;
1758
1759 case 97:
1760 #line 221 "lscp.y"
1761 { yyval.Dotnum = yyvsp[0].Number; }
1762 break;
1763
1764 case 102:
1765 #line 236 "lscp.y"
1766 { yyval.String = yyvsp[0].String; }
1767 break;
1768
1769 case 103:
1770 #line 237 "lscp.y"
1771 { std::stringstream ss; ss << yyvsp[0].Number; yyval.String = ss.str(); }
1772 break;
1773
1774 case 104:
1775 #line 238 "lscp.y"
1776 { std::stringstream ss; ss << yyvsp[0].Dotnum; yyval.String = ss.str(); }
1777 break;
1778
1779 case 105:
1780 #line 241 "lscp.y"
1781 { std::string s; s = yyvsp[0].Char; yyval.String = s; }
1782 break;
1783
1784 case 106:
1785 #line 242 "lscp.y"
1786 { yyval.String = yyvsp[-1].String + yyvsp[0].Char; }
1787 break;
1788
1789
1790 }
1791
1792 /* Line 999 of yacc.c. */
1793 #line 1793 "y.tab.c"
1794
1795 yyvsp -= yylen;
1796 yyssp -= yylen;
1797
1798
1799 YY_STACK_PRINT (yyss, yyssp);
1800
1801 *++yyvsp = yyval;
1802
1803
1804 /* Now `shift' the result of the reduction. Determine what state
1805 that goes to, based on the state we popped back to and the rule
1806 number reduced by. */
1807
1808 yyn = yyr1[yyn];
1809
1810 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1811 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1812 yystate = yytable[yystate];
1813 else
1814 yystate = yydefgoto[yyn - YYNTOKENS];
1815
1816 goto yynewstate;
1817
1818
1819 /*------------------------------------.
1820 | yyerrlab -- here on detecting error |
1821 `------------------------------------*/
1822 yyerrlab:
1823 /* If not already recovering from an error, report this error. */
1824 if (!yyerrstatus)
1825 {
1826 ++yynerrs;
1827 #if YYERROR_VERBOSE
1828 yyn = yypact[yystate];
1829
1830 if (YYPACT_NINF < yyn && yyn < YYLAST)
1831 {
1832 YYSIZE_T yysize = 0;
1833 int yytype = YYTRANSLATE (yychar);
1834 char *yymsg;
1835 int yyx, yycount;
1836
1837 yycount = 0;
1838 /* Start YYX at -YYN if negative to avoid negative indexes in
1839 YYCHECK. */
1840 for (yyx = yyn < 0 ? -yyn : 0;
1841 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1842 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1843 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1844 yysize += yystrlen ("syntax error, unexpected ") + 1;
1845 yysize += yystrlen (yytname[yytype]);
1846 yymsg = (char *) YYSTACK_ALLOC (yysize);
1847 if (yymsg != 0)
1848 {
1849 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1850 yyp = yystpcpy (yyp, yytname[yytype]);
1851
1852 if (yycount < 5)
1853 {
1854 yycount = 0;
1855 for (yyx = yyn < 0 ? -yyn : 0;
1856 yyx < (int) (sizeof (yytname) / sizeof (char *));
1857 yyx++)
1858 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1859 {
1860 const char *yyq = ! yycount ? ", expecting " : " or ";
1861 yyp = yystpcpy (yyp, yyq);
1862 yyp = yystpcpy (yyp, yytname[yyx]);
1863 yycount++;
1864 }
1865 }
1866 yyerror (yymsg);
1867 YYSTACK_FREE (yymsg);
1868 }
1869 else
1870 yyerror ("syntax error; also virtual memory exhausted");
1871 }
1872 else
1873 #endif /* YYERROR_VERBOSE */
1874 yyerror ("syntax error");
1875 }
1876
1877
1878
1879 if (yyerrstatus == 3)
1880 {
1881 /* If just tried and failed to reuse lookahead token after an
1882 error, discard it. */
1883
1884 /* Return failure if at end of input. */
1885 if (yychar == YYEOF)
1886 {
1887 /* Pop the error token. */
1888 YYPOPSTACK;
1889 /* Pop the rest of the stack. */
1890 while (yyss < yyssp)
1891 {
1892 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1893 yydestruct (yystos[*yyssp], yyvsp);
1894 YYPOPSTACK;
1895 }
1896 YYABORT;
1897 }
1898
1899 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1900 yydestruct (yytoken, &yylval);
1901 yychar = YYEMPTY;
1902
1903 }
1904
1905 /* Else will try to reuse lookahead token after shifting the error
1906 token. */
1907 goto yyerrlab1;
1908
1909
1910 /*----------------------------------------------------.
1911 | yyerrlab1 -- error raised explicitly by an action. |
1912 `----------------------------------------------------*/
1913 yyerrlab1:
1914 yyerrstatus = 3; /* Each real token shifted decrements this. */
1915
1916 for (;;)
1917 {
1918 yyn = yypact[yystate];
1919 if (yyn != YYPACT_NINF)
1920 {
1921 yyn += YYTERROR;
1922 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1923 {
1924 yyn = yytable[yyn];
1925 if (0 < yyn)
1926 break;
1927 }
1928 }
1929
1930 /* Pop the current state because it cannot handle the error token. */
1931 if (yyssp == yyss)
1932 YYABORT;
1933
1934 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1935 yydestruct (yystos[yystate], yyvsp);
1936 yyvsp--;
1937 yystate = *--yyssp;
1938
1939 YY_STACK_PRINT (yyss, yyssp);
1940 }
1941
1942 if (yyn == YYFINAL)
1943 YYACCEPT;
1944
1945 YYDPRINTF ((stderr, "Shifting error token, "));
1946
1947 *++yyvsp = yylval;
1948
1949
1950 yystate = yyn;
1951 goto yynewstate;
1952
1953
1954 /*-------------------------------------.
1955 | yyacceptlab -- YYACCEPT comes here. |
1956 `-------------------------------------*/
1957 yyacceptlab:
1958 yyresult = 0;
1959 goto yyreturn;
1960
1961 /*-----------------------------------.
1962 | yyabortlab -- YYABORT comes here. |
1963 `-----------------------------------*/
1964 yyabortlab:
1965 yyresult = 1;
1966 goto yyreturn;
1967
1968 #ifndef yyoverflow
1969 /*----------------------------------------------.
1970 | yyoverflowlab -- parser overflow comes here. |
1971 `----------------------------------------------*/
1972 yyoverflowlab:
1973 yyerror ("parser stack overflow");
1974 yyresult = 2;
1975 /* Fall through. */
1976 #endif
1977
1978 yyreturn:
1979 #ifndef yyoverflow
1980 if (yyss != yyssa)
1981 YYSTACK_FREE (yyss);
1982 #endif
1983 return yyresult;
1984 }
1985
1986
1987 #line 79 "lscp.y"
1988
1989
1990 /**
1991 * Will be called when an error occured (usually syntax error).
1992 */
1993 void yyerror(const char* s) {
1994 dmsg(2,("LSCPParser: %s\n", s));
1995 }
1996
1997 /**
1998 * Clears input buffer and restarts scanner.
1999 */
2000 void restart(yyparse_param_t* pparam, int& yychar) {
2001 // restart scanner
2002 yyrestart(stdin, pparam->pScanner);
2003 // reset lookahead symbol
2004 yyclearin;
2005 }
2006
2007

  ViewVC Help
Powered by ViewVC