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

Contents of /linuxsampler/trunk/src/network/lscp.l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 210 - (show annotations) (download)
Sat Jul 24 12:33:49 2004 UTC (15 years, 6 months ago) by schoenebeck
File size: 6368 byte(s)
* implemented "SET ECHO" LSCP command

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20 * MA 02111-1307 USA *
21 ***************************************************************************/
22
23 /* Note: don't forget to run 'make parser' after you changed this file, */
24 /* otherwise the parser will not be regenerated! */
25
26 %{
27
28 #include "lscpparser.h"
29 #include "lscpsymbols.h"
30
31 %}
32
33 %option reentrant
34
35 %x INSTRING
36
37 DIGIT [0-9]
38
39 %%
40
41 " " { return SP; }
42 \n { return LF; }
43 \r { return CR; }
44 "#" { return HASH; }
45 "=" { return EQ; }
46 ("+"|"-")?{DIGIT}+"."{DIGIT}+ { yylval->Dotnum = atof(yytext); return DOTNUM; }
47 ADD { return ADD; }
48 GET { return GET; }
49 CREATE { return CREATE; }
50 DESTROY { return DESTROY; }
51 LIST { return LIST; }
52 LOAD { return LOAD; }
53 NON_MODAL { return NON_MODAL; }
54 REMOVE { return REMOVE; }
55 SET { return SET; }
56 SUBSCRIBE { return SUBSCRIBE; }
57 UNSUBSCRIBE { return UNSUBSCRIBE; }
58 CHANNEL { return CHANNEL; }
59 NOTIFICATION { return NOTIFICATION; }
60 AVAILABLE_ENGINES { return AVAILABLE_ENGINES; }
61 AVAILABLE_AUDIO_OUTPUT_DRIVERS { return AVAILABLE_AUDIO_OUTPUT_DRIVERS; }
62 CHANNELS { return CHANNELS; }
63 INFO { return INFO; }
64 BUFFER_FILL { return BUFFER_FILL; }
65 STREAM_COUNT { return STREAM_COUNT; }
66 VOICE_COUNT { return VOICE_COUNT; }
67 INSTRUMENT { return INSTRUMENT; }
68 ENGINE { return ENGINE; }
69 AUDIO_OUTPUT_DEVICE_PARAMETER { return AUDIO_OUTPUT_DEVICE_PARAMETER; }
70 AUDIO_OUTPUT_DEVICES { return AUDIO_OUTPUT_DEVICES; }
71 AUDIO_OUTPUT_DEVICE { return AUDIO_OUTPUT_DEVICE; }
72 AUDIO_OUTPUT_DRIVER_PARAMETER { return AUDIO_OUTPUT_DRIVER_PARAMETER; }
73 AUDIO_OUTPUT_DRIVER { return AUDIO_OUTPUT_DRIVER; }
74 AUDIO_OUTPUT_CHANNEL_PARAMETER { return AUDIO_OUTPUT_CHANNEL_PARAMETER; }
75 AUDIO_OUTPUT_CHANNEL { return AUDIO_OUTPUT_CHANNEL; }
76 AUDIO_OUTPUT_TYPE { return AUDIO_OUTPUT_TYPE; }
77 AVAILABLE_MIDI_INPUT_DRIVERS { return AVAILABLE_MIDI_INPUT_DRIVERS; }
78 MIDI_INPUT_DEVICE_PARAMETER { return MIDI_INPUT_DEVICE_PARAMETER; }
79 MIDI_INPUT_PORT_PARAMETER { return MIDI_INPUT_PORT_PARAMETER; }
80 MIDI_INPUT_DEVICES { return MIDI_INPUT_DEVICES; }
81 MIDI_INPUT_DEVICE { return MIDI_INPUT_DEVICE; }
82 MIDI_INPUT_DRIVER_PARAMETER { return MIDI_INPUT_DRIVER_PARAMETER; }
83 MIDI_INPUT_DRIVER { return MIDI_INPUT_DRIVER; }
84 MIDI_INPUT_PORT { return MIDI_INPUT_PORT; }
85 MIDI_INPUT_CHANNEL { return MIDI_INPUT_CHANNEL; }
86 MIDI_INPUT_TYPE { return MIDI_INPUT_TYPE; }
87 MIDI_INPUT { return MIDI_INPUT; }
88 VOLUME { return VOLUME; }
89 BYTES { return BYTES; }
90 PERCENTAGE { return PERCENTAGE; }
91 RESET { return RESET; }
92 MISCELLANEOUS { return MISCELLANEOUS; }
93 ECHO { return ECHO; }
94 QUIT { return QUIT; }
95 0|([1-9]{DIGIT}*) { yylval->Number = atoi(yytext); return NUMBER; }
96 "\'" { yylval->String = ""; BEGIN(INSTRING); }
97 <INSTRING>[^\'\\]+ { yylval->String += yytext; }
98 <INSTRING>"\\n" { yylval->String += '\n'; }
99 <INSTRING>"\\r" { yylval->String += '\r'; }
100 <INSTRING>"\\t" { yylval->String += '\t'; }
101 <INSTRING>"\\\\" { yylval->String += '\\'; }
102 <INSTRING>"\\\"" { yylval->String += '\"'; }
103 <INSTRING>"\\\'" { yylval->String += '\''; }
104 <INSTRING>"\\"[^nrt\"\\] { yylval->String += yytext; }
105 <INSTRING>"\'" { BEGIN(INITIAL); return STRINGVAL; }
106 . { yylval->Char = yytext[0]; return CHAR; }
107
108 %%
109
110 /**
111 * We provide our own version of yywrap() so we don't have to link against
112 * the lex library.
113 */
114 int yywrap(yyscan_t yyscanner) {
115 return 1; // continue scanning
116 }

  ViewVC Help
Powered by ViewVC