Class ErrorReportingParseRunner<V>
java.lang.Object
org.parboiled.parserunners.AbstractParseRunner<V>
org.parboiled.parserunners.ErrorReportingParseRunner<V>
- All Implemented Interfaces:
MatchHandler, ParseRunner<V>
A
ParseRunner implementation that creates an
InvalidInputError for the error at a known error location.
It never causes the parser to perform more than one parsing run and is rarely used directly.
Instead its functionality is relied upon by the ReportingParseRunner and RecoveringParseRunner classes.-
Constructor Summary
ConstructorsConstructorDescriptionErrorReportingParseRunner(Rule rule, int errorIndex) Creates a new ErrorReportingParseRunner instance for the given rule and the given errorIndex.ErrorReportingParseRunner(Rule rule, int errorIndex, MatchHandler inner) Creates a new ErrorReportingParseRunner instance for the given rule and the given errorIndex. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(MatcherContext<?> context) Runs the given MatcherContext.run(InputBuffer inputBuffer) Performs the actual parse and creates a corresponding ParsingResult instance.Methods inherited from class AbstractParseRunner
createParsingResult, createRootContext, getParseErrors, getRootMatcher, getValueStack, resetValueStack, run, run, withParseErrors, withValueStack
-
Constructor Details
-
ErrorReportingParseRunner
Creates a new ErrorReportingParseRunner instance for the given rule and the given errorIndex.- Parameters:
rule- the parser ruleerrorIndex- the index of the error to report
-
ErrorReportingParseRunner
Creates a new ErrorReportingParseRunner instance for the given rule and the given errorIndex. The given MatchHandler is used as a delegate for the actual match handling.- Parameters:
rule- the parser ruleerrorIndex- the index of the error to reportinner- another MatchHandler to delegate the actual match handling to, can be null
-
-
Method Details
-
run
Description copied from interface:ParseRunnerPerforms the actual parse and creates a corresponding ParsingResult instance.- Specified by:
runin interfaceParseRunner<V>- Parameters:
inputBuffer- the inputBuffer to use- Returns:
- the ParsingResult for the run
-
match
Description copied from interface:MatchHandlerRuns the given MatcherContext.- Specified by:
matchin interfaceMatchHandler- Parameters:
context- the MatcherContext- Returns:
- true if matched
-