/[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 111 - (show annotations) (download)
Sat Jun 5 20:55:50 2004 UTC (19 years, 10 months ago) by schoenebeck
File size: 46232 byte(s)
* LSCP allows now comment lines, that is lines starting with a hash ('#')
  character
* src/engines/gig/Voice.cpp: fixed "SET CHANNEL VOLUME" bug

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

  ViewVC Help
Powered by ViewVC