Avoid creating PredicateEvalInfo events for precedence predicates

This commit is contained in:
Sam Harwell 2014-06-02 20:59:31 -05:00
parent 244c8ee0c7
commit 5e93d5f7b7
1 changed files with 8 additions and 5 deletions

View File

@ -164,11 +164,14 @@ public class ProfilingATNSimulator extends ParserATNSimulator {
@Override
protected boolean evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx) {
boolean result = super.evalSemanticContext(pred, parserCallStack, alt, fullCtx);
boolean fullContext = _llStopIndex >= 0;
int stopIndex = fullContext ? _llStopIndex : _sllStopIndex;
decisions[currentDecision].predicateEvals.add(
new PredicateEvalInfo(currentDecision, _input, _startIndex, stopIndex, pred, result, alt, fullCtx)
);
if (!(pred instanceof SemanticContext.PrecedencePredicate)) {
boolean fullContext = _llStopIndex >= 0;
int stopIndex = fullContext ? _llStopIndex : _sllStopIndex;
decisions[currentDecision].predicateEvals.add(
new PredicateEvalInfo(currentDecision, _input, _startIndex, stopIndex, pred, result, alt, fullCtx)
);
}
return result;
}