Package | Description |
---|---|
org.antlr.v4.runtime | |
org.antlr.v4.runtime.tree.pattern |
Modifier and Type | Method and Description |
---|---|
ParseTreePattern |
Parser.compileParseTreePattern(String pattern,
int patternRuleIndex)
The preferred method of getting a tree pattern.
|
ParseTreePattern |
Parser.compileParseTreePattern(String pattern,
int patternRuleIndex,
Lexer lexer)
The same as
Parser.compileParseTreePattern(String, int) but specify a
Lexer rather than trying to deduce it from this parser. |
Modifier and Type | Method and Description |
---|---|
ParseTreePattern |
ParseTreePatternMatcher.compile(String pattern,
int patternRuleIndex)
For repeated use of a tree pattern, compile it to a
ParseTreePattern using this method. |
ParseTreePattern |
ParseTreeMatch.getPattern()
Get the tree pattern we are matching against.
|
Modifier and Type | Method and Description |
---|---|
ParseTreeMatch |
ParseTreePatternMatcher.match(ParseTree tree,
ParseTreePattern pattern)
Compare
pattern matched against tree and return a
ParseTreeMatch object that contains the matched elements, or the
node at which the match failed. |
boolean |
ParseTreePatternMatcher.matches(ParseTree tree,
ParseTreePattern pattern)
Does
pattern matched as rule patternRuleIndex match tree? Pass in a
compiled pattern instead of a string representation of a tree pattern. |
Constructor and Description |
---|
ParseTreeMatch(ParseTree tree,
ParseTreePattern pattern,
MultiMap<String,ParseTree> labels,
ParseTree mismatchedNode)
Constructs a new instance of
ParseTreeMatch from the specified
parse tree and pattern. |
Copyright © 1992–2014 ANTLR. All rights reserved.