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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 228 - (hide annotations) (download)
Sat Aug 28 14:55:34 2004 UTC (19 years, 7 months ago) by schoenebeck
File size: 31171 byte(s)
* src/network/lscp.y: fixed symbol 'midi_input_channel_index' to allow
  keyword 'ALL' for the respective LSCP commands

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

  ViewVC Help
Powered by ViewVC