示例#1
0
 def visitBody(self, ctx: MPParser.BodyContext):
     if ctx.vardecl():
         return self.visit(ctx.vardecl())
     elif ctx.funcdecl():
         return [self.visit(ctx.funcdecl())]
     else:
         return [self.visit(ctx.procdecl())]
示例#2
0
    def visitBody(self, ctx: MPParser.BodyContext):

        return [], [self.visit(ctx.stmt())] if ctx.stmt() else []
示例#3
0
 def visitBody(self, ctx: MPParser.BodyContext):
     return 3 + sum([self.visit(x) for x in ctx.stmt()
                     ])  #(self.visit(ctx.stmt()) if ctx.stmt() else 0)
 def visitBody(self, ctx: MPParser.BodyContext):
     return self.visit(ctx.funcall())
示例#5
0
 def visitBody(self, ctx: MPParser.BodyContext):
     return 3 + (self.visit(ctx.stmt()) if ctx.stmt() else 0)
示例#6
0
 def visitBody(self, ctx: MPParser.BodyContext):
     return reduce(lambda a, x: a + x,
                   [self.flatten(self.visit(x)) for x in ctx.stmt()], [])