Exemplo n.º 1
0
 def visitDo_while_statement(self, ctx:MCParser.Do_while_statementContext):
     expr = self.visit(ctx.exp())
     sl = []
     for x in ctx.statement():
         stmt = self.visitStatement(x)
         sl.append(stmt)
     return Dowhile(sl,expr)
Exemplo n.º 2
0
 def visitDo_while_statement(self, ctx: MCParser.Do_while_statementContext):
     list_stmt = [self.visit(x) for x in ctx.statement()]
     # for x in ctx.statement():
     #     temp_stmt = self.visit(x)
     #     list_stmt.append(temp_stmt)
     expression = self.visit(ctx.exp())
     return Dowhile(flatten([list_stmt]), expression)
Exemplo n.º 3
0
 def visitDo_while_statement(self, ctx: MCParser.Do_while_statementContext):
     # do_while_statement: DO statement+ WHILE exp SM;
     lstStatement = [self.visit(x) for x in ctx.statement()]
     return Dowhile(lstStatement, self.visit(ctx.exp()))
Exemplo n.º 4
0
 def visitDo_while_statement(self, ctx: MCParser.Do_while_statementContext):
     '''do_while_statement: DO statement+ WHILE exp_bool SEMI ; '''
     stmt_lst = [self.visit(x) for x in ctx.statement()]
     exp_bool = self.visit(ctx.exp_bool())
     return Dowhile(stmt_lst, exp_bool)