public class TracingParseRunner<V> extends ReportingParseRunner<V> implements MatchHandler
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 and Description |
|---|
TracingParseRunner(Rule rule)
Creates a new TracingParseRunner instance without filter and a console log for the given rule.
|
| Modifier and Type | Method and Description |
|---|---|
Predicate<Tuple2<Context<?>,java.lang.Boolean>> |
getFilter() |
Sink<java.lang.String> |
getLog() |
boolean |
match(MatcherContext<?> context)
Runs the given MatcherContext.
|
TracingParseRunner<V> |
withFilter(Predicate<?> filter)
Attaches the given filter to this TracingParseRunner instance.
|
TracingParseRunner<V> |
withLog(Sink<java.lang.String> log)
Attaches the given log to this TracingParseRunner instance.
|
run, rungetParseErrors, getRootMatcher, getValueStack, run, run, withParseErrors, withValueStackpublic TracingParseRunner(Rule rule)
rule - the parser rulepublic TracingParseRunner<V> withFilter(Predicate<?> filter)
Predicates operations and the predefined predicate constructors in Filters
much more cumbersome to write (due to Java limited type parameters inference logic you would have to explicitly
state the type parameters in many places).filter - the matcher filter selecting the matchers to print tracing statements for. Must be of type
Predicatepublic TracingParseRunner<V> withLog(Sink<java.lang.String> log)
log - the log to usepublic Sink<java.lang.String> getLog()
public boolean match(MatcherContext<?> context)
MatchHandlermatch in interface MatchHandlercontext - the MatcherContext