def visitVardecls(self, ctx: MCParser.VardeclsContext): if ctx.getChildCount() == 2: return self.visit(ctx.vardecl()) + self.visit(ctx.vardecls( )) # return number of leaf nodes from the first right hand side else: return self.visit(ctx.vardecl( )) # return number of leaf nodes from the first right hand side
def visitVardecls(self, ctx: MCParser.VardeclsContext): if ctx.getChildCount() == 2: return [self.visit(ctx.vardecl())] + self.visit(ctx.vardecls( )) # return the list of VarDecl for the first right hand side else: return [ self.visit(ctx.vardecl()) ] # return the list of VarDecl for the second right hand side
def visitVardecls(self, ctx:MCParser.VardeclsContext): return self.visitVardecl(ctx.vardecl()) + self.visitVardecls(ctx.vardecls()) if ctx.vardecls() else self.visitVardecl(ctx.vardecl())
def visitVardecls(self,ctx:MCParser.VardeclsContext): return [self.visit(ctx.vardecl())] + self.visit(ctx.vardecls()) if (ctx.vardecls()) else [self.visit(ctx.vardecl())]