Exemple #1
0
 public object Clone(int id, Frame parent)
 {
     return new Frame()
     {
         Parent = parent,
         Id = id,
         EntryPoint = EntryPoint,
         ArgsCount = ArgsCount
     };
 }
Exemple #2
0
 protected void Call(object arg)
 {
     Frame frame = new Frame();
     frame.Parent = Memory.PeekFrame();
     frame.Id = frame.Parent.Id + 1;
     frame.Parent.EntryPoint = Module.Code.Pointer;
     Function function = Memory.GetVariable(arg.ToString()).AsFunction();
     int argsCount = Int32.Parse(StackVM.Pop().Value.ToString());
     for (int i = 0; i < argsCount - function.ArgsNumber; i++)
     {
         StackVM.Pop();
     }
     if (function == null)
     {
         throw new CodeException(Module.Code.Pointer.ToString() + ": " + arg.ToString() + " is not a function");
     }
     Memory.PushFrame(frame);
     Go(function.EntryPoint);
 }
Exemple #3
0
 public void Push(Frame frame)
 {
     frameStack.Push(frame);
 }
Exemple #4
0
 public void AddFrame(Frame frame)
 {
     frames.Add(frame.Id, frame);
 }