Exemplo n.º 1
0
 private string TrashToString(Storage o)
 {
     RegisterStorage rst = o as RegisterStorage;
     if (rst != null)
         return rst.Name;
     return o.ToString();
 }
Exemplo n.º 2
0
Arquivo: Frame.cs Projeto: uxmal/reko
 public Identifier EnsureIdentifier(Storage stgForeign)
 {
     var reg = stgForeign as RegisterStorage;
     if (reg != null)
         return EnsureRegister(reg);
     var grf = stgForeign as FlagGroupStorage;
     if (grf != null)
         return EnsureFlagGroup(grf);
     var seq = stgForeign as SequenceStorage;
     if (seq != null)
         return EnsureSequence(
             seq.Head, 
             seq.Tail, 
             PrimitiveType.CreateWord(
                 (int)(seq.Head.BitSize + seq.Tail.BitSize)/DataType.BitsPerByte));
     var fp = stgForeign as FpuStackStorage;
     if (fp != null)
         return EnsureFpuStackVariable(fp.FpuStackOffset, fp.DataType);
     var st = stgForeign as StackStorage;
     if (st != null)
         return EnsureStackVariable(st.StackOffset, st.DataType);
     throw new NotImplementedException(string.Format(
         "Unsupported storage {0}.",
         stgForeign != null ? stgForeign.ToString() : "(null)"));
 }