public AnonymousScopeEntry GetAnonymousScope(int id) { if (this.reader == null) { throw new InvalidOperationException(); } AnonymousScopeEntry result; if (this.anonymous_scopes != null) { AnonymousScopeEntry scope; this.anonymous_scopes.TryGetValue(id, out scope); result = scope; } else { this.anonymous_scopes = new Dictionary <int, AnonymousScopeEntry>(); this.reader.BaseStream.Position = (long)this.ot.AnonymousScopeTableOffset; for (int i = 0; i < this.ot.AnonymousScopeCount; i++) { AnonymousScopeEntry scope = new AnonymousScopeEntry(this.reader); this.anonymous_scopes.Add(scope.ID, scope); } result = this.anonymous_scopes[id]; } return(result); }
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]); } }
internal void DefineCapturedScope(int scope_id, int id, string captured_name) { if (this.reader != null) { throw new InvalidOperationException(); } AnonymousScopeEntry scope = this.anonymous_scopes[scope_id]; scope.AddCapturedScope(id, captured_name); }
internal void DefineCapturedVariable(int scope_id, string name, string captured_name, CapturedVariable.CapturedKind kind) { if (this.reader != null) { throw new InvalidOperationException(); } AnonymousScopeEntry scope = this.anonymous_scopes[scope_id]; scope.AddCapturedVariable(name, captured_name, kind); }
void read_scopes() { lock (this) { if (anonymous_scopes != null) { return; } long old_pos = reader.BaseStream.Position; reader.BaseStream.Position = ot.AnonymousScopeTableOffset; anonymous_scopes = new Hashtable(); for (int i = 0; i < ot.AnonymousScopeCount; i++) { AnonymousScopeEntry scope = new AnonymousScopeEntry(reader); anonymous_scopes.Add(scope.ID, scope); } reader.BaseStream.Position = old_pos; } }
public AnonymousScopeEntry GetAnonymousScope(int id) { if (reader == null) { throw new InvalidOperationException(); } lock (this) { if (anonymous_scopes != null) { return((AnonymousScopeEntry)anonymous_scopes [id]); } anonymous_scopes = new Hashtable(); reader.BaseStream.Position = ot.AnonymousScopeTableOffset; for (int i = 0; i < ot.AnonymousScopeCount; i++) { AnonymousScopeEntry scope = new AnonymousScopeEntry(reader); anonymous_scopes.Add(scope.ID, scope); } return((AnonymousScopeEntry)anonymous_scopes [id]); } }
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]; } }
public AnonymousScopeEntry GetAnonymousScope(int id) { if (reader == null) throw new InvalidOperationException (); lock (this) { if (anonymous_scopes != null) return (AnonymousScopeEntry) anonymous_scopes [id]; anonymous_scopes = new Hashtable (); reader.BaseStream.Position = ot.AnonymousScopeTableOffset; for (int i = 0; i < ot.AnonymousScopeCount; i++) { AnonymousScopeEntry scope = new AnonymousScopeEntry (reader); anonymous_scopes.Add (scope.ID, scope); } return (AnonymousScopeEntry) anonymous_scopes [id]; } }
public AnonymousScopeEntry GetAnonymousScope(int id) { if (this.reader == null) { throw new InvalidOperationException(); } AnonymousScopeEntry result; if (this.anonymous_scopes != null) { AnonymousScopeEntry scope; this.anonymous_scopes.TryGetValue(id, out scope); result = scope; } else { this.anonymous_scopes = new Dictionary<int, AnonymousScopeEntry>(); this.reader.BaseStream.Position = (long)this.ot.AnonymousScopeTableOffset; for (int i = 0; i < this.ot.AnonymousScopeCount; i++) { AnonymousScopeEntry scope = new AnonymousScopeEntry(this.reader); this.anonymous_scopes.Add(scope.ID, scope); } result = this.anonymous_scopes[id]; } return result; }
void read_scopes() { lock (this) { if (anonymous_scopes != null) return; long old_pos = reader.BaseStream.Position; reader.BaseStream.Position = ot.AnonymousScopeTableOffset; anonymous_scopes = new Hashtable (); for (int i = 0; i < ot.AnonymousScopeCount; i++) { AnonymousScopeEntry scope = new AnonymousScopeEntry (reader); anonymous_scopes.Add (scope.ID, scope); } reader.BaseStream.Position = old_pos; } }
protected void CheckAnonymousScope(AnonymousScopeEntry scope) { Debug ("Anonymous scope: {0}", scope); foreach (CapturedScope captured in scope.CapturedScopes) { if (File.GetAnonymousScope (captured.Scope) == null) throw new MonoSymbolFileException ("Anonymous scope {0} has invalid captured scopes.", scope.ID); } }