Ejemplo n.º 1
0
 public override void VisitVariableReferenceExpression(VariableReferenceExpression node)
 {
     if (this.processStep == 1)
     {
         return;
     }
     V_0 = this.states.Peek();
     if (!this.ContainsKey(node.get_Variable()))
     {
         V_1 = this.GetInitialVariableState(V_0);
         V_2 = new RemoveConditionOnlyVariables.VariableStateAndExpression(node.get_Variable(), V_1);
         if (V_0 == 1)
         {
             stackVariable27 = V_2;
             stackVariable27.set_NumberOfTimesAssigned(stackVariable27.get_NumberOfTimesAssigned() + 1);
         }
         this.variables.Add(V_2);
     }
     else
     {
         this.ChangeVariableState(V_0, node);
     }
     this.VisitVariableReferenceExpression(node);
     this.currentVariable = node.get_Variable();
     return;
 }
Ejemplo n.º 2
0
 private void RemoveNotSetStatementExpressions(RemoveConditionOnlyVariables.VariableStateAndExpression keyValuePair, HashSet <RemoveConditionOnlyVariables.VariableStateAndExpression> variablesToRemove)
 {
     stackVariable2 = new Stack <RemoveConditionOnlyVariables.StatementExpression>(keyValuePair.get_StatementExpressions());
     keyValuePair.get_StatementExpressions().Clear();
     V_0 = stackVariable2.GetEnumerator();
     try
     {
         while (V_0.MoveNext())
         {
             V_1 = V_0.get_Current();
             if (V_1.get_Statement() == null)
             {
                 continue;
             }
             if (V_1.get_ParentWhileStatement() == null)
             {
                 keyValuePair.get_StatementExpressions().Add(V_1);
             }
             else
             {
                 V_2 = this.GetParentWhileStatementIndex(keyValuePair.get_StatementExpressions(), V_1.get_ParentWhileStatement());
                 keyValuePair.get_StatementExpressions().Insert(V_2, V_1);
             }
         }
     }
     finally
     {
         ((IDisposable)V_0).Dispose();
     }
     if (keyValuePair.get_StatementExpressions().get_Count() == 0)
     {
         dummyVar0 = variablesToRemove.Add(keyValuePair);
     }
     return;
 }
Ejemplo n.º 3
0
 private bool TryGetValue(VariableReference variableReference, out RemoveConditionOnlyVariables.VariableStateAndExpression variableStateAndExpression)
 {
     V_0 = new RemoveConditionOnlyVariables.u003cu003ec__DisplayClass11_0();
     V_0.variableReference = variableReference;
     V_1 = this.variables.Where <RemoveConditionOnlyVariables.VariableStateAndExpression>(new Func <RemoveConditionOnlyVariables.VariableStateAndExpression, bool>(V_0.u003cTryGetValueu003eb__0)).FirstOrDefault <RemoveConditionOnlyVariables.VariableStateAndExpression>();
     variableStateAndExpression = V_1;
     return(V_1 != null);
 }
Ejemplo n.º 4
0
 private Expression GetCurrentStatementExpression(RemoveConditionOnlyVariables.VariableStateAndExpression variableStateAndExpression)
 {
     if (variableStateAndExpression.get_StatementExpressions().get_Count() == 0)
     {
         return(null);
     }
     V_0       = variableStateAndExpression.get_StatementExpressions().get_Item(variableStateAndExpression.get_StatementExpressions().get_Count() - 1);
     dummyVar0 = variableStateAndExpression.get_StatementExpressions().Remove(V_0);
     return(V_0.get_Expression().CloneExpressionOnly());
 }