/[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 411 by schoenebeck, Sat Feb 26 02:01:14 2005 UTC revision 483 by schoenebeck, Mon Mar 21 23:40:56 2005 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 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 68  int yylex(YYSTYPE* yylval) { Line 69  int yylex(YYSTYPE* yylval) {
69  %type <Char> char digit  %type <Char> char digit
70  %type <Dotnum> dotnum volume_value boolean  %type <Dotnum> dotnum volume_value boolean
71  %type <Number> number sampler_channel instrument_index audio_channel_index device_index midi_input_channel_index midi_input_port_index  %type <Number> number sampler_channel instrument_index audio_channel_index device_index midi_input_channel_index midi_input_port_index
72  %type <String> string text stringval digits param_val filename engine_name command create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args audio_output_type_name midi_input_type_name set_instruction subscribe_event unsubscribe_event  %type <String> string text stringval digits param_val_list param_val filename engine_name command create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args audio_output_type_name midi_input_type_name set_instruction subscribe_event unsubscribe_event
73  %type <FillResponse> buffer_size_type  %type <FillResponse> buffer_size_type
74  %type <KeyValList> key_val_list  %type <KeyValList> key_val_list
75    
# Line 152  get_instruction       :  AVAILABLE_ENGIN Line 153  get_instruction       :  AVAILABLE_ENGIN
153                        |  ENGINE SP INFO SP engine_name                                              { $$ = LSCPSERVER->GetEngineInfo($5);                              }                        |  ENGINE SP INFO SP engine_name                                              { $$ = LSCPSERVER->GetEngineInfo($5);                              }
154                        ;                        ;
155    
156  set_instruction       :  AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }  set_instruction       :  AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }
157                        |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP number SP number SP string '=' param_val  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }                        |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP number SP number SP string '=' param_val_list  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }
158                        |  MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val               { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7);        }                        |  MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list               { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7);        }
159                        |  MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val       { $$ = 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);      }
160                        |  CHANNEL SP set_chan_instruction                                             { $$ = $3;                                                         }                        |  CHANNEL SP set_chan_instruction                                                  { $$ = $3;                                                         }
161                        |  ECHO SP boolean                                                             { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3);  }                        |  ECHO SP boolean                                                                  { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3);  }
162                        ;                        ;
163    
164  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); }
# Line 185  set_chan_instruction  :  AUDIO_OUTPUT_DE Line 186  set_chan_instruction  :  AUDIO_OUTPUT_DE
186                        |  VOLUME SP sampler_channel SP volume_value                                                           { $$ = LSCPSERVER->SetVolume($5, $3);                 }                        |  VOLUME SP sampler_channel SP volume_value                                                           { $$ = LSCPSERVER->SetVolume($5, $3);                 }
187                        ;                        ;
188    
189  key_val_list          :  string '=' param_val                  { $$[$1] = $3;          }  key_val_list          :  string '=' param_val_list                  { $$[$1] = $3;          }
190                        |  key_val_list SP string '=' param_val  { $$ = $1; $$[$3] = $5; }                        |  key_val_list SP string '=' param_val_list  { $$ = $1; $$[$3] = $5; }
191                        ;                        ;
192    
193  buffer_size_type      :  BYTES       { $$ = fill_response_bytes;      }  buffer_size_type      :  BYTES       { $$ = fill_response_bytes;      }
# Line 240  engine_name               :  string Line 241  engine_name               :  string
241  filename                  :  stringval  filename                  :  stringval
242                            ;                            ;
243    
244    param_val_list            :  param_val
245                              |  param_val_list','param_val  { $$ = $1 + "," + $3; }
246                              ;
247    
248  param_val                 :  string  param_val                 :  string
249                            |  stringval                            |  '\'' string '\''  { $$ = "\'" + $2 + "\'"; }  // we eleminate encapsulating (apostrophe) limiters later
250                            |  number     { std::stringstream ss; ss << $1; $$ = ss.str(); }                            |  '\"' string '\"'  { $$ = "\"" + $2 + "\""; }  // s.a.
251                            |  dotnum     { std::stringstream ss; ss << $1; $$ = ss.str(); }                            |  number            { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
252                              |  dotnum            { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); }
253                            ;                            ;
254    
255    

Legend:
Removed from v.411  
changed lines
  Added in v.483

  ViewVC Help
Powered by ViewVC