setProfile method
@since 4.3
Implementation
void setProfile(bool profile) {
final interp = interpreter!;
final saveMode = interp.predictionMode;
if (profile) {
if (interp is! ProfilingATNSimulator) {
interpreter = ProfilingATNSimulator(this);
}
} else if (interp is ProfilingATNSimulator) {
final sim = ParserATNSimulator(
this,
getATN(),
interp.decisionToDFA,
interp.sharedContextCache,
);
interpreter = sim;
}
interpreter!.predictionMode = saveMode;
}