public class GlobalMatchingVisitor extends AbstractMatchingVisitor
Modifier and Type | Field and Description |
---|---|
static Key<java.util.List<? extends PsiElement>> |
UNMATCHED_ELEMENTS_KEY |
Constructor and Description |
---|
GlobalMatchingVisitor() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsAbsenceOfMatch(PsiElement element) |
protected boolean |
doMatchInAnyOrder(NodeIterator elements,
NodeIterator elements2) |
PsiElement |
getElement() |
MatchContext |
getMatchContext() |
protected NodeFilter |
getNodeFilter() |
boolean |
getResult() |
boolean |
handleTypedElement(PsiElement typedElement,
PsiElement match) |
boolean |
isLeftLooseMatching() |
boolean |
isRightLooseMatching() |
boolean |
match(PsiElement el1,
PsiElement el2)
Identifies the match between given element of program tree and pattern element
|
void |
matchContext(NodeIterator elements)
Descents the tree in depth finding matches
|
boolean |
matchOptionally(PsiElement patternNode,
PsiElement matchNode) |
boolean |
matchSequentially(NodeIterator patternNodes,
NodeIterator matchNodes)
Matches tree segments starting with given elements to find equality
|
boolean |
matchText(PsiElement left,
PsiElement right) |
boolean |
matchText(java.lang.String left,
java.lang.String right) |
void |
scopeMatch(PsiElement patternNode,
boolean typedVar,
PsiElement matchNode) |
void |
setMatchContext(MatchContext matchContext) |
boolean |
setResult(boolean result) |
matchInAnyOrder, matchInAnyOrder, matchOptionally, matchSequentially, matchSequentially, matchSequentiallyOptionally, matchSons, matchSonsInAnyOrder, matchSonsOptionally
public static final Key<java.util.List<? extends PsiElement>> UNMATCHED_ELEMENTS_KEY
public PsiElement getElement()
public boolean getResult()
public boolean setResult(boolean result)
public MatchContext getMatchContext()
protected boolean doMatchInAnyOrder(NodeIterator elements, NodeIterator elements2)
doMatchInAnyOrder
in class AbstractMatchingVisitor
public boolean matchOptionally(PsiElement patternNode, PsiElement matchNode)
matchOptionally
in class AbstractMatchingVisitor
protected NodeFilter getNodeFilter()
getNodeFilter
in class AbstractMatchingVisitor
public final boolean handleTypedElement(PsiElement typedElement, PsiElement match)
public boolean allowsAbsenceOfMatch(PsiElement element)
public boolean match(PsiElement el1, PsiElement el2)
match
in class AbstractMatchingVisitor
el1
- the pattern for matchingel2
- the tree element for matchingpublic boolean matchSequentially(NodeIterator patternNodes, NodeIterator matchNodes)
matchSequentially
in class AbstractMatchingVisitor
patternNodes
- the pattern element for matchingmatchNodes
- the tree element for matchingpublic void matchContext(NodeIterator elements)
elements
- the element for which the sons are looked for matchpublic void setMatchContext(MatchContext matchContext)
public boolean isLeftLooseMatching()
isLeftLooseMatching
in class AbstractMatchingVisitor
public boolean isRightLooseMatching()
isRightLooseMatching
in class AbstractMatchingVisitor
public boolean matchText(PsiElement left, PsiElement right)
public boolean matchText(java.lang.String left, java.lang.String right)
public void scopeMatch(PsiElement patternNode, boolean typedVar, PsiElement matchNode)