Beispiel #1
0
 internal static void Check(FormalValueAccess[] accesses)
 {
     var ss = accesses.Select(x => x.Size).Distinct().ToArray();
     if(ss.Length != 1 || ss[0] != accesses.ToArray().Length)
         Tracer.FlaggedLine("Size problem");
     var ii = accesses.Select((x, i) => i - x.Index).Distinct().ToArray();
     if(ii.Length != 1 || ii[0] != 0)
         Tracer.FlaggedLine("Consequtivity problem");
 }
Beispiel #2
0
 public static IFormalValue[] Transpose(FormalValueAccess[] accesses)
 {
     var distinctAccesses = accesses.Distinct().ToArray();
     if(distinctAccesses.Length == 1 && distinctAccesses[0] == null)
         return new IFormalValue[1];
     var result = accesses.Select(x => x == null ? null : x.FormalValue).Distinct().ToArray();
     foreach(var formalValue in result)
         if(formalValue != null)
             formalValue.Check(accesses.Where(x => x != null && x.FormalValue == formalValue).ToArray());
     return result;
 }
Beispiel #3
0
 void IFormalValue.Check(FormalValueAccess[] formalValueAccesses) { }
Beispiel #4
0
 void IFormalValue.Check(FormalValueAccess[] accesses) => FormalValueAccess.Check(accesses);
Beispiel #5
0
 void SetFormalValues(IFormalValue element, int startAddress, Size size)
 {
     var size1 = size.ToInt();
     for(var i = 0; i < size1; i++)
         _data[i + startAddress] = new FormalValueAccess(element, i, size1);
 }
Beispiel #6
0
 IFormalValue CreateValuesInFrame(Size size, Size offset)
 {
     var element = FormalValueAccess.Variable(Names[_nextValue++]);
     var size1 = size.ToInt();
     var start = _frameData.Length + offset.ToInt();
     for(var i = 0; i < size1; i++)
         _frameData[i + start] = new FormalValueAccess(element, i, size1);
     return element;
 }