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 @Override
protected boolean evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx) { protected boolean evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx) {
boolean result = super.evalSemanticContext(pred, parserCallStack, alt, fullCtx); boolean result = super.evalSemanticContext(pred, parserCallStack, alt, fullCtx);
boolean fullContext = _llStopIndex >= 0; if (!(pred instanceof SemanticContext.PrecedencePredicate)) {
int stopIndex = fullContext ? _llStopIndex : _sllStopIndex; boolean fullContext = _llStopIndex >= 0;
decisions[currentDecision].predicateEvals.add( int stopIndex = fullContext ? _llStopIndex : _sllStopIndex;
new PredicateEvalInfo(currentDecision, _input, _startIndex, stopIndex, pred, result, alt, fullCtx) decisions[currentDecision].predicateEvals.add(
); new PredicateEvalInfo(currentDecision, _input, _startIndex, stopIndex, pred, result, alt, fullCtx)
);
}
return result; return result;
} }