public abstract class AbstractParseRunner<V> extends java.lang.Object implements ParseRunner<V>
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
initialValueStackSnapshot |
private java.util.List<ParseError> |
parseErrors |
private Matcher |
rootMatcher |
private ValueStack<V> |
valueStack |
Constructor and Description |
---|
AbstractParseRunner(Rule rule) |
Modifier and Type | Method and Description |
---|---|
protected ParsingResult<V> |
createParsingResult(boolean matched,
MatcherContext<V> rootContext) |
protected MatcherContext<V> |
createRootContext(InputBuffer inputBuffer,
MatchHandler matchHandler,
boolean fastStringMatching) |
java.util.List<ParseError> |
getParseErrors() |
Matcher |
getRootMatcher() |
ValueStack<V> |
getValueStack() |
protected void |
resetValueStack() |
ParsingResult<V> |
run(char[] input)
Performs the actual parse and creates a corresponding ParsingResult instance.
|
ParsingResult<V> |
run(java.lang.String input)
Performs the actual parse and creates a corresponding ParsingResult instance.
|
ParseRunner<V> |
withParseErrors(java.util.List<ParseError> parseErrors)
Initializes the parse runner with the given error list.
|
ParseRunner<V> |
withValueStack(ValueStack<V> valueStack)
Initializes the parse runner with the given ValueStack instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private final Matcher rootMatcher
private java.util.List<ParseError> parseErrors
private ValueStack<V> valueStack
private java.lang.Object initialValueStackSnapshot
public AbstractParseRunner(Rule rule)
public Matcher getRootMatcher()
public ParseRunner<V> withParseErrors(java.util.List<ParseError> parseErrors)
ParseRunner
withParseErrors
in interface ParseRunner<V>
parseErrors
- the error list to start off withpublic java.util.List<ParseError> getParseErrors()
public ParseRunner<V> withValueStack(ValueStack<V> valueStack)
ParseRunner
withValueStack
in interface ParseRunner<V>
valueStack
- the ValueStack to usepublic ValueStack<V> getValueStack()
public ParsingResult<V> run(java.lang.String input)
ParseRunner
run
in interface ParseRunner<V>
input
- the input text to parsepublic ParsingResult<V> run(char[] input)
ParseRunner
run
in interface ParseRunner<V>
input
- the input text to parseprotected void resetValueStack()
protected MatcherContext<V> createRootContext(InputBuffer inputBuffer, MatchHandler matchHandler, boolean fastStringMatching)
protected ParsingResult<V> createParsingResult(boolean matched, MatcherContext<V> rootContext)