public class ParsingContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ParsingContext.AutoCompleteResult
Describes one autoComplete possibility.
|
Constructor and Description |
---|
ParsingContext(Grammar grammar,
AdvancedReader source) |
Modifier and Type | Method and Description |
---|---|
Set<ParsingContext.AutoCompleteResult> |
getAutoCompleteResults() |
<L extends LexerParser> |
getEquivalentParseResult(L parser)
Allows to retrieve a result pushed by a previous equivalent parser on the same source part.
|
Grammar |
getGrammar() |
Matcher |
getLastCompletedMatch() |
<M extends Matcher> |
getMatchResult(M matcher)
The context allows to keep trace of match result and to retrieve what has already been parsed.
|
<T> T |
getProperty(String key)
Retrieves a property from the context
|
AdvancedReader |
getSource() |
boolean |
isAlreadyInHierarchy(Matcher matcher)
Tells if this very matcher is already in matching process.
|
boolean |
isAutoComplete() |
boolean |
isExcluded(Matcher matcher)
Tells if this very matcher is has been specified as excluded by a member of the matching hierarchy.
|
boolean |
isSyntaxValidation() |
Matcher |
popLastCompletedMatch() |
ParsingContext |
popMatcher()
Removes the matcher at the top of the stack of the matching process
|
void |
pushCompletedMatch(Matcher lastCompletedMatch) |
ParsingContext |
pushMatcher(Matcher matcher)
Pushes a matcher at the top of the stack of the matching process
|
<M extends Matcher> |
pushMatchResult(M matcher)
Pushes a match result in this context's buffer.
|
<L extends LexerParser> |
pushParseResult(L parser)
Pushes a parsed result in this context's buffer.
|
void |
setAutoComplete(boolean b) |
<T> T |
setProperty(String key,
Object value)
Sets a property in the context
|
void |
setSyntaxValidation(boolean syntaxValidation) |
public ParsingContext(Grammar grammar, AdvancedReader source)
public <L extends LexerParser> L getEquivalentParseResult(L parser)
public <L extends LexerParser> void pushParseResult(L parser)
public boolean isAlreadyInHierarchy(Matcher matcher)
public boolean isExcluded(Matcher matcher) throws DslException
DslException
public <M extends Matcher> M getMatchResult(M matcher)
public <M extends Matcher> void pushMatchResult(M matcher)
public ParsingContext pushMatcher(Matcher matcher)
public ParsingContext popMatcher()
public Matcher getLastCompletedMatch()
public Matcher popLastCompletedMatch()
public void pushCompletedMatch(Matcher lastCompletedMatch)
public boolean isAutoComplete()
public void setAutoComplete(boolean b)
public boolean isSyntaxValidation()
public void setSyntaxValidation(boolean syntaxValidation)
public Set<ParsingContext.AutoCompleteResult> getAutoCompleteResults()
public Grammar getGrammar()
public AdvancedReader getSource()
public <T> T setProperty(String key, Object value)
key
- value
- public <T> T getProperty(String key)
key
-