3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
* Copyright (C) 2005 - 2014 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* 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 * |
* it under the terms of the GNU General Public License as published by * |
34 |
#include "lscpparser.h" |
#include "lscpparser.h" |
35 |
#include "lscpserver.h" |
#include "lscpserver.h" |
36 |
#include "lscpevent.h" |
#include "lscpevent.h" |
37 |
|
#include "lscpsymbols.h" |
38 |
|
#include <algorithm> |
39 |
|
|
40 |
|
namespace LinuxSampler { |
41 |
|
|
42 |
// to save us typing work in the rules action definitions |
// to save us typing work in the rules action definitions |
43 |
#define LSCPSERVER ((yyparse_param_t*) yyparse_param)->pServer |
#define LSCPSERVER ((yyparse_param_t*) yyparse_param)->pServer |
44 |
#define SESSION_PARAM ((yyparse_param_t*) yyparse_param) |
#define SESSION_PARAM ((yyparse_param_t*) yyparse_param) |
45 |
#define INCREMENT_LINE { SESSION_PARAM->iLine++; SESSION_PARAM->iColumn = 0; } |
#define INCREMENT_LINE { SESSION_PARAM->iLine++; SESSION_PARAM->iColumn = 0; sParsed.clear(); } |
46 |
|
|
47 |
// clears input buffer |
// clears input buffer |
48 |
void restart(yyparse_param_t* pparam, int& yychar); |
void restart(yyparse_param_t* pparam, int& yychar); |
49 |
#define RESTART restart((yyparse_param_t*) YYPARSE_PARAM, yychar) |
#define RESTART restart((yyparse_param_t*) YYPARSE_PARAM, yychar) |
50 |
|
|
|
// we provide our own version of yyerror() so we don't have to link against the yacc library |
|
|
void yyerror(const char* s); |
|
|
|
|
51 |
static char buf[1024]; // input buffer to feed the parser with new characters |
static char buf[1024]; // input buffer to feed the parser with new characters |
52 |
static int bytes = 0; // current number of characters in the input buffer |
static int bytes = 0; // current number of characters in the input buffer |
53 |
static int ptr = 0; // current position in the input buffer |
static int ptr = 0; // current position in the input buffer |
54 |
static String sLastError; // error message of the last error occured |
static String sLastError; // error message of the last error occured |
55 |
|
static String sParsed; ///< Characters of current line which have already been shifted (consumed/parsed) by the parser. |
56 |
|
|
57 |
// external reference to the function which actually reads from the socket |
// external reference to the function which actually reads from the socket |
58 |
extern int GetLSCPCommand( void *buf, int max_size); |
extern int GetLSCPCommand( void *buf, int max_size); |
83 |
const char c = buf[ptr++]; |
const char c = buf[ptr++]; |
84 |
// increment current reading position (just for verbosity / messages) |
// increment current reading position (just for verbosity / messages) |
85 |
GetCurrentYaccSession()->iColumn++; |
GetCurrentYaccSession()->iColumn++; |
86 |
|
sParsed += c; |
87 |
// we have to handle "normal" and "extended" ASCII characters separately |
// we have to handle "normal" and "extended" ASCII characters separately |
88 |
if (isExtendedAsciiChar(c)) { |
if (isExtendedAsciiChar(c)) { |
89 |
// workaround for characters with ASCII code higher than 127 |
// workaround for characters with ASCII code higher than 127 |
104 |
return atoi(d2)*8*8 + atoi(d1)*8 + atoi(d0); |
return atoi(d2)*8*8 + atoi(d1)*8 + atoi(d0); |
105 |
} |
} |
106 |
|
|
107 |
|
} |
108 |
|
|
109 |
|
using namespace LinuxSampler; |
110 |
|
|
111 |
|
static std::set<String> yyExpectedSymbols(); |
112 |
|
|
113 |
|
/** |
114 |
|
* Will be called when an error occured (usually syntax error). |
115 |
|
* |
116 |
|
* We provide our own version of yyerror() so we a) don't have to link against |
117 |
|
* the yacc library and b) can render more helpful syntax error messages. |
118 |
|
*/ |
119 |
|
void yyerror(void* x, const char* s) { |
120 |
|
yyparse_param_t* param = GetCurrentYaccSession(); |
121 |
|
|
122 |
|
// get the text part already parsed (of current line) |
123 |
|
const bool bContainsLineFeed = |
124 |
|
sParsed.find('\r') != std::string::npos || |
125 |
|
sParsed.find('\n') != std::string::npos; |
126 |
|
// remove potential line feed characters |
127 |
|
if (bContainsLineFeed) { |
128 |
|
for (size_t p = sParsed.find('\r'); p != std::string::npos; |
129 |
|
p = sParsed.find('\r')) sParsed.erase(p); |
130 |
|
for (size_t p = sParsed.find('\n'); p != std::string::npos; |
131 |
|
p = sParsed.find('\n')) sParsed.erase(p); |
132 |
|
} |
133 |
|
|
134 |
|
// start assembling the error message with Bison's own message |
135 |
|
String txt = s; |
136 |
|
|
137 |
|
// append exact position info of syntax error |
138 |
|
txt += (" (line:" + ToString(param->iLine+1)) + |
139 |
|
(",column:" + ToString(param->iColumn)) + ")"; |
140 |
|
|
141 |
|
// append the part of the lined that has already been parsed |
142 |
|
txt += ". Context: \"" + sParsed; |
143 |
|
if (txt.empty() || bContainsLineFeed) |
144 |
|
txt += "^"; |
145 |
|
else |
146 |
|
txt.insert(txt.size() - 1, "^"); |
147 |
|
txt += "...\""; |
148 |
|
|
149 |
|
// append the non-terminal symbols expected now/next |
150 |
|
std::set<String> expectedSymbols = yyExpectedSymbols(); |
151 |
|
for (std::set<String>::const_iterator it = expectedSymbols.begin(); |
152 |
|
it != expectedSymbols.end(); ++it) |
153 |
|
{ |
154 |
|
if (it == expectedSymbols.begin()) |
155 |
|
txt += " -> Should be: " + *it; |
156 |
|
else |
157 |
|
txt += " | " + *it; |
158 |
|
} |
159 |
|
|
160 |
|
dmsg(2,("LSCPParser: %s\n", txt.c_str())); |
161 |
|
sLastError = txt; |
162 |
|
} |
163 |
|
|
164 |
%} |
%} |
165 |
|
|
166 |
// reentrant parser |
// reentrant parser |
167 |
%pure_parser |
%pure-parser |
168 |
|
|
169 |
|
%parse-param {void* yyparse_param} |
170 |
|
|
171 |
|
// After entering the yyparse() function, store references to the parser's |
172 |
|
// state stack, so that we can create more helpful syntax error messages than |
173 |
|
// Bison (2.x) could do. |
174 |
|
%initial-action { |
175 |
|
yyparse_param_t* p = (yyparse_param_t*) yyparse_param; |
176 |
|
p->ppStackBottom = &yyss; |
177 |
|
p->ppStackTop = &yyssp; |
178 |
|
} |
179 |
|
|
180 |
// tell bison to spit out verbose syntax error messages |
// tell bison to spit out verbose syntax error messages |
181 |
%error-verbose |
%error-verbose |
183 |
%token <Char> EXT_ASCII_CHAR |
%token <Char> EXT_ASCII_CHAR |
184 |
|
|
185 |
%type <Char> char char_base alpha_char digit digit_oct digit_hex escape_seq escape_seq_octal escape_seq_hex |
%type <Char> char char_base alpha_char digit digit_oct digit_hex escape_seq escape_seq_octal escape_seq_hex |
186 |
%type <Dotnum> dotnum volume_value boolean |
%type <Dotnum> real dotnum volume_value boolean control_value |
187 |
%type <Number> number sampler_channel instrument_index fx_send_id audio_channel_index device_index midi_input_channel_index midi_input_port_index midi_map midi_bank midi_prog midi_ctrl |
%type <Number> number sampler_channel instrument_index fx_send_id audio_channel_index device_index effect_index effect_instance effect_chain chain_pos input_control midi_input_channel_index midi_input_port_index midi_map midi_bank midi_prog midi_ctrl |
188 |
%type <String> string string_escaped text text_escaped text_escaped_base stringval stringval_escaped digits param_val_list param_val query_val filename db_path map_name entry_name fx_send_name engine_name command add_instruction 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 remove_instruction unmap_instruction set_instruction subscribe_event unsubscribe_event map_instruction reset_instruction clear_instruction find_instruction move_instruction copy_instruction scan_mode edit_instruction format_instruction |
%type <String> string string_escaped text text_escaped text_escaped_base stringval stringval_escaped digits param_val_list param_val query_val filename module effect_system db_path map_name entry_name fx_send_name effect_name engine_name command add_instruction create_instruction destroy_instruction get_instruction list_instruction load_instruction send_instruction set_chan_instruction load_instr_args load_engine_args audio_output_type_name midi_input_type_name remove_instruction unmap_instruction set_instruction subscribe_event unsubscribe_event map_instruction reset_instruction clear_instruction find_instruction move_instruction copy_instruction scan_mode edit_instruction format_instruction append_instruction insert_instruction |
189 |
%type <FillResponse> buffer_size_type |
%type <FillResponse> buffer_size_type |
190 |
%type <KeyValList> key_val_list query_val_list |
%type <KeyValList> key_val_list query_val_list |
191 |
%type <LoadMode> instr_load_mode |
%type <LoadMode> instr_load_mode |
243 |
| COPY SP copy_instruction { $$ = $3; } |
| COPY SP copy_instruction { $$ = $3; } |
244 |
| EDIT SP edit_instruction { $$ = $3; } |
| EDIT SP edit_instruction { $$ = $3; } |
245 |
| FORMAT SP format_instruction { $$ = $3; } |
| FORMAT SP format_instruction { $$ = $3; } |
246 |
|
| SEND SP send_instruction { $$ = $3; } |
247 |
|
| APPEND SP append_instruction { $$ = $3; } |
248 |
|
| INSERT SP insert_instruction { $$ = $3; } |
249 |
| RESET { $$ = LSCPSERVER->ResetSampler(); } |
| RESET { $$ = LSCPSERVER->ResetSampler(); } |
250 |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
251 |
; |
; |
252 |
|
|
253 |
add_instruction : CHANNEL { $$ = LSCPSERVER->AddChannel(); } |
add_instruction : CHANNEL { $$ = LSCPSERVER->AddChannel(); } |
254 |
|
| CHANNEL SP MIDI_INPUT SP sampler_channel SP device_index { $$ = LSCPSERVER->AddChannelMidiInput($5,$7); } |
255 |
|
| CHANNEL SP MIDI_INPUT SP sampler_channel SP device_index SP midi_input_port_index { $$ = LSCPSERVER->AddChannelMidiInput($5,$7,$9); } |
256 |
| DB_INSTRUMENT_DIRECTORY SP db_path { $$ = LSCPSERVER->AddDbInstrumentDirectory($3); } |
| DB_INSTRUMENT_DIRECTORY SP db_path { $$ = LSCPSERVER->AddDbInstrumentDirectory($3); } |
257 |
| DB_INSTRUMENTS SP NON_MODAL SP scan_mode SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($5,$7,$9, true); } |
| DB_INSTRUMENTS SP NON_MODAL SP scan_mode SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($5,$7,$9, true); } |
258 |
| DB_INSTRUMENTS SP scan_mode SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7); } |
| DB_INSTRUMENTS SP NON_MODAL SP scan_mode SP FILE_AS_DIR SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($5,$9,$11, true, true); } |
259 |
| DB_INSTRUMENTS SP NON_MODAL SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($5,$7, -1, true); } |
| DB_INSTRUMENTS SP scan_mode SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7); } |
260 |
| DB_INSTRUMENTS SP NON_MODAL SP db_path SP filename SP instrument_index { $$ = LSCPSERVER->AddDbInstruments($5,$7,$9, true); } |
| DB_INSTRUMENTS SP scan_mode SP FILE_AS_DIR SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($3,$7,$9, false, true); } |
261 |
| DB_INSTRUMENTS SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($3,$5); } |
| DB_INSTRUMENTS SP NON_MODAL SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($5,$7, -1, true); } |
262 |
| DB_INSTRUMENTS SP db_path SP filename SP instrument_index { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7); } |
| DB_INSTRUMENTS SP NON_MODAL SP db_path SP filename SP instrument_index { $$ = LSCPSERVER->AddDbInstruments($5,$7,$9, true); } |
263 |
|
| DB_INSTRUMENTS SP db_path SP filename { $$ = LSCPSERVER->AddDbInstruments($3,$5); } |
264 |
|
| DB_INSTRUMENTS SP db_path SP filename SP instrument_index { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7); } |
265 |
| MIDI_INSTRUMENT_MAP { $$ = LSCPSERVER->AddMidiInstrumentMap(); } |
| MIDI_INSTRUMENT_MAP { $$ = LSCPSERVER->AddMidiInstrumentMap(); } |
266 |
| MIDI_INSTRUMENT_MAP SP map_name { $$ = LSCPSERVER->AddMidiInstrumentMap($3); } |
| MIDI_INSTRUMENT_MAP SP map_name { $$ = LSCPSERVER->AddMidiInstrumentMap($3); } |
267 |
|
| SEND_EFFECT_CHAIN SP device_index { $$ = LSCPSERVER->AddSendEffectChain($3); } |
268 |
; |
; |
269 |
|
|
270 |
subscribe_event : AUDIO_OUTPUT_DEVICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_audio_device_count); } |
subscribe_event : AUDIO_OUTPUT_DEVICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_audio_device_count); } |
293 |
| TOTAL_STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_total_stream_count); } |
| TOTAL_STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_total_stream_count); } |
294 |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_total_voice_count); } |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_total_voice_count); } |
295 |
| GLOBAL_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_global_info); } |
| GLOBAL_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_global_info); } |
296 |
|
| EFFECT_INSTANCE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_fx_instance_count); } |
297 |
|
| EFFECT_INSTANCE_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_fx_instance_info); } |
298 |
|
| SEND_EFFECT_CHAIN_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_send_fx_chain_count); } |
299 |
|
| SEND_EFFECT_CHAIN_INFO { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_send_fx_chain_info); } |
300 |
; |
; |
301 |
|
|
302 |
unsubscribe_event : AUDIO_OUTPUT_DEVICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_audio_device_count); } |
unsubscribe_event : AUDIO_OUTPUT_DEVICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_audio_device_count); } |
325 |
| TOTAL_STREAM_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_stream_count); } |
| TOTAL_STREAM_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_stream_count); } |
326 |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_voice_count); } |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_voice_count); } |
327 |
| GLOBAL_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_global_info); } |
| GLOBAL_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_global_info); } |
328 |
|
| EFFECT_INSTANCE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_fx_instance_count); } |
329 |
|
| EFFECT_INSTANCE_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_fx_instance_info); } |
330 |
|
| SEND_EFFECT_CHAIN_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_send_fx_chain_count); } |
331 |
|
| SEND_EFFECT_CHAIN_INFO { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_send_fx_chain_info); } |
332 |
; |
; |
333 |
|
|
334 |
map_instruction : MIDI_INSTRUMENT SP modal_arg midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($4,$6,$8,$10,$12,$14,$16,MidiInstrumentMapper::DONTCARE,"",$3); } |
map_instruction : MIDI_INSTRUMENT SP modal_arg midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($4,$6,$8,$10,$12,$14,$16,MidiInstrumentMapper::DONTCARE,"",$3); } |
341 |
; |
; |
342 |
|
|
343 |
remove_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($3); } |
remove_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($3); } |
344 |
|
| CHANNEL SP MIDI_INPUT SP sampler_channel { $$ = LSCPSERVER->RemoveChannelMidiInput($5); } |
345 |
|
| CHANNEL SP MIDI_INPUT SP sampler_channel SP device_index { $$ = LSCPSERVER->RemoveChannelMidiInput($5,$7); } |
346 |
|
| CHANNEL SP MIDI_INPUT SP sampler_channel SP device_index SP midi_input_port_index { $$ = LSCPSERVER->RemoveChannelMidiInput($5,$7,$9); } |
347 |
| MIDI_INSTRUMENT_MAP SP midi_map { $$ = LSCPSERVER->RemoveMidiInstrumentMap($3); } |
| MIDI_INSTRUMENT_MAP SP midi_map { $$ = LSCPSERVER->RemoveMidiInstrumentMap($3); } |
348 |
| MIDI_INSTRUMENT_MAP SP ALL { $$ = LSCPSERVER->RemoveAllMidiInstrumentMaps(); } |
| MIDI_INSTRUMENT_MAP SP ALL { $$ = LSCPSERVER->RemoveAllMidiInstrumentMaps(); } |
349 |
|
| SEND_EFFECT_CHAIN SP device_index SP effect_chain { $$ = LSCPSERVER->RemoveSendEffectChain($3,$5); } |
350 |
|
| SEND_EFFECT_CHAIN SP EFFECT SP device_index SP effect_chain SP chain_pos { $$ = LSCPSERVER->RemoveSendEffectChainEffect($5,$7,$9); } |
351 |
|
| FX_SEND SP EFFECT SP sampler_channel SP fx_send_id { $$ = LSCPSERVER->SetFxSendEffect($5,$7,-1,-1); } |
352 |
| DB_INSTRUMENT_DIRECTORY SP FORCE SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($5, true); } |
| DB_INSTRUMENT_DIRECTORY SP FORCE SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($5, true); } |
353 |
| DB_INSTRUMENT_DIRECTORY SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($3); } |
| DB_INSTRUMENT_DIRECTORY SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($3); } |
354 |
| DB_INSTRUMENT SP db_path { $$ = LSCPSERVER->RemoveDbInstrument($3); } |
| DB_INSTRUMENT SP db_path { $$ = LSCPSERVER->RemoveDbInstrument($3); } |
355 |
; |
; |
356 |
|
|
357 |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
358 |
|
| AVAILABLE_EFFECTS { $$ = LSCPSERVER->GetAvailableEffects(); } |
359 |
|
| EFFECT_INSTANCES { $$ = LSCPSERVER->GetEffectInstances(); } |
360 |
|
| EFFECT SP INFO SP effect_index { $$ = LSCPSERVER->GetEffectInfo($5); } |
361 |
|
| EFFECT_INSTANCE SP INFO SP effect_instance { $$ = LSCPSERVER->GetEffectInstanceInfo($5); } |
362 |
|
| EFFECT_INSTANCE_INPUT_CONTROL SP INFO SP effect_instance SP input_control { $$ = LSCPSERVER->GetEffectInstanceInputControlInfo($5,$7); } |
363 |
|
| SEND_EFFECT_CHAINS SP device_index { $$ = LSCPSERVER->GetSendEffectChains($3); } |
364 |
|
| SEND_EFFECT_CHAIN SP INFO SP device_index SP effect_chain { $$ = LSCPSERVER->GetSendEffectChainInfo($5,$7); } |
365 |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableMidiInputDrivers(); } |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableMidiInputDrivers(); } |
366 |
| MIDI_INPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetMidiInputDriverInfo($5); } |
| MIDI_INPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetMidiInputDriverInfo($5); } |
367 |
| MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7); } |
| MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7); } |
403 |
| DB_INSTRUMENT SP INFO SP db_path { $$ = LSCPSERVER->GetDbInstrumentInfo($5); } |
| DB_INSTRUMENT SP INFO SP db_path { $$ = LSCPSERVER->GetDbInstrumentInfo($5); } |
404 |
| DB_INSTRUMENTS_JOB SP INFO SP number { $$ = LSCPSERVER->GetDbInstrumentsJobInfo($5); } |
| DB_INSTRUMENTS_JOB SP INFO SP number { $$ = LSCPSERVER->GetDbInstrumentsJobInfo($5); } |
405 |
| VOLUME { $$ = LSCPSERVER->GetGlobalVolume(); } |
| VOLUME { $$ = LSCPSERVER->GetGlobalVolume(); } |
406 |
|
| VOICES { $$ = LSCPSERVER->GetGlobalMaxVoices(); } |
407 |
|
| STREAMS { $$ = LSCPSERVER->GetGlobalMaxStreams(); } |
408 |
| FILE SP INSTRUMENTS SP filename { $$ = LSCPSERVER->GetFileInstruments($5); } |
| FILE SP INSTRUMENTS SP filename { $$ = LSCPSERVER->GetFileInstruments($5); } |
409 |
| FILE SP INSTRUMENT SP INFO SP filename SP instrument_index { $$ = LSCPSERVER->GetFileInstrumentInfo($7,$9); } |
| FILE SP INSTRUMENT SP INFO SP filename SP instrument_index { $$ = LSCPSERVER->GetFileInstrumentInfo($7,$9); } |
410 |
; |
; |
414 |
| MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); } |
| MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); } |
415 |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' NONE { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, ""); } |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' NONE { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, ""); } |
416 |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); } |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); } |
417 |
|
| EFFECT_INSTANCE_INPUT_CONTROL SP VALUE SP effect_instance SP input_control SP control_value { $$ = LSCPSERVER->SetEffectInstanceInputControlValue($5, $7, $9); } |
418 |
| CHANNEL SP set_chan_instruction { $$ = $3; } |
| CHANNEL SP set_chan_instruction { $$ = $3; } |
419 |
| MIDI_INSTRUMENT_MAP SP NAME SP midi_map SP map_name { $$ = LSCPSERVER->SetMidiInstrumentMapName($5, $7); } |
| MIDI_INSTRUMENT_MAP SP NAME SP midi_map SP map_name { $$ = LSCPSERVER->SetMidiInstrumentMapName($5, $7); } |
420 |
| FX_SEND SP NAME SP sampler_channel SP fx_send_id SP fx_send_name { $$ = LSCPSERVER->SetFxSendName($5,$7,$9); } |
| FX_SEND SP NAME SP sampler_channel SP fx_send_id SP fx_send_name { $$ = LSCPSERVER->SetFxSendName($5,$7,$9); } |
421 |
| FX_SEND SP AUDIO_OUTPUT_CHANNEL SP sampler_channel SP fx_send_id SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetFxSendAudioOutputChannel($5,$7,$9,$11); } |
| FX_SEND SP AUDIO_OUTPUT_CHANNEL SP sampler_channel SP fx_send_id SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetFxSendAudioOutputChannel($5,$7,$9,$11); } |
422 |
| FX_SEND SP MIDI_CONTROLLER SP sampler_channel SP fx_send_id SP midi_ctrl { $$ = LSCPSERVER->SetFxSendMidiController($5,$7,$9); } |
| FX_SEND SP MIDI_CONTROLLER SP sampler_channel SP fx_send_id SP midi_ctrl { $$ = LSCPSERVER->SetFxSendMidiController($5,$7,$9); } |
423 |
| FX_SEND SP LEVEL SP sampler_channel SP fx_send_id SP volume_value { $$ = LSCPSERVER->SetFxSendLevel($5,$7,$9); } |
| FX_SEND SP LEVEL SP sampler_channel SP fx_send_id SP volume_value { $$ = LSCPSERVER->SetFxSendLevel($5,$7,$9); } |
424 |
|
| FX_SEND SP EFFECT SP sampler_channel SP fx_send_id SP effect_chain SP chain_pos { $$ = LSCPSERVER->SetFxSendEffect($5,$7,$9,$11); } |
425 |
| DB_INSTRUMENT_DIRECTORY SP NAME SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentDirectoryName($5,$7); } |
| DB_INSTRUMENT_DIRECTORY SP NAME SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentDirectoryName($5,$7); } |
426 |
| DB_INSTRUMENT_DIRECTORY SP DESCRIPTION SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentDirectoryDescription($5,$7); } |
| DB_INSTRUMENT_DIRECTORY SP DESCRIPTION SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentDirectoryDescription($5,$7); } |
427 |
| DB_INSTRUMENT SP NAME SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentName($5,$7); } |
| DB_INSTRUMENT SP NAME SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentName($5,$7); } |
428 |
| DB_INSTRUMENT SP DESCRIPTION SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentDescription($5,$7); } |
| DB_INSTRUMENT SP DESCRIPTION SP db_path SP stringval_escaped { $$ = LSCPSERVER->SetDbInstrumentDescription($5,$7); } |
429 |
|
| DB_INSTRUMENT SP FILE_PATH SP filename SP filename { $$ = LSCPSERVER->SetDbInstrumentFilePath($5,$7); } |
430 |
| ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } |
| ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } |
431 |
| VOLUME SP volume_value { $$ = LSCPSERVER->SetGlobalVolume($3); } |
| VOLUME SP volume_value { $$ = LSCPSERVER->SetGlobalVolume($3); } |
432 |
|
| VOICES SP number { $$ = LSCPSERVER->SetGlobalMaxVoices($3); } |
433 |
|
| STREAMS SP number { $$ = LSCPSERVER->SetGlobalMaxStreams($3); } |
434 |
; |
; |
435 |
|
|
436 |
create_instruction : AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); } |
create_instruction : AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); } |
439 |
| MIDI_INPUT_DEVICE SP string { $$ = LSCPSERVER->CreateMidiInputDevice($3); } |
| MIDI_INPUT_DEVICE SP string { $$ = LSCPSERVER->CreateMidiInputDevice($3); } |
440 |
| FX_SEND SP sampler_channel SP midi_ctrl { $$ = LSCPSERVER->CreateFxSend($3,$5); } |
| FX_SEND SP sampler_channel SP midi_ctrl { $$ = LSCPSERVER->CreateFxSend($3,$5); } |
441 |
| FX_SEND SP sampler_channel SP midi_ctrl SP fx_send_name { $$ = LSCPSERVER->CreateFxSend($3,$5,$7); } |
| FX_SEND SP sampler_channel SP midi_ctrl SP fx_send_name { $$ = LSCPSERVER->CreateFxSend($3,$5,$7); } |
442 |
|
| EFFECT_INSTANCE SP effect_index { $$ = LSCPSERVER->CreateEffectInstance($3); } |
443 |
|
| EFFECT_INSTANCE SP effect_system SP module SP effect_name { $$ = LSCPSERVER->CreateEffectInstance($3,$5,$7); } |
444 |
; |
; |
445 |
|
|
446 |
reset_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($3); } |
reset_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($3); } |
454 |
| DB_INSTRUMENTS SP db_path SP query_val_list { $$ = LSCPSERVER->FindDbInstruments($3,$5, true); } |
| DB_INSTRUMENTS SP db_path SP query_val_list { $$ = LSCPSERVER->FindDbInstruments($3,$5, true); } |
455 |
| DB_INSTRUMENT_DIRECTORIES SP NON_RECURSIVE SP db_path SP query_val_list { $$ = LSCPSERVER->FindDbInstrumentDirectories($5,$7, false); } |
| DB_INSTRUMENT_DIRECTORIES SP NON_RECURSIVE SP db_path SP query_val_list { $$ = LSCPSERVER->FindDbInstrumentDirectories($5,$7, false); } |
456 |
| DB_INSTRUMENT_DIRECTORIES SP db_path SP query_val_list { $$ = LSCPSERVER->FindDbInstrumentDirectories($3,$5, true); } |
| DB_INSTRUMENT_DIRECTORIES SP db_path SP query_val_list { $$ = LSCPSERVER->FindDbInstrumentDirectories($3,$5, true); } |
457 |
|
| LOST SP DB_INSTRUMENT_FILES { $$ = LSCPSERVER->FindLostDbInstrumentFiles(); } |
458 |
; |
; |
459 |
|
|
460 |
move_instruction : DB_INSTRUMENT_DIRECTORY SP db_path SP db_path { $$ = LSCPSERVER->MoveDbInstrumentDirectory($3,$5); } |
move_instruction : DB_INSTRUMENT_DIRECTORY SP db_path SP db_path { $$ = LSCPSERVER->MoveDbInstrumentDirectory($3,$5); } |
468 |
destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
469 |
| MIDI_INPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyMidiInputDevice($3); } |
| MIDI_INPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyMidiInputDevice($3); } |
470 |
| FX_SEND SP sampler_channel SP fx_send_id { $$ = LSCPSERVER->DestroyFxSend($3,$5); } |
| FX_SEND SP sampler_channel SP fx_send_id { $$ = LSCPSERVER->DestroyFxSend($3,$5); } |
471 |
|
| EFFECT_INSTANCE SP number { $$ = LSCPSERVER->DestroyEffectInstance($3); } |
472 |
; |
; |
473 |
|
|
474 |
load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; } |
load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; } |
475 |
| ENGINE SP load_engine_args { $$ = $3; } |
| ENGINE SP load_engine_args { $$ = $3; } |
476 |
; |
; |
477 |
|
|
478 |
|
append_instruction : SEND_EFFECT_CHAIN SP EFFECT SP device_index SP effect_chain SP effect_instance { $$ = LSCPSERVER->AppendSendEffectChainEffect($5,$7,$9); } |
479 |
|
; |
480 |
|
|
481 |
|
insert_instruction : SEND_EFFECT_CHAIN SP EFFECT SP device_index SP effect_chain SP chain_pos SP effect_instance { $$ = LSCPSERVER->InsertSendEffectChainEffect($5,$7,$9,$11); } |
482 |
|
; |
483 |
|
|
484 |
set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); } |
set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); } |
485 |
| AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); } |
| AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); } |
486 |
| AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name { $$ = LSCPSERVER->SetAudioOutputType($5, $3); } |
| AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name { $$ = LSCPSERVER->SetAudioOutputType($5, $3); } |
518 |
list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } |
list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } |
519 |
| MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } |
| MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } |
520 |
| CHANNELS { $$ = LSCPSERVER->ListChannels(); } |
| CHANNELS { $$ = LSCPSERVER->ListChannels(); } |
521 |
|
| CHANNEL SP MIDI_INPUTS SP sampler_channel { $$ = LSCPSERVER->ListChannelMidiInputs($5); } |
522 |
| AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); } |
| AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); } |
523 |
|
| AVAILABLE_EFFECTS { $$ = LSCPSERVER->ListAvailableEffects(); } |
524 |
|
| EFFECT_INSTANCES { $$ = LSCPSERVER->ListEffectInstances(); } |
525 |
|
| SEND_EFFECT_CHAINS SP number { $$ = LSCPSERVER->ListSendEffectChains($3); } |
526 |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); } |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); } |
527 |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); } |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); } |
528 |
| MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->ListMidiInstrumentMappings($3); } |
| MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->ListMidiInstrumentMappings($3); } |
536 |
| FILE SP INSTRUMENTS SP filename { $$ = LSCPSERVER->ListFileInstruments($5); } |
| FILE SP INSTRUMENTS SP filename { $$ = LSCPSERVER->ListFileInstruments($5); } |
537 |
; |
; |
538 |
|
|
539 |
|
send_instruction : CHANNEL SP MIDI_DATA SP string SP sampler_channel SP number SP number { $$ = LSCPSERVER->SendChannelMidiData($5, $7, $9, $11); } |
540 |
|
; |
541 |
|
|
542 |
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); } |
543 |
| NON_MODAL SP filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($3, $5, $7, true); } |
| NON_MODAL SP filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($3, $5, $7, true); } |
544 |
; |
; |
551 |
| PERSISTENT { $$ = MidiInstrumentMapper::PERSISTENT; } |
| PERSISTENT { $$ = MidiInstrumentMapper::PERSISTENT; } |
552 |
; |
; |
553 |
|
|
554 |
|
effect_instance : number |
555 |
|
; |
556 |
|
|
557 |
device_index : number |
device_index : number |
558 |
; |
; |
559 |
|
|
589 |
| number { $$ = $1; } |
| number { $$ = $1; } |
590 |
; |
; |
591 |
|
|
592 |
|
control_value : real |
593 |
|
; |
594 |
|
|
595 |
sampler_channel : number |
sampler_channel : number |
596 |
; |
; |
597 |
|
|
626 |
fx_send_name : stringval_escaped |
fx_send_name : stringval_escaped |
627 |
; |
; |
628 |
|
|
629 |
|
effect_name : stringval_escaped |
630 |
|
; |
631 |
|
|
632 |
|
effect_index : number |
633 |
|
; |
634 |
|
|
635 |
|
effect_chain : number |
636 |
|
; |
637 |
|
|
638 |
|
chain_pos : number |
639 |
|
; |
640 |
|
|
641 |
|
input_control : number |
642 |
|
; |
643 |
|
|
644 |
param_val_list : param_val |
param_val_list : param_val |
645 |
| param_val_list','param_val { $$ = $1 + "," + $3; } |
| param_val_list','param_val { $$ = $1 + "," + $3; } |
646 |
; |
; |
649 |
param_val : string { $$ = "\'" + $1 + "\'"; } |
param_val : string { $$ = "\'" + $1 + "\'"; } |
650 |
| stringval { $$ = "\'" + $1 + "\'"; } |
| stringval { $$ = "\'" + $1 + "\'"; } |
651 |
| number { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
| number { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
652 |
| dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
| dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } //TODO: maybe better using 'real' instead of 'number' and 'dotnum' rules |
653 |
; |
; |
654 |
|
|
655 |
query_val_list : string '=' query_val { $$[$1] = $3; } |
query_val_list : string '=' query_val { $$[$1] = $3; } |
665 |
| FLAT { $$ = "FLAT"; } |
| FLAT { $$ = "FLAT"; } |
666 |
; |
; |
667 |
|
|
668 |
|
effect_system : string |
669 |
|
; |
670 |
|
|
671 |
|
module : filename |
672 |
|
; |
673 |
|
|
674 |
// GRAMMAR_BNF_END - do NOT delete or modify this line !!! |
// GRAMMAR_BNF_END - do NOT delete or modify this line !!! |
675 |
|
|
676 |
|
|
685 |
| '-' digits '.' digits { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
| '-' digits '.' digits { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
686 |
; |
; |
687 |
|
|
688 |
|
real : digits '.' digits { std::stringstream ss($1 + "." + $3); ss.imbue(std::locale::classic()); ss >> $$; } |
689 |
|
| '+' digits '.' digits { std::stringstream ss($2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
690 |
|
| '-' digits '.' digits { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
691 |
|
| digits { std::stringstream ss($1); ss.imbue(std::locale::classic()); ss >> $$; } |
692 |
|
| '+' digits { std::stringstream ss($2); ss.imbue(std::locale::classic()); ss >> $$; } |
693 |
|
| '-' digits { std::stringstream ss("-" + $2); ss.imbue(std::locale::classic()); ss >> $$; } |
694 |
|
; |
695 |
|
|
696 |
|
|
697 |
digits : digit { $$ = $1; } |
digits : digit { $$ = $1; } |
698 |
| digits digit { $$ = $1 + $2; } |
| digits digit { $$ = $1 + $2; } |
881 |
FIND : 'F''I''N''D' |
FIND : 'F''I''N''D' |
882 |
; |
; |
883 |
|
|
884 |
|
FILE_AS_DIR : 'F''I''L''E''_''A''S''_''D''I''R' |
885 |
|
; |
886 |
|
|
887 |
MOVE : 'M''O''V''E' |
MOVE : 'M''O''V''E' |
888 |
; |
; |
889 |
|
|
920 |
SET : 'S''E''T' |
SET : 'S''E''T' |
921 |
; |
; |
922 |
|
|
923 |
|
APPEND : 'A''P''P''E''N''D' |
924 |
|
; |
925 |
|
|
926 |
|
INSERT : 'I''N''S''E''R''T' |
927 |
|
; |
928 |
|
|
929 |
SUBSCRIBE : 'S''U''B''S''C''R''I''B''E' |
SUBSCRIBE : 'S''U''B''S''C''R''I''B''E' |
930 |
; |
; |
931 |
|
|
983 |
DB_INSTRUMENT_INFO : 'D''B''_''I''N''S''T''R''U''M''E''N''T''_''I''N''F''O' |
DB_INSTRUMENT_INFO : 'D''B''_''I''N''S''T''R''U''M''E''N''T''_''I''N''F''O' |
984 |
; |
; |
985 |
|
|
986 |
|
DB_INSTRUMENT_FILES : 'D''B''_''I''N''S''T''R''U''M''E''N''T''_''F''I''L''E''S' |
987 |
|
; |
988 |
|
|
989 |
DB_INSTRUMENTS_JOB_INFO : 'D''B''_''I''N''S''T''R''U''M''E''N''T''S''_''J''O''B''_''I''N''F''O' |
DB_INSTRUMENTS_JOB_INFO : 'D''B''_''I''N''S''T''R''U''M''E''N''T''S''_''J''O''B''_''I''N''F''O' |
990 |
; |
; |
991 |
|
|
1028 |
GLOBAL_INFO : 'G''L''O''B''A''L''_''I''N''F''O' |
GLOBAL_INFO : 'G''L''O''B''A''L''_''I''N''F''O' |
1029 |
; |
; |
1030 |
|
|
1031 |
|
EFFECT_INSTANCE_COUNT : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E''_''C''O''U''N''T' |
1032 |
|
; |
1033 |
|
|
1034 |
|
EFFECT_INSTANCE_INFO : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E''_''I''N''F''O' |
1035 |
|
; |
1036 |
|
|
1037 |
|
SEND_EFFECT_CHAIN_COUNT : 'S''E''N''D''_''E''F''F''E''C''T''_''C''H''A''I''N''_''C''O''U''N''T' |
1038 |
|
; |
1039 |
|
|
1040 |
|
SEND_EFFECT_CHAIN_INFO : 'S''E''N''D''_''E''F''F''E''C''T''_''C''H''A''I''N''_''I''N''F''O' |
1041 |
|
; |
1042 |
|
|
1043 |
INSTRUMENT : 'I''N''S''T''R''U''M''E''N''T' |
INSTRUMENT : 'I''N''S''T''R''U''M''E''N''T' |
1044 |
; |
; |
1045 |
|
|
1082 |
AUDIO_OUTPUT_TYPE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E' |
AUDIO_OUTPUT_TYPE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E' |
1083 |
; |
; |
1084 |
|
|
1085 |
|
AVAILABLE_EFFECTS : 'A''V''A''I''L''A''B''L''E''_''E''F''F''E''C''T''S' |
1086 |
|
; |
1087 |
|
|
1088 |
|
EFFECT : 'E''F''F''E''C''T' |
1089 |
|
; |
1090 |
|
|
1091 |
|
EFFECT_INSTANCE : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E' |
1092 |
|
; |
1093 |
|
|
1094 |
|
EFFECT_INSTANCES : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E''S' |
1095 |
|
; |
1096 |
|
|
1097 |
|
EFFECT_INSTANCE_INPUT_CONTROL : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E''_''I''N''P''U''T''_''C''O''N''T''R''O''L' |
1098 |
|
; |
1099 |
|
|
1100 |
|
SEND_EFFECT_CHAIN : 'S''E''N''D''_''E''F''F''E''C''T''_''C''H''A''I''N' |
1101 |
|
; |
1102 |
|
|
1103 |
|
SEND_EFFECT_CHAINS : 'S''E''N''D''_''E''F''F''E''C''T''_''C''H''A''I''N''S' |
1104 |
|
; |
1105 |
|
|
1106 |
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' |
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' |
1107 |
; |
; |
1108 |
|
|
1148 |
MIDI_INPUT : 'M''I''D''I''_''I''N''P''U''T' |
MIDI_INPUT : 'M''I''D''I''_''I''N''P''U''T' |
1149 |
; |
; |
1150 |
|
|
1151 |
|
MIDI_INPUTS : 'M''I''D''I''_''I''N''P''U''T''S' |
1152 |
|
; |
1153 |
|
|
1154 |
MIDI_CONTROLLER : 'M''I''D''I''_''C''O''N''T''R''O''L''L''E''R' |
MIDI_CONTROLLER : 'M''I''D''I''_''C''O''N''T''R''O''L''L''E''R' |
1155 |
; |
; |
1156 |
|
|
1157 |
|
SEND : 'S''E''N''D' |
1158 |
|
; |
1159 |
|
|
1160 |
FX_SEND : 'F''X''_''S''E''N''D' |
FX_SEND : 'F''X''_''S''E''N''D' |
1161 |
; |
; |
1162 |
|
|
1196 |
NON_RECURSIVE : 'N''O''N''_''R''E''C''U''R''S''I''V''E' |
NON_RECURSIVE : 'N''O''N''_''R''E''C''U''R''S''I''V''E' |
1197 |
; |
; |
1198 |
|
|
1199 |
|
LOST : 'L''O''S''T' |
1200 |
|
; |
1201 |
|
|
1202 |
|
FILE_PATH : 'F''I''L''E''_''P''A''T''H' |
1203 |
|
; |
1204 |
|
|
1205 |
SERVER : 'S''E''R''V''E''R' |
SERVER : 'S''E''R''V''E''R' |
1206 |
; |
; |
1207 |
|
|
1211 |
LEVEL : 'L''E''V''E''L' |
LEVEL : 'L''E''V''E''L' |
1212 |
; |
; |
1213 |
|
|
1214 |
|
VALUE : 'V''A''L''U''E' |
1215 |
|
; |
1216 |
|
|
1217 |
MUTE : 'M''U''T''E' |
MUTE : 'M''U''T''E' |
1218 |
; |
; |
1219 |
|
|
1220 |
SOLO : 'S''O''L''O' |
SOLO : 'S''O''L''O' |
1221 |
; |
; |
1222 |
|
|
1223 |
|
VOICES : 'V''O''I''C''E''S' |
1224 |
|
; |
1225 |
|
|
1226 |
|
STREAMS : 'S''T''R''E''A''M''S' |
1227 |
|
; |
1228 |
|
|
1229 |
BYTES : 'B''Y''T''E''S' |
BYTES : 'B''Y''T''E''S' |
1230 |
; |
; |
1231 |
|
|
1241 |
FORMAT : 'F''O''R''M''A''T' |
FORMAT : 'F''O''R''M''A''T' |
1242 |
; |
; |
1243 |
|
|
1244 |
|
MIDI_DATA : 'M''I''D''I''_''D''A''T''A' |
1245 |
|
; |
1246 |
|
|
1247 |
RESET : 'R''E''S''E''T' |
RESET : 'R''E''S''E''T' |
1248 |
; |
; |
1249 |
|
|
1261 |
|
|
1262 |
%% |
%% |
1263 |
|
|
1264 |
|
#define DEBUG_BISON_SYNTAX_ERROR_WALKER 0 |
1265 |
|
|
1266 |
/** |
/** |
1267 |
* Will be called when an error occured (usually syntax error). |
* Internal function, only called by yyExpectedSymbols(). It is given a Bison |
1268 |
|
* parser state stack, reflecting the parser's entire state at a certain point, |
1269 |
|
* i.e. when a syntax error occured. This function will then walk ahead the |
1270 |
|
* potential parse tree starting from the current head of the given state |
1271 |
|
* stack. This function will call itself recursively to scan the individual |
1272 |
|
* parse tree branches. As soon as it hits on the next non-terminal grammar |
1273 |
|
* symbol in one parse tree branch, it adds the found non-terminal symbol to |
1274 |
|
* @a expectedSymbols and aborts scanning the respective tree branch further. |
1275 |
|
* If any local parser state is reached a second time, the respective parse |
1276 |
|
* tree is aborted to avoid any endless recursion. |
1277 |
|
* |
1278 |
|
* @param stack - Bison (yacc) state stack |
1279 |
|
* @param expectedSymbols - will be filled with next expected grammar symbols |
1280 |
|
* @param depth - just for internal debugging purposes |
1281 |
*/ |
*/ |
1282 |
void yyerror(const char* s) { |
static void walkAndFillExpectedSymbols(std::vector<YYTYPE_INT16>& stack, std::set<String>& expectedSymbols, int depth = 0) { |
1283 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1284 |
|
printf("\n"); |
1285 |
|
for (int i = 0; i < depth; ++i) printf("\t"); |
1286 |
|
printf("State stack:"); |
1287 |
|
for (int i = 0; i < stack.size(); ++i) { |
1288 |
|
printf(" %d", stack[i]); |
1289 |
|
} |
1290 |
|
printf("\n"); |
1291 |
|
#endif |
1292 |
|
|
1293 |
|
if (stack.empty()) return; |
1294 |
|
|
1295 |
|
int state = stack[stack.size() - 1]; |
1296 |
|
int n = yypact[state]; |
1297 |
|
if (n == YYPACT_NINF) { // default reduction required ... |
1298 |
|
// get default reduction rule for this state |
1299 |
|
n = yydefact[state]; |
1300 |
|
if (n <= 0 || n >= YYNRULES) return; // no rule, something is wrong |
1301 |
|
// return the new resolved expected symbol (left-hand symbol of grammar |
1302 |
|
// rule), then we're done in this state |
1303 |
|
expectedSymbols.insert(yytname[yyr1[n]]); |
1304 |
|
return; |
1305 |
|
} |
1306 |
|
if (!(YYPACT_NINF < n && n <= YYLAST)) return; |
1307 |
|
|
1308 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1309 |
|
for (int i = 0; i < depth; ++i) printf("\t"); |
1310 |
|
printf("Expected tokens:"); |
1311 |
|
#endif |
1312 |
|
int begin = n < 0 ? -n : 0; |
1313 |
|
int checklim = YYLAST - n + 1; |
1314 |
|
int end = checklim < YYNTOKENS ? checklim : YYNTOKENS; |
1315 |
|
int rule, action, stackSize; |
1316 |
|
for (int token = begin; token < end; ++token) { |
1317 |
|
if (token == YYTERROR || yycheck[n + token] != token) continue; |
1318 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1319 |
|
printf(" %s", yytname[token]); |
1320 |
|
#endif |
1321 |
|
|
1322 |
|
//if (yycheck[n + token] != token) goto default_reduction; |
1323 |
|
|
1324 |
|
action = yytable[n + token]; |
1325 |
|
if (action == 0 || action == YYTABLE_NINF) { |
1326 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1327 |
|
printf(" (invalid action) "); fflush(stdout); |
1328 |
|
#endif |
1329 |
|
continue; // error, ignore |
1330 |
|
} |
1331 |
|
if (action < 0) { // reduction with rule -action required ... |
1332 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1333 |
|
printf(" (reduction) "); fflush(stdout); |
1334 |
|
#endif |
1335 |
|
rule = -action; |
1336 |
|
goto reduce; |
1337 |
|
} |
1338 |
|
if (action == YYFINAL) continue; // "accept" state, we don't care about it here |
1339 |
|
|
1340 |
|
// "shift" required ... |
1341 |
|
|
1342 |
|
if (std::find(stack.begin(), stack.end(), action) != stack.end()) |
1343 |
|
continue; // duplicate state, ignore it to avoid endless recursions |
1344 |
|
|
1345 |
|
// "shift" / push the new state on the state stack and call this |
1346 |
|
// function recursively, and restore the stack after the recurse return |
1347 |
|
stackSize = stack.size(); |
1348 |
|
stack.push_back(action); |
1349 |
|
walkAndFillExpectedSymbols( //FIXME: could cause stack overflow (should be a loop instead), is probably fine with our current grammar though |
1350 |
|
stack, expectedSymbols, depth + 1 |
1351 |
|
); |
1352 |
|
stack.resize(stackSize); // restore stack |
1353 |
|
continue; |
1354 |
|
|
1355 |
|
//default_reduction: // resolve default reduction for this state |
1356 |
|
// printf(" (default red.) "); fflush(stdout); |
1357 |
|
// rule = yydefact[state]; |
1358 |
|
|
1359 |
|
reduce: // "reduce" required |
1360 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1361 |
|
printf(" (reduce by %d) ", rule); fflush(stdout); |
1362 |
|
#endif |
1363 |
|
if (rule == 0 || rule >= YYNRULES) continue; // invalid rule, something is wrong |
1364 |
|
// store the left-hand symbol of the grammar rule |
1365 |
|
expectedSymbols.insert(yytname[yyr1[rule]]); |
1366 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1367 |
|
printf(" (SYM %s) ", yytname[yyr1[rule]]); fflush(stdout); |
1368 |
|
#endif |
1369 |
|
} |
1370 |
|
#if DEBUG_BISON_SYNTAX_ERROR_WALKER |
1371 |
|
printf("\n"); |
1372 |
|
#endif |
1373 |
|
} |
1374 |
|
|
1375 |
|
/** |
1376 |
|
* Should only be called on syntax errors: returns a set of non-terminal |
1377 |
|
* symbols expected to appear now/next, just at the point where the syntax |
1378 |
|
* error appeared. |
1379 |
|
*/ |
1380 |
|
static std::set<String> yyExpectedSymbols() { |
1381 |
|
std::set<String> result; |
1382 |
yyparse_param_t* param = GetCurrentYaccSession(); |
yyparse_param_t* param = GetCurrentYaccSession(); |
1383 |
String msg = s |
YYTYPE_INT16* ss = (*param->ppStackBottom); |
1384 |
+ (" (line:" + ToString(param->iLine+1)) |
YYTYPE_INT16* sp = (*param->ppStackTop); |
1385 |
+ ( ",column:" + ToString(param->iColumn)) |
int iStackSize = sp - ss + 1; |
1386 |
+ ")"; |
// copy and wrap parser's state stack into a convenient STL container |
1387 |
dmsg(2,("LSCPParser: %s\n", msg.c_str())); |
std::vector<YYTYPE_INT16> stack; |
1388 |
sLastError = msg; |
for (int i = 0; i < iStackSize; ++i) { |
1389 |
|
stack.push_back(ss[i]); |
1390 |
|
} |
1391 |
|
// do the actual parser work |
1392 |
|
walkAndFillExpectedSymbols(stack, result); |
1393 |
|
return result; |
1394 |
} |
} |
1395 |
|
|
1396 |
|
namespace LinuxSampler { |
1397 |
|
|
1398 |
/** |
/** |
1399 |
* Clears input buffer. |
* Clears input buffer. |
1400 |
*/ |
*/ |
1402 |
bytes = 0; |
bytes = 0; |
1403 |
ptr = 0; |
ptr = 0; |
1404 |
sLastError = ""; |
sLastError = ""; |
1405 |
|
sParsed = ""; |
1406 |
|
} |
1407 |
|
|
1408 |
} |
} |