79 |
|
|
80 |
//TODO: return more meaningful error messages |
//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 |
input : line LF |
91 |
| line CR LF |
| line CR LF |
92 |
; |
; |
94 |
line : /* epsilon (empty line ignored) */ { return LSCP_DONE; } |
line : /* epsilon (empty line ignored) */ { return LSCP_DONE; } |
95 |
| comment { return LSCP_DONE; } |
| comment { return LSCP_DONE; } |
96 |
| command { LSCPSERVER->AnswerClient($1); return LSCP_DONE; } |
| command { LSCPSERVER->AnswerClient($1); return LSCP_DONE; } |
97 |
| error { LSCPSERVER->AnswerClient("Err:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; } |
| error { LSCPSERVER->AnswerClient("ERR:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; } |
98 |
; |
; |
99 |
|
|
100 |
comment : '#' |
comment : '#' |
120 |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
121 |
; |
; |
122 |
|
|
123 |
subscribe_event : CHANNELS { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channels); } |
subscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_count); } |
124 |
| VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); } |
| VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); } |
125 |
| STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); } |
| STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); } |
126 |
| BUFFER_FILL { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_buffer_fill); } |
| BUFFER_FILL { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_buffer_fill); } |
127 |
| INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_info); } |
| CHANNEL_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_info); } |
128 |
| MISCELLANEOUS { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_misc); } |
| MISCELLANEOUS { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_misc); } |
129 |
; |
; |
130 |
|
|
131 |
unsubscribe_event : CHANNELS { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channels); } |
unsubscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_count); } |
132 |
| VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_voice_count); } |
| VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_voice_count); } |
133 |
| STREAM_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_stream_count); } |
| STREAM_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_stream_count); } |
134 |
| BUFFER_FILL { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_buffer_fill); } |
| BUFFER_FILL { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_buffer_fill); } |
135 |
| INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_info); } |
| CHANNEL_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_info); } |
136 |
| MISCELLANEOUS { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_misc); } |
| MISCELLANEOUS { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_misc); } |
137 |
; |
; |
138 |
|
|
139 |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
159 |
| CHANNEL SP STREAM_COUNT SP sampler_channel { $$ = LSCPSERVER->GetStreamCount($5); } |
| CHANNEL SP STREAM_COUNT SP sampler_channel { $$ = LSCPSERVER->GetStreamCount($5); } |
160 |
| CHANNEL SP VOICE_COUNT SP sampler_channel { $$ = LSCPSERVER->GetVoiceCount($5); } |
| CHANNEL SP VOICE_COUNT SP sampler_channel { $$ = LSCPSERVER->GetVoiceCount($5); } |
161 |
| ENGINE SP INFO SP engine_name { $$ = LSCPSERVER->GetEngineInfo($5); } |
| 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); } |
set_instruction : AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); } |
203 |
| PERCENTAGE { $$ = fill_response_percentage; } |
| PERCENTAGE { $$ = fill_response_percentage; } |
204 |
; |
; |
205 |
|
|
206 |
list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } |
list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } |
207 |
| MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } |
| MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } |
208 |
| CHANNELS { $$ = LSCPSERVER->ListChannels(); } |
| 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); } |
load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); } |
264 |
| dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
| 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 |
// atomic variable symbol rules |
271 |
|
|
438 |
INFO : 'I''N''F''O' |
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' |
BUFFER_FILL : 'B''U''F''F''E''R''_''F''I''L''L' |
448 |
; |
; |
449 |
|
|
516 |
MIDI_INPUT : 'M''I''D''I''_''I''N''P''U''T' |
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' |
VOLUME : 'V''O''L''U''M''E' |
523 |
; |
; |
524 |
|
|