def visitProgram(self, ctx: MPParser.ProgramContext): return Program([ FuncDecl(Id("main"), [], self.visit(ctx.mptype()), Block([], [self.visit(ctx.body())] if ctx.body() else [])) ])
def visitProgram(self, ctx: MPParser.ProgramContext): A = [] for x in ctx.body(): A += self.visit(x) return Program(A)