コード例 #1
0
ファイル: Mutator.cs プロジェクト: OlliSaarikivi/Automata
 public Mutator WithAssignment(Accessor accessor, Mutator value)
 {
     if (accessor == null)
     {
         return(value.Cast(GetSortMapping()));
     }
     else
     {
         return(accessor.AcceptAssignment(this, value));
     }
 }
コード例 #2
0
        /// <summary>
        /// Return a new instance with the assignment applied. Unchanged field reuse the existing <see cref="Mutator"/> instances.
        /// </summary>
        /// <param name="accessor"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override Mutator WithAssignment(FieldAccessor accessor, Mutator value)
        {
            var newMutators = _sortMapping.FieldSymbols.Zip(_fieldMutators, (Symbol, Mutator) => new { Symbol, Mutator }).Select(x =>
            {
                if (x.Symbol == accessor.Symbol)
                {
                    return(x.Mutator.WithAssignment(accessor.Next, value));
                }
                else
                {
                    return(x.Mutator);
                }
            });

            return(new StructMutator(_sortMapping, newMutators));
        }
コード例 #3
0
ファイル: Mutator.cs プロジェクト: OlliSaarikivi/Automata
 public Mutator WithAssignment(ParameterAccessor accessor, Mutator value)
 {
     Debug.Assert(false, "A parameter access reached a Mutator?!");
     throw new NotImplementedException();
 }
コード例 #4
0
ファイル: Mutator.cs プロジェクト: OlliSaarikivi/Automata
 public virtual Mutator WithAssignment(FieldAccessor accessor, Mutator value)
 {
     throw new NotImplementedException();
 }