Пример #1
0
        public AnonymousScopeEntry GetAnonymousScope(int id)
        {
            if (reader == null)
            {
                throw new InvalidOperationException();
            }

            AnonymousScopeEntry scope;

            lock (this) {
                if (anonymous_scopes != null)
                {
                    anonymous_scopes.TryGetValue(id, out scope);
                    return(scope);
                }

                anonymous_scopes           = new Dictionary <int, AnonymousScopeEntry> ();
                reader.BaseStream.Position = ot.AnonymousScopeTableOffset;
                for (int i = 0; i < ot.AnonymousScopeCount; i++)
                {
                    scope = new AnonymousScopeEntry(reader);
                    anonymous_scopes.Add(scope.ID, scope);
                }

                return(anonymous_scopes [id]);
            }
        }
Пример #2
0
        internal void DefineCapturedScope(int scope_id, int id, string captured_name)
        {
            if (reader != null)
            {
                throw new InvalidOperationException();
            }

            AnonymousScopeEntry scope = anonymous_scopes [scope_id];

            scope.AddCapturedScope(id, captured_name);
        }
Пример #3
0
        internal void DefineCapturedVariable(int scope_id, string name, string captured_name,
                                             CapturedVariable.CapturedKind kind)
        {
            if (reader != null)
            {
                throw new InvalidOperationException();
            }

            AnonymousScopeEntry scope = anonymous_scopes [scope_id];

            scope.AddCapturedVariable(name, captured_name, kind);
        }