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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 141 by senkov, Mon Jun 21 01:21:33 2004 UTC revision 1781 by iliev, Mon Sep 29 18:21:21 2008 UTC
# Line 3  Line 3 
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                       *
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  *
# Line 20  Line 21 
21   *   MA  02111-1307  USA                                                   *   *   MA  02111-1307  USA                                                   *
22   ***************************************************************************/   ***************************************************************************/
23    
24    /*
25        The parser's C++ source files should be automatically (re)generated if
26        this file was modified. If not, or in case you want explicitly
27        regenerate the parser C++ files, run 'make parser'. In both cases you
28        need to have bison or another yacc compatible parser generator
29        installed though.
30    */
31    
32  %{  %{
33    
34  #include "lscpparser.h"  #include "lscpparser.h"
35  #include "lscpserver.h"  #include "lscpserver.h"
36    #include "lscpevent.h"
37    
38  // as we need an reentrant scanner, we have to pass the pointer to the scanner with each yylex() call  namespace LinuxSampler {
 #define YYLEX_PARAM ((yyparse_param_t*) yyparse_param)->pScanner  
39    
40  // to save us typing work in the rules action definitions  // to save us typing work in the rules action definitions
41  #define LSCPSERVER ((yyparse_param_t*) yyparse_param)->pServer  #define LSCPSERVER ((yyparse_param_t*) yyparse_param)->pServer
42    #define SESSION_PARAM ((yyparse_param_t*) yyparse_param)
43    #define INCREMENT_LINE { SESSION_PARAM->iLine++; SESSION_PARAM->iColumn = 0; }
44    
45  // clears input buffer and restarts scanner.  // clears input buffer
46  void restart(yyparse_param_t* pparam, int& yychar);  void restart(yyparse_param_t* pparam, int& yychar);
47  #define RESTART restart((yyparse_param_t*) YYPARSE_PARAM, yychar)  #define RESTART restart((yyparse_param_t*) YYPARSE_PARAM, yychar)
48    
49  // external reference to the main scanner function yylex()  static char buf[1024]; // input buffer to feed the parser with new characters
50  extern YY_DECL;  static int bytes = 0;  // current number of characters in the input buffer
51    static int ptr   = 0;  // current position in the input buffer
52    static String sLastError; // error message of the last error occured
53    
54    // external reference to the function which actually reads from the socket
55    extern int GetLSCPCommand( void *buf, int max_size);
56    
57    // external reference to the function in lscpserver.cpp which returns the
58    // current session (only works because the server runs as singleton)
59    extern yyparse_param_t* GetCurrentYaccSession();
60    
61    // returns true if supplied characters has an ASCII code of 128 or higher
62    inline bool isExtendedAsciiChar(const char c) {
63        return (c < 0);
64    }
65    
66    // custom scanner function which reads from the socket
67    // (bison expects it to return the numerical ID of the next
68    // "recognized token" from the input stream)
69    int yylex(YYSTYPE* yylval) {
70        // check if we have to read new characters
71        if (ptr >= bytes) {
72            bytes = GetLSCPCommand(buf, 1023);
73            ptr   = 0;
74            if (bytes < 0) {
75                bytes = 0;
76                return 0;
77            }
78        }
79        // this is the next character in the input stream
80        const char c = buf[ptr++];
81        // increment current reading position (just for verbosity / messages)
82        GetCurrentYaccSession()->iColumn++;
83        // we have to handle "normal" and "extended" ASCII characters separately
84        if (isExtendedAsciiChar(c)) {
85            // workaround for characters with ASCII code higher than 127
86            yylval->Char = c;
87            return EXT_ASCII_CHAR;
88        } else {
89            // simply return the ASCII code as terminal symbol ID
90            return (int) c;
91        }
92    }
93    
94    // parser helper functions
95    
96    int octalsToNumber(char oct_digit0, char oct_digit1 = '0', char oct_digit2 = '0') {
97        const char d0[] = { oct_digit0, '\0' };
98        const char d1[] = { oct_digit1, '\0' };
99        const char d2[] = { oct_digit2, '\0' };
100        return atoi(d2)*8*8 + atoi(d1)*8 + atoi(d0);
101    }
102    
103  // external reference to restart the lex scanner  }
 extern void yyrestart(FILE* input_file, yyscan_t yyscanner);  
104    
105  // we provide our own version of yyerror() so we don't have to link against the yacc library  // we provide our own version of yyerror() so we don't have to link against the yacc library
106  void yyerror(const char* s);  void yyerror(const char* s);
107    
108    using namespace LinuxSampler;
109    
110  %}  %}
111    
112  // reentrant parser  // reentrant parser
113  %pure_parser  %pure_parser
114    
115  %token <Char>   CHAR  // tell bison to spit out verbose syntax error messages
116  %token <Dotnum> DOTNUM  %error-verbose
117  %token <Number> NUMBER  
118  %token <String> STRINGVAL  %token <Char> EXT_ASCII_CHAR
119  %token SP LF CR HASH EQ  
120  %token ADD GET CREATE DESTROY LIST LOAD NON_MODAL REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET QUIT  %type <Char> char char_base alpha_char digit digit_oct digit_hex escape_seq escape_seq_octal escape_seq_hex
121  %token CHANNEL NOTIFICATION  %type <Dotnum> dotnum volume_value boolean
122  %token AVAILABLE_ENGINES AVAILABLE_AUDIO_OUTPUT_DRIVERS CHANNELS INFO BUFFER_FILL STREAM_COUNT VOICE_COUNT  %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
123  %token INSTRUMENT ENGINE  %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 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
 %token AUDIO_OUTPUT_CHANNEL AUDIO_OUTPUT_CHANNEL_PARAMETER AUDIO_OUTPUT_DEVICE AUDIO_OUTPUT_DEVICES AUDIO_OUTPUT_DEVICE_PARAMETER AUDIO_OUTPUT_DRIVER AUDIO_OUTPUT_DRIVER_PARAMETER MIDI_INPUT_PORT MIDI_INPUT_CHANNEL MIDI_INPUT_TYPE VOLUME  
 %token BYTES PERCENTAGE  
 %token MISCELLANEOUS  
   
 %type <Dotnum> volume  
 %type <Number> sampler_channel instrument_index audio_output_channel midi_input_channel  
 %type <String> string param_val filename engine_name midi_input_port command create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args midi_input_type set_instruction subscribe_event unsubscribe_event  
