Package org.parboiled.parserunners
Class ErrorLocatingParseRunner<V>
java.lang.Object
org.parboiled.parserunners.AbstractParseRunner<V>
org.parboiled.parserunners.ErrorLocatingParseRunner<V>
- All Implemented Interfaces:
MatchHandler
,ParseRunner<V>
A
ParseRunner
implementation that creates a simple BasicParseError
for the first error found in the
input and adds it to the list of ParseErrors.
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
ConstructorsConstructorDescriptionErrorLocatingParseRunner
(Rule rule) Creates a new ErrorLocatingParseRunner instance for the given rule.ErrorLocatingParseRunner
(Rule rule, MatchHandler inner) Creates a new ErrorLocatingParseRunner instance for the given rule. -
Method Summary
Modifier and TypeMethodDescriptionboolean
match
(MatcherContext<?> context) Runs the given MatcherContext.run
(InputBuffer inputBuffer) Performs the actual parse and creates a corresponding ParsingResult instance.Methods inherited from class org.parboiled.parserunners.AbstractParseRunner
getParseErrors, getRootMatcher, getValueStack, run, run, withParseErrors, withValueStack
-
Constructor Details
-
ErrorLocatingParseRunner
Creates a new ErrorLocatingParseRunner instance for the given rule.- Parameters:
rule
- the parser rule
-
ErrorLocatingParseRunner
Creates a new ErrorLocatingParseRunner instance for the given rule. The given MatchHandler is used as a delegate for the actual match handling.- Parameters:
rule
- the parser ruleinner
- another MatchHandler to delegate the actual match handling to, can be null
-
-
Method Details
-
run
Description copied from interface:ParseRunner
Performs the actual parse and creates a corresponding ParsingResult instance.- Specified by:
run
in interfaceParseRunner<V>
- Parameters:
inputBuffer
- the inputBuffer to use- Returns:
- the ParsingResult for the run
-
match
Description copied from interface:MatchHandler
Runs the given MatcherContext.- Specified by:
match
in interfaceMatchHandler
- Parameters:
context
- the MatcherContext- Returns:
- true if matched
-