/// <summary> /// Initializes a new instance of the <see cref="CopyStackContext"/> class. /// </summary> /// <param name="context">The context.</param> public CopyStackContext(CopyStackContext context) { this.variables = context.variables.Clone(); this.controllVariables = context.controllVariables.Clone(); this.temporaryVariables = context.temporaryVariables.Clone(); this.arrays = context.arrays.Clone(); StackLevel = context.StackLevel; }
/// <summary> /// Initializes a new instance of the <see cref="CopyStackContext" /> class. /// </summary> /// <param name="stackLevel">The stack level.</param> public CopyStackContext(int stackLevel) { this.variables = new CopyIndexContainer(); this.controllVariables = new CopyIndexContainer(); this.temporaryVariables = new CopySet <MemoryIndex>(); this.arrays = new CopySet <AssociativeArray>(); StackLevel = stackLevel; }
/// <inheritdoc /> public override void AddCallArray(AssociativeArray array, Snapshot snapshot) { CopySet <Snapshot> snapshots; if (!callArrays.TryGetValue(array, out snapshots)) { snapshots = new CopySet <Snapshot>(); callArrays[array] = snapshots; } snapshots.Add(snapshot); }
/// <summary> /// Sets all given declaration for declarations with given name. /// </summary> /// <param name="key">The key.</param> /// <param name="values">The values.</param> public void SetAll(QualifiedName key, IEnumerable <T> values) { CopySet <T> set; if (!declarations.TryGetValue(key, out set)) { set = new CopySet <T>(); declarations[key] = set; } set.Clear(); set.AddAll(values); }
/// <inheritdoc /> public override bool TryGetCallArraySnapshot(AssociativeArray array, out IEnumerable <Snapshot> snapshots) { CopySet <Snapshot> snapshotSet = null; if (callArrays.TryGetValue(array, out snapshotSet)) { snapshots = snapshotSet; return(true); } else { snapshots = null; return(false); } }
/// <summary> /// Adds new declaration into the structure. If there /// </summary> /// <param name="key">The key.</param> /// <param name="value">The value.</param> public void Add(QualifiedName key, T value) { CopySet <T> set; if (!declarations.TryGetValue(key, out set)) { set = new CopySet <T>(); declarations[key] = set; } if (!set.Contains(value)) { set.Add(value); } }
/// <inheritdoc /> public CopySet(CopySet <T> set) { valueSet = new HashSet <T>(set.valueSet); }
/// <summary> /// Initializes a new instance of the <see cref="CopyMemoryAlias"/> class. /// </summary> /// <param name="memoryAlias">The memory alias.</param> public CopyMemoryAlias(CopyMemoryAlias memoryAlias) { this.sourceIndex = memoryAlias.sourceIndex; this.mayAliases = memoryAlias.mayAliases.Clone(); this.mustAliases = memoryAlias.mustAliases.Clone(); }
/// <summary> /// Initializes a new instance of the <see cref="CopyMemoryAlias"/> class. /// </summary> public CopyMemoryAlias() { mayAliases = new CopySet <MemoryIndex>(); mustAliases = new CopySet <MemoryIndex>(); }