def visitRoot(self, ctx: SkylineParser.RootContext): """ Crida i retorna els Skylines calculats """ lst = [n for n in ctx.getChildren()] if len(lst) == 0: return "" else: n = next(ctx.getChildren()) return self.visit(n)
def visitRoot(self, ctx: SkylineParser.RootContext): """ Mètode de crida de l'arrel i el mostra per pantalla""" n = next(ctx.getChildren()) print(' ' * self.nivell + 'ROOT') self.nivell += 1 return self.visit(n) self.nivell -= 1
def visitRoot(self, ctx: SkylineParser.RootContext): # r = self.visitChildren(ctx) l = [n for n in ctx.getChildren()] self.skyline.setNewMessage() r = self.visit(l[0]) try: for i in range(0, len(r)): self.skyline.addBuilding(r[i]) except: print('Resgurardat')
def visitRoot(self, ctx: SkylineParser.RootContext): n = next(ctx.getChildren()) return self.visit(n)
def visitRoot(self, ctx: SkylineParser.RootContext): """Visitor for root rule in grammar, returns a skyline""" n = next(ctx.getChildren()) result = self.visit(n) return result
def visitRoot(self, ctx: SkylineParser.RootContext): ch = next(ctx.getChildren()) return self.visit(ch) if ch == ctx.assig() else (None, self.visit(ch))