124  %type <FillResponse> buffer_size_type  %type <FillResponse> buffer_size_type
125  %type <KeyValList> key_val_list  %type <KeyValList> key_val_list query_val_list
126    %type <LoadMode> instr_load_mode
127    %type <Bool> modal_arg
128    %type <UniversalPath> path path_base path_prefix path_body
129    
130  %start input  %start input
131    
# Line 74  void yyerror(const char* s); Line 133  void yyerror(const char* s);
133    
134  //TODO: return more meaningful error messages  //TODO: return more meaningful error messages
135    
136  input                 :  line  /*
137                        |  input LF line    The LSCP specification document input file (Documentation/lscp.xml) is
138                        |  input CR LF line    automatically updated with this file using the scripts/update_grammar.pl
139      script. Do not modify or delete the GRAMMAR_BNF_BEGIN and GRAMMAR_BNF_END
140      lines !
141    */
142    
143    // GRAMMAR_BNF_BEGIN - do NOT delete or modify this line !!!
144    
145    input                 : line LF
146                          | line CR LF
147                        ;                        ;
148    
149  line                  :  /* epsilon (empty line ignored) */  line                  :  /* epsilon (empty line ignored) */ { INCREMENT_LINE; return LSCP_DONE; }
150                        |  comment                        |  comment  { INCREMENT_LINE; return LSCP_DONE; }
151                        |  command  { LSCPSERVER->AnswerClient($1); }                        |  command  { INCREMENT_LINE; LSCPSERVER->AnswerClient($1); return LSCP_DONE; }
152                        |  error    { LSCPSERVER->AnswerClient("Err:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; }                        |  error    { INCREMENT_LINE; LSCPSERVER->AnswerClient("ERR:0:" + sLastError + "\r\n"); RESTART; return LSCP_SYNTAX_ERROR; }
153                        ;                        ;
154    
155  comment               :  HASH  comment               :  '#'
156                        |  comment HASH                        |  comment '#'
157                        |  comment SP                        |  comment SP
158                        |  comment NUMBER                        |  comment number
159                        |  comment string                        |  comment string
160                        ;                        ;
161    
162  command               :  ADD SP CHANNEL                             { $$ = LSCPSERVER->AddChannel();                  }  command               :  ADD SP add_instruction                { $$ = $3;                                                }
163                        |  GET SP get_instruction                     { $$ = $3;                                        }                        |  MAP SP map_instruction                { $$ = $3;                                                }
164                        |  CREATE SP create_instruction               { $$ = $3;                                        }                        |  UNMAP SP unmap_instruction            { $$ = $3;                                                }
165                        |  DESTROY SP destroy_instruction             { $$ = $3;                                        }                        |  GET SP get_instruction                { $$ = $3;                                                }
166                        |  LIST SP list_instruction                   { $$ = $3;                                        }                        |  CREATE SP create_instruction          { $$ = $3;                                                }
167                        |  LOAD SP load_instruction                   { $$ = $3;                                        }                        |  DESTROY SP destroy_instruction        { $$ = $3;                                                }
168                        |  REMOVE SP CHANNEL SP sampler_channel       { $$ = LSCPSERVER->RemoveChannel($5);             }                        |  LIST SP list_instruction              { $$ = $3;                                                }
169                        |  SET SP set_instruction                     { $$ = $3;                                        }                        |  LOAD SP load_instruction              { $$ = $3;                                                }
170                        |  SUBSCRIBE SP subscribe_event               { $$ = $3;                                        }                        |  REMOVE SP remove_instruction          { $$ = $3;                                                }
171                        |  UNSUBSCRIBE SP unsubscribe_event           { $$ = $3;                                        }                        |  SET SP set_instruction                { $$ = $3;                                                }
172                        |  RESET SP CHANNEL SP sampler_channel        { $$ = LSCPSERVER->ResetChannel($5);              }                        |  SUBSCRIBE SP subscribe_event          { $$ = $3;                                                }
173                        |  QUIT                                       { LSCPSERVER->AnswerClient("Bye!\r\n"); return 0; }                        |  UNSUBSCRIBE SP unsubscribe_event      { $$ = $3;                                                }
174                        ;                        |  RESET SP reset_instruction            { $$ = $3;                                                }
175                          |  CLEAR SP clear_instruction            { $$ = $3;                                                }
176  subscribe_event       :  CHANNELS                                   { $$ = LSCPSERVER->SubscribeNotification(event_channels); }                        |  FIND SP find_instruction              { $$ = $3;                                                }
177                        |  VOICE_COUNT                                { $$ = LSCPSERVER->SubscribeNotification(event_voice_count); }                        |  MOVE SP move_instruction              { $$ = $3;                                                }
178                        |  STREAM_COUNT                               { $$ = LSCPSERVER->SubscribeNotification(event_stream_count); }                        |  COPY SP copy_instruction              { $$ = $3;                                                }
179                        |  BUFFER_FILL                                { $$ = LSCPSERVER->SubscribeNotification(event_channel_buffer_fill); }                        |  EDIT SP edit_instruction              { $$ = $3;                                                }
180                        |  INFO                                       { $$ = LSCPSERVER->SubscribeNotification(event_channel_info); }                        |  FORMAT SP format_instruction          { $$ = $3;                                                }
181                        |  MISCELLANEOUS                              { $$ = LSCPSERVER->SubscribeNotification(event_misc); }  command               :  SEND SP send_instruction              { $$ = $3;                                                }
182                        ;                        |  RESET                                 { $$ = LSCPSERVER->ResetSampler();                        }
183                          |  QUIT                                  { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; }
184  unsubscribe_event     :  CHANNELS                                   { $$ = LSCPSERVER->UnsubscribeNotification(event_channels); }                        ;
185                        |  VOICE_COUNT                                { $$ = LSCPSERVER->UnsubscribeNotification(event_voice_count); }  
186                        |  STREAM_COUNT                               { $$ = LSCPSERVER->UnsubscribeNotification(event_stream_count); }  add_instruction       :  CHANNEL                               { $$ = LSCPSERVER->AddChannel();                  }
187                        |  BUFFER_FILL                                { $$ = LSCPSERVER->UnsubscribeNotification(event_channel_buffer_fill); }                        |  DB_INSTRUMENT_DIRECTORY SP db_path    { $$ = LSCPSERVER->AddDbInstrumentDirectory($3);  }
188                        |  INFO                                       { $$ = LSCPSERVER->UnsubscribeNotification(event_channel_info); }                        |  DB_INSTRUMENTS SP NON_MODAL SP scan_mode SP db_path SP filename                        { $$ = LSCPSERVER->AddDbInstruments($5,$7,$9, true);        }
189                        |  MISCELLANEOUS                              { $$ = LSCPSERVER->UnsubscribeNotification(event_misc); }                        |  DB_INSTRUMENTS SP NON_MODAL SP scan_mode SP FILE_AS_DIR SP db_path SP filename         { $$ = LSCPSERVER->AddDbInstruments($5,$9,$11, true, true); }
190                          |  DB_INSTRUMENTS SP scan_mode SP db_path SP filename                                     { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7);              }
191                          |  DB_INSTRUMENTS SP scan_mode SP FILE_AS_DIR SP db_path SP filename                      { $$ = LSCPSERVER->AddDbInstruments($3,$7,$9, false, true); }
192                          |  DB_INSTRUMENTS SP NON_MODAL SP db_path SP filename                                     { $$ = LSCPSERVER->AddDbInstruments($5,$7, -1, true);       }
193                          |  DB_INSTRUMENTS SP NON_MODAL SP db_path SP filename SP instrument_index                 { $$ = LSCPSERVER->AddDbInstruments($5,$7,$9, true);        }
194                          |  DB_INSTRUMENTS SP db_path SP filename                                                  { $$ = LSCPSERVER->AddDbInstruments($3,$5);                 }
195                          |  DB_INSTRUMENTS SP db_path SP filename SP instrument_index                              { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7);              }
196                          |  MIDI_INSTRUMENT_MAP                   { $$ = LSCPSERVER->AddMidiInstrumentMap();                }
197                          |  MIDI_INSTRUMENT_MAP SP map_name       { $$ = LSCPSERVER->AddMidiInstrumentMap($3);              }
198                          ;
199    
200    subscribe_event       :  AUDIO_OUTPUT_DEVICE_COUNT             { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_audio_device_count);   }
201                          |  AUDIO_OUTPUT_DEVICE_INFO              { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_audio_device_info);    }
202                          |  MIDI_INPUT_DEVICE_COUNT               { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_midi_device_count);    }
203                          |  MIDI_INPUT_DEVICE_INFO                { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_midi_device_info);     }
204                          |  CHANNEL_COUNT                         { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_count);        }
205                          |  CHANNEL_MIDI                          { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_midi);         }
206                          |  DEVICE_MIDI                           { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_device_midi);          }
207                          |  VOICE_COUNT                           { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count);          }
208                          |  STREAM_COUNT                          { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count);         }
209                          |  BUFFER_FILL                           { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_buffer_fill);          }
210                          |  CHANNEL_INFO                          { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_info);         }
211                          |  FX_SEND_COUNT                         { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_fx_send_count);        }
212                          |  FX_SEND_INFO                          { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_fx_send_info);         }
213                          |  MIDI_INSTRUMENT_MAP_COUNT             { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_midi_instr_map_count); }
214                          |  MIDI_INSTRUMENT_MAP_INFO              { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_midi_instr_map_info);  }
215                          |  MIDI_INSTRUMENT_COUNT                 { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_midi_instr_count);     }
216                          |  MIDI_INSTRUMENT_INFO                  { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_midi_instr_info);      }
217                          |  DB_INSTRUMENT_DIRECTORY_COUNT         { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_db_instr_dir_count);   }
218                          |  DB_INSTRUMENT_DIRECTORY_INFO          { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_db_instr_dir_info);    }
219                          |  DB_INSTRUMENT_COUNT                   { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_db_instr_count);       }
220                          |  DB_INSTRUMENT_INFO                    { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_db_instr_info);        }
221                          |  DB_INSTRUMENTS_JOB_INFO               { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_db_instrs_job_info);   }
222                          |  MISCELLANEOUS                         { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_misc);                 }
223                          |  TOTAL_STREAM_COUNT                    { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_total_stream_count);   }
224                          |  TOTAL_VOICE_COUNT                     { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_total_voice_count);    }
225                          |  GLOBAL_INFO                           { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_global_info);          }
226                          ;
227    
228    unsubscribe_event     :  AUDIO_OUTPUT_DEVICE_COUNT             { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_audio_device_count);   }
229                          |  AUDIO_OUTPUT_DEVICE_INFO              { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_audio_device_info);    }
230                          |  MIDI_INPUT_DEVICE_COUNT               { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_midi_device_count);    }
231                          |  MIDI_INPUT_DEVICE_INFO                { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_midi_device_info);     }
232                          |  CHANNEL_COUNT                         { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_count);        }
233                          |  CHANNEL_MIDI                          { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_midi);         }
234                          |  DEVICE_MIDI                           { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_device_midi);          }
235                          |  VOICE_COUNT                           { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_voice_count);          }
236                          |  STREAM_COUNT                          { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_stream_count);         }
237                          |  BUFFER_FILL                           { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_buffer_fill);          }
238                          |  CHANNEL_INFO                          { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_channel_info);         }
239                          |  FX_SEND_COUNT                         { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_fx_send_count);        }
240                          |  FX_SEND_INFO                          { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_fx_send_info);         }
241                          |  MIDI_INSTRUMENT_MAP_COUNT             { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_midi_instr_map_count); }
242                          |  MIDI_INSTRUMENT_MAP_INFO              { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_midi_instr_map_info);  }
243                          |  MIDI_INSTRUMENT_COUNT                 { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_midi_instr_count);     }
244                          |  MIDI_INSTRUMENT_INFO                  { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_midi_instr_info);      }
245                          |  DB_INSTRUMENT_DIRECTORY_COUNT         { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_db_instr_dir_count);   }
246                          |  DB_INSTRUMENT_DIRECTORY_INFO          { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_db_instr_dir_info);    }
247                          |  DB_INSTRUMENT_COUNT                   { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_db_instr_count);       }
248                          |  DB_INSTRUMENT_INFO                    { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_db_instr_info);        }
249                          |  DB_INSTRUMENTS_JOB_INFO               { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_db_instrs_job_info);   }
250                          |  MISCELLANEOUS                         { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_misc);                 }
251                          |  TOTAL_STREAM_COUNT                    { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_stream_count);   }
252                          |  TOTAL_VOICE_COUNT                     { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_voice_count);    }
253                          |  GLOBAL_INFO                           { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_global_info);          }
254                          ;
255    
256    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); }
257                          |  MIDI_INSTRUMENT SP modal_arg midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP instr_load_mode { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($4,$6,$8,$10,$12,$14,$16,$18,"",$3); }
258                          |  MIDI_INSTRUMENT SP modal_arg midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP entry_name { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($4,$6,$8,$10,$12,$14,$16,MidiInstrumentMapper::DONTCARE,$18,$3); }
259                          |  MIDI_INSTRUMENT SP modal_arg midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP instr_load_mode SP entry_name { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($4,$6,$8,$10,$12,$14,$16,$18,$20,$3); }
260                          ;
261    
262    unmap_instruction     :  MIDI_INSTRUMENT SP midi_map SP midi_bank SP midi_prog  { $$ = LSCPSERVER->RemoveMIDIInstrumentMapping($3,$5,$7); }
263                          ;
264    
265    remove_instruction    :  CHANNEL SP sampler_channel                   { $$ = LSCPSERVER->RemoveChannel($3);                      }
266                          |  MIDI_INSTRUMENT_MAP SP midi_map              { $$ = LSCPSERVER->RemoveMidiInstrumentMap($3);            }
267                          |  MIDI_INSTRUMENT_MAP SP ALL                   { $$ = LSCPSERVER->RemoveAllMidiInstrumentMaps();          }
268                          |  DB_INSTRUMENT_DIRECTORY SP FORCE SP db_path  { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($5, true);  }
269                          |  DB_INSTRUMENT_DIRECTORY SP db_path           { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($3);        }
270                          |  DB_INSTRUMENT SP db_path                     { $$ = LSCPSERVER->RemoveDbInstrument($3);                 }
271                        ;                        ;
272    
273  get_instruction       :  AVAILABLE_ENGINES                                                          { $$ = LSCPSERVER->GetAvailableEngines();                          }  get_instruction       :  AVAILABLE_ENGINES                                                          { $$ = LSCPSERVER->GetAvailableEngines();                          }
274                          |  AVAILABLE_MIDI_INPUT_DRIVERS                                               { $$ = LSCPSERVER->GetAvailableMidiInputDrivers();                 }
275                          |  MIDI_INPUT_DRIVER SP INFO SP string                                        { $$ = LSCPSERVER->GetMidiInputDriverInfo($5);                     }
276                          |  MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string                    { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7);        }
277                          |  MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list    { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7, $9);    }
278                        |  AVAILABLE_AUDIO_OUTPUT_DRIVERS                                             { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers();               }                        |  AVAILABLE_AUDIO_OUTPUT_DRIVERS                                             { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers();               }
279                        |  AUDIO_OUTPUT_DRIVER SP INFO SP string                                      { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5);                   }                        |  AUDIO_OUTPUT_DRIVER SP INFO SP string                                      { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5);                   }
280                        |  AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string                  { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7);      }                        |  AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string                  { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7);      }
281                        |  AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list  { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7, $9);  }                        |  AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list  { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7, $9);  }
282                        |  AUDIO_OUTPUT_DEVICES                                                       { $$ = LSCPSERVER->GetAudioOutputDeviceCount();                    }                        |  AUDIO_OUTPUT_DEVICES                                                       { $$ = LSCPSERVER->GetAudioOutputDeviceCount();                    }
283                        |  AUDIO_OUTPUT_DEVICE SP INFO SP NUMBER                                      { $$ = LSCPSERVER->GetAudioOutputDeviceInfo($5);                   }                        |  MIDI_INPUT_DEVICES                                                         { $$ = LSCPSERVER->GetMidiInputDeviceCount();                      }
284                        |  AUDIO_OUTPUT_CHANNEL SP INFO SP NUMBER SP NUMBER                           { $$ = LSCPSERVER->GetAudioOutputChannelInfo($5, $7);              }                        |  AUDIO_OUTPUT_DEVICE SP INFO SP number                                      { $$ = LSCPSERVER->GetAudioOutputDeviceInfo($5);                   }
285                        |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP INFO SP NUMBER SP NUMBER SP string       { $$ = LSCPSERVER->GetAudioOutputChannelParameterInfo($5, $7, $9); }                        |  MIDI_INPUT_DEVICE SP INFO SP number                                        { $$ = LSCPSERVER->GetMidiInputDeviceInfo($5);                     }
286                          |  MIDI_INPUT_PORT SP INFO SP number SP number                                { $$ = LSCPSERVER->GetMidiInputPortInfo($5, $7);                   }
287                          |  MIDI_INPUT_PORT_PARAMETER SP INFO SP number SP number SP string            { $$ = LSCPSERVER->GetMidiInputPortParameterInfo($5, $7, $9);      }
288                          |  AUDIO_OUTPUT_CHANNEL SP INFO SP number SP number                           { $$ = LSCPSERVER->GetAudioOutputChannelInfo($5, $7);              }
289                          |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP INFO SP number SP number SP string       { $$ = LSCPSERVER->GetAudioOutputChannelParameterInfo($5, $7, $9); }
290                        |  CHANNELS                                                                   { $$ = LSCPSERVER->GetChannels();                                  }                        |  CHANNELS                                                                   { $$ = LSCPSERVER->GetChannels();                                  }
291                        |  CHANNEL SP INFO SP sampler_channel                                         { $$ = LSCPSERVER->GetChannelInfo($5);                             }                        |  CHANNEL SP INFO SP sampler_channel                                         { $$ = LSCPSERVER->GetChannelInfo($5);                             }
292                        |  CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel              { $$ = LSCPSERVER->GetBufferFill($5, $7);                          }                        |  CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel              { $$ = LSCPSERVER->GetBufferFill($5, $7);                          }
293                        |  CHANNEL SP STREAM_COUNT SP sampler_channel                                 { $$ = LSCPSERVER->GetStreamCount($5);                             }                        |  CHANNEL SP STREAM_COUNT SP sampler_channel                                 { $$ = LSCPSERVER->GetStreamCount($5);                             }
294                        |  CHANNEL SP VOICE_COUNT SP sampler_channel                                  { $$ = LSCPSERVER->GetVoiceCount($5);                              }                        |  CHANNEL SP VOICE_COUNT SP sampler_channel                                  { $$ = LSCPSERVER->GetVoiceCount($5);                              }
295                        |  ENGINE SP INFO SP engine_name                                              { $$ = LSCPSERVER->GetEngineInfo($5);                              }                        |  ENGINE SP INFO SP engine_name                                              { $$ = LSCPSERVER->GetEngineInfo($5);                              }
296                          |  SERVER SP INFO                                                             { $$ = LSCPSERVER->GetServerInfo();                                }
297                          |  TOTAL_STREAM_COUNT                                                         { $$ = LSCPSERVER->GetTotalStreamCount();                           }
298                          |  TOTAL_VOICE_COUNT                                                          { $$ = LSCPSERVER->GetTotalVoiceCount();                           }
299                          |  TOTAL_VOICE_COUNT_MAX                                                      { $$ = LSCPSERVER->GetTotalVoiceCountMax();                        }
300                          |  MIDI_INSTRUMENTS SP midi_map                                               { $$ = LSCPSERVER->GetMidiInstrumentMappings($3);                  }
301                          |  MIDI_INSTRUMENTS SP ALL                                                    { $$ = LSCPSERVER->GetAllMidiInstrumentMappings();                 }
302                          |  MIDI_INSTRUMENT SP INFO SP midi_map SP midi_bank SP midi_prog              { $$ = LSCPSERVER->GetMidiInstrumentMapping($5,$7,$9);             }
303                          |  MIDI_INSTRUMENT_MAPS                                                       { $$ = LSCPSERVER->GetMidiInstrumentMaps();                        }
304                          |  MIDI_INSTRUMENT_MAP SP INFO SP midi_map                                    { $$ = LSCPSERVER->GetMidiInstrumentMap($5);                       }
305                          |  FX_SENDS SP sampler_channel                                                { $$ = LSCPSERVER->GetFxSends($3);                                 }
306                          |  FX_SEND SP INFO SP sampler_channel SP fx_send_id                           { $$ = LSCPSERVER->GetFxSendInfo($5,$7);                           }
307                          |  DB_INSTRUMENT_DIRECTORIES SP RECURSIVE SP db_path                          { $$ = LSCPSERVER->GetDbInstrumentDirectoryCount($5, true);        }
308                          |  DB_INSTRUMENT_DIRECTORIES SP db_path                                       { $$ = LSCPSERVER->GetDbInstrumentDirectoryCount($3, false);       }
309                          |  DB_INSTRUMENT_DIRECTORY SP INFO SP db_path                                 { $$ = LSCPSERVER->GetDbInstrumentDirectoryInfo($5);               }
310                          |  DB_INSTRUMENTS SP RECURSIVE SP db_path                                     { $$ = LSCPSERVER->GetDbInstrumentCount($5, true);                 }
311                          |  DB_INSTRUMENTS SP db_path                                                  { $$ = LSCPSERVER->GetDbInstrumentCount($3, false);                }
312                          |  DB_INSTRUMENT SP INFO SP db_path                                           { $$ = LSCPSERVER->GetDbInstrumentInfo($5);                        }
313                          |  DB_INSTRUMENTS_JOB SP INFO SP number                                       { $$ = LSCPSERVER->GetDbInstrumentsJobInfo($5);                    }
314                          |  VOLUME                                                                     { $$ = LSCPSERVER->GetGlobalVolume();                              }
315                          |  FILE SP INSTRUMENTS SP filename                                            { $$ = LSCPSERVER->GetFileInstruments($5);                         }
316                          |  FILE SP INSTRUMENT SP INFO SP filename SP instrument_index                 { $$ = LSCPSERVER->GetFileInstrumentInfo($7,$9);                   }
317                          ;
318    
319    set_instruction       :  AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }
320                          |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP number SP number SP string '=' param_val_list  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }
321                          |  MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list               { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7);        }
322                          |  MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' NONE                 { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, "");      }
323                          |  MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list       { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9);      }
324                          |  CHANNEL SP set_chan_instruction                                                  { $$ = $3;                                                         }
325                          |  MIDI_INSTRUMENT_MAP SP NAME SP midi_map SP map_name                              { $$ = LSCPSERVER->SetMidiInstrumentMapName($5, $7);               }
326                          |  FX_SEND SP NAME SP sampler_channel SP fx_send_id SP fx_send_name                 { $$ = LSCPSERVER->SetFxSendName($5,$7,$9);                        }
327                          |  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); }
328                          |  FX_SEND SP MIDI_CONTROLLER SP sampler_channel SP fx_send_id SP midi_ctrl         { $$ = LSCPSERVER->SetFxSendMidiController($5,$7,$9);              }
329                          |  FX_SEND SP LEVEL SP sampler_channel SP fx_send_id SP volume_value                { $$ = LSCPSERVER->SetFxSendLevel($5,$7,$9);                       }
330                          |  DB_INSTRUMENT_DIRECTORY SP NAME SP db_path SP stringval_escaped                  { $$ = LSCPSERVER->SetDbInstrumentDirectoryName($5,$7);            }
331                          |  DB_INSTRUMENT_DIRECTORY SP DESCRIPTION SP db_path SP stringval_escaped           { $$ = LSCPSERVER->SetDbInstrumentDirectoryDescription($5,$7);     }
332                          |  DB_INSTRUMENT SP NAME SP db_path SP stringval_escaped                            { $$ = LSCPSERVER->SetDbInstrumentName($5,$7);                     }
333                          |  DB_INSTRUMENT SP DESCRIPTION SP db_path SP stringval_escaped                     { $$ = LSCPSERVER->SetDbInstrumentDescription($5,$7);              }
334                          |  DB_INSTRUMENT SP FILE_PATH SP filename SP filename                               { $$ = LSCPSERVER->SetDbInstrumentFilePath($5,$7);                 }
335                          |  ECHO SP boolean                                                                  { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3);  }
336                          |  VOLUME SP volume_value                                                           { $$ = LSCPSERVER->SetGlobalVolume($3);                            }
337                          ;
338    
339    create_instruction    :  AUDIO_OUTPUT_DEVICE SP string SP key_val_list  { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); }
340                          |  AUDIO_OUTPUT_DEVICE SP string                  { $$ = LSCPSERVER->CreateAudioOutputDevice($3);    }
341                          |  MIDI_INPUT_DEVICE SP string SP key_val_list    { $$ = LSCPSERVER->CreateMidiInputDevice($3,$5);   }
342                          |  MIDI_INPUT_DEVICE SP string                    { $$ = LSCPSERVER->CreateMidiInputDevice($3);      }
343                          |  FX_SEND SP sampler_channel SP midi_ctrl        { $$ = LSCPSERVER->CreateFxSend($3,$5);            }
344                          |  FX_SEND SP sampler_channel SP midi_ctrl SP fx_send_name  { $$ = LSCPSERVER->CreateFxSend($3,$5,$7); }
345                          ;
346    
347    reset_instruction     :  CHANNEL SP sampler_channel  { $$ = LSCPSERVER->ResetChannel($3); }
348                          ;
349    
350    clear_instruction     :  MIDI_INSTRUMENTS SP midi_map   { $$ = LSCPSERVER->ClearMidiInstrumentMappings($3);  }
351                          |  MIDI_INSTRUMENTS SP ALL        { $$ = LSCPSERVER->ClearAllMidiInstrumentMappings(); }
352                          ;
353    
354    find_instruction      :  DB_INSTRUMENTS SP NON_RECURSIVE SP db_path SP query_val_list              { $$ = LSCPSERVER->FindDbInstruments($5,$7, false);           }
355                          |  DB_INSTRUMENTS SP db_path SP query_val_list                               { $$ = LSCPSERVER->FindDbInstruments($3,$5, true);            }
356                          |  DB_INSTRUMENT_DIRECTORIES SP NON_RECURSIVE SP db_path SP query_val_list   { $$ = LSCPSERVER->FindDbInstrumentDirectories($5,$7, false); }
357                          |  DB_INSTRUMENT_DIRECTORIES SP db_path SP query_val_list                    { $$ = LSCPSERVER->FindDbInstrumentDirectories($3,$5, true);  }
358                          |  LOST SP DB_INSTRUMENT_FILES                                               { $$ = LSCPSERVER->FindLostDbInstrumentFiles();                 }
359                          ;
360    
361    move_instruction      :  DB_INSTRUMENT_DIRECTORY SP db_path SP db_path    { $$ = LSCPSERVER->MoveDbInstrumentDirectory($3,$5); }
362                          |  DB_INSTRUMENT SP db_path SP db_path              { $$ = LSCPSERVER->MoveDbInstrument($3,$5);          }
363                          ;
364    
365    copy_instruction      :  DB_INSTRUMENT_DIRECTORY SP db_path SP db_path    { $$ = LSCPSERVER->CopyDbInstrumentDirectory($3,$5); }
366                          |  DB_INSTRUMENT SP db_path SP db_path              { $$ = LSCPSERVER->CopyDbInstrument($3,$5);          }
367                          ;
368    
369    destroy_instruction   :  AUDIO_OUTPUT_DEVICE SP number  { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); }
370                          |  MIDI_INPUT_DEVICE SP number    { $$ = LSCPSERVER->DestroyMidiInputDevice($3);   }
371                          |  FX_SEND SP sampler_channel SP fx_send_id  { $$ = LSCPSERVER->DestroyFxSend($3,$5); }
372                        ;                        ;
373    
374  set_instruction       :  AUDIO_OUTPUT_DEVICE_PARAMETER SP NUMBER SP string EQ param_val             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }  load_instruction      :  INSTRUMENT SP load_instr_args  { $$ = $3; }
375                        |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP NUMBER SP NUMBER SP string EQ param_val  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }                        |  ENGINE SP load_engine_args     { $$ = $3; }
                       |  CHANNEL SP set_chan_instruction                                                   { $$ = $3;                                                         }  
