def visitWhile_stmt(self, ctx: BKITParser.While_stmtContext):
        exp = ctx.expression().accept(self)

        vardecl = []
        stmt = []
        if ctx.variable_declaration_stmt():
            for x in ctx.variable_declaration_stmt():
                vardecl.extend(x.accept(self))

        if ctx.statement_list():
            for x in ctx.statement_list():
                stmt.append(x.accept(self))

        sl = (vardecl, stmt)
        return While(exp, sl)
예제 #2
0
 def visitWhile_stmt(self, ctx: BKITParser.While_stmtContext):
     return While(ctx.expression().accept(self),ctx.stmt_list().accept(self))
 def visitWhile_stmt(
         self, ctx: BKITParser.While_stmtContext):  # return While() object
     return While(ctx.expression().accept(self),
                  ctx.statement_list().accept(self))