Beispiel #1
0
        public static BoundStatement If(SyntaxNode syntax, BoundExpression condition, BoundStatement thenStmt, BoundStatement?elseStmt, BoundLabel elseLabel, BoundLabel endLabel)
        {
            if (elseStmt == null)
            {
                return(If(syntax, condition, thenStmt, endLabel));
            }

            return(Block(syntax,
                         GotoFalse(syntax, elseLabel, condition),
                         thenStmt,
                         Goto(syntax, endLabel),
                         Label(syntax, elseLabel),
                         elseStmt,
                         Label(syntax, endLabel)));
        }
Beispiel #2
0
 public static BoundWhileStatement While(SyntaxNode syntax, BoundExpression condition, BoundStatement body, BoundLabel breakLabel, BoundLabel continueLabel)
 {
     return(new BoundWhileStatement(syntax, condition, body, breakLabel, continueLabel));
 }
Beispiel #3
0
 public static BoundStatement If(SyntaxNode syntax, BoundExpression condition, BoundStatement thenStmt, BoundLabel endLabel)
 {
     return(Block(syntax,
                  GotoFalse(syntax, endLabel, condition),
                  thenStmt,
                  Label(syntax, endLabel)));
 }