org.parboiled.parserunners
Class ReportingParseRunner<V>
java.lang.Object
org.parboiled.parserunners.BasicParseRunner<V>
org.parboiled.parserunners.ReportingParseRunner<V>
- All Implemented Interfaces:
- ParseRunner<V>
public class ReportingParseRunner<V>
- extends BasicParseRunner<V>
A 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.
Method Summary |
static
|
run(Rule rule,
java.lang.String input)
Create a new ReportingParseRunner instance with the given rule and input text and returns the result of
its BasicParseRunner.run(String) method invocation. |
protected boolean |
runRootContext()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReportingParseRunner
public ReportingParseRunner(Rule rule)
- Creates a new ReportingParseRunner instance for the given rule.
- Parameters:
rule
- the parser rule
ReportingParseRunner
public ReportingParseRunner(Rule rule,
ValueStack<V> valueStack)
- Creates a new ReportingParseRunner instance for the given rule using the given ValueStack instance.
- Parameters:
rule
- the parser rulevalueStack
- the value stack
run
public static <V> ParsingResult<V> run(Rule rule,
java.lang.String input)
- Create a new ReportingParseRunner instance with the given rule and input text and returns the result of
its
BasicParseRunner.run(String)
method invocation.
- Parameters:
rule
- the parser rule to runinput
- the input text to run on
- Returns:
- the ParsingResult for the parsing run
runRootContext
protected boolean runRootContext()
- Overrides:
runRootContext
in class BasicParseRunner<V>