Пример #1
0
        /// <inheritdoc />
        public IVariableState <IConcreteValue> Copy()
        {
            var result = new CilVariableState(_valueFactory);

            foreach (var entry in _variables)
            {
                result._variables.Add(entry.Key, (IConcreteValue)entry.Value.Copy());
            }

            return(result);
        }
Пример #2
0
 /// <summary>
 /// Creates a new empty instance of the <see cref="CilProgramState"/> class.
 /// </summary>
 public CilProgramState(IValueFactory valueFactory)
 {
     Stack = new StackState<ICliValue>();
     Variables = new CilVariableState(valueFactory);
 }
Пример #3
0
 /// <summary>
 /// Creates a new empty instance of the <see cref="CilProgramState"/> class.
 /// </summary>
 public CilProgramState(IValueFactory valueFactory)
 {
     _valueFactory = valueFactory ?? throw new ArgumentNullException(nameof(valueFactory));
     Stack         = new StackState <IConcreteValue>();
     Variables     = new CilVariableState(valueFactory);
 }