org.parboiled.parserunners
Class BasicParseRunner<V>

java.lang.Object
  extended by org.parboiled.parserunners.AbstractParseRunner<V>
      extended by org.parboiled.parserunners.BasicParseRunner<V>
All Implemented Interfaces:
MatchHandler, ParseRunner<V>

public class BasicParseRunner<V>
extends AbstractParseRunner<V>
implements MatchHandler

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
BasicParseRunner(Rule rule)
          Creates a new BasicParseRunner instance for the given rule.
 
Method Summary
 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.
 
Methods inherited from class org.parboiled.parserunners.AbstractParseRunner
getParseErrors, getRootMatcher, getValueStack, run, run, withParseErrors, withValueStack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicParseRunner

public BasicParseRunner(Rule rule)
Creates a new BasicParseRunner instance for the given rule.

Parameters:
rule - the parser rule
Method Detail

run

@Deprecated
public 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.

Create a new BasicParseRunner instance with the given rule and input text and returns the result of its AbstractParseRunner.run(String) method invocation.

Parameters:
rule - the parser rule to run
input - 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.

Specified by:
run in interface ParseRunner<V>
Parameters:
inputBuffer - the inputBuffer to use
Returns:
the ParsingResult for the run

match

public boolean match(MatcherContext<?> context)
Description copied from interface: MatchHandler
Runs the given MatcherContext.

Specified by:
match in interface MatchHandler
Parameters:
context - the MatcherContext
Returns:
true if matched