def visitBody(self, ctx: MPParser.BodyContext): if ctx.vardecl(): return self.visit(ctx.vardecl()) elif ctx.funcdecl(): return [self.visit(ctx.funcdecl())] else: return [self.visit(ctx.procdecl())]
def visitBody(self, ctx: MPParser.BodyContext): return [], [self.visit(ctx.stmt())] if ctx.stmt() else []
def visitBody(self, ctx: MPParser.BodyContext): return 3 + sum([self.visit(x) for x in ctx.stmt() ]) #(self.visit(ctx.stmt()) if ctx.stmt() else 0)
def visitBody(self, ctx: MPParser.BodyContext): return self.visit(ctx.funcall())
def visitBody(self, ctx: MPParser.BodyContext): return 3 + (self.visit(ctx.stmt()) if ctx.stmt() else 0)
def visitBody(self, ctx: MPParser.BodyContext): return reduce(lambda a, x: a + x, [self.flatten(self.visit(x)) for x in ctx.stmt()], [])