Home | History | Annotate | Download | only in antlr3

Lines Matching refs:pattern

56 ## token types for pattern parser
67 def __init__(self, pattern):
68 ## The tree pattern to lex like "(A B C)"
69 self.pattern = pattern
77 ## How long is the pattern in char?
78 self.n = len(pattern)
160 self.c = self.pattern[self.p]
171 def pattern(self):
318 patterns like "(A B C)". You can create a tree from that pattern or
348 def create(self, pattern):
350 Create a tree or node from the indicated tree pattern that closely
364 tokenizer = TreePatternLexer(pattern)
366 return parser.pattern()
403 a string with a pattern that must be matched.
430 def _findPattern(self, t, pattern):
431 """Return a List of subtrees matching pattern."""
435 # Create a TreePattern from the pattern
436 tokenizer = TreePatternLexer(pattern)
438 tpattern = parser.pattern()
459 If what is a string, it is parsed as a pattern and only matching
461 The implementation uses the root node of the pattern in combination
466 all nodes of that type (this is faster than the pattern match).
468 since using a token type rather than a pattern doesn't let us set a
496 def _visitPattern(self, tree, pattern, visitor):
498 For all subtrees that match the pattern, execute the visit action.
501 # Create a TreePattern from the pattern
502 tokenizer = TreePatternLexer(pattern)
504 tpattern = parser.pattern()
521 def parse(self, t, pattern, labels=None):
523 Given a pattern like (ASSIGN %lhs:ID %rhs:.) with optional labels
525 return true if the pattern matches and fill the labels Map with
527 the pattern is malformed or the tree does not match.
529 If a node specifies a text arg in pattern, then that must match
533 tokenizer = TreePatternLexer(pattern)
535 tpattern = parser.pattern()
543 structure and token types in t1. Check text if the pattern has
545 in tree matched against nodes in pattern with labels.
557 # if pattern has text, check node text
563 # map label in pattern to node in t1