def visitProgram(self,ctx:MCParser.ProgramContext):
     list_declaration = [self.visit(ctx.getChild(i)) for i in range(ctx.getChildCount()-1)]
     declarations = []
     for x in list_declaration:
         if isinstance(x, list):
             declarations += x
         else:
             declarations += [x]
     return Program(declarations)
Пример #2
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     return Program([
         self.visit(ctx.getChild(x)) for x in range(ctx.getChildCount() - 1)
     ])