/[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 64 - (show annotations) (download)
Thu May 6 20:06:20 2004 UTC (19 years, 10 months ago) by schoenebeck
File size: 45635 byte(s)
* src/Sampler.cpp: fixed 3 stupid but fatal bugs that left in the rush (in
  method SamplerChannels(), CreateAudioOutputDevice() and
  CreateMidiInputDevice())
* src/network/lscpserver.cpp: implemented LSCP command
  'SET CHANNEL MIDI_INPUT_CHANNEL'
* src/Sampler.h: moved enums 'audio_output_type_t', 'midi_input_type_t'
  and 'engine_type_t' into the respective base classes
  ('AudioOutputDevice', 'MidiInputDevice', 'Engine')

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

  ViewVC Help
Powered by ViewVC