/[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 138 - (show annotations) (download)
Sun Jun 20 23:18:24 2004 UTC (19 years, 10 months ago) by senkov
File size: 56322 byte(s)
* Fix for CREATE_AUDIO_OUTPUT_DEVICE with all default params
* Fix for GET AUDIO_OUTPUT_DEVICES resultset
* Support for BACKGROUND loading

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

  ViewVC Help
Powered by ViewVC