コード例 #1
0
 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)
コード例 #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
コード例 #3
0
ファイル: SkylineVisitor.py プロジェクト: ignasisant/LP---Bot
 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')
コード例 #4
0
 def visitRoot(self, ctx: SkylineParser.RootContext):
     n = next(ctx.getChildren())
     return self.visit(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
コード例 #6
0
 def visitRoot(self, ctx: SkylineParser.RootContext):
     ch = next(ctx.getChildren())
     return self.visit(ch) if ch == ctx.assig() else (None, self.visit(ch))