Beispiel #1
0
        internal override void Execute(ref int ip, ValueStack valueStack, EnvironmentStack envStack, CallStack callStack)
        {
            List<Variable> values = new List<Variable>();

            for (int i = 0; i < NumberOfPushedArguments; ++i)
            {
                Symbol symbol = (Symbol)valueStack.Pop();
                values.Add(envStack.Get(symbol));
            }
            values.Reverse();
            valueStack.Push(new Closure((IP)valueStack.Pop(), values));
            ip += Length;
        }
Beispiel #2
0
 internal override void Execute(ref int ip, ValueStack valueStack, EnvironmentStack envStack, CallStack callStack)
 {
     object o = valueStack.Pop();
     envStack.Get(Symbol).SetValue(o);
     ip += Length;
 }
Beispiel #3
0
 internal override void Execute(ref int ip, ValueStack valueStack, EnvironmentStack envStack, CallStack callStack)
 {
     object o = valueStack.Pop();
     if (o is Variable) envStack.Set(Symbol, (Variable)o); // Link to variable, e.g. in Closure
     else
     {
         if (envStack.HasVariable(Symbol))
             envStack.Get(Symbol).SetValue(o);
         else
             envStack.Set(Symbol, new Variable(o));
     }
     ip += Length;
 }
Beispiel #4
0
 internal override void Execute(ref int ip, ValueStack valueStack, EnvironmentStack envStack, CallStack callStack)
 {
     valueStack.Push(envStack.Get(Symbol).GetValue());
     ip += Length;
 }