Ejemplo n.º 1
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     # program: decls+ EOF;
     lstDecl = []
     for decl in ctx.decls():
         if (isinstance(self.visit(decl), list)):
             lstDecl += self.visit(decl)
         else:
             lstDecl += [self.visit(decl)]
     return Program(
         lstDecl
     )  #return Program(list(map(lambda x:self.visit(x),ctx.decls())))
Ejemplo n.º 2
0
 def visitProgram(self, ctx: MCParser.ProgramContext):
     return Program(self.visit(ctx.decls()))