/[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 826 - (hide annotations) (download)
Sun Jan 8 20:19:49 2006 UTC (13 years, 8 months ago) by schoenebeck
File size: 34247 byte(s)
* bugfix in LSCP parser which was confused by space(s) within device
  parameters
  (e.g. "SET AUDIO_OUTPUT_CHANNEL_PARAMETER 0 0 SOMEPARAM='foo bar'")
* changed version to 0.3.3cvs

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

  ViewVC Help
Powered by ViewVC