--- linuxsampler/trunk/src/scriptvm/tree.h 2020/08/06 11:45:24 3803 +++ linuxsampler/trunk/src/scriptvm/tree.h 2020/08/06 12:15:02 3804 @@ -668,14 +668,26 @@ }; typedef Ref NoFunctionCallRef; -class EventHandler : virtual public Statements, virtual public VMEventHandler { +class Subroutine : public Statements { StatementsRef statements; +public: + Subroutine(StatementsRef statements); + Statement* statement(uint i) OVERRIDE { return statements->statement(i); } + void dump(int level = 0) OVERRIDE; +}; +typedef Ref SubroutineRef; + +class UserFunction : public Subroutine { +public: + UserFunction(StatementsRef statements); +}; +typedef Ref UserFunctionRef; + +class EventHandler : public Subroutine, virtual public VMEventHandler { bool usingPolyphonics; public: void dump(int level = 0) OVERRIDE; - StmtFlags_t exec(); EventHandler(StatementsRef statements); - Statement* statement(uint i) OVERRIDE { return statements->statement(i); } bool isPolyphonic() const OVERRIDE { return usingPolyphonics; } }; typedef Ref EventHandlerRef; @@ -964,7 +976,7 @@ std::set userPreprocessorConditions; std::map vartable; - std::map userFnTable; + std::map userFnTable; vmint globalIntVarCount; vmint globalRealVarCount; vmint globalStrVarCount; @@ -1010,7 +1022,7 @@ RealVariableRef globalRealVar(const String& name); StringVariableRef globalStrVar(const String& name); VariableRef variableByName(const String& name); - StatementsRef userFunctionByName(const String& name); + UserFunctionRef userFunctionByName(const String& name); void addErr(int firstLine, int lastLine, int firstColumn, int lastColumn, int firstByte, int lengthBytes, const char* txt); void addWrn(int firstLine, int lastLine, int firstColumn, int lastColumn,