376                        ;                        ;
377    
378  create_instruction    :  AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); }  set_chan_instruction  :  AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index                                              { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3);      }
379                        |  AUDIO_OUTPUT_DEVICE SP string                 { $$ = LSCPSERVER->CreateAudioOutputDevice($3); }                        |  AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index               { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); }
380                          |  AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name                                      { $$ = LSCPSERVER->SetAudioOutputType($5, $3);        }
381                          |  MIDI_INPUT SP sampler_channel SP device_index SP midi_input_port_index SP midi_input_channel_index  { $$ = LSCPSERVER->SetMIDIInput($5, $7, $9, $3);      }
382                          |  MIDI_INPUT_DEVICE SP sampler_channel SP device_index                                                { $$ = LSCPSERVER->SetMIDIInputDevice($5, $3);        }
383                          |  MIDI_INPUT_PORT SP sampler_channel SP midi_input_port_index                                         { $$ = LSCPSERVER->SetMIDIInputPort($5, $3);          }
384                          |  MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel_index                                   { $$ = LSCPSERVER->SetMIDIInputChannel($5, $3);       }
385                          |  MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type_name                                          { $$ = LSCPSERVER->SetMIDIInputType($5, $3);          }
386                          |  VOLUME SP sampler_channel SP volume_value                                                           { $$ = LSCPSERVER->SetVolume($5, $3);                 }
387                          |  MUTE SP sampler_channel SP boolean                                                                  { $$ = LSCPSERVER->SetChannelMute($5, $3);            }
388                          |  SOLO SP sampler_channel SP boolean                                                                  { $$ = LSCPSERVER->SetChannelSolo($5, $3);            }
389                          |  MIDI_INSTRUMENT_MAP SP sampler_channel SP midi_map                                                  { $$ = LSCPSERVER->SetChannelMap($3, $5);             }
390                          |  MIDI_INSTRUMENT_MAP SP sampler_channel SP NONE                                                      { $$ = LSCPSERVER->SetChannelMap($3, -1);             }
391                          |  MIDI_INSTRUMENT_MAP SP sampler_channel SP DEFAULT                                                   { $$ = LSCPSERVER->SetChannelMap($3, -2);             }
392                        ;                        ;
393    
394  destroy_instruction   :  AUDIO_OUTPUT_DEVICE SP NUMBER  { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); }  edit_instruction      :  CHANNEL SP INSTRUMENT SP sampler_channel  { $$ = LSCPSERVER->EditSamplerChannelInstrument($5); }
395                        ;                        ;
396    
397  load_instruction      :  INSTRUMENT SP load_instr_args  { $$ = $3; }  format_instruction    :  INSTRUMENTS_DB  { $$ = LSCPSERVER->FormatInstrumentsDb(); }
                       |  ENGINE SP load_engine_args     { $$ = $3; }  
