/[svn]/linuxsampler/trunk/src/network/lscp.y
ViewVC logotype

Contents of /linuxsampler/trunk/src/network/lscp.y

Parent Directory Parent Directory | Revision Log Revision Log


Revision 573 - (show annotations) (download)
Tue May 24 03:18:30 2005 UTC (18 years, 10 months ago) by schoenebeck
File size: 33045 byte(s)
command syntax (BNF) of LSCP specification is now auto generated

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005 Christian Schoenebeck *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24 /* Note: don't forget to run 'make parser' after you changed this file, */
25 /* otherwise the parser will not be regenerated! */
26
27 %{
28
29 #include "lscpparser.h"
30 #include "lscpserver.h"
31 #include "lscpevent.h"
32
33 // to save us typing work in the rules action definitions
34 #define LSCPSERVER ((yyparse_param_t*) yyparse_param)->pServer
35
36 // clears input buffer
37 void restart(yyparse_param_t* pparam, int& yychar);
38 #define RESTART restart((yyparse_param_t*) YYPARSE_PARAM, yychar)
39
40 // we provide our own version of yyerror() so we don't have to link against the yacc library
41 void yyerror(const char* s);
42
43 static char buf[1024]; // input buffer to feed the parser with new characters
44 static int bytes = 0; // current number of characters in the input buffer
45 static int ptr = 0; // current position in the input buffer
46
47 // external reference to the function which actually reads from the socket
48 extern int GetLSCPCommand( void *buf, int max_size);
49
50 // custom scanner function which reads from the socket
51 int yylex(YYSTYPE* yylval) {
52 // check if we have to read new characters
53 if (ptr >= bytes) {
54 bytes = GetLSCPCommand(buf, 1023);
55 ptr = 0;
56 if (bytes < 0) {
57 bytes = 0;
58 return 0;
59 }
60 }
61 return (int) buf[ptr++];
62 }
63
64 %}
65
66 // reentrant parser
67 %pure_parser
68
69 %type <Char> char digit
70 %type <Dotnum> dotnum volume_value boolean
71 %type <Number> number sampler_channel instrument_index audio_channel_index device_index midi_input_channel_index midi_input_port_index
72 %type <String> string text stringval digits param_val_list param_val filename engine_name command create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args audio_output_type_name midi_input_type_name set_instruction subscribe_event unsubscribe_event
73 %type <FillResponse> buffer_size_type
74 %type <KeyValList> key_val_list
75
76 %start input
77
78 %%
79
80 //TODO: return more meaningful error messages
81
82 /*
83 The LSCP specification input file (Documentation/lscp.xml) is automatically
84 updated with this file using the scripts/update_grammar.pl script. Do not
85 modify or delete the GRAMMAR_BNF_BEGIN and GRAMMAR_BNF_END lines !
86 */
87
88 // GRAMMAR_BNF_BEGIN - do NOT delete or modify this line !!!
89
90 input : line LF
91 | line CR LF
92 ;
93
94 line : /* epsilon (empty line ignored) */ { return LSCP_DONE; }
95 | comment { return LSCP_DONE; }
96 | command { LSCPSERVER->AnswerClient($1); return LSCP_DONE; }
97 | error { LSCPSERVER->AnswerClient("ERR:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; }
98 ;
99
100 comment : '#'
101 | comment '#'
102 | comment SP
103 | comment number
104 | comment string
105 ;
106
107 command : ADD SP CHANNEL { $$ = LSCPSERVER->AddChannel(); }
108 | GET SP get_instruction { $$ = $3; }
109 | CREATE SP create_instruction { $$ = $3; }
110 | DESTROY SP destroy_instruction { $$ = $3; }
111 | LIST SP list_instruction { $$ = $3; }
112 | LOAD SP load_instruction { $$ = $3; }
113 | REMOVE SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($5); }
114 | SET SP set_instruction { $$ = $3; }
115 | SUBSCRIBE SP subscribe_event { $$ = $3; }
116 | UNSUBSCRIBE SP unsubscribe_event { $$ = $3; }
117 | SELECT SP text { $$ = LSCPSERVER->QueryDatabase($3); }
118 | RESET SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($5); }
119 | RESET { $$ = LSCPSERVER->ResetSampler(); }
120 | QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; }
121 ;
122
123 subscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_count); }
124 | VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); }
125 | STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); }
126 | BUFFER_FILL { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_buffer_fill); }
127 | CHANNEL_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_info); }
128 | MISCELLANEOUS { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_misc); }
129 ;
130
131 unsubscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_count); }
132 | VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_voice_count); }
133 | STREAM_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_stream_count); }
134 | BUFFER_FILL { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_buffer_fill); }
135 | CHANNEL_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_info); }
136 | MISCELLANEOUS { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_misc); }
137 ;
138
139 get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); }
140 | AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableMidiInputDrivers(); }
141 | MIDI_INPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetMidiInputDriverInfo($5); }
142 | MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7); }
143 | MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7, $9); }
144 | AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers(); }
145 | AUDIO_OUTPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5); }
146 | AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7); }
147 | AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7, $9); }
148 | AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDeviceCount(); }
149 | MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDeviceCount(); }
150 | AUDIO_OUTPUT_DEVICE SP INFO SP number { $$ = LSCPSERVER->GetAudioOutputDeviceInfo($5); }
151 | MIDI_INPUT_DEVICE SP INFO SP number { $$ = LSCPSERVER->GetMidiInputDeviceInfo($5); }
152 | MIDI_INPUT_PORT SP INFO SP number SP number { $$ = LSCPSERVER->GetMidiInputPortInfo($5, $7); }
153 | MIDI_INPUT_PORT_PARAMETER SP INFO SP number SP number SP string { $$ = LSCPSERVER->GetMidiInputPortParameterInfo($5, $7, $9); }
154 | AUDIO_OUTPUT_CHANNEL SP INFO SP number SP number { $$ = LSCPSERVER->GetAudioOutputChannelInfo($5, $7); }
155 | AUDIO_OUTPUT_CHANNEL_PARAMETER SP INFO SP number SP number SP string { $$ = LSCPSERVER->GetAudioOutputChannelParameterInfo($5, $7, $9); }
156 | CHANNELS { $$ = LSCPSERVER->GetChannels(); }
157 | CHANNEL SP INFO SP sampler_channel { $$ = LSCPSERVER->GetChannelInfo($5); }
158 | CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel { $$ = LSCPSERVER->GetBufferFill($5, $7); }
159 | CHANNEL SP STREAM_COUNT SP sampler_channel { $$ = LSCPSERVER->GetStreamCount($5); }
160 | CHANNEL SP VOICE_COUNT SP sampler_channel { $$ = LSCPSERVER->GetVoiceCount($5); }
161 | ENGINE SP INFO SP engine_name { $$ = LSCPSERVER->GetEngineInfo($5); }
162 | SERVER SP INFO { $$ = LSCPSERVER->GetServerInfo(); }
163 ;
164
165 set_instruction : AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); }
166 | AUDIO_OUTPUT_CHANNEL_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }
167 | MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); }
168 | MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); }
169 | CHANNEL SP set_chan_instruction { $$ = $3; }
170 | ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); }
171 ;
172
173 create_instruction : AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); }
174 | AUDIO_OUTPUT_DEVICE SP string { $$ = LSCPSERVER->CreateAudioOutputDevice($3); }
175 | MIDI_INPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateMidiInputDevice($3,$5); }
176 | MIDI_INPUT_DEVICE SP string { $$ = LSCPSERVER->CreateMidiInputDevice($3); }
177 ;
178
179 destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); }
180 | MIDI_INPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyMidiInputDevice($3); }
181 ;
182
183 load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; }
184 | ENGINE SP load_engine_args { $$ = $3; }
185 ;
186
187 set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); }
188 | AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); }
189 | AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name { $$ = LSCPSERVER->SetAudioOutputType($5, $3); }
190 | MIDI_INPUT SP sampler_channel SP device_index SP midi_input_port_index SP midi_input_channel_index { $$ = LSCPSERVER->SetMIDIInput($5, $7, $9, $3); }
191 | MIDI_INPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetMIDIInputDevice($5, $3); }
192 | MIDI_INPUT_PORT SP sampler_channel SP midi_input_port_index { $$ = LSCPSERVER->SetMIDIInputPort($5, $3); }
193 | MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel_index { $$ = LSCPSERVER->SetMIDIInputChannel($5, $3); }
194 | MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type_name { $$ = LSCPSERVER->SetMIDIInputType($5, $3); }
195 | VOLUME SP sampler_channel SP volume_value { $$ = LSCPSERVER->SetVolume($5, $3); }
196 ;
197
198 key_val_list : string '=' param_val_list { $$[$1] = $3; }
199 | key_val_list SP string '=' param_val_list { $$ = $1; $$[$3] = $5; }
200 ;
201
202 buffer_size_type : BYTES { $$ = fill_response_bytes; }
203 | PERCENTAGE { $$ = fill_response_percentage; }
204 ;
205
206 list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); }
207 | MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); }
208 | CHANNELS { $$ = LSCPSERVER->ListChannels(); }
209 | AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); }
210 | AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); }
211 | AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); }
212 ;
213
214 load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); }
215 | NON_MODAL SP filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($3, $5, $7, true); }
216 ;
217
218 load_engine_args : engine_name SP sampler_channel { $$ = LSCPSERVER->SetEngineType($1, $3); }
219 ;
220
221 device_index : number
222 ;
223
224 audio_channel_index : number
225 ;
226
227 audio_output_type_name : string
228 ;
229
230 midi_input_port_index : number
231 ;
232
233 midi_input_channel_index : number
234 | ALL { $$ = 16; }
235 ;
236
237 midi_input_type_name : string
238 ;
239
240 volume_value : dotnum
241 | number { $$ = $1; }
242 ;
243
244 sampler_channel : number
245 ;
246
247 instrument_index : number
248 ;
249
250 engine_name : string
251 ;
252
253 filename : stringval
254 ;
255
256 param_val_list : param_val
257 | param_val_list','param_val { $$ = $1 + "," + $3; }
258 ;
259
260 param_val : string
261 | '\'' string '\'' { $$ = "\'" + $2 + "\'"; } // we eleminate encapsulating (apostrophe) limiters later
262 | '\"' string '\"' { $$ = "\"" + $2 + "\""; } // s.a.
263 | number { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
264 | dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
265 ;
266
267 // GRAMMAR_BNF_END - do NOT delete or modify this line !!!
268
269
270 // atomic variable symbol rules
271
272 boolean : number { $$ = $1; }
273 | string { $$ = -1; }
274 ;
275
276 string : char { std::string s; s = $1; $$ = s; }
277 | string char { $$ = $1 + $2; }
278 ;
279
280 dotnum : digits '.' digits { $$ = atof(String($1 + "." + $3).c_str()); }
281 | '+' digits '.' digits { String s = "+"; s += $2; s += "."; s += $4; $$ = atof(s.c_str()); }
282 | '-' digits '.' digits { $$ = atof(String("-" + $2 + "." + $4).c_str()); }
283 ;
284
285
286 digits : digit { $$ = $1; }
287 | digits digit { $$ = $1 + $2; }
288 ;
289
290 digit : '0' { $$ = '0'; }
291 | '1' { $$ = '1'; }
292 | '2' { $$ = '2'; }
293 | '3' { $$ = '3'; }
294 | '4' { $$ = '4'; }
295 | '5' { $$ = '5'; }
296 | '6' { $$ = '6'; }
297 | '7' { $$ = '7'; }
298 | '8' { $$ = '8'; }
299 | '9' { $$ = '9'; }
300 ;
301
302 number : digit { $$ = atoi(String(1, $1).c_str()); }
303 | '1' digits { $$ = atoi(String(String("1") + $2).c_str()); }
304 | '2' digits { $$ = atoi(String(String("2") + $2).c_str()); }
305 | '3' digits { $$ = atoi(String(String("3") + $2).c_str()); }
306 | '4' digits { $$ = atoi(String(String("4") + $2).c_str()); }
307 | '5' digits { $$ = atoi(String(String("5") + $2).c_str()); }
308 | '6' digits { $$ = atoi(String(String("6") + $2).c_str()); }
309 | '7' digits { $$ = atoi(String(String("7") + $2).c_str()); }
310 | '8' digits { $$ = atoi(String(String("8") + $2).c_str()); }
311 | '9' digits { $$ = atoi(String(String("9") + $2).c_str()); }
312
313 char : 'A' { $$ = 'A'; } | 'B' { $$ = 'B'; } | 'C' { $$ = 'C'; } | 'D' { $$ = 'D'; } | 'E' { $$ = 'E'; } | 'F' { $$ = 'F'; } | 'G' { $$ = 'G'; } | 'H' { $$ = 'H'; } | 'I' { $$ = 'I'; } | 'J' { $$ = 'J'; } | 'K' { $$ = 'K'; } | 'L' { $$ = 'L'; } | 'M' { $$ = 'M'; } | 'N' { $$ = 'N'; } | 'O' { $$ = 'O'; } | 'P' { $$ = 'P'; } | 'Q' { $$ = 'Q'; } | 'R' { $$ = 'R'; } | 'S' { $$ = 'S'; } | 'T' { $$ = 'T'; } | 'U' { $$ = 'U'; } | 'V' { $$ = 'V'; } | 'W' { $$ = 'W'; } | 'X' { $$ = 'X'; } | 'Y' { $$ = 'Y'; } | 'Z' { $$ = 'Z'; }
314 | 'a' { $$ = 'a'; } | 'b' { $$ = 'b'; } | 'c' { $$ = 'c'; } | 'd' { $$ = 'd'; } | 'e' { $$ = 'e'; } | 'f' { $$ = 'f'; } | 'g' { $$ = 'g'; } | 'h' { $$ = 'h'; } | 'i' { $$ = 'i'; } | 'j' { $$ = 'j'; } | 'k' { $$ = 'k'; } | 'l' { $$ = 'l'; } | 'm' { $$ = 'm'; } | 'n' { $$ = 'n'; } | 'o' { $$ = 'o'; } | 'p' { $$ = 'p'; } | 'q' { $$ = 'q'; } | 'r' { $$ = 'r'; } | 's' { $$ = 's'; } | 't' { $$ = 't'; } | 'u' { $$ = 'u'; } | 'v' { $$ = 'v'; } | 'w' { $$ = 'w'; } | 'x' { $$ = 'x'; } | 'y' { $$ = 'y'; } | 'z' { $$ = 'z'; }
315 | '0' { $$ = '0'; } | '1' { $$ = '1'; } | '2' { $$ = '2'; } | '3' { $$ = '3'; } | '4' { $$ = '4'; } | '5' { $$ = '5'; } | '6' { $$ = '6'; } | '7' { $$ = '7'; } | '8' { $$ = '8'; } | '9' { $$ = '9'; }
316 | '!' { $$ = '!'; } | '#' { $$ = '#'; } | '$' { $$ = '$'; } | '%' { $$ = '%'; } | '&' { $$ = '&'; } | '(' { $$ = '('; } | ')' { $$ = ')'; } | '*' { $$ = '*'; } | '+' { $$ = '+'; } | '-' { $$ = '-'; } | '.' { $$ = '.'; } | ',' { $$ = ','; } | '/' { $$ = '/'; }
317 | ':' { $$ = ':'; } | ';' { $$ = ';'; } | '<' { $$ = '<'; } | '=' { $$ = '='; } | '>' { $$ = '>'; } | '?' { $$ = '?'; } | '@' { $$ = '@'; }
318 | '[' { $$ = '['; } | '\\' { $$ = '\\'; } | ']' { $$ = ']'; } | '^' { $$ = '^'; } | '_' { $$ = '_'; }
319 | '{' { $$ = '{'; } | '|' { $$ = '|'; } | '}' { $$ = '}'; } | '~' { $$ = '~'; }
320 | '\200' { $$ = '\200'; } | '\201' { $$ = '\201'; } | '\202' { $$ = '\202'; }
321 | '\203' { $$ = '\203'; } | '\204' { $$ = '\204'; } | '\205' { $$ = '\205'; }
322 | '\206' { $$ = '\206'; } | '\207' { $$ = '\207'; } | '\210' { $$ = '\210'; }
323 | '\211' { $$ = '\211'; } | '\212' { $$ = '\212'; } | '\213' { $$ = '\213'; }
324 | '\214' { $$ = '\214'; } | '\215' { $$ = '\215'; } | '\216' { $$ = '\216'; }
325 | '\217' { $$ = '\217'; } | '\220' { $$ = '\220'; } | '\221' { $$ = '\221'; }
326 | '\222' { $$ = '\222'; } | '\223' { $$ = '\223'; } | '\224' { $$ = '\224'; }
327 | '\225' { $$ = '\225'; } | '\226' { $$ = '\226'; } | '\227' { $$ = '\227'; }
328 | '\230' { $$ = '\230'; } | '\231' { $$ = '\231'; } | '\232' { $$ = '\232'; }
329 | '\233' { $$ = '\233'; } | '\234' { $$ = '\234'; } | '\235' { $$ = '\235'; }
330 | '\236' { $$ = '\236'; } | '\237' { $$ = '\237'; } | '\240' { $$ = '\240'; }
331 | '\241' { $$ = '\241'; } | '\242' { $$ = '\242'; } | '\243' { $$ = '\243'; }
332 | '\244' { $$ = '\244'; } | '\245' { $$ = '\245'; } | '\246' { $$ = '\246'; }
333 | '\247' { $$ = '\247'; } | '\250' { $$ = '\250'; } | '\251' { $$ = '\251'; }
334 | '\252' { $$ = '\252'; } | '\253' { $$ = '\253'; } | '\254' { $$ = '\254'; }
335 | '\255' { $$ = '\255'; } | '\256' { $$ = '\256'; } | '\257' { $$ = '\257'; }
336 | '\260' { $$ = '\260'; } | '\261' { $$ = '\261'; } | '\262' { $$ = '\262'; }
337 | '\263' { $$ = '\263'; } | '\264' { $$ = '\264'; } | '\265' { $$ = '\265'; }
338 | '\266' { $$ = '\266'; } | '\267' { $$ = '\267'; } | '\270' { $$ = '\270'; }
339 | '\271' { $$ = '\271'; } | '\272' { $$ = '\272'; } | '\273' { $$ = '\273'; }
340 | '\274' { $$ = '\274'; } | '\275' { $$ = '\275'; } | '\276' { $$ = '\276'; }
341 | '\277' { $$ = '\277'; } | '\300' { $$ = '\300'; } | '\301' { $$ = '\301'; }
342 | '\302' { $$ = '\302'; } | '\303' { $$ = '\303'; } | '\304' { $$ = '\304'; }
343 | '\305' { $$ = '\305'; } | '\306' { $$ = '\306'; } | '\307' { $$ = '\307'; }
344 | '\310' { $$ = '\310'; } | '\311' { $$ = '\311'; } | '\312' { $$ = '\312'; }
345 | '\313' { $$ = '\313'; } | '\314' { $$ = '\314'; } | '\315' { $$ = '\315'; }
346 | '\316' { $$ = '\316'; } | '\317' { $$ = '\317'; } | '\320' { $$ = '\320'; }
347 | '\321' { $$ = '\321'; } | '\322' { $$ = '\322'; } | '\323' { $$ = '\323'; }
348 | '\324' { $$ = '\324'; } | '\325' { $$ = '\325'; } | '\326' { $$ = '\326'; }
349 | '\327' { $$ = '\327'; } | '\330' { $$ = '\330'; } | '\331' { $$ = '\331'; }
350 | '\332' { $$ = '\332'; } | '\333' { $$ = '\333'; } | '\334' { $$ = '\334'; }
351 | '\335' { $$ = '\335'; } | '\336' { $$ = '\336'; } | '\337' { $$ = '\337'; }
352 | '\340' { $$ = '\340'; } | '\341' { $$ = '\341'; } | '\342' { $$ = '\342'; }
353 | '\343' { $$ = '\343'; } | '\344' { $$ = '\344'; } | '\345' { $$ = '\345'; }
354 | '\346' { $$ = '\346'; } | '\347' { $$ = '\347'; } | '\350' { $$ = '\350'; }
355 | '\351' { $$ = '\351'; } | '\352' { $$ = '\352'; } | '\353' { $$ = '\353'; }
356 | '\354' { $$ = '\354'; } | '\355' { $$ = '\355'; } | '\356' { $$ = '\356'; }
357 | '\357' { $$ = '\357'; } | '\360' { $$ = '\360'; } | '\361' { $$ = '\361'; }
358 | '\362' { $$ = '\362'; } | '\363' { $$ = '\363'; } | '\364' { $$ = '\364'; }
359 | '\365' { $$ = '\365'; } | '\366' { $$ = '\366'; } | '\367' { $$ = '\367'; }
360 | '\370' { $$ = '\370'; } | '\371' { $$ = '\371'; } | '\372' { $$ = '\372'; }
361 | '\373' { $$ = '\373'; } | '\374' { $$ = '\374'; } | '\375' { $$ = '\375'; }
362 | '\376' { $$ = '\376'; } | '\377' { $$ = '\377'; }
363 ;
364
365 text : SP { $$ = " "; }
366 | string
367 | text SP { $$ = $1 + " "; }
368 | text string { $$ = $1 + $2; }
369 ;
370
371 stringval : '\'' text '\'' { $$ = $2; }
372 | '\"' text '\"' { $$ = $2; }
373 ;
374
375
376 // rules which are more or less just terminal symbols
377
378 SP : ' '
379 ;
380
381 LF : '\n'
382 ;
383
384 CR : '\r'
385 ;
386
387 ADD : 'A''D''D'
388 ;
389
390 GET : 'G''E''T'
391 ;
392
393 CREATE : 'C''R''E''A''T''E'
394 ;
395
396 DESTROY : 'D''E''S''T''R''O''Y'
397 ;
398
399 LIST : 'L''I''S''T'
400 ;
401
402 LOAD : 'L''O''A''D'
403 ;
404
405 ALL : 'A''L''L'
406 ;
407
408 NON_MODAL : 'N''O''N''_''M''O''D''A''L'
409 ;
410
411 REMOVE : 'R''E''M''O''V''E'
412 ;
413
414 SET : 'S''E''T'
415 ;
416
417 SUBSCRIBE : 'S''U''B''S''C''R''I''B''E'
418 ;
419
420 UNSUBSCRIBE : 'U''N''S''U''B''S''C''R''I''B''E'
421 ;
422
423 SELECT : 'S''E''L''E''C''T'
424 ;
425
426 CHANNEL : 'C''H''A''N''N''E''L'
427 ;
428
429 AVAILABLE_ENGINES : 'A''V''A''I''L''A''B''L''E''_''E''N''G''I''N''E''S'
430 ;
431
432 AVAILABLE_AUDIO_OUTPUT_DRIVERS : 'A''V''A''I''L''A''B''L''E''_''A''U''D''I''O''_''O''U''T''P''U''T''_''D''R''I''V''E''R''S'
433 ;
434
435 CHANNELS : 'C''H''A''N''N''E''L''S'
436 ;
437
438 INFO : 'I''N''F''O'
439 ;
440
441 CHANNEL_COUNT : 'C''H''A''N''N''E''L''_''C''O''U''N''T'
442 ;
443
444 CHANNEL_INFO : 'C''H''A''N''N''E''L''_''I''N''F''O'
445 ;
446
447 BUFFER_FILL : 'B''U''F''F''E''R''_''F''I''L''L'
448 ;
449
450 STREAM_COUNT : 'S''T''R''E''A''M''_''C''O''U''N''T'
451 ;
452
453 VOICE_COUNT : 'V''O''I''C''E''_''C''O''U''N''T'
454 ;
455
456 INSTRUMENT : 'I''N''S''T''R''U''M''E''N''T'
457 ;
458
459 ENGINE : 'E' 'N' 'G' 'I' 'N' 'E'
460 ;
461
462 AUDIO_OUTPUT_DEVICE_PARAMETER : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E''_''P''A''R''A''M''E''T''E''R'
463 ;
464
465 AUDIO_OUTPUT_DEVICES : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E''S'
466 ;
467
468 AUDIO_OUTPUT_DEVICE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E'
469 ;
470
471 AUDIO_OUTPUT_DRIVER_PARAMETER : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''R''I''V''E''R''_''P''A''R''A''M''E''T''E''R'
472 ;
473
474 AUDIO_OUTPUT_DRIVER : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''R''I''V''E''R'
475 ;
476
477 AUDIO_OUTPUT_CHANNEL_PARAMETER : 'A''U''D''I''O''_''O''U''T''P''U''T''_''C''H''A''N''N''E''L''_''P''A''R''A''M''E''T''E''R'
478 ;
479
480 AUDIO_OUTPUT_CHANNEL : 'A''U''D''I''O''_''O''U''T''P''U''T''_''C''H''A''N''N''E''L'
481 ;
482
483 AUDIO_OUTPUT_TYPE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E'
484 ;
485
486 AVAILABLE_MIDI_INPUT_DRIVERS : 'A''V''A''I''L''A''B''L''E''_''M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R''S'
487 ;
488
489 MIDI_INPUT_DEVICE_PARAMETER : 'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E''_''P''A''R''A''M''E''T''E''R'
490 ;
491
492 MIDI_INPUT_PORT_PARAMETER : 'M''I''D''I''_''I''N''P''U''T''_''P''O''R''T''_''P''A''R''A''M''E''T''E''R'
493 ;
494
495 MIDI_INPUT_DEVICES : 'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E''S'
496 ;
497
498 MIDI_INPUT_DEVICE : 'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E'
499 ;
500
501 MIDI_INPUT_DRIVER_PARAMETER : 'M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R''_''P''A''R''A''M''E''T''E''R'
502 ;
503
504 MIDI_INPUT_DRIVER : 'M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R'
505 ;
506
507 MIDI_INPUT_PORT : 'M''I''D''I''_''I''N''P''U''T''_''P''O''R''T'
508 ;
509
510 MIDI_INPUT_CHANNEL : 'M''I''D''I''_''I''N''P''U''T''_''C''H''A''N''N''E''L'
511 ;
512
513 MIDI_INPUT_TYPE : 'M''I''D''I''_''I''N''P''U''T''_''T''Y''P''E'
514 ;
515
516 MIDI_INPUT : 'M''I''D''I''_''I''N''P''U''T'
517 ;
518
519 SERVER : 'S''E''R''V''E''R'
520 ;
521
522 VOLUME : 'V''O''L''U''M''E'
523 ;
524
525 BYTES : 'B''Y''T''E''S'
526 ;
527
528 PERCENTAGE : 'P''E''R''C''E''N''T''A''G''E'
529 ;
530
531 RESET : 'R''E''S''E''T'
532 ;
533
534 MISCELLANEOUS : 'M''I''S''C''E''L''L''A''N''E''O''U''S'
535 ;
536
537 ECHO : 'E''C''H''O'
538 ;
539
540 QUIT : 'Q''U''I''T'
541 ;
542
543 %%
544
545 /**
546 * Will be called when an error occured (usually syntax error).
547 */
548 void yyerror(const char* s) {
549 dmsg(2,("LSCPParser: %s\n", s));
550 }
551
552 /**
553 * Clears input buffer.
554 */
555 void restart(yyparse_param_t* pparam, int& yychar) {
556 bytes = 0;
557 ptr = 0;
558 }

  ViewVC Help
Powered by ViewVC