Exemplo n.º 1
0
 def visitProgram(self,ctx:MCParser.ProgramContext):
     declList = []
     for x in ctx.decl():
         decl = self.visitDecl(x)
         if isinstance(decl, list):
             declList.extend(decl if decl else [])
         else:
             declList.append(decl)
     return Program(declList)
Exemplo n.º 2
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     return Program(
         i for x in ctx.decl() for i in self.visit(x)
     )
Exemplo n.º 3
0
 def visitProgram (self, ctx:MCParser.ProgramContext):
     return Program(list(reduce(lambda x,y: x + self.visit(y),ctx.decl(),[])))
Exemplo n.º 4
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     x = Program([i for x in ctx.decl() for i in self.visit(x)])
     return x
Exemplo n.º 5
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     d = []
     for i in ctx.decl():
         d = d + self.visit(i)
     return Program(d)
Exemplo n.º 6
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     lst = []
     for x in ctx.decl():
         lst += self.visit(x)
     return Program(lst)
Exemplo n.º 7
0
    def visitProgram(self, ctx: MCParser.ProgramContext):

        return Program(fatten([self.visit(decl) for decl in ctx.decl()]))
Exemplo n.º 8
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     return Program([j for i in ctx.decl() for j in self.visit(i)])
Exemplo n.º 9
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     return Program(Flatten([self.visit(x) for x in ctx.decl()]))