|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.parboiled.parserunners.BasicParseRunner<V>
public class BasicParseRunner<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.
Nested Class Summary | |
---|---|
static class |
BasicParseRunner.Handler
The most trivial MatchHandler implementation. |
Field Summary | |
---|---|
protected java.lang.Object |
initialValueStackSnapshot
|
protected InputBuffer |
inputBuffer
|
protected boolean |
matched
|
protected java.util.List<ParseError> |
parseErrors
|
protected MatcherContext<V> |
rootContext
|
Matcher |
rootMatcher
|
protected ValueStack<V> |
valueStack
|
Constructor Summary | |
---|---|
BasicParseRunner(Rule rule)
Creates a new BasicParseRunner instance for the given rule. |
|
BasicParseRunner(Rule rule,
ValueStack<V> valueStack)
Creates a new BasicParseRunner instance for the given rule using the given ValueStack instance. |
Method Summary | ||
---|---|---|
ParsingResult<V> |
run(char[] input)
|
|
ParsingResult<V> |
run(InputBuffer inputBuffer)
Performs the actual parse and creates a corresponding ParsingResult instance. |
|
static
|
run(Rule rule,
java.lang.String input)
Create a new BasicParseRunner instance with the given rule and input text and returns the result of its run(String) method invocation. |
|
ParsingResult<V> |
run(java.lang.String input)
Performs the actual parse and creates a corresponding ParsingResult instance. |
|
protected boolean |
runRootContext()
|
|
protected boolean |
runRootContext(MatchHandler handler,
boolean fastStringMatching)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.List<ParseError> parseErrors
protected final ValueStack<V> valueStack
protected final java.lang.Object initialValueStackSnapshot
public final Matcher rootMatcher
protected InputBuffer inputBuffer
protected MatcherContext<V> rootContext
protected boolean matched
Constructor Detail |
---|
public BasicParseRunner(Rule rule)
rule
- the parser rulepublic BasicParseRunner(Rule rule, ValueStack<V> valueStack)
rule
- the parser rulevalueStack
- the value stackMethod Detail |
---|
public static <V> ParsingResult<V> run(Rule rule, java.lang.String input)
run(String)
method invocation.
rule
- the parser rule to runinput
- the input text to run on
public ParsingResult<V> run(java.lang.String input)
ParseRunner
run
in interface ParseRunner<V>
input
- the input text to parse
public ParsingResult<V> run(char[] input)
public ParsingResult<V> run(InputBuffer inputBuffer)
ParseRunner
run
in interface ParseRunner<V>
inputBuffer
- the inputBuffer to use
protected boolean runRootContext()
protected boolean runRootContext(MatchHandler handler, boolean fastStringMatching)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |