public interface Matcher extends Serializable
LexerMatcher.getMatcher(com.massa.dsl.lexer.LexerParser)
method.Modifier and Type | Method and Description |
---|---|
boolean |
equivalent(Matcher obj)
Equality without start mark, when equality should check LexerMatcher and start mark.
|
List<ParsingContext.AutoCompleteResult> |
getAutoCompleteOptions(MatchingPhase phase)
Computes autoComplete options from current partial matches, if any.
|
int |
getEffectiveStartMark() |
int |
getEndMark() |
Pattern |
getFollowingCharPattern() |
CharPatternMatchResult |
getFollowingCharPatternMatchResult() |
Grammar |
getGrammar() |
LexerMatcher |
getLexerMatcher() |
LexerParser |
getLexerParser() |
String |
getMatchedText()
Retrieves text between start of match and end of match.
|
ParsingContext |
getParsingContext() |
Pattern |
getPreviousCharPattern() |
CharPatternMatchResult |
getPreviousCharPatternMatchResult() |
AdvancedReader |
getSource() |
int |
getStartMark() |
Integer |
getWeight() |
void |
injectResult(Object target)
If the matcher (or one or several of the matchers in the chain) generates an Object, this allows to inject it (or them) into the result.
|
boolean |
isAutoCompletePossible()
Considering match result, tells if autoComplete is possible or not (i.e. if options should be searched or not).
|
boolean |
isExcludedFromHierarchy(Matcher matcher)
Tells if provided sub matcher should be excluded from matching hierarchy.
|
boolean |
isExclusionHierarchyBreaker()
Tells if this matcher should break search for exclusion in older hierarchy.
|
Boolean |
isMatched() |
boolean |
isSkipMatchText() |
int |
match(MatchingPhase phase,
boolean unread)
Tells if this match pattern matches the next characters of the source.
|
void |
toBeginParse()
Replaces the source at its state to where the parsing process should begin.
|
void |
toEndOfMatch()
Replaces the source at its state after match ended if successful.
|
void |
toStartOfMatch()
Replaces the source at its state before match started.
|
int match(MatchingPhase phase, boolean unread) throws IOException, DslException
phase
- Phase when the matching is performed.unread
- Tells if the source should be replaced at start after the match operation or not.
If match fails, this parameter is ignored and source is unread.IOException
DslException
List<ParsingContext.AutoCompleteResult> getAutoCompleteOptions(MatchingPhase phase) throws IOException, DslException
phase
- Phase when the matching is performed.IOException
DslException
boolean isAutoCompletePossible() throws DslException
DslException
Boolean isMatched()
CharPatternMatchResult getPreviousCharPatternMatchResult()
CharPatternMatchResult getFollowingCharPatternMatchResult()
Integer getWeight()
int getStartMark()
int getEffectiveStartMark()
int getEndMark()
void toStartOfMatch()
void toEndOfMatch()
String getMatchedText() throws IOException
IOException
void toBeginParse()
void injectResult(Object target) throws DslException
target
- DslException
LexerMatcher getLexerMatcher()
LexerParser getLexerParser()
ParsingContext getParsingContext()
Grammar getGrammar()
AdvancedReader getSource()
boolean isExcludedFromHierarchy(Matcher matcher) throws DslException
matcher
- DslException
boolean equivalent(Matcher obj)
obj
- Pattern getPreviousCharPattern()
Pattern getFollowingCharPattern()
boolean isSkipMatchText()
boolean isExclusionHierarchyBreaker()