Lines Matching refs:nodes

56         Compare two nodes for equality.
68 Compare two nodes for equality.
70 This is called by __eq__ and __ne__. It is only called if the two nodes
209 """Concrete implementation for interior nodes."""
219 child nodes, and an optional context keyword argument.
254 """Compare two nodes for equality."""
319 """Concrete implementation for leaf nodes."""
363 """Compare two nodes for equality."""
427 - WildcardPattern matches a sequence of nodes of variable length.
461 updated with the nodes matching named subpatterns.
479 def match_seq(self, nodes, results=None):
481 Does this pattern exactly match a sequence of nodes?
485 if len(nodes) != 1:
487 return self.match(nodes[0], results)
489 def generate_matches(self, nodes):
496 if nodes and self.match(nodes[0], r):
537 updated with the nodes matching named subpatterns.
555 non-leaf nodes that also match the content pattern.
586 updated with the nodes matching named subpatterns.
608 A wildcard pattern can match zero or more nodes.
677 def match_seq(self, nodes, results=None):
678 """Does this pattern exactly match a sequence of nodes?"""
679 for c, r in self.generate_matches(nodes):
680 if c == len(nodes):
684 results[self.name] = list(nodes)
688 def generate_matches(self, nodes):
690 Generator yielding matches for a sequence of nodes.
693 nodes: sequence of nodes
697 count: the match comprises nodes[:count];
702 for count in range(self.min, 1 + min(len(nodes), self.max)):
705 r[self.name] = nodes[:count]
708 yield self._bare_name_matches(nodes)
718 for count, r in self._recursive_matches(nodes, 0):
720 r[self.name] = nodes[:count]
725 for count, r in self._iterative_matches(nodes):
727 r[self.name] = nodes[:count]
733 def _iterative_matches(self, nodes):
735 nodelen = len(nodes)
742 for c, r in generate_matches(alt, nodes):
746 # for each match, iterate down the nodes
750 # stop if the entire set of nodes has been matched
753 for c1, r1 in generate_matches(alt, nodes[c0:]):
762 def _bare_name_matches(self, nodes):
767 max = len(nodes)
771 if leaf[0].match(nodes[count], r):
775 r[self.name] = nodes[:count]
778 def _recursive_matches(self, nodes, count):
785 for c0, r0 in generate_matches(alt, nodes):
786 for c1, r1 in self._recursive_matches(nodes[c0:], count+1):
812 def match_seq(self, nodes):
813 # We only match an empty sequence of nodes in its entirety
814 return len(nodes) == 0
816 def generate_matches(self, nodes):
819 if len(nodes) == 0:
823 for c, r in self.content.generate_matches(nodes):
828 def generate_matches(patterns, nodes):
830 Generator yielding matches for a sequence of patterns and nodes.
834 nodes: a sequence of nodes
838 count: the entire sequence of patterns matches nodes[:count];
845 for c0, r0 in p.generate_matches(nodes):
849 for c1, r1 in generate_matches(rest, nodes[c0:]):