@Override
	protected boolean evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx) {
		boolean result = super.evalSemanticContext(pred, parserCallStack, 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;
	}
At the point of LL failover, we record how SLL would resolve the conflict so that
 we can determine whether or not a decision / input pair is context-sensitive.
 If LL gives a different result than SLL's predicted alternative, we have a
 context sensitivity for sure. The converse is not necessarily true, however.
 It's possible that after conflict resolution chooses minimum alternatives,
 SLL could get the same answer as LL. Regardless of whether or not the result indicates
 an ambiguity, it is not treated as a context sensitivity because LL prediction
 was not required in order to produce a correct prediction for this decision and input sequence.
 It may in fact still be a context sensitivity but we don't know by looking at the
 minimum alternatives for the current input.
runtime/Java/src/org/antlr/v4/runtime/atn/ProfilingATNSimulator.java