/[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 556 - (show annotations) (download)
Sat May 21 01:10:12 2005 UTC (18 years, 10 months ago) by schoenebeck
File size: 32455 byte(s)
* Little LSCP API change: renamed events "CHANNELS" -> "CHANNEL_COUNT" and
  "INFO" -> "CHANNEL_INFO" to be more meaningful (patch by Grigor Iliev).

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 input : line LF
83 | line CR LF
84 ;
85
86 line : /* epsilon (empty line ignored) */ { return LSCP_DONE; }
87 | comment { return LSCP_DONE; }
88 | command { LSCPSERVER->AnswerClient($1); return LSCP_DONE; }
89 | error { LSCPSERVER->AnswerClient("ERR:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; }
90 ;
91
92 comment : '#'
93 | comment '#'
94 | comment SP
95 | comment number
96 | comment string
97 ;
98
99 command : ADD SP CHANNEL { $$ = LSCPSERVER->AddChannel(); }
100 | GET SP get_instruction { $$ = $3; }
101 | CREATE SP create_instruction { $$ = $3; }
102 | DESTROY SP destroy_instruction { $$ = $3; }
103 | LIST SP list_instruction { $$ = $3; }
104 | LOAD SP load_instruction { $$ = $3; }
105 | REMOVE SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($5); }
106 | SET SP set_instruction { $$ = $3; }
107 | SUBSCRIBE SP subscribe_event { $$ = $3; }
108 | UNSUBSCRIBE SP unsubscribe_event { $$ = $3; }
109 | SELECT SP text { $$ = LSCPSERVER->QueryDatabase($3); }
110 | RESET SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($5); }
111 | RESET { $$ = LSCPSERVER->ResetSampler(); }
112 | QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; }
113 ;
114
115 subscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_count); }
116 | VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); }
117 | STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); }
118 | BUFFER_FILL { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_buffer_fill); }
119 | CHANNEL_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_info); }
120 | MISCELLANEOUS { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_misc); }
121 ;
122
123 unsubscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_count); }
124 | VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_voice_count); }
125 | STREAM_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_stream_count); }
126 | BUFFER_FILL { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_buffer_fill); }
127 | CHANNEL_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_info); }
128 | MISCELLANEOUS { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_misc); }
129 ;
130
131 get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); }
132 | AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableMidiInputDrivers(); }
133 | MIDI_INPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetMidiInputDriverInfo($5); }
134 | MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7); }
135 | MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7, $9); }
136 | AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers(); }
137 | AUDIO_OUTPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5); }
138 | AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7); }
139 | AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7, $9); }
140 | AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDeviceCount(); }
141 | MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDeviceCount(); }
142 | AUDIO_OUTPUT_DEVICE SP INFO SP number { $$ = LSCPSERVER->GetAudioOutputDeviceInfo($5); }
143 | MIDI_INPUT_DEVICE SP INFO SP number { $$ = LSCPSERVER->GetMidiInputDeviceInfo($5); }
144 | MIDI_INPUT_PORT SP INFO SP number SP number { $$ = LSCPSERVER->GetMidiInputPortInfo($5, $7); }
145 | MIDI_INPUT_PORT_PARAMETER SP INFO SP number SP number SP string { $$ = LSCPSERVER->GetMidiInputPortParameterInfo($5, $7, $9); }
146 | AUDIO_OUTPUT_CHANNEL SP INFO SP number SP number { $$ = LSCPSERVER->GetAudioOutputChannelInfo($5, $7); }
147 | AUDIO_OUTPUT_CHANNEL_PARAMETER SP INFO SP number SP number SP string { $$ = LSCPSERVER->GetAudioOutputChannelParameterInfo($5, $7, $9); }
148 | CHANNELS { $$ = LSCPSERVER->GetChannels(); }
149 | CHANNEL SP INFO SP sampler_channel { $$ = LSCPSERVER->GetChannelInfo($5); }
150 | CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel { $$ = LSCPSERVER->GetBufferFill($5, $7); }
151 | CHANNEL SP STREAM_COUNT SP sampler_channel { $$ = LSCPSERVER->GetStreamCount($5); }
152 | CHANNEL SP VOICE_COUNT SP sampler_channel { $$ = LSCPSERVER->GetVoiceCount($5); }
153 | ENGINE SP INFO SP engine_name { $$ = LSCPSERVER->GetEngineInfo($5); }
154 ;
155
156 set_instruction : AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); }
157 | AUDIO_OUTPUT_CHANNEL_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }
158 | MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); }
159 | MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); }
160 | CHANNEL SP set_chan_instruction { $$ = $3; }
161 | ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); }
162 ;
163
164 create_instruction : AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); }
165 | AUDIO_OUTPUT_DEVICE SP string { $$ = LSCPSERVER->CreateAudioOutputDevice($3); }
166 | MIDI_INPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateMidiInputDevice($3,$5); }
167 | MIDI_INPUT_DEVICE SP string { $$ = LSCPSERVER->CreateMidiInputDevice($3); }
168 ;
169
170 destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); }
171 | MIDI_INPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyMidiInputDevice($3); }
172 ;
173
174 load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; }
175 | ENGINE SP load_engine_args { $$ = $3; }
176 ;
177
178 set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); }
179 | AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); }
180 | AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name { $$ = LSCPSERVER->SetAudioOutputType($5, $3); }
181 | MIDI_INPUT SP sampler_channel SP device_index SP midi_input_port_index SP midi_input_channel_index { $$ = LSCPSERVER->SetMIDIInput($5, $7, $9, $3); }
182 | MIDI_INPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetMIDIInputDevice($5, $3); }
183 | MIDI_INPUT_PORT SP sampler_channel SP midi_input_port_index { $$ = LSCPSERVER->SetMIDIInputPort($5, $3); }
184 | MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel_index { $$ = LSCPSERVER->SetMIDIInputChannel($5, $3); }
185 | MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type_name { $$ = LSCPSERVER->SetMIDIInputType($5, $3); }
186 | VOLUME SP sampler_channel SP volume_value { $$ = LSCPSERVER->SetVolume($5, $3); }
187 ;
188
189 key_val_list : string '=' param_val_list { $$[$1] = $3; }
190 | key_val_list SP string '=' param_val_list { $$ = $1; $$[$3] = $5; }
191 ;
192
193 buffer_size_type : BYTES { $$ = fill_response_bytes; }
194 | PERCENTAGE { $$ = fill_response_percentage; }
195 ;
196
197 list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); }
198 | MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); }
199 | CHANNELS { $$ = LSCPSERVER->ListChannels(); }
200 | AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); }
201 | AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); }
202 | AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); }
203 ;
204
205 load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); }
206 | NON_MODAL SP filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($3, $5, $7, true); }
207 ;
208
209 load_engine_args : engine_name SP sampler_channel { $$ = LSCPSERVER->SetEngineType($1, $3); }
210 ;
211
212 device_index : number
213 ;
214
215 audio_channel_index : number
216 ;
217
218 audio_output_type_name : string
219 ;
220
221 midi_input_port_index : number
222 ;
223
224 midi_input_channel_index : number
225 | ALL { $$ = 16; }
226 ;
227
228 midi_input_type_name : string
229 ;
230
231 volume_value : dotnum
232 | number { $$ = $1; }
233 ;
234
235 sampler_channel : number
236 ;
237
238 instrument_index : number
239 ;
240
241 engine_name : string
242 ;
243
244 filename : stringval
245 ;
246
247 param_val_list : param_val
248 | param_val_list','param_val { $$ = $1 + "," + $3; }
249 ;
250
251 param_val : string
252 | '\'' string '\'' { $$ = "\'" + $2 + "\'"; } // we eleminate encapsulating (apostrophe) limiters later
253 | '\"' string '\"' { $$ = "\"" + $2 + "\""; } // s.a.
254 | number { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
255 | dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
256 ;
257
258
259 // atomic variable symbol rules
260
261 boolean : number { $$ = $1; }
262 | string { $$ = -1; }
263 ;
264
265 string : char { std::string s; s = $1; $$ = s; }
266 | string char { $$ = $1 + $2; }
267 ;
268
269 dotnum : digits '.' digits { $$ = atof(String($1 + "." + $3).c_str()); }
270 | '+' digits '.' digits { String s = "+"; s += $2; s += "."; s += $4; $$ = atof(s.c_str()); }
271 | '-' digits '.' digits { $$ = atof(String("-" + $2 + "." + $4).c_str()); }
272 ;
273
274
275 digits : digit { $$ = $1; }
276 | digits digit { $$ = $1 + $2; }
277 ;
278
279 digit : '0' { $$ = '0'; }
280 | '1' { $$ = '1'; }
281 | '2' { $$ = '2'; }
282 | '3' { $$ = '3'; }
283 | '4' { $$ = '4'; }
284 | '5' { $$ = '5'; }
285 | '6' { $$ = '6'; }
286 | '7' { $$ = '7'; }
287 | '8' { $$ = '8'; }
288 | '9' { $$ = '9'; }
289 ;
290
291 number : digit { $$ = atoi(String(1, $1).c_str()); }
292 | '1' digits { $$ = atoi(String(String("1") + $2).c_str()); }
293 | '2' digits { $$ = atoi(String(String("2") + $2).c_str()); }
294 | '3' digits { $$ = atoi(String(String("3") + $2).c_str()); }
295 | '4' digits { $$ = atoi(String(String("4") + $2).c_str()); }
296 | '5' digits { $$ = atoi(String(String("5") + $2).c_str()); }
297 | '6' digits { $$ = atoi(String(String("6") + $2).c_str()); }
298 | '7' digits { $$ = atoi(String(String("7") + $2).c_str()); }
299 | '8' digits { $$ = atoi(String(String("8") + $2).c_str()); }
300 | '9' digits { $$ = atoi(String(String("9") + $2).c_str()); }
301
302 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'; }
303 | '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'; }
304 | '0' { $$ = '0'; } | '1' { $$ = '1'; } | '2' { $$ = '2'; } | '3' { $$ = '3'; } | '4' { $$ = '4'; } | '5' { $$ = '5'; } | '6' { $$ = '6'; } | '7' { $$ = '7'; } | '8' { $$ = '8'; } | '9' { $$ = '9'; }
305 | '!' { $$ = '!'; } | '#' { $$ = '#'; } | '$' { $$ = '$'; } | '%' { $$ = '%'; } | '&' { $$ = '&'; } | '(' { $$ = '('; } | ')' { $$ = ')'; } | '*' { $$ = '*'; } | '+' { $$ = '+'; } | '-' { $$ = '-'; } | '.' { $$ = '.'; } | ',' { $$ = ','; } | '/' { $$ = '/'; }
306 | ':' { $$ = ':'; } | ';' { $$ = ';'; } | '<' { $$ = '<'; } | '=' { $$ = '='; } | '>' { $$ = '>'; } | '?' { $$ = '?'; } | '@' { $$ = '@'; }
307 | '[' { $$ = '['; } | '\\' { $$ = '\\'; } | ']' { $$ = ']'; } | '^' { $$ = '^'; } | '_' { $$ = '_'; }
308 | '{' { $$ = '{'; } | '|' { $$ = '|'; } | '}' { $$ = '}'; } | '~' { $$ = '~'; }
309 | '\200' { $$ = '\200'; } | '\201' { $$ = '\201'; } | '\202' { $$ = '\202'; }
310 | '\203' { $$ = '\203'; } | '\204' { $$ = '\204'; } | '\205' { $$ = '\205'; }
311 | '\206' { $$ = '\206'; } | '\207' { $$ = '\207'; } | '\210' { $$ = '\210'; }
312 | '\211' { $$ = '\211'; } | '\212' { $$ = '\212'; } | '\213' { $$ = '\213'; }
313 | '\214' { $$ = '\214'; } | '\215' { $$ = '\215'; } | '\216' { $$ = '\216'; }
314 | '\217' { $$ = '\217'; } | '\220' { $$ = '\220'; } | '\221' { $$ = '\221'; }
315 | '\222' { $$ = '\222'; } | '\223' { $$ = '\223'; } | '\224' { $$ = '\224'; }
316 | '\225' { $$ = '\225'; } | '\226' { $$ = '\226'; } | '\227' { $$ = '\227'; }
317 | '\230' { $$ = '\230'; } | '\231' { $$ = '\231'; } | '\232' { $$ = '\232'; }
318 | '\233' { $$ = '\233'; } | '\234' { $$ = '\234'; } | '\235' { $$ = '\235'; }
319 | '\236' { $$ = '\236'; } | '\237' { $$ = '\237'; } | '\240' { $$ = '\240'; }
320 | '\241' { $$ = '\241'; } | '\242' { $$ = '\242'; } | '\243' { $$ = '\243'; }
321 | '\244' { $$ = '\244'; } | '\245' { $$ = '\245'; } | '\246' { $$ = '\246'; }
322 | '\247' { $$ = '\247'; } | '\250' { $$ = '\250'; } | '\251' { $$ = '\251'; }
323 | '\252' { $$ = '\252'; } | '\253' { $$ = '\253'; } | '\254' { $$ = '\254'; }
324 | '\255' { $$ = '\255'; } | '\256' { $$ = '\256'; } | '\257' { $$ = '\257'; }
325 | '\260' { $$ = '\260'; } | '\261' { $$ = '\261'; } | '\262' { $$ = '\262'; }
326 | '\263' { $$ = '\263'; } | '\264' { $$ = '\264'; } | '\265' { $$ = '\265'; }
327 | '\266' { $$ = '\266'; } | '\267' { $$ = '\267'; } | '\270' { $$ = '\270'; }
328 | '\271' { $$ = '\271'; } | '\272' { $$ = '\272'; } | '\273' { $$ = '\273'; }
329 | '\274' { $$ = '\274'; } | '\275' { $$ = '\275'; } | '\276' { $$ = '\276'; }
330 | '\277' { $$ = '\277'; } | '\300' { $$ = '\300'; } | '\301' { $$ = '\301'; }
331 | '\302' { $$ = '\302'; } | '\303' { $$ = '\303'; } | '\304' { $$ = '\304'; }
332 | '\305' { $$ = '\305'; } | '\306' { $$ = '\306'; } | '\307' { $$ = '\307'; }
333 | '\310' { $$ = '\310'; } | '\311' { $$ = '\311'; } | '\312' { $$ = '\312'; }
334 | '\313' { $$ = '\313'; } | '\314' { $$ = '\314'; } | '\315' { $$ = '\315'; }
335 | '\316' { $$ = '\316'; } | '\317' { $$ = '\317'; } | '\320' { $$ = '\320'; }
336 | '\321' { $$ = '\321'; } | '\322' { $$ = '\322'; } | '\323' { $$ = '\323'; }
337 | '\324' { $$ = '\324'; } | '\325' { $$ = '\325'; } | '\326' { $$ = '\326'; }
338 | '\327' { $$ = '\327'; } | '\330' { $$ = '\330'; } | '\331' { $$ = '\331'; }
339 | '\332' { $$ = '\332'; } | '\333' { $$ = '\333'; } | '\334' { $$ = '\334'; }
340 | '\335' { $$ = '\335'; } | '\336' { $$ = '\336'; } | '\337' { $$ = '\337'; }
341 | '\340' { $$ = '\340'; } | '\341' { $$ = '\341'; } | '\342' { $$ = '\342'; }
342 | '\343' { $$ = '\343'; } | '\344' { $$ = '\344'; } | '\345' { $$ = '\345'; }
343 | '\346' { $$ = '\346'; } | '\347' { $$ = '\347'; } | '\350' { $$ = '\350'; }
344 | '\351' { $$ = '\351'; } | '\352' { $$ = '\352'; } | '\353' { $$ = '\353'; }
345 | '\354' { $$ = '\354'; } | '\355' { $$ = '\355'; } | '\356' { $$ = '\356'; }
346 | '\357' { $$ = '\357'; } | '\360' { $$ = '\360'; } | '\361' { $$ = '\361'; }
347 | '\362' { $$ = '\362'; } | '\363' { $$ = '\363'; } | '\364' { $$ = '\364'; }
348 | '\365' { $$ = '\365'; } | '\366' { $$ = '\366'; } | '\367' { $$ = '\367'; }
349 | '\370' { $$ = '\370'; } | '\371' { $$ = '\371'; } | '\372' { $$ = '\372'; }
350 | '\373' { $$ = '\373'; } | '\374' { $$ = '\374'; } | '\375' { $$ = '\375'; }
351 | '\376' { $$ = '\376'; } | '\377' { $$ = '\377'; }
352 ;
353
354 text : SP { $$ = " "; }
355 | string
356 | text SP { $$ = $1 + " "; }
357 | text string { $$ = $1 + $2; }
358 ;
359
360 stringval : '\'' text '\'' { $$ = $2; }
361 | '\"' text '\"' { $$ = $2; }
362 ;
363
364
365 // rules which are more or less just terminal symbols
366
367 SP : ' '
368 ;
369
370 LF : '\n'
371 ;
372
373 CR : '\r'
374 ;
375
376 ADD : 'A''D''D'
377 ;
378
379 GET : 'G''E''T'
380 ;
381
382 CREATE : 'C''R''E''A''T''E'
383 ;
384
385 DESTROY : 'D''E''S''T''R''O''Y'
386 ;
387
388 LIST : 'L''I''S''T'
389 ;
390
391 LOAD : 'L''O''A''D'
392 ;
393
394 ALL : 'A''L''L'
395 ;
396
397 NON_MODAL : 'N''O''N''_''M''O''D''A''L'
398 ;
399
400 REMOVE : 'R''E''M''O''V''E'
401 ;
402
403 SET : 'S''E''T'
404 ;
405
406 SUBSCRIBE : 'S''U''B''S''C''R''I''B''E'
407 ;
408
409 UNSUBSCRIBE : 'U''N''S''U''B''S''C''R''I''B''E'
410 ;
411
412 SELECT : 'S''E''L''E''C''T'
413 ;
414
415 CHANNEL : 'C''H''A''N''N''E''L'
416 ;
417
418 AVAILABLE_ENGINES : 'A''V''A''I''L''A''B''L''E''_''E''N''G''I''N''E''S'
419 ;
420
421 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'
422 ;
423
424 CHANNELS : 'C''H''A''N''N''E''L''S'
425 ;
426
427 INFO : 'I''N''F''O'
428 ;
429
430 CHANNEL_COUNT : 'C''H''A''N''N''E''L''_''C''O''U''N''T'
431 ;
432
433 CHANNEL_INFO : 'C''H''A''N''N''E''L''_''I''N''F''O'
434 ;
435
436 BUFFER_FILL : 'B''U''F''F''E''R''_''F''I''L''L'
437 ;
438
439 STREAM_COUNT : 'S''T''R''E''A''M''_''C''O''U''N''T'
440 ;
441
442 VOICE_COUNT : 'V''O''I''C''E''_''C''O''U''N''T'
443 ;
444
445 INSTRUMENT : 'I''N''S''T''R''U''M''E''N''T'
446 ;
447
448 ENGINE : 'E' 'N' 'G' 'I' 'N' 'E'
449 ;
450
451 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'
452 ;
453
454 AUDIO_OUTPUT_DEVICES : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E''S'
455 ;
456
457 AUDIO_OUTPUT_DEVICE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E'
458 ;
459
460 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'
461 ;
462
463 AUDIO_OUTPUT_DRIVER : 'A''U''D''I''O''_''O''U''T''P''U''T''_''D''R''I''V''E''R'
464 ;
465
466 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'
467 ;
468
469 AUDIO_OUTPUT_CHANNEL : 'A''U''D''I''O''_''O''U''T''P''U''T''_''C''H''A''N''N''E''L'
470 ;
471
472 AUDIO_OUTPUT_TYPE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E'
473 ;
474
475 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'
476 ;
477
478 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'
479 ;
480
481 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'
482 ;
483
484 MIDI_INPUT_DEVICES : 'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E''S'
485 ;
486
487 MIDI_INPUT_DEVICE : 'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E'
488 ;
489
490 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'
491 ;
492
493 MIDI_INPUT_DRIVER : 'M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R'
494 ;
495
496 MIDI_INPUT_PORT : 'M''I''D''I''_''I''N''P''U''T''_''P''O''R''T'
497 ;
498
499 MIDI_INPUT_CHANNEL : 'M''I''D''I''_''I''N''P''U''T''_''C''H''A''N''N''E''L'
500 ;
501
502 MIDI_INPUT_TYPE : 'M''I''D''I''_''I''N''P''U''T''_''T''Y''P''E'
503 ;
504
505 MIDI_INPUT : 'M''I''D''I''_''I''N''P''U''T'
506 ;
507
508 VOLUME : 'V''O''L''U''M''E'
509 ;
510
511 BYTES : 'B''Y''T''E''S'
512 ;
513
514 PERCENTAGE : 'P''E''R''C''E''N''T''A''G''E'
515 ;
516
517 RESET : 'R''E''S''E''T'
518 ;
519
520 MISCELLANEOUS : 'M''I''S''C''E''L''L''A''N''E''O''U''S'
521 ;
522
523 ECHO : 'E''C''H''O'
524 ;
525
526 QUIT : 'Q''U''I''T'
527 ;
528
529 %%
530
531 /**
532 * Will be called when an error occured (usually syntax error).
533 */
534 void yyerror(const char* s) {
535 dmsg(2,("LSCPParser: %s\n", s));
536 }
537
538 /**
539 * Clears input buffer.
540 */
541 void restart(yyparse_param_t* pparam, int& yychar) {
542 bytes = 0;
543 ptr = 0;
544 }

  ViewVC Help
Powered by ViewVC