Exemplo n.º 1
0
 public static void MakeArray(MemoryBlock memory, AsquellObj to, params AsquellObj[] values)
 {
     if (to.Type == AsquellObjectType.RunTimeValue)
     {
         ArrayObj array = new ArrayObj(values);
         memory.ModifyVariable(to, array.BaseObj);
         return;
     }
     throw new ArgumentException("Invalid type for modifying memory! First argument must be a variable!");
 }
Exemplo n.º 2
0
 public static void PowerNumbers(MemoryBlock memory, AsquellObj a, AsquellObj b, AsquellObj storeResult)
 {
     NumericObj NumA = getNumericObj(a, memory);
     NumericObj NumB = getNumericObj(b, memory);
     if (NumA != null && NumB != null)
     {
         memory.ModifyVariable(storeResult, (NumA ^ NumB).BaseObj);
         return;
     }
     throw new ArgumentException("Invalid type for power!");
 }
Exemplo n.º 3
0
 public static void MoveMemory(MemoryBlock memory, AsquellObj to, AsquellObj from)
 {
     if (from.Type == AsquellObjectType.RunTimeValue)
     {
         if (memory.VariableInMemory(from))
         {
             AsquellObj rawValue = memory.GetRealVariable(from);
             memory.ModifyVariable(to, rawValue);
             memory.DeleteVariable(from);
             return;
         }
         else
         {
             throw new KeyNotFoundException("Can not find '"+from.Value.ToString()+"' in memory!");
         }
     }
     throw new ArgumentException("Invalid type for moving memory! First argument must be a variable!");
 }
Exemplo n.º 4
0
 public static void SetMemory(MemoryBlock memory, AsquellObj to, AsquellObj from)
 {
     memory.ModifyVariable(to, from);
 }