Beispiel #1
0
 public override void Execute(NetStack stack)
 {
     dynamic r = stack.Pop();
     dynamic l = stack.Pop();
     stack.Push(l + r);
     //throw new ArgumentException(string.Format("Cannot add operands of type {0} and {1}", l.GetType().Name, r.GetType().Name));
 }
Beispiel #2
0
        public override void Execute(NetStack stack)
        {
            var condition = stack.Pop<Statement>();
            var body = stack.Pop<Statement>();

            condition.Evaluate(stack);
            var result = stack.Pop<bool>();
            while (result)
            {
                body.Evaluate(stack);
                condition.Evaluate(stack);
                result = stack.Pop<bool>();
            }
        }
Beispiel #3
0
 public override void Execute(NetStack stack)
 {
     var statement = stack.Pop() as Statement;
     statement.Evaluate(stack);
 }
Beispiel #4
0
 public override void Execute(NetStack stack)
 {
     var label = stack.Pop<string>();
     stack.Push(new FunctionLabel(label));
 }
Beispiel #5
0
 public override void Execute(NetStack stack)
 {
     var top = stack.Pop();
     var bottom = stack.Pop();
     stack.Push(top).Push(bottom);
 }
Beispiel #6
0
 public override void Execute(NetStack stack)
 {
     dynamic r = stack.Pop();
     dynamic l = stack.Pop();
     stack.Push(l > r);
 }
Beispiel #7
0
 public override void Execute(NetStack stack)
 {
     var l = stack.Pop();
     var r = stack.Pop();
     stack.Push(l.Equals(r));
 }
Beispiel #8
0
 public override void Execute(NetStack stack)
 {
     var val = stack.Pop();
     stack.Push(val).Push(val);
 }
Beispiel #9
0
 public override void Execute(NetStack stack)
 {
     stack.Push(stack.Pop<long>() - 1);
 }
Beispiel #10
0
 public override void Execute(NetStack stack)
 {
     dynamic variable = stack.Pop();
     stack.Push(++variable);
 }
Beispiel #11
0
 public override void Execute(NetStack stack)
 {
     var offset = stack.Pop<long>();
     var value = stack.Peek(offset);
     stack.Push(value);
 }
Beispiel #12
0
 public override void Execute(NetStack stack)
 {
     stack.Push(new Parser().Parse(stack.Pop<string>()));
 }
Beispiel #13
0
 public override void Execute(NetStack stack)
 {
     stack.Pop();
 }
Beispiel #14
0
 public override void Execute(NetStack stack)
 {
     var label = stack.Pop<FunctionLabel>();
     var body = stack.Pop<Statement>();
     stack.BindFunction(body, label.Label);
 }