Package org.parboiled.parserunners
Class BasicParseRunner<V>
java.lang.Object
org.parboiled.parserunners.AbstractParseRunner<V>
org.parboiled.parserunners.BasicParseRunner<V>
- All Implemented Interfaces:
MatchHandler
,ParseRunner<V>
The most basic of all
ParseRunner
implementations. It runs a rule against a given input text and builds a
corresponding ParsingResult
instance. However, it does not report any parse errors nor recover from them.
Instead it simply marks the ParsingResult as "unmatched" if the input is not valid with regard to the rule grammar.
It never causes the parser to perform more than one parsing run and is the fastest way to determine
whether a given input conforms to the rule grammar.-
Constructor Summary
ConstructorDescriptionBasicParseRunner
(Rule rule) Creates a new BasicParseRunner 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.static <V> ParsingResult<V>
Deprecated.As of 0.11.0 you should use the "regular" constructor and one of the "run" methods rather than this static method.Methods inherited from class org.parboiled.parserunners.AbstractParseRunner
getParseErrors, getRootMatcher, getValueStack, run, run, withParseErrors, withValueStack
-
Constructor Details
-
BasicParseRunner
Creates a new BasicParseRunner instance for the given rule.- Parameters:
rule
- the parser rule
-
-
Method Details
-
run
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 BasicParseRunner 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
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
-