Package org.parboiled.parserunners
Class ReportingParseRunner<V>
- java.lang.Object
-
- org.parboiled.parserunners.AbstractParseRunner<V>
-
- org.parboiled.parserunners.ReportingParseRunner<V>
-
- All Implemented Interfaces:
ParseRunner<V>
- Direct Known Subclasses:
TracingParseRunner
public class ReportingParseRunner<V> extends AbstractParseRunner<V>
AParseRunner
implementation that properly reports the firstInvalidInputError
if the input does not conform to the rule grammar. It performs exactly as theBasicParseRunner
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 Summary
Constructors Constructor Description ReportingParseRunner(Rule rule)
Creates a new ReportingParseRunner instance for the given rule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ParsingResult<V>
run(InputBuffer inputBuffer)
Performs the actual parse and creates a corresponding ParsingResult instance.static <V> ParsingResult<V>
run(Rule rule, 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.protected ParsingResult<V>
runBasicMatch(InputBuffer inputBuffer)
protected ParsingResult<V>
runLocatingMatch(InputBuffer inputBuffer)
protected ParsingResult<V>
runReportingMatch(InputBuffer inputBuffer, int errorIndex)
-
Methods inherited from class org.parboiled.parserunners.AbstractParseRunner
createParsingResult, createRootContext, getParseErrors, getRootMatcher, getValueStack, resetValueStack, run, run, withParseErrors, withValueStack
-
-
-
-
Constructor Detail
-
ReportingParseRunner
public ReportingParseRunner(Rule rule)
Creates a new ReportingParseRunner instance for the given rule.- Parameters:
rule
- the parser rule
-
-
Method Detail
-
run
@Deprecated public static <V> ParsingResult<V> run(Rule rule, 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.Create a new ReportingParseRunner instance with the given rule and input text and returns the result of itsAbstractParseRunner.run(String)
method invocation.- Parameters:
rule
- the parser rule to runinput
- the input text to run on- Returns:
- the ParsingResult for the parsing run
-
run
public ParsingResult<V> run(InputBuffer inputBuffer)
Description copied from interface:ParseRunner
Performs the actual parse and creates a corresponding ParsingResult instance.- Parameters:
inputBuffer
- the inputBuffer to use- Returns:
- the ParsingResult for the run
-
runBasicMatch
protected ParsingResult<V> runBasicMatch(InputBuffer inputBuffer)
-
runLocatingMatch
protected ParsingResult<V> runLocatingMatch(InputBuffer inputBuffer)
-
runReportingMatch
protected ParsingResult<V> runReportingMatch(InputBuffer inputBuffer, int errorIndex)
-
-