Ejemplo n.º 1
0
 private ForStatement CreateForStatement(Statement initializer, WhileStatement theWhile)
 {
     V_0 = theWhile.get_Body().get_Statements().get_Count() - 1;
     V_1 = theWhile.get_Body().get_Statements().get_Item(V_0).get_Label();
     V_2 = new ForStatement((initializer as ExpressionStatement).get_Expression(), theWhile.get_Condition(), (theWhile.get_Body().get_Statements().get_Item(V_0) as ExpressionStatement).get_Expression(), new BlockStatement());
     V_3 = 0;
     while (V_3 < V_0)
     {
         V_2.get_Body().AddStatement(theWhile.get_Body().get_Statements().get_Item(V_3));
         V_3 = V_3 + 1;
     }
     if (!String.IsNullOrEmpty(V_1))
     {
         stackVariable42 = new EmptyStatement();
         stackVariable42.set_Label(V_1);
         V_2.get_Body().AddStatement(stackVariable42);
     }
     return(V_2);
 }
Ejemplo n.º 2
0
 public override ICodeNode VisitExpressionStatement(ExpressionStatement node)
 {
     V_0 = (Expression)this.Visit(node.get_Expression());
     if (V_0 != null)
     {
         node.set_Expression(V_0);
         return(node);
     }
     if (!String.IsNullOrEmpty(node.get_Label()))
     {
         V_1 = node.GetNextStatement();
         if (V_1 == null || !String.IsNullOrEmpty(V_1.get_Label()))
         {
             stackVariable16 = new EmptyStatement();
             stackVariable16.set_Label(node.get_Label());
             return(stackVariable16);
         }
         V_1.set_Label(node.get_Label());
     }
     return(null);
 }
Ejemplo n.º 3
0
 public override ICodeNode VisitExpressionStatement(ExpressionStatement node)
 {
     node.set_Expression((Expression)this.Visit(node.get_Expression()));
     if (node.get_Expression() != null)
     {
         return(node);
     }
     if (node.get_Label() != null && String.op_Inequality(node.get_Label(), String.Empty))
     {
         V_0 = node.GetNextStatement();
         if (V_0 == null || V_0.get_Label() != null && String.op_Inequality(V_0.get_Label(), String.Empty))
         {
             stackVariable19 = new EmptyStatement();
             stackVariable19.set_Label(node.get_Label());
             V_1 = stackVariable19;
             this.methodContext.get_GotoLabels().set_Item(node.get_Label(), V_1);
             return(V_1);
         }
         V_0.set_Label(node.get_Label());
         this.methodContext.get_GotoLabels().set_Item(node.get_Label(), V_0);
     }
     return(null);
 }