def visitDecl(self, ctx: MPParser.DeclContext): if ctx.varDecl(): return self.visit(ctx.varDecl()) elif ctx.funcDecl(): return self.visit(ctx.funcDecl()) else: return self.visit(ctx.procDecl())
def visitDecl(self, ctx: MPParser.DeclContext): #decl: var_dec | fun_dec | procedure_dec result = self.visitChildren(ctx) if ctx.var_dec(): for i in range(1, len(result)): result[0] = str(result[0]) + "," + str(result[i]) return result[0] else: return result
def visitDecl(self, ctx: MPParser.DeclContext): return 1 + self.visit(ctx.getChild(0))
def visitDecl(self, ctx: MPParser.DeclContext): # ctx.varDecl() # if ctx.varDecl(): return self.visit(ctx.getChild(0))
def visitDecl(self, ctx: MPParser.DeclContext): return self.visit(ctx.funcdecl()) if ctx.funcdecl() else self.visit( ctx.procdecl())
def visitDecl(self, ctx: MPParser.DeclContext): if ctx.vardecl(): return self.visit(ctx.vardecl()) else: return [self.visit(ctx.getChild(0))]
def visitDecl(self, ctx: MPParser.DeclContext): # decl : var_dec | func_dec | procedure_dec if ctx.var_dec(): return ','.join(str(x) for x in self.visit(ctx.var_dec())) return self.visitChildren(ctx)