Exemplo n.º 1
0
 private void EmbedIntoDefaultIf(GotoStatement jump)
 {
     V_0 = jump.get_Parent() as BlockStatement;
     V_1 = new BlockStatement();
     V_1.AddStatement(jump);
     V_2 = new IfStatement(this.GetLiteralExpression(true), V_1, null);
     V_1.set_Parent(V_2);
     V_3 = V_0.get_Statements().IndexOf(jump);
     V_0.get_Statements().RemoveAt(V_3);
     V_0.AddStatementAt(V_3, V_2);
     if (V_0.get_Parent() as ConditionCase != null && V_0.get_Statements().IndexOf(V_2) == V_0.get_Statements().get_Count())
     {
         V_0.AddStatement(new BreakStatement(null));
     }
     return;
 }
Exemplo n.º 2
0
 private bool IsUnconditionalJump(GotoStatement jump)
 {
     V_0 = jump.get_Parent() as BlockStatement;
     if (V_0 == null)
     {
         throw new ArgumentOutOfRangeException("Goto statement outside of block.");
     }
     if (V_0.get_Parent() == null)
     {
         return(true);
     }
     if (V_0.get_Parent() as IfStatement == null)
     {
         return(true);
     }
     V_1 = V_0.get_Parent() as IfStatement;
     if (V_1.get_Then() == V_0 && V_0.get_Statements().get_Count() == 1 && V_1.get_Else() == null)
     {
         return(false);
     }
     return(true);
 }