Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
        /// <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);
            }
        }
Exemplo n.º 6
0
        /// <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);
            }
        }
Exemplo n.º 7
0
 /// <inheritdoc />
 public CopySet(CopySet <T> set)
 {
     valueSet = new HashSet <T>(set.valueSet);
 }
Exemplo n.º 8
0
 /// <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();
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CopyMemoryAlias"/> class.
 /// </summary>
 public CopyMemoryAlias()
 {
     mayAliases  = new CopySet <MemoryIndex>();
     mustAliases = new CopySet <MemoryIndex>();
 }