public class ErrorLocatingParseRunner<V> extends AbstractParseRunner<V> implements MatchHandler
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.Modifier and Type | Field and Description |
---|---|
private int |
errorIndex |
private MatchHandler |
inner |
Constructor and Description |
---|
ErrorLocatingParseRunner(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
match(MatcherContext<?> context)
Runs the given MatcherContext.
|
private boolean |
notTestNot(MatcherContext context) |
ParsingResult<V> |
run(InputBuffer inputBuffer)
Performs the actual parse and creates a corresponding ParsingResult instance.
|
createParsingResult, createRootContext, getParseErrors, getRootMatcher, getValueStack, resetValueStack, run, run, withParseErrors, withValueStack
private final MatchHandler inner
private int errorIndex
public ErrorLocatingParseRunner(Rule rule)
rule
- the parser rulepublic ErrorLocatingParseRunner(Rule rule, MatchHandler inner)
rule
- the parser ruleinner
- another MatchHandler to delegate the actual match handling to, can be nullpublic ParsingResult<V> run(InputBuffer inputBuffer)
ParseRunner
run
in interface ParseRunner<V>
inputBuffer
- the inputBuffer to usepublic boolean match(MatcherContext<?> context)
MatchHandler
match
in interface MatchHandler
context
- the MatcherContextprivate boolean notTestNot(MatcherContext context)