コード例 #1
0
 public static Dictionary <MemberIdentifier, CodeSpan> GenerateMemberMapping(string assemblyFilePath, StringWriter writer, List <WritingInfo> writingInfos)
 {
     stackVariable1 = writer.ToString();
     V_0            = new Dictionary <MemberIdentifier, CodeSpan>();
     V_1            = new TwoDimensionalString(stackVariable1, writer.get_NewLine(), false);
     V_2            = writingInfos.GetEnumerator();
     try
     {
         while (V_2.MoveNext())
         {
             V_3 = V_2.get_Current().get_MemberDeclarationToCodePostionMap().GetEnumerator();
             try
             {
                 while (V_3.MoveNext())
                 {
                     V_4 = V_3.get_Current();
                     V_5 = V_4.get_Key();
                     V_6 = V_4.get_Value();
                     V_7 = ExternallyVisibleDecompilationUtilities.GetSpan(V_1, V_1.TrimStart(V_6));
                     V_0.Add(ExternallyVisibleDecompilationUtilities.GetIdentifier(assemblyFilePath, V_5), V_7);
                 }
             }
             finally
             {
                 ((IDisposable)V_3).Dispose();
             }
         }
     }
     finally
     {
         ((IDisposable)V_2).Dispose();
     }
     return(V_0);
 }
コード例 #2
0
 private bool[] MinimumVertexCover(List <KeyValuePair <int, int> > maxCardinalMatching)
 {
     V_0 = new Boolean[this.size];
     V_1 = new Boolean[this.size * 2];
     V_3 = maxCardinalMatching.GetEnumerator();
     try
     {
         while (V_3.MoveNext())
         {
             V_4       = V_3.get_Current();
             V_5       = V_4.get_Key();
             V_6       = V_4.get_Value();
             V_0[V_5]  = true;
             dummyVar0 = this.equalityGraph[V_5].Remove(V_6);
             this.equalityGraph[V_6] = new List <int>();
             this.equalityGraph[V_6].Add(V_5);
         }
     }
     finally
     {
         ((IDisposable)V_3).Dispose();
     }
     V_7 = 0;
     while (V_7 < this.size)
     {
         if (!V_0[V_7])
         {
             this.KonigDFS(V_7, V_1);
         }
         V_7 = V_7 + 1;
     }
     V_2 = new Boolean[this.size * 2];
     V_8 = 0;
     while (V_8 < this.size)
     {
         V_2[V_8] = !V_1[V_8];
         V_8      = V_8 + 1;
     }
     V_9 = 0;
     while (V_9 < this.size)
     {
         V_2[V_9 + this.size] = V_1[V_9 + this.size];
         V_9 = V_9 + 1;
     }
     return(V_2);
 }
コード例 #3
0
 private bool TryMatchCondition(Expression condition, BlockStatement block, CreateCompilerOptimizedSwitchByStringStatementsStep.SwitchData data)
 {
     if (condition.get_CodeNodeType() != 23 && condition.get_CodeNodeType() != 24)
     {
         return(false);
     }
     if (condition.get_CodeNodeType() != 24)
     {
         V_5 = condition as UnaryExpression;
         if (V_5.get_Operator() != 11 || V_5.get_Operand().get_CodeNodeType() != 24)
         {
             return(false);
         }
         V_0 = V_5.get_Operand() as BinaryExpression;
     }
     else
     {
         V_0 = condition as BinaryExpression;
         if (V_0.get_Operator() == 11)
         {
             if (!this.TryMatchCondition(V_0.get_Left(), null, data) || !this.TryMatchCondition(V_0.get_Right(), null, data))
             {
                 return(false);
             }
             if (block != null)
             {
                 V_2 = data.get_CaseConditionToBlockMap().get_Count() - 1;
                 V_4 = data.get_CaseConditionToBlockMap().get_Item(V_2);
                 V_3 = V_4.get_Key();
                 data.get_CaseConditionToBlockMap().set_Item(V_2, new KeyValuePair <Expression, BlockStatement>(V_3, block));
             }
             return(true);
         }
     }
     if (V_0.get_Right().get_CodeNodeType() != 22 || V_0.get_Operator() != 9)
     {
         return(false);
     }
     V_1 = V_0.get_Right() as LiteralExpression;
     if (condition.get_CodeNodeType() == 23 && String.op_Inequality(V_1.get_ExpressionType().get_FullName(), "System.String"))
     {
         return(false);
     }
     if (condition.get_CodeNodeType() == 24 && String.op_Inequality(V_1.get_ExpressionType().get_FullName(), "System.Object") || V_1.get_Value() != null)
     {
         return(false);
     }
     if (data.get_SwitchExpression() != null)
     {
         if (!data.get_SwitchExpression().Equals(V_0.get_Left()))
         {
             return(false);
         }
         data.get_SwitchExpressionLoadInstructions().Add(V_0.get_Left().get_UnderlyingSameMethodInstructions().First <Instruction>().get_Offset());
     }
     else
     {
         data.set_SwitchExpression(V_0.get_Left());
     }
     data.get_CaseConditionToBlockMap().Add(new KeyValuePair <Expression, BlockStatement>(V_1, block));
     return(true);
 }
コード例 #4
0
 private List <int> GetStatementsToInline(StatementCollection statements)
 {
     V_0 = new List <int>();
     V_1 = this.finder.Find(statements);
     V_2 = (BlockStatement)statements.get_Item(0).get_Parent();
     if (V_2 == null)
     {
         throw new NullReferenceException("parent");
     }
     V_3 = this.patternsContext.get_VariableToDefineUseCountContext().GetEnumerator();
     try
     {
         while (V_3.MoveNext())
         {
             V_4 = V_3.get_Current();
             if (V_4.get_Value().DefineCount != 1 || V_4.get_Value().UseCount != 1 || V_1.Contains(V_4.get_Key()))
             {
                 continue;
             }
             V_5 = this.patternsContext.get_VariableToSingleAssignmentMap().get_Item(V_4.get_Key());
             if (V_5.get_Parent() != V_2)
             {
                 continue;
             }
             V_6 = statements.IndexOf(V_5);
             if (V_6 == -1)
             {
                 throw new IndexOutOfRangeException("index");
             }
             V_0.Add(V_6);
         }
     }
     finally
     {
         ((IDisposable)V_3).Dispose();
     }
     V_0.Sort();
     return(V_0);
 }