public void Allocate() { if (SymbolTable.MemFree < size_) { throw new Exception( string.Format("Insufficient memory to allocate the array \"{0}\"!", name_)); } for (int i = 0; i < size_; i++) { string elementName = string.Format("{0}[{1}]", name_, i); SymbolTable.Add(elementName); SymbolTable.Set(elementName, null); } }
public SILArray(string name, params ISILObject[] elements) { if (elements.Length > 8192) { throw new Exception("Array is too big, must be 8192 elements or less!"); } // allocate space for the strings name_ = name; // deep copy foreach (ISILObject e in elements) { string elementName = string.Format("{0}[{1}]", name_, size_++); SymbolTable.Add(elementName); SymbolTable.Set(elementName, (SILInteger)e.Value); } }
static void INTEGER_Execute(SIL_Action action) { string silVar = (string)action.ParsingArgs[0]; SymbolTable.Add(silVar); }