reportAttemptingFullContext method

  1. @override
void reportAttemptingFullContext(
  1. Parser recognizer,
  2. DFA dfa,
  3. int startIndex,
  4. int stopIndex,
  5. BitSet? conflictingAlts,
  6. ATNConfigSet configs,
)
override

This method is called when an SLL conflict occurs and the parser is about to use the full context information to make an LL decision.

If one or more configurations in [configs] contains a semantic predicate, the predicates are evaluated before this method is called. The subset of alternatives which are still viable after predicates are evaluated is reported in [conflictingAlts].

This method is not used by lexers.

@param recognizer the parser instance @param dfa the DFA for the current decision @param startIndex the input index where the decision started @param stopIndex the input index where the SLL conflict occurred @param conflictingAlts The specific conflicting alternatives. If this is null, the conflicting alternatives are all alternatives represented in configs. At the moment, conflictingAlts is non-null (for the reference implementation, but Sam's optimized version can see this as null). @param configs the ATN configuration set where the SLL conflict was detected

Implementation

@override
void reportAttemptingFullContext(
  Parser recognizer,
  DFA dfa,
  int startIndex,
  int stopIndex,
  BitSet? conflictingAlts,
  ATNConfigSet configs,
) {
  final decision = getDecisionDescription(recognizer, dfa);
  final text = recognizer.tokenStream.getText(
    Interval.of(startIndex, stopIndex),
  );
  final message = "reportAttemptingFullContext d=$decision, input='$text'";
  recognizer.notifyErrorListeners(message);
}