def visitProgram(self, ctx: MPParser.ProgramContext): lstdecl = [] for x in ctx.declaration(): decl = self.visit(x) if type(decl) == type([]): lstdecl = lstdecl + decl else: lstdecl.append(decl) return Program(lstdecl)
def visitProgram(self, ctx: MPParser.ProgramContext): templist = [] for decl in ctx.declaration(): if decl.varDec(): templist += self.visit(decl) else: templist += [self.visit(decl)] #templist += typeDec return Program(templist)
def visitProgram(self,ctx:MPParser.ProgramContext): templist = [] for decl in ctx.declaration(): templist += self.visit(decl) return Program(templist)
def visitProgram(self, ctx:MPParser.ProgramContext): return Program(flat_arr([self.visit(x) for x in ctx.declaration()]))
def visitProgram(self, ctx: MPParser.ProgramContext): listDec = [] for dec in ctx.declaration(): listDec += self.visit(dec) return Program(listDec)
def visitProgram(self, ctx: MPParser.ProgramContext): return Program( list( reduce(lambda x, y: x + y, [self.visit(t) for t in ctx.declaration()], [])))