コード例 #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)));
        }
コード例 #2
0
 public static BoundWhileStatement While(SyntaxNode syntax, BoundExpression condition, BoundStatement body, BoundLabel breakLabel, BoundLabel continueLabel)
 {
     return(new BoundWhileStatement(syntax, condition, body, breakLabel, continueLabel));
 }
コード例 #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)));
 }