protected static class ElementMatcherProvider.TransitionMatcher<T extends IElementMatcherProvider.IElementPattern> extends java.lang.Object implements IElementMatcherProvider.IElementMatcherExtension<T>
Modifier and Type | Field and Description |
---|---|
protected IGrammarAccess |
grammar |
protected MatcherState |
lastState |
protected MatcherNFAProvider |
nfaProvider |
protected java.util.Stack<MatcherState> |
ruleCallStack |
Constructor and Description |
---|
ElementMatcherProvider.TransitionMatcher(IGrammarAccess grammar,
MatcherNFAProvider nfaProvider,
java.lang.Iterable<T> patterns) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<MatcherState> |
findRuleCallsTo(AbstractRule rule,
java.util.Set<AbstractRule> visited) |
Pair<java.lang.Integer,RuleCall> |
findTopmostRuleCall(com.google.common.base.Predicate<RuleCall> predicate) |
protected Pair<java.util.List<MatcherTransition>,java.util.List<MatcherState>> |
findTransitionPath(MatcherState from,
AbstractElement to,
boolean returning,
boolean canReturn,
java.util.Set<Pair<java.lang.Boolean,MatcherState>> visited) |
protected java.util.List<MatcherTransition> |
findTransitionsToToken(MatcherState from,
java.util.Set<MatcherState> targets,
boolean returning,
boolean canReturn,
java.util.Set<MatcherState> visited) |
java.util.Collection<T> |
finish() |
protected java.util.Set<MatcherState> |
getAllStates(AbstractElement element) |
IGrammarAccess |
getGrammar() |
MatcherNFAProvider |
getNfaProvider() |
void |
init(ParserRule rule) |
protected void |
installAfter(IElementMatcherProvider.IAfterElement pattern) |
protected void |
installAllPatterns(java.lang.Iterable<T> patterns) |
protected void |
installBefore(IElementMatcherProvider.IBeforeElement pattern) |
protected void |
installBetween(IElementMatcherProvider.IBetweenElements pattern) |
protected void |
installBetween(IElementMatcherProvider.IBetweenElements pattern,
AbstractElement loopCenter) |
protected void |
installBetween(IElementMatcherProvider.IBetweenElements pattern,
AbstractElement first,
AbstractElement second) |
java.util.Collection<T> |
matchNext(AbstractElement nextElement) |
protected java.util.Collection<T> |
patternsForTransition(Pair<java.util.List<MatcherTransition>,java.util.List<MatcherState>> transition) |
protected java.util.Collection<T> |
patternsForTwoStates(MatcherState first,
MatcherState second) |
protected IGrammarAccess grammar
protected MatcherState lastState
protected MatcherNFAProvider nfaProvider
protected java.util.Stack<MatcherState> ruleCallStack
public ElementMatcherProvider.TransitionMatcher(IGrammarAccess grammar, MatcherNFAProvider nfaProvider, java.lang.Iterable<T> patterns)
protected java.util.Set<MatcherState> findRuleCallsTo(AbstractRule rule, java.util.Set<AbstractRule> visited)
public Pair<java.lang.Integer,RuleCall> findTopmostRuleCall(com.google.common.base.Predicate<RuleCall> predicate)
findTopmostRuleCall
in interface IElementMatcherProvider.IElementMatcher<T extends IElementMatcherProvider.IElementPattern>
protected Pair<java.util.List<MatcherTransition>,java.util.List<MatcherState>> findTransitionPath(MatcherState from, AbstractElement to, boolean returning, boolean canReturn, java.util.Set<Pair<java.lang.Boolean,MatcherState>> visited)
protected java.util.List<MatcherTransition> findTransitionsToToken(MatcherState from, java.util.Set<MatcherState> targets, boolean returning, boolean canReturn, java.util.Set<MatcherState> visited)
public java.util.Collection<T> finish()
finish
in interface IElementMatcherProvider.IElementMatcher<T extends IElementMatcherProvider.IElementPattern>
protected java.util.Set<MatcherState> getAllStates(AbstractElement element)
public IGrammarAccess getGrammar()
public MatcherNFAProvider getNfaProvider()
protected void installAfter(IElementMatcherProvider.IAfterElement pattern)
protected void installAllPatterns(java.lang.Iterable<T> patterns)
protected void installBefore(IElementMatcherProvider.IBeforeElement pattern)
protected void installBetween(IElementMatcherProvider.IBetweenElements pattern)
protected void installBetween(IElementMatcherProvider.IBetweenElements pattern, AbstractElement loopCenter)
protected void installBetween(IElementMatcherProvider.IBetweenElements pattern, AbstractElement first, AbstractElement second)
public void init(ParserRule rule)
init
in interface IElementMatcherProvider.IElementMatcherExtension<T extends IElementMatcherProvider.IElementPattern>
public java.util.Collection<T> matchNext(AbstractElement nextElement)
matchNext
in interface IElementMatcherProvider.IElementMatcher<T extends IElementMatcherProvider.IElementPattern>
protected java.util.Collection<T> patternsForTransition(Pair<java.util.List<MatcherTransition>,java.util.List<MatcherState>> transition)
protected java.util.Collection<T> patternsForTwoStates(MatcherState first, MatcherState second)