Exemplo n.º 1
0
 public VMException(FunctionDefn defn, string filename, Statement st, Exception inner)
     : base("", inner)
 {
     this.defn = defn;
     this.st = st;
     this.filename = filename;
 }
Exemplo n.º 2
0
 public bool ImplementsMethod(FunctionDefn f)
 {
     List<FunctionDefn> matches = new List<FunctionDefn>(GetMethods(f.name));
     foreach (FunctionDefn fd in matches)
         if (fd.Matches(f))
             return true;
     return false;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="f"></param>
 /// <param name="self"></param>
 public Frame(FunctionDefn f, ClassInstance self, ModuleInstance mi)
 {
     this.function = f;
     this.self = self;
     moduleInstance = mi;
     if (self != null)
         moduleDef = self.Type.GetModule();
     AddScope(new Scope());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new frame, and returns a frame manager, which will release the frame
 /// on Dispose.
 /// </summary>
 /// <param name="fun"></param>
 /// <param name="classInstance"></param>
 /// <returns></returns>
 public DisposableFrame CreateFrame(FunctionDefn fun, ClassInstance classInstance, ModuleInstance mi)
 {
     return new DisposableFrame(this, fun, classInstance, mi);
 }
Exemplo n.º 5
0
 public DisposableFrame(VM vm, FunctionDefn def, ClassInstance ci, ModuleInstance mi)
 {
     this.vm = vm;
     vm.PushNewFrame(def, ci, mi);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Called when a new function execution starts.
 /// </summary>
 /// <param name="f"></param>
 /// <param name="self"></param>
 public void PushNewFrame(FunctionDefn f, ClassInstance self, ModuleInstance mi)
 {
     frames.Add(new Frame(f, self, mi));
 }
Exemplo n.º 7
0
 public void AddMethod(FunctionDefn x)
 {
     methods.Add(x);
 }
Exemplo n.º 8
0
 public FunctionValue(HeronValue self, FunctionDefn f)
 {
     this.self = self;
     fun = f;
 }