1 |
/* |
/* |
2 |
* Copyright (c) 2014-2016 Christian Schoenebeck and Andreas Persson |
* Copyright (c) 2014-2017 Christian Schoenebeck and Andreas Persson |
3 |
* |
* |
4 |
* http://www.linuxsampler.org |
* http://www.linuxsampler.org |
5 |
* |
* |
48 |
#define SCANNER_ERR(txt) scanner_error(yylloc, yyextra, txt) |
#define SCANNER_ERR(txt) scanner_error(yylloc, yyextra, txt) |
49 |
#define SCANNER_WRN(txt) scanner_warning(yylloc, yyextra, txt) |
#define SCANNER_WRN(txt) scanner_warning(yylloc, yyextra, txt) |
50 |
|
|
51 |
|
// shut up warning that 'register' keyword is deprecated as of C++11 |
52 |
|
#if defined(__cplusplus) && __cplusplus >= 201103L |
53 |
|
# define register |
54 |
|
#endif |
55 |
|
|
56 |
using namespace LinuxSampler; |
using namespace LinuxSampler; |
57 |
|
|
58 |
static int countNewLineChars(const char* txt) { |
static int countNewLineChars(const char* txt) { |
63 |
} |
} |
64 |
|
|
65 |
static int countCharsPastLastNewLine(const char* txt) { |
static int countCharsPastLastNewLine(const char* txt) { |
66 |
const int n = strlen(txt); |
const int n = (int)strlen(txt); |
67 |
for (int i = n - 1; i >= 0; --i) |
for (int i = n - 1; i >= 0; --i) |
68 |
if (txt[i] == '\n') |
if (txt[i] == '\n') |
69 |
return n - i - 1; |
return n - i - 1; |
248 |
"mod" return MOD; |
"mod" return MOD; |
249 |
"function" return FUNCTION; |
"function" return FUNCTION; |
250 |
"call" return CALL; |
"call" return CALL; |
251 |
|
"synchronized" return SYNCHRONIZED; |
252 |
|
|
253 |
[&,()[\]<>=*+#/-] { |
[&,()[\]<>=*+#/-] { |
254 |
return *yytext; |
return *yytext; |
279 |
|
|
280 |
[ \t\r]+ /* eat up whitespace */ |
[ \t\r]+ /* eat up whitespace */ |
281 |
|
|
282 |
. printf( "Unrecognized character: '%s' (line %d, column %d)\n", yytext, yylineno, yycolumn); |
. { |
283 |
|
printf( "Unrecognized character: '%s' (line %d, column %d)\n", yytext, yylineno, yycolumn); |
284 |
|
return UNKNOWN_CHAR; |
285 |
|
} |
286 |
|
|
287 |
%% |
%% |
288 |
|
|