<ID> = <expr>; converted to a ParseTree by
ParseTreePatternMatcher#compile(String, int).
| Modifier and Type | Field and Description |
|---|---|
| private final ParseTreePatternMatcher | matcher
This is the backing field for |
| private final String | pattern
This is the backing field for |
| private final int | patternRuleIndex
This is the backing field for |
| private final ParseTree | patternTree
This is the backing field for |
| Access | Constructor and Description |
|---|---|
| public | ParseTreePattern(ParseTreePatternMatcher
The matcher, String ParseTreePatternMatcher which created this
tree pattern.The tree pattern in concrete syntax form. pattern, int The parser rule which serves as the root of the
tree pattern. patternRuleIndex, ParseTree The tree pattern in patternTree)ParseTree form.Construct a new instance of the |
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: A collection ofParseTreeMatch objects describing the
successful matches. Unsuccessful matches are omitted from the result,
regardless of the reason for the failure.The tree, String ParseTree to match against this pattern.An expression matching the nodes xpath)Find all nodes using XPath and then try to match those subtrees against this tree pattern. |
| public ParseTreePatternMatcher | Returns: TheParseTreePatternMatcher which created this tree
pattern.Get the |
| public String | Returns: The tree pattern in concrete syntax form.Get the tree pattern in concrete syntax form. |
| public int | Returns: The parser rule which serves as the outermost rule for the tree pattern.Get the parser rule which serves as the outermost rule for the tree pattern. |
| public ParseTree | |
| public ParseTreeMatch | Returns: AParseTreeMatch object describing the result of the
match operation. The ParseTreeMatch#succeeded() method can be
used to determine whether or not the match was successful.The parse tree to match against this tree pattern. tree)Match a specific parse tree against this tree pattern. |
| public boolean |
| matcher | back to summary |
|---|---|
| private final ParseTreePatternMatcher matcher This is the backing field for | |
| pattern | back to summary |
|---|---|
| private final String pattern This is the backing field for | |
| patternRuleIndex | back to summary |
|---|---|
| private final int patternRuleIndex This is the backing field for | |
| patternTree | back to summary |
|---|---|
| private final ParseTree patternTree This is the backing field for | |
| ParseTreePattern | back to summary |
|---|---|
| public ParseTreePattern(ParseTreePatternMatcher matcher, String pattern, int patternRuleIndex, ParseTree patternTree) Construct a new instance of the
| |
| findAll | back to summary |
|---|---|
| public List Find all nodes using XPath and then try to match those subtrees against this tree pattern.
| |
| getMatcher | back to summary |
|---|---|
| public ParseTreePatternMatcher getMatcher() Get the
| |
| getPattern | back to summary |
|---|---|
| public String getPattern() Get the tree pattern in concrete syntax form. | |
| getPatternRuleIndex | back to summary |
|---|---|
| public int getPatternRuleIndex() Get the parser rule which serves as the outermost rule for the tree pattern.
| |
| getPatternTree | back to summary |
|---|---|
| public ParseTree getPatternTree() Get the tree pattern as a | |
| match | back to summary |
|---|---|
| public ParseTreeMatch match(ParseTree tree) Match a specific parse tree against this tree pattern.
| |
| matches | back to summary |
|---|---|
| public boolean matches(ParseTree tree) Determine whether or not a parse tree matches this tree pattern.
| |