1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* |
* |
3 |
* Copyright (c) 2014 Christian Schoenebeck and Andreas Persson |
* Copyright (c) 2014 - 2016 Christian Schoenebeck and Andreas Persson |
4 |
* |
* |
5 |
* http://www.linuxsampler.org |
* http://www.linuxsampler.org |
6 |
* |
* |
42 |
Node(); |
Node(); |
43 |
virtual ~Node(); |
virtual ~Node(); |
44 |
virtual void dump(int level = 0) = 0; |
virtual void dump(int level = 0) = 0; |
45 |
|
virtual bool isPolyphonic() const = 0; |
46 |
void printIndents(int n); |
void printIndents(int n); |
47 |
}; |
}; |
48 |
typedef Ref<Node> NodeRef; |
typedef Ref<Node> NodeRef; |
78 |
int evalInt(); |
int evalInt(); |
79 |
void dump(int level = 0); |
void dump(int level = 0); |
80 |
bool isConstExpr() const { return true; } |
bool isConstExpr() const { return true; } |
81 |
|
bool isPolyphonic() const { return false; } |
82 |
}; |
}; |
83 |
typedef Ref<IntLiteral,Node> IntLiteralRef; |
typedef Ref<IntLiteral,Node> IntLiteralRef; |
84 |
|
|
89 |
bool isConstExpr() const { return true; } |
bool isConstExpr() const { return true; } |
90 |
void dump(int level = 0); |
void dump(int level = 0); |
91 |
String evalStr() { return value; } |
String evalStr() { return value; } |
92 |
|
bool isPolyphonic() const { return false; } |
93 |
}; |
}; |
94 |
typedef Ref<StringLiteral,Node> StringLiteralRef; |
typedef Ref<StringLiteral,Node> StringLiteralRef; |
95 |
|
|
100 |
void dump(int level = 0); |
void dump(int level = 0); |
101 |
int argsCount() const { return args.size(); } |
int argsCount() const { return args.size(); } |
102 |
VMExpr* arg(int i) { return (i >= 0 && i < argsCount()) ? &*args.at(i) : NULL; } |
VMExpr* arg(int i) { return (i >= 0 && i < argsCount()) ? &*args.at(i) : NULL; } |
103 |
|
bool isPolyphonic() const; |
104 |
}; |
}; |
105 |
typedef Ref<Args,Node> ArgsRef; |
typedef Ref<Args,Node> ArgsRef; |
106 |
|
|
107 |
class Variable : virtual public Expression { |
class Variable : virtual public VMVariable, virtual public Expression { |
108 |
public: |
public: |
109 |
virtual bool isConstExpr() const { return bConst; } |
bool isConstExpr() const OVERRIDE { return bConst; } |
110 |
|
bool isAssignable() const OVERRIDE { return !bConst; } |
111 |
virtual void assign(Expression* expr) = 0; |
virtual void assign(Expression* expr) = 0; |
112 |
|
void assignExpr(VMExpr* expr) OVERRIDE { Expression* e = dynamic_cast<Expression*>(expr); if (e) assign(e); } |
113 |
protected: |
protected: |
114 |
Variable(ParserContext* ctx, int _memPos, bool _bConst) |
Variable(ParserContext* ctx, int _memPos, bool _bConst) |
115 |
: context(ctx), memPos(_memPos), bConst(_bConst) {} |
: context(ctx), memPos(_memPos), bConst(_bConst) {} |
145 |
}; |
}; |
146 |
typedef Ref<ConstIntVariable,Node> ConstIntVariableRef; |
typedef Ref<ConstIntVariable,Node> ConstIntVariableRef; |
147 |
|
|
148 |
|
class BuiltInIntVariable : public IntVariable { |
149 |
|
String name; |
150 |
|
VMIntRelPtr* ptr; |
151 |
|
public: |
152 |
|
BuiltInIntVariable(const String& name, VMIntRelPtr* ptr); |
153 |
|
bool isAssignable() const OVERRIDE { return !ptr->readonly; } |
154 |
|
void assign(Expression* expr); |
155 |
|
int evalInt(); |
156 |
|
void dump(int level = 0); |
157 |
|
}; |
158 |
|
typedef Ref<BuiltInIntVariable,Node> BuiltInIntVariableRef; |
159 |
|
|
160 |
class PolyphonicIntVariable : public IntVariable { |
class PolyphonicIntVariable : public IntVariable { |
161 |
public: |
public: |
162 |
PolyphonicIntVariable(ParserContext* ctx); |
PolyphonicIntVariable(ParserContext* ctx); |
164 |
}; |
}; |
165 |
typedef Ref<PolyphonicIntVariable,Node> PolyphonicIntVariableRef; |
typedef Ref<PolyphonicIntVariable,Node> PolyphonicIntVariableRef; |
166 |
|
|
167 |
class IntArrayVariable : public Variable { |
class IntArrayVariable : public Variable, virtual public VMIntArrayExpr { |
168 |
ArrayList<int> values; |
ArrayList<int> values; |
169 |
public: |
public: |
170 |
IntArrayVariable(ParserContext* ctx, int size); |
IntArrayVariable(ParserContext* ctx, int size); |
171 |
IntArrayVariable(ParserContext* ctx, int size, ArgsRef values); |
IntArrayVariable(ParserContext* ctx, int size, ArgsRef values); |
172 |
void assign(Expression* expr) {} // ignore scalar assignment |
void assign(Expression* expr) {} // ignore scalar assignment |
173 |
String evalCastToStr() { return ""; } // ignore cast to string |
String evalCastToStr() { return ""; } // ignore scalar cast to string |
174 |
ExprType_t exprType() const { return INT_ARR_EXPR; } |
ExprType_t exprType() const { return INT_ARR_EXPR; } |
175 |
const int arraySize() const { return values.size(); } |
virtual int arraySize() const { return values.size(); } |
176 |
|
virtual int evalIntElement(uint i); |
177 |
|
virtual void assignIntElement(uint i, int value); |
178 |
|
void dump(int level = 0); |
179 |
|
bool isPolyphonic() const { return false; } |
180 |
|
protected: |
181 |
|
IntArrayVariable(ParserContext* ctx, bool bConst); |
182 |
|
}; |
183 |
|
typedef Ref<IntArrayVariable,Node> IntArrayVariableRef; |
184 |
|
|
185 |
|
class BuiltInIntArrayVariable : public IntArrayVariable { |
186 |
|
String name; |
187 |
|
VMInt8Array* array; |
188 |
|
public: |
189 |
|
BuiltInIntArrayVariable(const String& name, VMInt8Array* array); |
190 |
|
int arraySize() const { return array->size; } |
191 |
int evalIntElement(uint i); |
int evalIntElement(uint i); |
192 |
void assignIntElement(uint i, int value); |
void assignIntElement(uint i, int value); |
193 |
void dump(int level = 0); |
void dump(int level = 0); |
194 |
}; |
}; |
195 |
typedef Ref<IntArrayVariable,Node> IntArrayVariableRef; |
typedef Ref<BuiltInIntArrayVariable,Node> BuiltInIntArrayVariableRef; |
196 |
|
|
197 |
class IntArrayElement : public IntVariable { |
class IntArrayElement : public IntVariable { |
198 |
IntArrayVariableRef array; |
IntArrayVariableRef array; |
211 |
void assign(Expression* expr); |
void assign(Expression* expr); |
212 |
String evalStr(); |
String evalStr(); |
213 |
void dump(int level = 0); |
void dump(int level = 0); |
214 |
|
bool isPolyphonic() const { return false; } |
215 |
protected: |
protected: |
216 |
StringVariable(ParserContext* ctx, bool bConst); |
StringVariable(ParserContext* ctx, bool bConst); |
217 |
}; |
}; |
235 |
public: |
public: |
236 |
BinaryOp(ExpressionRef lhs, ExpressionRef rhs) : lhs(lhs), rhs(rhs) { } |
BinaryOp(ExpressionRef lhs, ExpressionRef rhs) : lhs(lhs), rhs(rhs) { } |
237 |
bool isConstExpr() const { return lhs->isConstExpr() && rhs->isConstExpr(); } |
bool isConstExpr() const { return lhs->isConstExpr() && rhs->isConstExpr(); } |
238 |
|
bool isPolyphonic() const { return lhs->isPolyphonic() || rhs->isPolyphonic(); } |
239 |
}; |
}; |
240 |
typedef Ref<BinaryOp,Node> BinaryOpRef; |
typedef Ref<BinaryOp,Node> BinaryOpRef; |
241 |
|
|
292 |
NoOperation() : Statement() {} |
NoOperation() : Statement() {} |
293 |
StmtType_t statementType() const { return STMT_LEAF; } |
StmtType_t statementType() const { return STMT_LEAF; } |
294 |
void dump(int level = 0) {} |
void dump(int level = 0) {} |
295 |
|
bool isPolyphonic() const { return false; } |
296 |
}; |
}; |
297 |
typedef Ref<NoOperation,Node> NoOperationRef; |
typedef Ref<NoOperation,Node> NoOperationRef; |
298 |
|
|
312 |
void dump(int level = 0); |
void dump(int level = 0); |
313 |
StmtType_t statementType() const { return STMT_LIST; } |
StmtType_t statementType() const { return STMT_LIST; } |
314 |
virtual Statement* statement(uint i); |
virtual Statement* statement(uint i); |
315 |
|
bool isPolyphonic() const; |
316 |
}; |
}; |
317 |
typedef Ref<Statements,Node> StatementsRef; |
typedef Ref<Statements,Node> StatementsRef; |
318 |
|
|
323 |
virtual Statements* branch(uint i) const = 0; |
virtual Statements* branch(uint i) const = 0; |
324 |
}; |
}; |
325 |
|
|
326 |
|
class DynamicVariableCall : public Variable, virtual public IntExpr, virtual public StringExpr { |
327 |
|
VMDynVar* dynVar; |
328 |
|
String varName; |
329 |
|
public: |
330 |
|
DynamicVariableCall(const String& name, ParserContext* ctx, VMDynVar* v); |
331 |
|
ExprType_t exprType() const OVERRIDE { return dynVar->exprType(); } |
332 |
|
bool isConstExpr() const OVERRIDE { return dynVar->isConstExpr(); } |
333 |
|
bool isAssignable() const OVERRIDE { return dynVar->isAssignable(); } |
334 |
|
bool isPolyphonic() const OVERRIDE { return false; } |
335 |
|
void assign(Expression* expr) OVERRIDE { dynVar->assignExpr(expr); } |
336 |
|
int evalInt() OVERRIDE; |
337 |
|
String evalStr() OVERRIDE; |
338 |
|
String evalCastToStr() OVERRIDE; |
339 |
|
void dump(int level = 0) OVERRIDE; |
340 |
|
}; |
341 |
|
typedef Ref<DynamicVariableCall,Node> DynamicVariableCallRef; |
342 |
|
|
343 |
class FunctionCall : virtual public LeafStatement, virtual public IntExpr, virtual public StringExpr { |
class FunctionCall : virtual public LeafStatement, virtual public IntExpr, virtual public StringExpr { |
344 |
String functionName; |
String functionName; |
345 |
ArgsRef args; |
ArgsRef args; |
354 |
bool isConstExpr() const { return false; } |
bool isConstExpr() const { return false; } |
355 |
ExprType_t exprType() const; |
ExprType_t exprType() const; |
356 |
String evalCastToStr(); |
String evalCastToStr(); |
357 |
|
bool isPolyphonic() const { return args->isPolyphonic(); } |
358 |
protected: |
protected: |
359 |
VMFnResult* execVMFn(); |
VMFnResult* execVMFn(); |
360 |
}; |
}; |
362 |
|
|
363 |
class EventHandler : virtual public Statements, virtual public VMEventHandler { |
class EventHandler : virtual public Statements, virtual public VMEventHandler { |
364 |
StatementsRef statements; |
StatementsRef statements; |
365 |
|
bool usingPolyphonics; |
366 |
public: |
public: |
367 |
void dump(int level = 0); |
void dump(int level = 0); |
368 |
StmtFlags_t exec(); |
StmtFlags_t exec(); |
369 |
EventHandler(StatementsRef statements) { this->statements = statements; } |
EventHandler(StatementsRef statements); |
370 |
Statement* statement(uint i) { return statements->statement(i); } |
Statement* statement(uint i) { return statements->statement(i); } |
371 |
|
bool isPolyphonic() const { return usingPolyphonics; } |
372 |
}; |
}; |
373 |
typedef Ref<EventHandler,Node> EventHandlerRef; |
typedef Ref<EventHandler,Node> EventHandlerRef; |
374 |
|
|
375 |
class OnNote : public EventHandler { |
class OnNote : public EventHandler { |
376 |
public: |
public: |
377 |
OnNote(StatementsRef statements) : EventHandler(statements) {} |
OnNote(StatementsRef statements) : EventHandler(statements) {} |
378 |
|
VMEventHandlerType_t eventHandlerType() const { return VM_EVENT_HANDLER_NOTE; } |
379 |
String eventHandlerName() const { return "note"; } |
String eventHandlerName() const { return "note"; } |
380 |
}; |
}; |
381 |
typedef Ref<OnNote,Node> OnNoteRef; |
typedef Ref<OnNote,Node> OnNoteRef; |
383 |
class OnInit : public EventHandler { |
class OnInit : public EventHandler { |
384 |
public: |
public: |
385 |
OnInit(StatementsRef statements) : EventHandler(statements) {} |
OnInit(StatementsRef statements) : EventHandler(statements) {} |
386 |
|
VMEventHandlerType_t eventHandlerType() const { return VM_EVENT_HANDLER_INIT; } |
387 |
String eventHandlerName() const { return "init"; } |
String eventHandlerName() const { return "init"; } |
388 |
}; |
}; |
389 |
typedef Ref<OnInit,Node> OnInitRef; |
typedef Ref<OnInit,Node> OnInitRef; |
391 |
class OnRelease : public EventHandler { |
class OnRelease : public EventHandler { |
392 |
public: |
public: |
393 |
OnRelease(StatementsRef statements) : EventHandler(statements) {} |
OnRelease(StatementsRef statements) : EventHandler(statements) {} |
394 |
|
VMEventHandlerType_t eventHandlerType() const { return VM_EVENT_HANDLER_RELEASE; } |
395 |
String eventHandlerName() const { return "release"; } |
String eventHandlerName() const { return "release"; } |
396 |
}; |
}; |
397 |
typedef Ref<OnRelease,Node> OnReleaseRef; |
typedef Ref<OnRelease,Node> OnReleaseRef; |
399 |
class OnController : public EventHandler { |
class OnController : public EventHandler { |
400 |
public: |
public: |
401 |
OnController(StatementsRef statements) : EventHandler(statements) {} |
OnController(StatementsRef statements) : EventHandler(statements) {} |
402 |
|
VMEventHandlerType_t eventHandlerType() const { return VM_EVENT_HANDLER_CONTROLLER; } |
403 |
String eventHandlerName() const { return "controller"; } |
String eventHandlerName() const { return "controller"; } |
404 |
}; |
}; |
405 |
typedef Ref<OnController,Node> OnControllerRef; |
typedef Ref<OnController,Node> OnControllerRef; |
415 |
EventHandler* eventHandlerByName(const String& name) const; |
EventHandler* eventHandlerByName(const String& name) const; |
416 |
EventHandler* eventHandler(uint index) const; |
EventHandler* eventHandler(uint index) const; |
417 |
inline uint size() const { return args.size(); } |
inline uint size() const { return args.size(); } |
418 |
|
bool isPolyphonic() const; |
419 |
}; |
}; |
420 |
typedef Ref<EventHandlers,Node> EventHandlersRef; |
typedef Ref<EventHandlers,Node> EventHandlersRef; |
421 |
|
|
427 |
Assignment(VariableRef variable, ExpressionRef value); |
Assignment(VariableRef variable, ExpressionRef value); |
428 |
void dump(int level = 0); |
void dump(int level = 0); |
429 |
StmtFlags_t exec(); |
StmtFlags_t exec(); |
430 |
|
bool isPolyphonic() const { return (variable && variable->isPolyphonic()) || (value && value->isPolyphonic()); } |
431 |
}; |
}; |
432 |
typedef Ref<Assignment,Node> AssignmentRef; |
typedef Ref<Assignment,Node> AssignmentRef; |
433 |
|
|
443 |
void dump(int level = 0); |
void dump(int level = 0); |
444 |
int evalBranch(); |
int evalBranch(); |
445 |
Statements* branch(uint i) const; |
Statements* branch(uint i) const; |
446 |
|
bool isPolyphonic() const; |
447 |
}; |
}; |
448 |
typedef Ref<If,Node> IfRef; |
typedef Ref<If,Node> IfRef; |
449 |
|
|
467 |
//void addBranch(IntExprRef from, IntExprRef to, StatementsRef statements); |
//void addBranch(IntExprRef from, IntExprRef to, StatementsRef statements); |
468 |
//void addBranch(CaseBranchRef branch); |
//void addBranch(CaseBranchRef branch); |
469 |
//void addBranches(CaseBranchesRef branches); |
//void addBranches(CaseBranchesRef branches); |
470 |
|
bool isPolyphonic() const; |
471 |
}; |
}; |
472 |
typedef Ref<SelectCase,Node> SelectCaseRef; |
typedef Ref<SelectCase,Node> SelectCaseRef; |
473 |
|
|
481 |
void dump(int level = 0); |
void dump(int level = 0); |
482 |
bool evalLoopStartCondition(); |
bool evalLoopStartCondition(); |
483 |
Statements* statements() const; |
Statements* statements() const; |
484 |
|
bool isPolyphonic() const { return m_condition->isPolyphonic() || m_statements->isPolyphonic(); } |
485 |
}; |
}; |
486 |
|
|
487 |
class Neg : public IntExpr { |
class Neg : public IntExpr { |
491 |
int evalInt() { return (expr) ? -expr->evalInt() : 0; } |
int evalInt() { return (expr) ? -expr->evalInt() : 0; } |
492 |
void dump(int level = 0); |
void dump(int level = 0); |
493 |
bool isConstExpr() const { return expr->isConstExpr(); } |
bool isConstExpr() const { return expr->isConstExpr(); } |
494 |
|
bool isPolyphonic() const { return expr->isPolyphonic(); } |
495 |
}; |
}; |
496 |
typedef Ref<Neg,Node> NegRef; |
typedef Ref<Neg,Node> NegRef; |
497 |
|
|
503 |
String evalStr(); |
String evalStr(); |
504 |
void dump(int level = 0); |
void dump(int level = 0); |
505 |
bool isConstExpr() const; |
bool isConstExpr() const; |
506 |
|
bool isPolyphonic() const { return lhs->isPolyphonic() || rhs->isPolyphonic(); } |
507 |
}; |
}; |
508 |
typedef Ref<ConcatString,Node> ConcatStringRef; |
typedef Ref<ConcatString,Node> ConcatStringRef; |
509 |
|
|
522 |
int evalInt(); |
int evalInt(); |
523 |
void dump(int level = 0); |
void dump(int level = 0); |
524 |
bool isConstExpr() const; |
bool isConstExpr() const; |
525 |
|
bool isPolyphonic() const { return lhs->isPolyphonic() || rhs->isPolyphonic(); } |
526 |
private: |
private: |
527 |
IntExprRef lhs; |
IntExprRef lhs; |
528 |
IntExprRef rhs; |
IntExprRef rhs; |
538 |
}; |
}; |
539 |
typedef Ref<Or,Node> OrRef; |
typedef Ref<Or,Node> OrRef; |
540 |
|
|
541 |
|
class BitwiseOr : virtual public BinaryOp, virtual public IntExpr { |
542 |
|
public: |
543 |
|
BitwiseOr(IntExprRef lhs, IntExprRef rhs) : BinaryOp(lhs,rhs) {} |
544 |
|
int evalInt(); |
545 |
|
void dump(int level = 0); |
546 |
|
}; |
547 |
|
typedef Ref<BitwiseOr,Node> BitwiseOrRef; |
548 |
|
|
549 |
class And : virtual public BinaryOp, virtual public IntExpr { |
class And : virtual public BinaryOp, virtual public IntExpr { |
550 |
public: |
public: |
551 |
And(IntExprRef lhs, IntExprRef rhs) : BinaryOp(lhs,rhs) {} |
And(IntExprRef lhs, IntExprRef rhs) : BinaryOp(lhs,rhs) {} |
554 |
}; |
}; |
555 |
typedef Ref<And,Node> AndRef; |
typedef Ref<And,Node> AndRef; |
556 |
|
|
557 |
|
class BitwiseAnd : virtual public BinaryOp, virtual public IntExpr { |
558 |
|
public: |
559 |
|
BitwiseAnd(IntExprRef lhs, IntExprRef rhs) : BinaryOp(lhs,rhs) {} |
560 |
|
int evalInt(); |
561 |
|
void dump(int level = 0); |
562 |
|
}; |
563 |
|
typedef Ref<BitwiseAnd,Node> BitwiseAndRef; |
564 |
|
|
565 |
class Not : virtual public IntExpr { |
class Not : virtual public IntExpr { |
566 |
IntExprRef expr; |
IntExprRef expr; |
567 |
public: |
public: |
569 |
int evalInt() { return !expr->evalInt(); } |
int evalInt() { return !expr->evalInt(); } |
570 |
void dump(int level = 0); |
void dump(int level = 0); |
571 |
bool isConstExpr() const { return expr->isConstExpr(); } |
bool isConstExpr() const { return expr->isConstExpr(); } |
572 |
|
bool isPolyphonic() const { return expr->isPolyphonic(); } |
573 |
}; |
}; |
574 |
typedef Ref<Not,Node> NotRef; |
typedef Ref<Not,Node> NotRef; |
575 |
|
|
576 |
|
class BitwiseNot : virtual public IntExpr { |
577 |
|
IntExprRef expr; |
578 |
|
public: |
579 |
|
BitwiseNot(IntExprRef expr) : expr(expr) {} |
580 |
|
int evalInt() { return ~expr->evalInt(); } |
581 |
|
void dump(int level = 0); |
582 |
|
bool isConstExpr() const { return expr->isConstExpr(); } |
583 |
|
bool isPolyphonic() const { return expr->isPolyphonic(); } |
584 |
|
}; |
585 |
|
typedef Ref<BitwiseNot,Node> BitwiseNotRef; |
586 |
|
|
587 |
class ParserContext : public VMParserContext { |
class ParserContext : public VMParserContext { |
588 |
public: |
public: |
589 |
struct Error { |
struct Error { |
594 |
|
|
595 |
void* scanner; |
void* scanner; |
596 |
std::istream* is; |
std::istream* is; |
597 |
std::vector<ParserIssue> errors; |
std::vector<ParserIssue> vErrors; |
598 |
std::vector<ParserIssue> warnings; |
std::vector<ParserIssue> vWarnings; |
599 |
std::vector<ParserIssue> issues; |
std::vector<ParserIssue> vIssues; |
600 |
|
|
601 |
std::set<String> builtinPreprocessorConditions; |
std::set<String> builtinPreprocessorConditions; |
602 |
std::set<String> userPreprocessorConditions; |
std::set<String> userPreprocessorConditions; |
603 |
|
|
604 |
std::map<String,VariableRef> vartable; |
std::map<String,VariableRef> vartable; |
605 |
|
std::map<String,StatementsRef> userFnTable; |
606 |
int globalIntVarCount; |
int globalIntVarCount; |
607 |
int globalStrVarCount; |
int globalStrVarCount; |
608 |
int polyphonicIntVarCount; |
int polyphonicIntVarCount; |
616 |
|
|
617 |
ArrayList<int>* globalIntMemory; |
ArrayList<int>* globalIntMemory; |
618 |
ArrayList<String>* globalStrMemory; |
ArrayList<String>* globalStrMemory; |
619 |
|
int requiredMaxStackSize; |
620 |
|
|
621 |
VMFunctionProvider* functionProvider; |
VMFunctionProvider* functionProvider; |
622 |
|
|
625 |
ParserContext(VMFunctionProvider* parent) : |
ParserContext(VMFunctionProvider* parent) : |
626 |
scanner(NULL), is(NULL), |
scanner(NULL), is(NULL), |
627 |
globalIntVarCount(0), globalStrVarCount(0), polyphonicIntVarCount(0), |
globalIntVarCount(0), globalStrVarCount(0), polyphonicIntVarCount(0), |
628 |
globalIntMemory(NULL), globalStrMemory(NULL), functionProvider(parent), |
globalIntMemory(NULL), globalStrMemory(NULL), requiredMaxStackSize(-1), |
629 |
execContext(NULL) |
functionProvider(parent), execContext(NULL) |
630 |
{ |
{ |
631 |
} |
} |
632 |
virtual ~ParserContext() { destroyScanner(); } |
virtual ~ParserContext(); |
633 |
VariableRef globalVar(const String& name); |
VariableRef globalVar(const String& name); |
634 |
IntVariableRef globalIntVar(const String& name); |
IntVariableRef globalIntVar(const String& name); |
635 |
StringVariableRef globalStrVar(const String& name); |
StringVariableRef globalStrVar(const String& name); |
636 |
VariableRef variableByName(const String& name); |
VariableRef variableByName(const String& name); |
637 |
void addErr(int line, const char* txt); |
StatementsRef userFunctionByName(const String& name); |
638 |
void addWrn(int line, const char* txt); |
void addErr(int firstLine, int lastLine, int firstColumn, int lastColumn, const char* txt); |
639 |
|
void addWrn(int firstLine, int lastLine, int firstColumn, int lastColumn, const char* txt); |
640 |
void createScanner(std::istream* is); |
void createScanner(std::istream* is); |
641 |
void destroyScanner(); |
void destroyScanner(); |
642 |
bool setPreprocessorCondition(const char* name); |
bool setPreprocessorCondition(const char* name); |
643 |
bool resetPreprocessorCondition(const char* name); |
bool resetPreprocessorCondition(const char* name); |
644 |
bool isPreprocessorConditionSet(const char* name); |
bool isPreprocessorConditionSet(const char* name); |
645 |
|
std::vector<ParserIssue> issues() const OVERRIDE; |
646 |
|
std::vector<ParserIssue> errors() const OVERRIDE; |
647 |
|
std::vector<ParserIssue> warnings() const OVERRIDE; |
648 |
|
VMEventHandler* eventHandler(uint index) OVERRIDE; |
649 |
|
VMEventHandler* eventHandlerByName(const String& name) OVERRIDE; |
650 |
|
void registerBuiltInConstIntVariables(const std::map<String,int>& vars); |
651 |
|
void registerBuiltInIntVariables(const std::map<String,VMIntRelPtr*>& vars); |
652 |
|
void registerBuiltInIntArrayVariables(const std::map<String,VMInt8Array*>& vars); |
653 |
|
void registerBuiltInDynVariables(const std::map<String,VMDynVar*>& vars); |
654 |
}; |
}; |
655 |
|
|
656 |
class ExecContext : public VMExecContext { |
class ExecContext : public VMExecContext { |
697 |
stackFrame = -1; |
stackFrame = -1; |
698 |
} |
} |
699 |
|
|
700 |
int suspensionTimeMicroseconds() const { |
int suspensionTimeMicroseconds() const OVERRIDE { |
701 |
return suspendMicroseconds; |
return suspendMicroseconds; |
702 |
} |
} |
703 |
}; |
}; |