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)
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 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')
Ejemplo n.º 4
0
 def visitRoot(self, ctx: SkylineParser.RootContext):
     n = next(ctx.getChildren())
     return self.visit(n)
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 def visitRoot(self, ctx: SkylineParser.RootContext):
     return self.visit(ctx.instr())
Ejemplo n.º 7
0
 def visitRoot(self, ctx: SkylineParser.RootContext):
     ch = next(ctx.getChildren())
     return self.visit(ch) if ch == ctx.assig() else (None, self.visit(ch))