setTraceConditionFunction

Supply a function to dynamically switch tracing on and off based on the rule name.

  1. void setTraceConditionFunction(bool delegate(string ruleName, const ref ParseTree p) condition)
  2. void setTraceConditionFunction(bool function(string ruleName, const ref ParseTree p) condition)
    version(tracer)
    void
    setTraceConditionFunction
    (
    bool function(
    string ruleName
    ,
    const ref ParseTree p
    )
    condition
    )

Examples

/* Exclude build-in parsers, only trace parsers generated from MyGrammar. */
setTraceConditionFunction(ruleName => ruleName.startsWith("MyGrammar"));

Meta