示例#1
0
 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;
     }
 }
示例#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]);
            }
        }
示例#3
0
 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;
 }
示例#4
0
 public GlobalSetExpression(ModuleGlobalWrapper global, Expression value) : base(global) {
     this._value = value;
 }
示例#5
0
 public GlobalGetExpression(ModuleGlobalWrapper global) {
     this._global = global;
 }
示例#6
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]);
            }
        }