예제 #1
0
        public void FuncStackTest()
        {
            var sut = new FuncStack();

            sut.Should().NotBeNull();
            sut.Stack.Should().NotBeNull();
            sut.Stack.Should().BeEmpty();
        }
예제 #2
0
        public void PopTest()
        {
            var sut = new FuncStack();

            sut.Should().NotBeNull();
            sut.Push(5.AsFun()); // assume push works
            sut.Pop();
            sut.Stack.Should().BeEmpty();
        }
예제 #3
0
        public void PushTest()
        {
            var sut = new FuncStack();

            sut.Should().NotBeNull();
            sut.Stack.Should().NotBeNull();
            sut.Stack.Should().BeEmpty();
            sut.Push(5.AsFun());
            sut.Stack.Should().NotBeEmpty();
        }
예제 #4
0
 public Core(VM vm, int id) : base("Core", id)
 {
     this.vm = vm;
     this.native_interface = new NativeInterface(this.vm, this);
     this.state            = new CoreState(id, new CoreErrorHandler(), 0, false, 0);
     this.pc         = 0;
     this.locals     = new WItem[0];
     this.traceback  = new TraceBack();
     this.func_stack = new FuncStack(this);
     this.exec_stack = new ExecStack(this);
 }