internal void SetData(ModuleGlobalWrapper[] data) {
     _data = data;
     _names = new SymbolId[data.Length];
     for (int i = 0; i < data.Length; i++) {
         _names[i] = data[i].Name;
     }
 }
Exemple #2
0
        void IModuleDictionaryInitialization.InitializeModuleDictionary(CodeContext context)
        {
            if (_names.Length == 0)
            {
                return;
            }

            if (_data[0] != null)
            {
                throw Error.AlreadyInitialized();
            }

            for (int i = 0; i < _names.Length; i++)
            {
                _data[i] = new ModuleGlobalWrapper(context, _names[i]);
            }
        }
 private ModuleGlobalWrapper GetWrapper(GlobalVariableExpression node) {
     ModuleGlobalWrapper ret;
     if (!_wrappers.TryGetValue(node, out ret)) {
         ret = new ModuleGlobalWrapper(_codeContext, SymbolTable.StringToId(node.Name));
         _wrappers[node] = ret;
     }
     return ret;
 }
 public GlobalSetExpression(ModuleGlobalWrapper global, Expression value) : base(global) {
     this._value = value;
 }
 public GlobalGetExpression(ModuleGlobalWrapper global) {
     this._global = global;
 }
        void IModuleDictionaryInitialization.InitializeModuleDictionary(CodeContext context) {
            if (_names.Length == 0) {
                return;
            }

            if (_data[0] != null) {
                throw Error.AlreadyInitialized();
            }

            for (int i = 0; i < _names.Length; i++) {
                _data[i] = new ModuleGlobalWrapper(context, _names[i]);
            }
        }