Esempio n. 1
0
 private void ExtractConditionIntoVariable(VariableReferenceExpression conditionVar, ConditionStatement statement, BlockStatement containingBlock)
 {
     V_0 = new ExpressionStatement(new BinaryExpression(26, conditionVar, statement.get_Condition(), this.typeSystem, null, false));
     containingBlock.AddStatementAt(containingBlock.get_Statements().IndexOf(statement), V_0);
     statement.set_Condition(conditionVar.CloneExpressionOnly());
     return;
 }
Esempio n. 2
0
 private void TryProcessConditionStatement(ConditionStatement node)
 {
     if (this.processStep == 1 && this.TryGetVariableExpression(node.get_Condition(), out V_0))
     {
         node.set_Condition(V_0);
     }
     if (this.processStep == RemoveConditionOnlyVariables.ProcessStep.Search && node as WhileStatement == null && node as DoWhileStatement == null)
     {
         this.SetVariablesExpressionStatements(node);
     }
     return;
 }
 private void TryMergeExpressions(ConditionStatement node)
 {
     if (node.get_Condition() as UnaryExpression == null)
     {
         return;
     }
     V_0 = (UnaryExpression)node.get_Condition();
     if (V_0.get_Operator() != 1)
     {
         return;
     }
     if (V_0.get_Operand() as MethodInvocationExpression != null || V_0.get_Operand() as PropertyReferenceExpression != null)
     {
         return;
     }
     if (!this.IsConditionExpression(V_0.get_Operand()))
     {
         return;
     }
     node.set_Condition(Negator.Negate(V_0.get_Operand(), this.typeSystem));
     return;
 }