/[svn]/linuxsampler/trunk/src/scriptvm/tree.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/tree.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3311 by schoenebeck, Sat Jul 15 16:24:59 2017 UTC revision 3551 by schoenebeck, Thu Aug 1 10:22:56 2019 UTC
# Line 1  Line 1 
1  /*                                                              -*- c++ -*-  /*                                                              -*- c++ -*-
2   *   *
3   * Copyright (c) 2014 - 2017 Christian Schoenebeck and Andreas Persson   * Copyright (c) 2014 - 2019 Christian Schoenebeck and Andreas Persson
4   *   *
5   * http://www.linuxsampler.org   * http://www.linuxsampler.org
6   *   *
# Line 82  public: Line 82  public:
82  typedef Ref<StringExpr,Node> StringExprRef;  typedef Ref<StringExpr,Node> StringExprRef;
83    
84  class IntLiteral : virtual public IntExpr {  class IntLiteral : virtual public IntExpr {
     int value;  
85  public:  public:
86        int value;
87      IntLiteral(int value) : value(value) { }      IntLiteral(int value) : value(value) { }
88      int evalInt();      int evalInt();
89      void dump(int level = 0);      void dump(int level = 0);
# Line 197  class BuiltInIntArrayVariable : public I Line 197  class BuiltInIntArrayVariable : public I
197      VMInt8Array* array;      VMInt8Array* array;
198  public:  public:
199      BuiltInIntArrayVariable(const String& name, VMInt8Array* array);      BuiltInIntArrayVariable(const String& name, VMInt8Array* array);
200      int arraySize() const { return array->size; }      int arraySize() const OVERRIDE { return array->size; }
201      int evalIntElement(uint i);      int evalIntElement(uint i) OVERRIDE;
202      bool isAssignable() const OVERRIDE { return !array->readonly; }      bool isAssignable() const OVERRIDE { return !array->readonly; }
203      void assignIntElement(uint i, int value);      void assignIntElement(uint i, int value) OVERRIDE;
204      void dump(int level = 0);      void dump(int level = 0) OVERRIDE;
205  };  };
206  typedef Ref<BuiltInIntArrayVariable,Node> BuiltInIntArrayVariableRef;  typedef Ref<BuiltInIntArrayVariable,Node> BuiltInIntArrayVariableRef;
207    
# Line 350  public: Line 350  public:
350      String evalCastToStr() OVERRIDE;      String evalCastToStr() OVERRIDE;
351      int arraySize() const OVERRIDE { return dynVar->asIntArray()->arraySize(); }      int arraySize() const OVERRIDE { return dynVar->asIntArray()->arraySize(); }
352      int evalIntElement(uint i) OVERRIDE { return dynVar->asIntArray()->evalIntElement(i); }      int evalIntElement(uint i) OVERRIDE { return dynVar->asIntArray()->evalIntElement(i); }
353      void assignIntElement(uint i, int value) { return dynVar->asIntArray()->assignIntElement(i, value); }      void assignIntElement(uint i, int value) OVERRIDE { return dynVar->asIntArray()->assignIntElement(i, value); }
354      void dump(int level = 0) OVERRIDE;      void dump(int level = 0) OVERRIDE;
355  };  };
356  typedef Ref<DynamicVariableCall,Node> DynamicVariableCallRef;  typedef Ref<DynamicVariableCall,Node> DynamicVariableCallRef;
# Line 709  public: Line 709  public:
709      int stackFrame;      int stackFrame;
710      int suspendMicroseconds;      int suspendMicroseconds;
711      size_t instructionsCount;      size_t instructionsCount;
712        struct ExitRes {
713            Expression* value;
714            IntLiteral intLiteral;
715            StringLiteral stringLiteral;
716    
717      ExecContext() :          ExitRes() : intLiteral(0), stringLiteral("") { }
718          status(VM_EXEC_NOT_RUNNING), flags(STMT_SUCCESS), stackFrame(-1),      } exitRes;
         suspendMicroseconds(0), instructionsCount(0) {}  
719    
720        ExecContext();
721      virtual ~ExecContext() {}      virtual ~ExecContext() {}
722    
723      inline void pushStack(Statement* stmt) {      inline void pushStack(Statement* stmt) {
# Line 738  public: Line 742  public:
742          flags = STMT_SUCCESS;          flags = STMT_SUCCESS;
743      }      }
744    
745        inline void clearExitRes() {
746            exitRes.value = NULL;
747        }
748    
749      int suspensionTimeMicroseconds() const OVERRIDE {      int suspensionTimeMicroseconds() const OVERRIDE {
750          return suspendMicroseconds;          return suspendMicroseconds;
751      }      }
# Line 756  public: Line 764  public:
764      }      }
765    
766      void forkTo(VMExecContext* ectx) const OVERRIDE;      void forkTo(VMExecContext* ectx) const OVERRIDE;
767    
768        VMExpr* exitResult() OVERRIDE {
769            return exitRes.value;
770        }
771  };  };
772    
773  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.3311  
changed lines
  Added in v.3551

  ViewVC Help
Powered by ViewVC