ParseTreePattern

@uml A pattern like {@code <ID> = <expr>;} converted to a {@link ParseTree} by {@link ParseTreePatternMatcher#compile(String, int)}.

Constructors

this
this(ParseTreePatternMatcher matcher, string pattern, int patternRuleIndex, ParseTree patternTree)

@uml Construct a new instance of the {@link ParseTreePattern} class.

Members

Functions

findAll
ParseTreeMatch[] findAll(ParseTree tree, string xpath)

@uml Find all nodes using XPath and then try to match those subtrees against this tree pattern.

getMatcher
ParseTreePatternMatcher getMatcher()

@uml et the {@link ParseTreePatternMatcher} which created this tree pattern.

getPattern
string getPattern()

@uml Get the tree pattern in concrete syntax form.

getPatternRuleIndex
int getPatternRuleIndex()

@uml Get the parser rule which serves as the outermost rule for the tree pattern.

getPatternTree
ParseTree getPatternTree()

@uml Get the tree pattern as a {@link ParseTree}. The rule and token tags from the pattern are present in the parse tree as terminal nodes with a symbol of type {@link RuleTagToken} or {@link TokenTagToken}.

match
ParseTreeMatch match(ParseTree tree)

@uml Match a specific parse tree against this tree pattern.

matches
bool matches(ParseTree tree)

@uml Determine whether or not a parse tree matches this tree pattern.

Variables

matcher
ParseTreePatternMatcher matcher;

@uml This is the backing field for {@link #getMatcher()}.

patternTree
ParseTree patternTree;

@uml This is the backing field for {@link #getPatternTree()}.

Meta