public abstract class AbstractLexerParser extends Object implements LexerParser
Modifier and Type | Field and Description |
---|---|
protected int |
effectiveParseStartMark |
Constructor and Description |
---|
AbstractLexerParser(LexerParser parent) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterParse()
Hook called after parsing, including positioning the source at end of parse provided by end matcher if present.
|
protected void |
beforeParse()
Hook called before parsing, but after positioning the source at begin of parse provided by start matcher.
|
boolean |
equals(Object obj)
Checks LexerMatcher and start mark.
|
int |
getEffectiveParseStartMark() |
Grammar |
getGrammar() |
LexerParser |
getParent() |
int |
getParseEndMark() |
int |
getParseStartMark() |
ParsingContext |
getParsingContext() |
Object |
getResult()
Retrieves parsed result.
|
AdvancedReader |
getSource() |
protected void |
handleAutoCompletes() |
protected void |
handleOtherInjectionStrategy(InjectableLexerBlock parentBlock,
Object parentResult)
Default implementation throws Exception.
|
int |
hashCode() |
void |
injectResult(InjectableLexerBlock parentBlock,
Object parentResult)
Handles "add" and "set" injection strategies but delegates "other" to
handleOtherInjectionStrategy(InjectableLexerBlock, Object) |
protected abstract Object |
internalParse() |
boolean |
isExcludedFromHierarchy(Matcher matcher)
Tells if the provided matcher should be excluded from this lexer parser's hierarchy.
|
boolean |
isRoot()
Is this lexer root ?
|
void |
parse()
Parses the portion of the source targeted by this lexer.
|
Matcher |
resolveEnd()
Resolves the end matcher for this parser.
|
Matcher |
resolveStart()
Resolves the start matcher for this parser.
|
void |
toEnd()
Replaces the source at its state after process ended for this parser.
|
void |
toEndOfParse()
Replaces the source at its state after match ended if successful.
|
void |
toStart()
Replaces the source at its state before process started for this parser.
|
void |
toStartOfParse()
Replaces the source at its state before parse started.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLexer
public AbstractLexerParser(LexerParser parent)
public Matcher resolveStart() throws DslException
LexerParser
resolveStart
in interface LexerParser
DslException
public Matcher resolveEnd() throws DslException
LexerParser
resolveEnd
in interface LexerParser
DslException
public final void parse() throws DslException, IOException
LexerParser
parse
in interface LexerParser
DslException
IOException
protected void handleAutoCompletes() throws DslException, IOException
DslException
IOException
public Object getResult()
LexerParser
getResult
in interface LexerParser
public void injectResult(InjectableLexerBlock parentBlock, Object parentResult) throws UtilsException
handleOtherInjectionStrategy(InjectableLexerBlock, Object)
injectResult
in interface LexerParser
UtilsException
protected void handleOtherInjectionStrategy(InjectableLexerBlock parentBlock, Object parentResult) throws UtilsException
UtilsException
protected void beforeParse() throws DslException, IOException
DslException
IOException
protected abstract Object internalParse() throws DslException, IOException
DslException
IOException
protected void afterParse() throws DslException, IOException
DslException
IOException
public void toStart()
LexerParser
toStart
in interface LexerParser
public void toStartOfParse()
LexerParser
toStartOfParse
in interface LexerParser
public void toEndOfParse()
LexerParser
toEndOfParse
in interface LexerParser
public void toEnd()
LexerParser
toEnd
in interface LexerParser
public boolean isExcludedFromHierarchy(Matcher matcher) throws DslException
LexerParser
isExcludedFromHierarchy
in interface LexerParser
DslException
public int getParseStartMark()
getParseStartMark
in interface LexerParser
public int getEffectiveParseStartMark()
getEffectiveParseStartMark
in interface LexerParser
public int getParseEndMark()
getParseEndMark
in interface LexerParser
public LexerParser getParent()
getParent
in interface LexerParser
public boolean isRoot()
LexerParser
isRoot
in interface LexerParser
public Grammar getGrammar()
getGrammar
in interface LexerParser
public AdvancedReader getSource()
getSource
in interface LexerParser
public ParsingContext getParsingContext()
getParsingContext
in interface LexerParser