Class TracingParseRunner<V>
java.lang.Object
org.parboiled.parserunners.AbstractParseRunner<V>
org.parboiled.parserunners.ReportingParseRunner<V>
org.parboiled.parserunners.TracingParseRunner<V>
- All Implemented Interfaces:
MatchHandler, ParseRunner<V>
A
ParseRunner implementation used for debugging purposes.
It exhibits the same behavior as the ReportingParseRunner but collects debugging information as to which
rules did match and which didn't.-
Constructor Summary
ConstructorsConstructorDescriptionTracingParseRunner(Rule rule) Creates a new TracingParseRunner instance without filter and a console log for the given rule. -
Method Summary
Modifier and TypeMethodDescriptiongetLog()booleanmatch(MatcherContext<?> context) Runs the given MatcherContext.protected ParsingResult<V> runBasicMatch(InputBuffer inputBuffer) withFilter(Predicate<?> filter) Attaches the given filter to this TracingParseRunner instance.Attaches the given log to this TracingParseRunner instance.Methods inherited from class ReportingParseRunner
run, run, runLocatingMatch, runReportingMatchMethods inherited from class AbstractParseRunner
createParsingResult, createRootContext, getParseErrors, getRootMatcher, getValueStack, resetValueStack, run, run, withParseErrors, withValueStack
-
Constructor Details
-
TracingParseRunner
Creates a new TracingParseRunner instance without filter and a console log for the given rule.- Parameters:
rule- the parser rule
-
-
Method Details
-
withFilter
Attaches the given filter to this TracingParseRunner instance. The given filter is used to select the matchers to print tracing statements for. NOTE: The given filter must be of type Predicateinvalid input: '<'Tuple2invalid input: '<'Contextinvalid input: '<'?>, Boolean>>. The reason this type is not directly specified in the constructors signature is that this would make predicate expressions using thePredicatesoperations and the predefined predicate constructors inFiltersmuch more cumbersome to write (due to Java limited type parameters inference logic you would have to explicitly state the type parameters in many places).- Parameters:
filter- the matcher filter selecting the matchers to print tracing statements for. Must be of type Predicateinvalid input: '<'Tuple2invalid input: '<'Contextinvalid input: '<'?>, Boolean>>.- Returns:
- this instance
-
getFilter
-
withLog
Attaches the given log to this TracingParseRunner instance.- Parameters:
log- the log to use- Returns:
- this instance
-
getLog
-
runBasicMatch
- Overrides:
runBasicMatchin classReportingParseRunner<V>
-
match
Description copied from interface:MatchHandlerRuns the given MatcherContext.- Specified by:
matchin interfaceMatchHandler- Parameters:
context- the MatcherContext- Returns:
- true if matched
-