public class BasicParseRunner<V> extends AbstractParseRunner<V> implements MatchHandler
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 and Description |
---|
BasicParseRunner(Rule rule)
Creates a new BasicParseRunner instance for the given rule.
|
Modifier and Type | Method and Description |
---|---|
boolean |
match(MatcherContext<?> context)
Runs the given MatcherContext.
|
ParsingResult<V> |
run(InputBuffer inputBuffer)
Performs the actual parse and creates a corresponding ParsingResult instance.
|
static <V> ParsingResult<V> |
run(Rule rule,
java.lang.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.
|
createParsingResult, createRootContext, getParseErrors, getRootMatcher, getValueStack, resetValueStack, run, run, withParseErrors, withValueStack
public BasicParseRunner(Rule rule)
rule
- the parser rule@Deprecated public static <V> ParsingResult<V> run(Rule rule, java.lang.String input)
AbstractParseRunner.run(String)
method invocation.rule
- the parser rule to runinput
- the input text to run onpublic 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 MatcherContext