setTrace method

void setTrace(
  1. bool trace
)
inherited

During a parse is sometimes useful to listen in on the rule entry and exit events as well as token matches. This is for quick and dirty debugging.

Implementation

void setTrace(bool trace) {
  if (!trace) {
    removeParseListener(_tracer);
    _tracer = null;
  } else {
    if (_tracer != null) {
      removeParseListener(_tracer);
    } else {
      _tracer = TraceListener(this);
    }
    addParseListener(_tracer!);
  }
}