use of org.antlr.v4.runtime.atn.ProfilingATNSimulator in project antlr4 by antlr.
the class Parser method setProfile.
/**
* @since 4.3
*/
public void setProfile(boolean profile) {
ParserATNSimulator interp = getInterpreter();
PredictionMode saveMode = interp.getPredictionMode();
if (profile) {
if (!(interp instanceof ProfilingATNSimulator)) {
setInterpreter(new ProfilingATNSimulator(this));
}
} else if (interp instanceof ProfilingATNSimulator) {
ParserATNSimulator sim = new ParserATNSimulator(this, getATN(), interp.decisionToDFA, interp.getSharedContextCache());
setInterpreter(sim);
}
getInterpreter().setPredictionMode(saveMode);
}
use of org.antlr.v4.runtime.atn.ProfilingATNSimulator in project antlr4 by tunnelvisionlabs.
the class Parser method setProfile.
/**
* @since 4.3
*/
public void setProfile(boolean profile) {
ParserATNSimulator interp = getInterpreter();
if (profile) {
if (!(interp instanceof ProfilingATNSimulator)) {
setInterpreter(new ProfilingATNSimulator(this));
}
} else if (interp instanceof ProfilingATNSimulator) {
setInterpreter(new ParserATNSimulator(this, getATN()));
}
getInterpreter().setPredictionMode(interp.getPredictionMode());
}
Aggregations