public class ReportingParseRunner<V> extends AbstractParseRunner<V>
ParseRunner
implementation that properly reports the first InvalidInputError
if the input
does not conform to the rule grammar.
It performs exactly as the BasicParseRunner
on valid input, however, on invalid input two more parsing
runs are initiated: one for recording the first parse error and one for collecting the error report information.Constructor and Description |
---|
ReportingParseRunner(Rule rule)
Creates a new ReportingParseRunner instance for the given rule.
|
Modifier and Type | Method and Description |
---|---|
ParsingResult<V> |
run(InputBuffer inputBuffer)
Performs the actual parse and creates a corresponding ParsingResult instance.
|
static <V> ParsingResult<V> |
run(Rule rule,
java.lang.String input)
Deprecated.
As of 0.11.0 you should use the "regular" constructor and one of the "run" methods rather than
this static method. This method will be removed in one of the coming releases.
|
protected ParsingResult<V> |
runBasicMatch(InputBuffer inputBuffer) |
protected ParsingResult<V> |
runLocatingMatch(InputBuffer inputBuffer) |
protected ParsingResult<V> |
runReportingMatch(InputBuffer inputBuffer,
int errorIndex) |
createParsingResult, createRootContext, getParseErrors, getRootMatcher, getValueStack, resetValueStack, run, run, withParseErrors, withValueStack
public ReportingParseRunner(Rule rule)
rule
- the parser rule@Deprecated public static <V> ParsingResult<V> run(Rule rule, java.lang.String input)
AbstractParseRunner.run(String)
method invocation.rule
- the parser rule to runinput
- the input text to run onpublic ParsingResult<V> run(InputBuffer inputBuffer)
ParseRunner
inputBuffer
- the inputBuffer to useprotected ParsingResult<V> runBasicMatch(InputBuffer inputBuffer)
protected ParsingResult<V> runLocatingMatch(InputBuffer inputBuffer)
protected ParsingResult<V> runReportingMatch(InputBuffer inputBuffer, int errorIndex)