def visitStmt(self, ctx: MPParser.StmtContext): if ctx.breakstmt(): return Break() elif ctx.continuestmt(): return Continue() else: return self.visit(ctx.getChild(0))
def visitStmt(self, ctx: MPParser.StmtContext): stmt = [] for x in ctx.stmtsingle(): x = self.visit(x) #Kiểm tra x có phải list không if isinstance(x, list): for i in x: stmt.append(i) else: stmt.append(x) return stmt #[self.visit(x) for x in ctx.stmtsingle()]#list(map(self.visit,ctx.stmtsingle()))
def visitStmt(self, ctx: MPParser.StmtContext): return self.visit(ctx.funcall())
def visitStmt(self, ctx: MPParser.StmtContext): if ctx.compound_stmt() or ctx.assign_stmt(): return self.visitChildren(ctx) else: return [self.visitChildren(ctx)]
def visitStmt(self, ctx: MPParser.StmtContext): return self.visit(ctx.getChild(0))
def visitStmt(self, ctx: MPParser.StmtContext): # if ctx.stmtAssign(): # return self.visit(ctx.stmtAssign()) return self.visit(ctx.getChild(0))
def visitStmt(self, ctx: MPParser.StmtContext): if ctx.assignState() is not None: return self.visit(ctx.assignState()) elif ctx.ifState() is not None: return self.visit(ctx.ifState()) elif ctx.forState() is not None: return self.visit(ctx.forState()) elif ctx.whileState() is not None: return self.visit(ctx.whileState()) elif ctx.breakState() is not None: return self.visit(ctx.breakState()) elif ctx.continueState() is not None: return self.visit(ctx.continueState()) elif ctx.returnState() is not None: return self.visit(ctx.returnState()) elif ctx.callState() is not None: return self.visit(ctx.callState()) elif ctx.cpstate() is not None: return self.visit(ctx.cpstate()) elif ctx.withState() is not None: return self.visit(ctx.withState())
def visitStmt(self, ctx: MPParser.StmtContext): '''stmt: assignstmt | ifstmt | whilestmt | forstmt | breakstmt | continuestmt | returnstmt | compoundstmt | withstmt | callstmt;''' return self.visit(ctx.getChild(0))