Пример #1
0
 public override void Execute(CPU cpu)
 {
     object value1 = cpu.PopStack();
     object value2 = cpu.PopStack();
     cpu.PushStack(value1);
     cpu.PushStack(value2);
 }
Пример #2
0
 public override void Execute(CPU cpu)
 {
     object value = cpu.PopValue();
     string identifier = (string)cpu.PopStack();
     cpu.SetValue(identifier, value);
 }
Пример #3
0
 public override void Execute(CPU cpu)
 {
     cpu.PopStack();
 }
Пример #4
0
        public override void Execute(CPU cpu)
        {
            object value = cpu.PopValue();
            string suffixName = cpu.PopStack().ToString().ToUpper();
            object specialValue = cpu.PopValue();

            if (specialValue is SpecialValue)
            {
                if (!((SpecialValue)specialValue).SetSuffix(suffixName, value))
                {
                    throw new Exception(string.Format("Suffix {0} not found on object", suffixName));
                }
            }
            else
            {
                throw new Exception(string.Format("Values of type {0} cannot have suffixes", specialValue.GetType().ToString()));
            }
        }
Пример #5
0
 public override void Execute(CPU cpu)
 {
     object identifier = cpu.PopStack();
     if (identifier != null)
     {
         cpu.RemoveVariable(identifier.ToString());
     }
     else
     {
         cpu.RemoveAllVariables();
     }
 }