parameters: (self, tree, pattern, visitor)
docstring: For all subtrees that match the pattern, execute the visit action.
docstring_summary: For all subtrees that match the pattern, execute the visit action.
docstring_tokens: For all subtrees that match the pattern execute the visit action .
function: def _visitPattern(self, tree, pattern, visitor):
          """
          For all subtrees that match the pattern, execute the visit action.
          """
  
          # Create a TreePattern from the pattern
          tokenizer = TreePatternLexer(pattern)
          parser = TreePatternParser(tokenizer, self, TreePatternTreeAdaptor())
          tpattern = parser.pattern()
          
          # don't allow invalid patterns
          if (tpattern is None or tpattern.isNil()
              or isinstance(tpattern, WildcardTreePattern)):
              return
  
          rootTokenType = tpattern.getType()
  
          def rootvisitor(tree, parent, childIndex, labels):
              labels = {}
              if self._parse(tree, tpattern, labels):
                  visitor(tree, parent, childIndex, labels)
                  
          self.visit(tree, rootTokenType, rootvisitor)
function_tokens: def _visitPattern ( self , tree , pattern , visitor ) : # Create a TreePattern from the pattern tokenizer = TreePatternLexer ( pattern ) parser = TreePatternParser ( tokenizer , self , TreePatternTreeAdaptor ( ) ) tpattern = parser . pattern ( ) # don't allow invalid patterns if ( tpattern is None or tpattern . isNil ( ) or isinstance ( tpattern , WildcardTreePattern ) ) : return rootTokenType = tpattern . getType ( ) def rootvisitor ( tree , parent , childIndex , labels ) : labels = { } if self . _parse ( tree , tpattern , labels ) : visitor ( tree , parent , childIndex , labels ) self . visit ( tree , rootTokenType , rootvisitor )