398                        ;                        ;
399    
400  set_chan_instruction  :  AUDIO_OUTPUT_DEVICE SP sampler_channel SP NUMBER                                         { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3);      }  modal_arg             :  /* epsilon (empty argument) */  { $$ = true;  }
401                        |  AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_output_channel SP audio_output_channel  { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); }                        |  NON_MODAL SP                    { $$ = false; }
                       |  MIDI_INPUT_PORT SP sampler_channel SP midi_input_port                                    { $$ = LSCPSERVER->SetMIDIInputPort($5, $3);          }  
                       |  MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel                              { $$ = LSCPSERVER->SetMIDIInputChannel($5, $3);       }  
                       |  MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type                                    { $$ = LSCPSERVER->SetMIDIInputType($5, $3);          }  
                       |  VOLUME SP sampler_channel SP volume                                                      { $$ = LSCPSERVER->SetVolume($5, $3);                 }  
402                        ;                        ;
403    
404  key_val_list          :  string EQ param_val                  { $$[$1] = $3;          }  key_val_list          :  string '=' param_val_list                  { $$[$1] = $3;          }
405                        |  key_val_list SP string EQ param_val  { $$ = $1; $$[$3] = $5; }                        |  key_val_list SP string '=' param_val_list  { $$ = $1; $$[$3] = $5; }
406                        ;                        ;
407    
408  buffer_size_type      :  BYTES       { $$ = fill_response_bytes;      }  buffer_size_type      :  BYTES       { $$ = fill_response_bytes;      }
409                        |  PERCENTAGE  { $$ = fill_response_percentage; }                        |  PERCENTAGE  { $$ = fill_response_percentage; }
410                        ;                        ;
411    
412  list_instruction      :  AUDIO_OUTPUT_DEVICES  { $$ = LSCPSERVER->GetAudioOutputDevices(); }  list_instruction      :  AUDIO_OUTPUT_DEVICES                               { $$ = LSCPSERVER->GetAudioOutputDevices();              }
413                          |  MIDI_INPUT_DEVICES                                 { $$ = LSCPSERVER->GetMidiInputDevices();                }
414                          |  CHANNELS                                           { $$ = LSCPSERVER->ListChannels();                       }
415                          |  AVAILABLE_ENGINES                                  { $$ = LSCPSERVER->ListAvailableEngines();               }
416                          |  AVAILABLE_MIDI_INPUT_DRIVERS                       { $$ = LSCPSERVER->ListAvailableMidiInputDrivers();      }
417                          |  AVAILABLE_AUDIO_OUTPUT_DRIVERS                     { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers();    }
418                          |  MIDI_INSTRUMENTS SP midi_map                       { $$ = LSCPSERVER->ListMidiInstrumentMappings($3);       }
419                          |  MIDI_INSTRUMENTS SP ALL                            { $$ = LSCPSERVER->ListAllMidiInstrumentMappings();      }
420                          |  MIDI_INSTRUMENT_MAPS                               { $$ = LSCPSERVER->ListMidiInstrumentMaps();             }
421                          |  FX_SENDS SP sampler_channel                        { $$ = LSCPSERVER->ListFxSends($3);                      }
422                          |  DB_INSTRUMENT_DIRECTORIES SP RECURSIVE SP db_path  { $$ = LSCPSERVER->GetDbInstrumentDirectories($5, true); }
423                          |  DB_INSTRUMENT_DIRECTORIES SP db_path               { $$ = LSCPSERVER->GetDbInstrumentDirectories($3);       }
424                          |  DB_INSTRUMENTS SP RECURSIVE SP db_path             { $$ = LSCPSERVER->GetDbInstruments($5, true);           }
425                          |  DB_INSTRUMENTS SP db_path                          { $$ = LSCPSERVER->GetDbInstruments($3);                 }
426                          |  FILE SP INSTRUMENTS SP filename                    { $$ = LSCPSERVER->ListFileInstruments($5);              }
427                          ;
428    
429    send_instruction      :  CHANNEL SP MIDI_DATA SP string SP sampler_channel SP number SP number  { $$ = LSCPSERVER->SendChannelMidiData($5, $7, $9, $11); }
430                        ;                        ;
431    
432  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);       }
433                        |  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); }
434                        ;                        ;
435    
436  load_engine_args      :  engine_name SP sampler_channel  { $$ = LSCPSERVER->LoadEngine($1, $3); }  load_engine_args      :  engine_name SP sampler_channel  { $$ = LSCPSERVER->SetEngineType($1, $3); }
437                          ;
438    
439    instr_load_mode       :  ON_DEMAND       { $$ = MidiInstrumentMapper::ON_DEMAND;      }
440                          |  ON_DEMAND_HOLD  { $$ = MidiInstrumentMapper::ON_DEMAND_HOLD; }
441                          |  PERSISTENT      { $$ = MidiInstrumentMapper::PERSISTENT;     }
442                          ;
443    
444    device_index              :  number
445                              ;
446    
447    audio_channel_index       :  number
448                              ;
449    
450    audio_output_type_name    :  string
451                              ;
452    
453    midi_input_port_index     :  number
454                              ;
455    
456    midi_input_channel_index  :  number
457                              |  ALL  { $$ = 16; }
458                              ;
459    
460    midi_input_type_name      :  string
461                              ;
462    
463    midi_map                  :  number
464                              ;
465    
466    midi_bank                 :  number
467                              ;
468    
469    midi_prog                 :  number
470                              ;
471    
472    midi_ctrl                 :  number
473                              ;
474    
475    volume_value              :  dotnum
476                              |  number  { $$ = $1; }
477                              ;
478    
479    sampler_channel           :  number
480                              ;
481    
482    instrument_index          :  number
483                              ;
484    
485    fx_send_id                :  number
486                              ;
487    
488    engine_name               :  string
489                              ;
490    
491    filename                  :  path  {
492                                     #if WIN32
493                                     $$ = $1.toWindows();
494                                     #else
495                                     // assuming POSIX
496                                     $$ = $1.toPosix();
497                                     #endif
498                                 }
499                              ;
500    
501    db_path                   :  path  { $$ = $1.toDbPath(); }
502                              ;
503    
504    map_name                  :  stringval_escaped
505                              ;
506    
507    entry_name                :  stringval_escaped
508                              ;
509    
510    fx_send_name              :  stringval_escaped
511                              ;
512    
513    param_val_list            :  param_val
514                              |  param_val_list','param_val  { $$ = $1 + "," + $3; }
515                              ;
516    
517    //TODO: the re-encapsulation into apostrophes for string and strinval here is a hack, since we need a way for __parse_strings() (DeviceParameters.cpp) to distinguish a comma separated list of strings and a string which contains commas. A clean solution would be to move those parser jobs over here to lscp.y
518    param_val                 :  string            { $$ = "\'" + $1 + "\'"; }
519                              |  stringval         { $$ = "\'" + $1 + "\'"; }
520                              |  number            { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
521                              |  dotnum            { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
522                              ;
523    
524    query_val_list            :  string '=' query_val                    { $$[$1] = $3;          }
525                              |  query_val_list SP string '=' query_val  { $$ = $1; $$[$3] = $5; }
526                              ;
527    
528    query_val                 :  text_escaped
529                              |  stringval_escaped
530                              ;
531    
532    scan_mode                 :  RECURSIVE      { $$ = "RECURSIVE"; }
533                              |  NON_RECURSIVE  { $$ = "NON_RECURSIVE"; }
534                              |  FLAT           { $$ = "FLAT"; }
535                              ;
536    
537    // GRAMMAR_BNF_END - do NOT delete or modify this line !!!
538    
539    
540    // atomic variable symbol rules
541    
542    boolean               :  number  { $$ = $1; }
543                          |  string  { $$ = -1; }
544                          ;
545    
546    dotnum                :      digits '.' digits  { std::stringstream ss($1 + "." + $3); ss.imbue(std::locale::classic()); ss >> $$; }
547                          |  '+' digits '.' digits  { std::stringstream ss($2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; }
548                          |  '-' digits '.' digits  { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; }
549                          ;
550    
551    
552    digits                :  digit         { $$ = $1;      }
553                          |  digits digit  { $$ = $1 + $2; }
554                          ;
555    
556    digit                 :  '0'  { $$ = '0'; }
557                          |  '1'  { $$ = '1'; }
558                          |  '2'  { $$ = '2'; }
559                          |  '3'  { $$ = '3'; }
560                          |  '4'  { $$ = '4'; }
561                          |  '5'  { $$ = '5'; }
562                          |  '6'  { $$ = '6'; }
563                          |  '7'  { $$ = '7'; }
564                          |  '8'  { $$ = '8'; }
565                          |  '9'  { $$ = '9'; }
566                          ;
567    
568    digit_oct             :  '0'  { $$ = '0'; }
569                          |  '1'  { $$ = '1'; }
570                          |  '2'  { $$ = '2'; }
571                          |  '3'  { $$ = '3'; }
572                          |  '4'  { $$ = '4'; }
573                          |  '5'  { $$ = '5'; }
574                          |  '6'  { $$ = '6'; }
575                          |  '7'  { $$ = '7'; }
576                          ;
577    
578    digit_hex             :  '0'  { $$ = '0'; }
579                          |  '1'  { $$ = '1'; }
580                          |  '2'  { $$ = '2'; }
581                          |  '3'  { $$ = '3'; }
582                          |  '4'  { $$ = '4'; }
583                          |  '5'  { $$ = '5'; }
584                          |  '6'  { $$ = '6'; }
585                          |  '7'  { $$ = '7'; }
586                          |  '8'  { $$ = '8'; }
587                          |  '9'  { $$ = '9'; }
588                          |  'a'  { $$ = 'a'; }
589                          |  'b'  { $$ = 'b'; }
590                          |  'c'  { $$ = 'c'; }
591                          |  'd'  { $$ = 'd'; }
592                          |  'e'  { $$ = 'e'; }
593                          |  'f'  { $$ = 'f'; }
594                          |  'A'  { $$ = 'a'; }
595                          |  'B'  { $$ = 'b'; }
596                          |  'C'  { $$ = 'c'; }
597                          |  'D'  { $$ = 'd'; }
598                          |  'E'  { $$ = 'e'; }
599                          |  'F'  { $$ = 'f'; }
600                          ;
601    
602    number                :  digit       { $$ = atoi(String(1, $1).c_str());      }
603                          |  '1' digits  { $$ = atoi(String(String("1") + $2).c_str()); }
604                          |  '2' digits  { $$ = atoi(String(String("2") + $2).c_str()); }
605                          |  '3' digits  { $$ = atoi(String(String("3") + $2).c_str()); }
606                          |  '4' digits  { $$ = atoi(String(String("4") + $2).c_str()); }
607                          |  '5' digits  { $$ = atoi(String(String("5") + $2).c_str()); }
608                          |  '6' digits  { $$ = atoi(String(String("6") + $2).c_str()); }
609                          |  '7' digits  { $$ = atoi(String(String("7") + $2).c_str()); }
610                          |  '8' digits  { $$ = atoi(String(String("8") + $2).c_str()); }
611                          |  '9' digits  { $$ = atoi(String(String("9") + $2).c_str()); }
612                          ;
613    
614    path                  :  '\'' path_base '\''  { $$ = $2; }
615                          |  '\"' path_base '\"'  { $$ = $2; }
616                          ;
617    
618    path_base             :  path_prefix path_body  { $$ = $1 + $2; }
619                          ;
620    
621    path_prefix           :  '/'                 { $$ = Path();                    }
622                          |  alpha_char ':' '/'  { Path p; p.setDrive($1); $$ = p; }
623                          ;
624    
625    path_body             :  /* epsilon (empty argument) */ { $$ = Path();                           }
626                          |  path_body '/'                  { $$ = $1;                               }
627                          |  path_body text_escaped_base    { Path p; p.appendNode($2); $$ = $1 + p; }
628                          ;
629    
630    stringval             :  '\'' text '\''  { $$ = $2; }
631                          |  '\"' text '\"'  { $$ = $2; }
632                          ;
633    
634    stringval_escaped     :  '\'' text_escaped '\''  { $$ = $2; }
635                          |  '\"' text_escaped '\"'  { $$ = $2; }
636                          ;
637    
638    text                  :  SP           { $$ = " ";      }
639                          |  string
640                          |  text SP      { $$ = $1 + " "; }
641                          |  text string  { $$ = $1 + $2;  }
642                          ;
643    
644    // like text_escaped, but missing the slash ('/') character
645    text_escaped_base     :  SP                                { $$ = " ";      }
646                          |  string_escaped
647                          |  text_escaped_base SP              { $$ = $1 + " "; }
648                          |  text_escaped_base string_escaped  { $$ = $1 + $2;  }
649                          ;
650    
651    text_escaped          :  '/'                              { $$ = "/";      }
652                          |  text_escaped_base
653                          |  text_escaped '/'                 { $$ = $1 + "/"; }
654                          |  text_escaped text_escaped_base   { $$ = $1 + $2;  }
655                          ;
656    
657    string                :  char          { std::string s; s = $1; $$ = s; }
658                          |  string char   { $$ = $1 + $2;                  }
659                          ;
660    
661    string_escaped        :  char_base                   { std::string s; s = $1; $$ = s; }
662                          |  escape_seq                  { std::string s; s = $1; $$ = s; }
663                          |  string_escaped char_base    { $$ = $1 + $2;                  }
664                          |  string_escaped escape_seq   { $$ = $1 + $2;                  }
665                          ;
666    
667    // full ASCII character set except space, quotation mark and apostrophe
668    char                  :  char_base
669                          |  '\\'  { $$ = '\\'; }
670                          |  '/'   { $$ = '/';  }
671                          ;
672    
673    // characters A..Z and a..z
674    alpha_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'; }
675                          |  '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'; }
676                          ;
677    
678    // ASCII characters except space, quotation mark, apostrophe, backslash and slash
679    char_base             :  alpha_char
680                          |  '0' { $$ = '0'; } | '1' { $$ = '1'; } | '2' { $$ = '2'; } | '3' { $$ = '3'; } | '4' { $$ = '4'; } | '5' { $$ = '5'; } | '6' { $$ = '6'; } | '7' { $$ = '7'; } | '8' { $$ = '8'; } | '9' { $$ = '9'; }
681                          |  '!' { $$ = '!'; } | '#' { $$ = '#'; } | '$' { $$ = '$'; } | '%' { $$ = '%'; } | '&' { $$ = '&'; } | '(' { $$ = '('; } | ')' { $$ = ')'; } | '*' { $$ = '*'; } | '+' { $$ = '+'; } | '-' { $$ = '-'; } | '.' { $$ = '.'; } | ',' { $$ = ','; }
682                          |  ':' { $$ = ':'; } | ';' { $$ = ';'; } | '<' { $$ = '<'; } | '=' { $$ = '='; } | '>' { $$ = '>'; } | '?' { $$ = '?'; } | '@' { $$ = '@'; }
683                          |  '[' { $$ = '['; } | ']' { $$ = ']'; } | '^' { $$ = '^'; } | '_' { $$ = '_'; }
684                          |  '{' { $$ = '{'; } | '|' { $$ = '|'; } | '}' { $$ = '}'; } | '~' { $$ = '~'; }
685                          |  EXT_ASCII_CHAR
686                          ;
687    
688    escape_seq            :  '\\' '\''  { $$ = '\''; }
689                          |  '\\' '\"'  { $$ = '\"'; }
690                          |  '\\' '\\'  { $$ = '\\'; }
691                          |  '\\' '/'   { $$ = '/';  }
692                          |  '\\' 'n'   { $$ = '\n'; }
693                          |  '\\' 'r'   { $$ = '\r'; }
694                          |  '\\' 'f'   { $$ = '\f'; }
695                          |  '\\' 't'   { $$ = '\t'; }
696                          |  '\\' 'v'   { $$ = '\v'; }
697                          |  escape_seq_octal
698                          |  escape_seq_hex
699                          ;
700    
701    escape_seq_octal      :  '\\' digit_oct                      { $$ = (char) octalsToNumber($2);       }
702                          |  '\\' digit_oct digit_oct            { $$ = (char) octalsToNumber($3,$2);    }
703                          |  '\\' digit_oct digit_oct digit_oct  { $$ = (char) octalsToNumber($4,$3,$2); }
704                          ;
705    
706    escape_seq_hex        :  '\\' 'x' digit_hex            { $$ = (char) hexsToNumber($3);    }
707                          |  '\\' 'x' digit_hex digit_hex  { $$ = (char) hexsToNumber($4,$3); }
708                          ;
709    
710    // rules which are more or less just terminal symbols
711    
712    SP                    :  ' '
713                          ;
714    
715    LF                    :  '\n'
716                          ;
717    
718    CR                    :  '\r'
719                          ;
720    
721    ADD                   :  'A''D''D'
722                          ;
723    
724    GET                   :  'G''E''T'
725                          ;
726    
727    MAP                   :  'M''A''P'
728                          ;
729    
730    UNMAP                 :  'U''N''M''A''P'
731                          ;
732    
733    CLEAR                 :  'C''L''E''A''R'
734                          ;
735    
736    FIND                  :  'F''I''N''D'
737                          ;
738    
739    FILE_AS_DIR           :  'F''I''L''E''_''A''S''_''D''I''R'
740                          ;
741    
742    MOVE                  :  'M''O''V''E'
743                          ;
744    
745    COPY                  :  'C''O''P''Y'
746                          ;
747    
748    CREATE                :  'C''R''E''A''T''E'
749                          ;
750    
751    DESTROY               :  'D''E''S''T''R''O''Y'
752                          ;
753    
754    LIST                  :  'L''I''S''T'
755                          ;
756    
757    LOAD                  :  'L''O''A''D'
758                          ;
759    
760    ALL                   :  'A''L''L'
761                          ;
762    
763    NONE                  :  'N''O''N''E'
764                          ;
765    
766    DEFAULT               :  'D''E''F''A''U''L''T'
767                          ;
768    
769    NON_MODAL             :  'N''O''N''_''M''O''D''A''L'
770                          ;
771    
772    REMOVE                :  'R''E''M''O''V''E'
773                          ;
774    
775    SET                   :  'S''E''T'
776                          ;
777    
778    SUBSCRIBE             :  'S''U''B''S''C''R''I''B''E'
779                          ;
780    
781    UNSUBSCRIBE           :  'U''N''S''U''B''S''C''R''I''B''E'
782                          ;
783    
784    CHANNEL               :  'C''H''A''N''N''E''L'
785                          ;
786    
787    AVAILABLE_ENGINES     :  'A''V''A''I''L''A''B''L''E''_''E''N''G''I''N''E''S'
788                          ;
789    
790    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'
791                                    ;
792    
793    CHANNELS             :  'C''H''A''N''N''E''L''S'
794                         ;
795    
796    INFO                 :  'I''N''F''O'
797                         ;
798    
799    AUDIO_OUTPUT_DEVICE_COUNT :  'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E''_''C''O''U''N''T'
800                              ;
801    
802    AUDIO_OUTPUT_DEVICE_INFO  :  'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E''_''I''N''F''O'
803                              ;
804    
805    MIDI_INPUT_DEVICE_COUNT   :  'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E''_''C''O''U''N''T'
806                              ;
807    
808    MIDI_INPUT_DEVICE_INFO    :  'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E''_''I''N''F''O'
809                              ;
810    
811    MIDI_INSTRUMENT_MAP_COUNT :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''M''A''P''_''C''O''U''N''T'
812                              ;
813    
814    MIDI_INSTRUMENT_MAP_INFO  :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''M''A''P''_''I''N''F''O'
815                              ;
816    
817    MIDI_INSTRUMENT_COUNT     :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''C''O''U''N''T'
818                              ;
819    
820    MIDI_INSTRUMENT_INFO      :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''I''N''F''O'
821                              ;
822    
823    DB_INSTRUMENT_DIRECTORY_COUNT :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''D''I''R''E''C''T''O''R''Y''_''C''O''U''N''T'
824                                  ;
825    
826    DB_INSTRUMENT_DIRECTORY_INFO  :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''D''I''R''E''C''T''O''R''Y''_''I''N''F''O'
827                                  ;
828    
829    DB_INSTRUMENT_COUNT           :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''C''O''U''N''T'
830                                  ;
831    
832    DB_INSTRUMENT_INFO            :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''I''N''F''O'
833                                  ;
834    
835    DB_INSTRUMENT_FILES           :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''F''I''L''E''S'
836                                  ;
837    
838    DB_INSTRUMENTS_JOB_INFO       :  'D''B''_''I''N''S''T''R''U''M''E''N''T''S''_''J''O''B''_''I''N''F''O'
839                                  ;
840    
841    CHANNEL_COUNT        :  'C''H''A''N''N''E''L''_''C''O''U''N''T'
842                         ;
843    
844    CHANNEL_MIDI         :  'C''H''A''N''N''E''L''_''M''I''D''I'
845                         ;
846    
847    DEVICE_MIDI          :  'D''E''V''I''C''E''_''M''I''D''I'
848                         ;
849    
850    CHANNEL_INFO         :  'C''H''A''N''N''E''L''_''I''N''F''O'
851                         ;
852    
853    FX_SEND_COUNT        :  'F''X''_''S''E''N''D''_''C''O''U''N''T'
854                         ;
855    
856    FX_SEND_INFO         :  'F''X''_''S''E''N''D''_''I''N''F''O'
857                         ;
858    
859    BUFFER_FILL          :  'B''U''F''F''E''R''_''F''I''L''L'
860                         ;
861    
862    STREAM_COUNT         :  'S''T''R''E''A''M''_''C''O''U''N''T'
863                         ;
864    
865    VOICE_COUNT          :  'V''O''I''C''E''_''C''O''U''N''T'
866                         ;
867    
868    TOTAL_STREAM_COUNT   :  'T''O''T''A''L''_''S''T''R''E''A''M''_''C''O''U''N''T'
869                         ;
870    
871    TOTAL_VOICE_COUNT    :  'T''O''T''A''L''_''V''O''I''C''E''_''C''O''U''N''T'
872                         ;
873    
874    TOTAL_VOICE_COUNT_MAX:  'T''O''T''A''L''_''V''O''I''C''E''_''C''O''U''N''T''_''M''A''X'
875                         ;
876    
877    GLOBAL_INFO          :  'G''L''O''B''A''L''_''I''N''F''O'
878                         ;
879    
880    INSTRUMENT           :  'I''N''S''T''R''U''M''E''N''T'
881                         ;
882    
883    INSTRUMENTS          :  'I''N''S''T''R''U''M''E''N''T''S'
884                         ;
885    
886    ENGINE               :  'E' 'N' 'G' 'I' 'N' 'E'
887                         ;
888    
889    ON_DEMAND            :  'O''N''_''D''E''M''A''N''D'
890                         ;
891    
892    ON_DEMAND_HOLD       :  'O''N''_''D''E''M''A''N''D''_''H''O''L''D'
893                         ;
894    
895    PERSISTENT           :  'P''E''R''S''I''S''T''E''N''T'
896                         ;
897    
898    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'
899                                   ;
900    
901    AUDIO_OUTPUT_DEVICES  :  'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E''S'
902                          ;
903    
904    AUDIO_OUTPUT_DEVICE   :  'A''U''D''I''O''_''O''U''T''P''U''T''_''D''E''V''I''C''E'
905                        ;                        ;
906    
907  midi_input_type       :  string  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'
908                                   ;
909    
910    AUDIO_OUTPUT_DRIVER   :  'A''U''D''I''O''_''O''U''T''P''U''T''_''D''R''I''V''E''R'
911                          ;
912    
913    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'
914                                    ;
915    
916    AUDIO_OUTPUT_CHANNEL  :  'A''U''D''I''O''_''O''U''T''P''U''T''_''C''H''A''N''N''E''L'
917                          ;
918    
919    AUDIO_OUTPUT_TYPE     :  'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E'
920                          ;
921    
922    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'
923                                  ;
924    
925    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'
926                                 ;
927    
928    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'
929                                 ;
930    
931    MIDI_INPUT_DEVICES   :  'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E''S'
932                         ;
933    
934    MIDI_INPUT_DEVICE     :  'M''I''D''I''_''I''N''P''U''T''_''D''E''V''I''C''E'
935                          ;
936    
937    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'
938                                 ;
939    
940    MIDI_INSTRUMENT  :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T'
941                     ;
942    
943    MIDI_INSTRUMENTS  :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''S'
944                      ;
945    
946    MIDI_INSTRUMENT_MAP  :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''M''A''P'
947                         ;
948    
949    MIDI_INSTRUMENT_MAPS  :  'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''M''A''P''S'
950                          ;
951    
952    MIDI_INPUT_DRIVER     :  'M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R'
953                          ;
954    
955    MIDI_INPUT_PORT       :  'M''I''D''I''_''I''N''P''U''T''_''P''O''R''T'
956                          ;
957    
958    MIDI_INPUT_CHANNEL    :  'M''I''D''I''_''I''N''P''U''T''_''C''H''A''N''N''E''L'
959                          ;
960    
961    MIDI_INPUT_TYPE       :  'M''I''D''I''_''I''N''P''U''T''_''T''Y''P''E'
962                          ;
963    
964    MIDI_INPUT            :  'M''I''D''I''_''I''N''P''U''T'
965                          ;
966    
967    MIDI_CONTROLLER       :  'M''I''D''I''_''C''O''N''T''R''O''L''L''E''R'
968                          ;
969    
970    SEND                  :  'S''E''N''D'
971                        ;                        ;
972    
973  volume                :  DOTNUM  FX_SEND               :  'F''X''_''S''E''N''D'
                       |  NUMBER  { $$ = $1; }  
974                        ;                        ;
975    
976  sampler_channel       :  NUMBER  FX_SENDS              :  'F''X''_''S''E''N''D''S'
977                        ;                        ;
978    
979  instrument_index      :  NUMBER  DB_INSTRUMENT_DIRECTORY    :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''D''I''R''E''C''T''O''R''Y'
980                               ;
981    
982    DB_INSTRUMENT_DIRECTORIES  :  'D''B''_''I''N''S''T''R''U''M''E''N''T''_''D''I''R''E''C''T''O''R''I''E''S'
983                               ;
984    
985    DB_INSTRUMENTS             :  'D''B''_''I''N''S''T''R''U''M''E''N''T''S'
986                               ;
987    
988    DB_INSTRUMENT              :  'D''B''_''I''N''S''T''R''U''M''E''N''T'
989                               ;
990    
991    DB_INSTRUMENTS_JOB         :  'D''B''_''I''N''S''T''R''U''M''E''N''T''S''_''J''O''B'
992                               ;
993    
994    INSTRUMENTS_DB             :  'I''N''S''T''R''U''M''E''N''T''S''_''D''B'
995                               ;
996    
997    DESCRIPTION                :  'D''E''S''C''R''I''P''T''I''O''N'
998                               ;
999    
1000    FORCE                      :  'F''O''R''C''E'
1001                               ;
1002    
1003    FLAT                       :  'F''L''A''T'
1004                               ;
1005    
1006    RECURSIVE                  :  'R''E''C''U''R''S''I''V''E'
1007                               ;
1008    
1009    NON_RECURSIVE              :  'N''O''N''_''R''E''C''U''R''S''I''V''E'
1010                               ;
1011    
1012    LOST                       :  'L''O''S''T'
1013                               ;
1014    
1015    FILE_PATH                  :  'F''I''L''E''_''P''A''T''H'
1016                               ;
1017    
1018    SERVER                :  'S''E''R''V''E''R'
1019                          ;
1020    
1021    VOLUME                :  'V''O''L''U''M''E'
1022                          ;
1023    
1024    LEVEL                 :  'L''E''V''E''L'
1025                          ;
1026    
1027    MUTE                  :  'M''U''T''E'
1028                          ;
1029    
1030    SOLO                  :  'S''O''L''O'
1031                          ;
1032    
1033    BYTES                 :  'B''Y''T''E''S'
1034                          ;
1035    
1036    PERCENTAGE            :  'P''E''R''C''E''N''T''A''G''E'
1037                          ;
1038    
1039    FILE                  :  'F''I''L''E'
1040                          ;
1041    
1042    EDIT                  :  'E''D''I''T'
1043                        ;                        ;
1044    
1045  audio_output_channel  :  NUMBER  FORMAT                :  'F''O''R''M''A''T'
1046                        ;                        ;
1047    
1048  midi_input_channel    :  NUMBER  MIDI_DATA             :  'M''I''D''I''_''D''A''T''A'
1049                        ;                        ;
1050    
1051  engine_name           :  string  RESET                 :  'R''E''S''E''T'
1052                        ;                        ;
1053    
1054  midi_input_port       :  STRINGVAL  MISCELLANEOUS         :  'M''I''S''C''E''L''L''A''N''E''O''U''S'
1055                        ;                        ;
1056    
1057  filename              :  STRINGVAL  NAME                  :  'N''A''M''E'
1058                        ;                        ;
1059    
1060  param_val             :  STRINGVAL                { $$ = $1;                                             }  ECHO                  :  'E''C''H''O'
                       |  NUMBER                   { std::stringstream ss; ss << $1; $$ = ss.str();       }  
                       |  DOTNUM                   { std::stringstream ss; ss << $1; $$ = ss.str();       }  
1061                        ;                        ;
1062    
1063  string                :  CHAR          { std::string s; s = $1; $$ = s; }  QUIT                  :  'Q''U''I''T'
                       |  string CHAR   { $$ = $1 + $2;                  }  
1064                        ;                        ;
1065    
1066  %%  %%
# Line 224  string                :  CHAR          { Line 1069  string                :  CHAR          {
1069   * Will be called when an error occured (usually syntax error).   * Will be called when an error occured (usually syntax error).
1070   */   */
1071  void yyerror(const char* s) {  void yyerror(const char* s) {
1072      dmsg(2,("LSCPParser: %s\n", s));      yyparse_param_t* param = GetCurrentYaccSession();
1073        String msg = s
1074            + (" (line:"   + ToString(param->iLine+1))
1075            + ( ",column:" + ToString(param->iColumn))
1076            + ")";
1077        dmsg(2,("LSCPParser: %s\n", msg.c_str()));
1078        sLastError = msg;
1079  }  }
1080    
1081    namespace LinuxSampler {
1082    
1083  /**  /**
1084   * Clears input buffer and restarts scanner.   * Clears input buffer.
1085   */   */
1086  void restart(yyparse_param_t* pparam, int& yychar) {  void restart(yyparse_param_t* pparam, int& yychar) {
1087      // restart scanner      bytes = 0;
1088      yyrestart(stdin, pparam->pScanner);      ptr   = 0;
1089      // flush input buffer      sLastError = "";
1090      static char buf[1024];  }
1091      while(recv(hSession, buf, 1024, MSG_DONTWAIT) > 0);  
     // reset lookahead symbol  
     yyclearin;  
1092  }  }

Legend:
Removed from v.141  
changed lines
  Added in v.1781

  ViewVC Help
Powered by ViewVC