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 |
* |
* |
31 |
%parse-param { LinuxSampler::ParserContext* context } |
%parse-param { LinuxSampler::ParserContext* context } |
32 |
%lex-param { void* scanner } |
%lex-param { void* scanner } |
33 |
// avoid symbol collision with other (i.e. future) auto generated (f)lex scanners |
// avoid symbol collision with other (i.e. future) auto generated (f)lex scanners |
34 |
%name-prefix "InstrScript_" |
// (NOTE: "=" is deprecated here with Bison 3.x, however removing it would cause an error with Bison 2.x) |
35 |
|
%name-prefix="InstrScript_" |
36 |
%locations |
%locations |
37 |
%defines |
%defines |
38 |
%error-verbose |
%error-verbose |
507 |
PARSE_ERR(@1, (String("No variable declared with name '") + name + "'.").c_str()); |
PARSE_ERR(@1, (String("No variable declared with name '") + name + "'.").c_str()); |
508 |
else if (var->exprType() != INT_ARR_EXPR) |
else if (var->exprType() != INT_ARR_EXPR) |
509 |
PARSE_ERR(@2, (String("Variable '") + name + "' is not an array variable.").c_str()); |
PARSE_ERR(@2, (String("Variable '") + name + "' is not an array variable.").c_str()); |
510 |
|
else if (var->isConstExpr()) |
511 |
|
PARSE_ERR(@5, (String("Variable assignment: Cannot modify const array variable '") + name + "'.").c_str()); |
512 |
|
else if (!var->isAssignable()) |
513 |
|
PARSE_ERR(@5, (String("Variable assignment: Array variable '") + name + "' is not assignable.").c_str()); |
514 |
else if ($3->exprType() != INT_EXPR) |
else if ($3->exprType() != INT_EXPR) |
515 |
PARSE_ERR(@3, (String("Array variable '") + name + "' accessed with non integer expression.").c_str()); |
PARSE_ERR(@3, (String("Array variable '") + name + "' accessed with non integer expression.").c_str()); |
516 |
else if ($6->exprType() != INT_EXPR) |
else if ($6->exprType() != INT_EXPR) |
842 |
} |
} |
843 |
|
|
844 |
if (! yyres) |
if (! yyres) |
845 |
return yystrlen (yystr); |
return (int) yystrlen (yystr); |
846 |
|
|
847 |
return yystpcpy (yyres, yystr) - yyres; |
return int( yystpcpy (yyres, yystr) - yyres ); |
848 |
} |
} |