Beispiel #1
0
        public override ICodeNode VisitExpressionStatement(ExpressionStatement node)
        {
            node.Expression = (Expression)Visit(node.Expression);
            if (node.Expression == null)
            {
                if (node.Label != null && node.Label != string.Empty)
                {
                    Statement nextStatement = node.GetNextStatement();
                    if (nextStatement == null || nextStatement.Label != null && nextStatement.Label != string.Empty)
                    {
                        var result = new EmptyStatement()
                        {
                            Label = node.Label
                        };
                        this.methodContext.GotoLabels[node.Label] = result;
                        return(result);
                    }

                    nextStatement.Label = node.Label;
                    this.methodContext.GotoLabels[node.Label] = nextStatement;
                }
                return(null);
            }

            return(node);
        }
Beispiel #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);
 }
Beispiel #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);
 }
        public override ICodeNode VisitExpressionStatement(ExpressionStatement node)
        {
            Expression result = (Expression)Visit(node.Expression);

            if (result == null)
            {
                if (!string.IsNullOrEmpty(node.Label))
                {
                    Statement nextStatement = node.GetNextStatement();
                    if (nextStatement == null || !string.IsNullOrEmpty(nextStatement.Label))
                    {
                        Statement newStatement = new EmptyStatement();
                        newStatement.Label = node.Label;
                        return(newStatement);
                    }

                    nextStatement.Label = node.Label;
                }
                return(null);
            }

            node.Expression = result;
            return(node);
        }