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 |
* |
* |
463 |
memset(&values[0], 0, size * sizeof(int)); |
memset(&values[0], 0, size * sizeof(int)); |
464 |
} |
} |
465 |
|
|
466 |
IntArrayVariable::IntArrayVariable(ParserContext* ctx, int size, ArgsRef values) |
IntArrayVariable::IntArrayVariable(ParserContext* ctx, int size, ArgsRef values, bool _bConst) |
467 |
: Variable(ctx, 0, false) |
: Variable(ctx, 0, _bConst) |
468 |
{ |
{ |
469 |
this->values.resize(size); |
this->values.resize(size); |
470 |
for (int i = 0; i < values->argsCount(); ++i) { |
for (int i = 0; i < values->argsCount(); ++i) { |
724 |
return m_condition->evalInt(); |
return m_condition->evalInt(); |
725 |
} |
} |
726 |
|
|
727 |
|
void SyncBlock::dump(int level) { |
728 |
|
printIndents(level); |
729 |
|
printf("sync {\n"); |
730 |
|
m_statements->dump(level+1); |
731 |
|
printIndents(level); |
732 |
|
printf("}\n"); |
733 |
|
} |
734 |
|
|
735 |
|
Statements* SyncBlock::statements() const { |
736 |
|
return (m_statements) ? const_cast<Statements*>( &*m_statements ) : NULL; |
737 |
|
} |
738 |
|
|
739 |
void Neg::dump(int level) { |
void Neg::dump(int level) { |
740 |
printIndents(level); |
printIndents(level); |
741 |
printf("Negative Expr\n"); |
printf("Negative Expr\n"); |
977 |
vIssues.push_back(w); |
vIssues.push_back(w); |
978 |
} |
} |
979 |
|
|
980 |
|
void ParserContext::addPreprocessorComment(int firstLine, int lastLine, int firstColumn, int lastColumn) { |
981 |
|
CodeBlock block; |
982 |
|
block.firstLine = firstLine; |
983 |
|
block.lastLine = lastLine; |
984 |
|
block.firstColumn = firstColumn; |
985 |
|
block.lastColumn = lastColumn; |
986 |
|
vPreprocessorComments.push_back(block); |
987 |
|
} |
988 |
|
|
989 |
bool ParserContext::setPreprocessorCondition(const char* name) { |
bool ParserContext::setPreprocessorCondition(const char* name) { |
990 |
if (builtinPreprocessorConditions.count(name)) return false; |
if (builtinPreprocessorConditions.count(name)) return false; |
991 |
if (userPreprocessorConditions.count(name)) return false; |
if (userPreprocessorConditions.count(name)) return false; |
1017 |
return vWarnings; |
return vWarnings; |
1018 |
} |
} |
1019 |
|
|
1020 |
|
std::vector<CodeBlock> ParserContext::preprocessorComments() const { |
1021 |
|
return vPreprocessorComments; |
1022 |
|
} |
1023 |
|
|
1024 |
VMEventHandler* ParserContext::eventHandler(uint index) { |
VMEventHandler* ParserContext::eventHandler(uint index) { |
1025 |
if (!handlers) return NULL; |
if (!handlers) return NULL; |
1026 |
return handlers->eventHandler(index); |
return handlers->eventHandler(index); |