Java Code Examples for org.antlr.v4.runtime.dfa.DFA

The following are top voted examples for showing how to use org.antlr.v4.runtime.dfa.DFA. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: goworks   File: StatisticsParserATNSimulator.java   View source code 6 votes vote down vote up
@Override
protected void reportAttemptingFullContext(DFA dfa, BitSet conflictingAlts, SimulatorState conflictState, int startIndex, int stopIndex) {
    super.reportAttemptingFullContext(dfa, conflictingAlts, conflictState, startIndex, stopIndex);
        int k;
        if (startIndex == stopIndex) {
            k = 1;
        } else if (startIndex == stopIndex - 1) {
            k = 2;
        } else {
            k = 0;
            for (int i = startIndex; i <= stopIndex; i++) {
                parser.getInputStream().seek(i);
                if (parser.getInputStream().LT(1).getChannel() == Token.DEFAULT_CHANNEL) {
                    k++;
                }
            }
        }

    fullContextFallback[dfa.decision]++;
    totalLookaheadSll[dfa.decision] += k;
    minLookaheadSll[dfa.decision] = Math.min(minLookaheadSll[dfa.decision], k);
    maxLookaheadSll[dfa.decision] = Math.max(maxLookaheadSll[dfa.decision], k);
}
 
Example 2
Project: Scratch-ApuC   File: LexerInterpreter.java   View source code 6 votes vote down vote up
public LexerInterpreter(String grammarFileName, Collection<String> tokenNames, Collection<String> ruleNames, Collection<String> modeNames, ATN atn, CharStream input) {
	super(input);

	if (atn.grammarType != ATNType.LEXER) {
		throw new IllegalArgumentException("The ATN must be a lexer ATN.");
	}

	this.grammarFileName = grammarFileName;
	this.atn = atn;
	this.tokenNames = tokenNames.toArray(new String[tokenNames.size()]);
	this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]);
	this.modeNames = modeNames.toArray(new String[modeNames.size()]);

	this._decisionToDFA = new DFA[atn.getNumberOfDecisions()];
	for (int i = 0; i < _decisionToDFA.length; i++) {
		_decisionToDFA[i] = new DFA(atn.getDecisionState(i), i);
	}
	this._interp = new LexerATNSimulator(this,atn,_decisionToDFA,_sharedContextCache);
}
 
Example 3
Project: Scratch-ApuC   File: DiagnosticErrorListener.java   View source code 6 votes vote down vote up
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
							@NotNull DFA dfa,
							int startIndex,
							int stopIndex,
							boolean exact,
							@Nullable BitSet ambigAlts,
							@NotNull ATNConfigSet configs)
{
	if (exactOnly && !exact) {
		return;
	}

	String format = "reportAmbiguity d=%s: ambigAlts=%s, input='%s'";
	String decision = getDecisionDescription(recognizer, dfa);
	BitSet conflictingAlts = getConflictingAlts(ambigAlts, configs);
	String text = recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex));
	String message = String.format(format, decision, conflictingAlts, text);
	recognizer.notifyErrorListeners(message);
}
 
Example 4
Project: Scratch-ApuC   File: DiagnosticErrorListener.java   View source code 6 votes vote down vote up
protected String getDecisionDescription(@NotNull Parser recognizer, @NotNull DFA dfa) {
	int decision = dfa.decision;
	int ruleIndex = dfa.atnStartState.ruleIndex;

	String[] ruleNames = recognizer.getRuleNames();
	if (ruleIndex < 0 || ruleIndex >= ruleNames.length) {
		return String.valueOf(decision);
	}

	String ruleName = ruleNames[ruleIndex];
	if (ruleName == null || ruleName.isEmpty()) {
		return String.valueOf(decision);
	}

	return String.format("%d (%s)", decision, ruleName);
}
 
Example 5
Project: Scratch-ApuC   File: ParserATNSimulator.java   View source code 6 votes vote down vote up
/**
 * Add state {@code D} to the DFA if it is not already present, and return
 * the actual instance stored in the DFA. If a state equivalent to {@code D}
 * is already in the DFA, the existing state is returned. Otherwise this
 * method returns {@code D} after adding it to the DFA.
 *
 * <p>If {@code D} is {@link #ERROR}, this method returns {@link #ERROR} and
 * does not change the DFA.</p>
 *
 * @param dfa The dfa
 * @param D The DFA state to add
 * @return The state stored in the DFA. This will be either the existing
 * state if {@code D} is already in the DFA, or {@code D} itself if the
 * state was not already present.
 */
@NotNull
protected DFAState addDFAState(@NotNull DFA dfa, @NotNull DFAState D) {
	if (D == ERROR) {
		return D;
	}

	synchronized (dfa.states) {
		DFAState existing = dfa.states.get(D);
		if ( existing!=null ) return existing;

		D.stateNumber = dfa.states.size();
		if (!D.configs.isReadonly()) {
			D.configs.optimizeConfigs(this);
			D.configs.setReadonly(true);
		}
		dfa.states.put(D, D);
		if ( debug ) System.out.println("adding new DFA state: "+D);
		return D;
	}
}
 
Example 6
Project: Scratch-ApuC   File: ProfilingATNSimulator.java   View source code 6 votes vote down vote up
@Override
protected void reportAmbiguity(@NotNull DFA dfa, DFAState D, int startIndex, int stopIndex, boolean exact,
							   @Nullable BitSet ambigAlts, @NotNull ATNConfigSet configs)
{
	int prediction;
	if ( ambigAlts!=null ) {
		prediction = ambigAlts.nextSetBit(0);
	}
	else {
		prediction = configs.getAlts().nextSetBit(0);
	}
	if ( configs.fullCtx && prediction != conflictingAltResolvedBySLL ) {
		// Even though this is an ambiguity we are reporting, we can
		// still detect some context sensitivities.  Both SLL and LL
		// are showing a conflict, hence an ambiguity, but if they resolve
		// to different minimum alternatives we have also identified a
		// context sensitivity.
		decisions[currentDecision].contextSensitivities.add(
				new ContextSensitivityInfo(currentDecision, configs, _input, startIndex, stopIndex)
		);
	}
	decisions[currentDecision].ambiguities.add(
		new AmbiguityInfo(currentDecision, configs, _input, startIndex, stopIndex, configs.fullCtx)
	);
	super.reportAmbiguity(dfa, D, startIndex, stopIndex, exact, ambigAlts, configs);
}
 
Example 7
Project: Scratch-ApuC   File: LexerATNSimulator.java   View source code 6 votes vote down vote up
public int match(@NotNull CharStream input, int mode) {
	match_calls++;
	this.mode = mode;
	int mark = input.mark();
	try {
		this.startIndex = input.index();
		this.prevAccept.reset();
		DFA dfa = decisionToDFA[mode];
		if ( dfa.s0==null ) {
			return matchATN(input);
		}
		else {
			return execATN(input, dfa.s0);
		}
	}
	finally {
		input.release(mark);
	}
}
 
Example 8
Project: antlrworks2   File: StatisticsParserATNSimulator.java   View source code 6 votes vote down vote up
@Override
protected void reportAttemptingFullContext(DFA dfa, BitSet conflictingAlts, SimulatorState conflictState, int startIndex, int stopIndex) {
    super.reportAttemptingFullContext(dfa, conflictingAlts, conflictState, startIndex, stopIndex);
        int k;
        if (startIndex == stopIndex) {
            k = 1;
        } else if (startIndex == stopIndex - 1) {
            k = 2;
        } else {
            k = 0;
            for (int i = startIndex; i <= stopIndex; i++) {
                parser.getInputStream().seek(i);
                if (parser.getInputStream().LT(1).getChannel() == Token.DEFAULT_CHANNEL) {
                    k++;
                }
            }
        }

    fullContextFallback[dfa.decision]++;
    totalLookaheadSll[dfa.decision] += k;
    minLookaheadSll[dfa.decision] = Math.min(minLookaheadSll[dfa.decision], k);
    maxLookaheadSll[dfa.decision] = Math.max(maxLookaheadSll[dfa.decision], k);
}
 
Example 9
Project: digraph-parser   File: GraphParser.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
							@NotNull DFA dfa,
							int startIndex,
							int stopIndex,
							boolean exact,
							@Nullable BitSet ambigAlts,
							@NotNull ATNConfigSet configs)
{
}
 
Example 10
Project: digraph-parser   File: GraphParser.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(@NotNull Parser recognizer,
										@NotNull DFA dfa,
										int startIndex,
										int stopIndex,
										@Nullable BitSet conflictingAlts,
										@NotNull ATNConfigSet configs)
{
}
 
Example 11
Project: digraph-parser   File: GraphParser.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(@NotNull Parser recognizer,
									 @NotNull DFA dfa,
									 int startIndex,
									 int stopIndex,
									 int prediction,
									 @NotNull ATNConfigSet configs)
{
}
 
Example 12
Project: yauaa   File: UserAgent.java   View source code 5 votes vote down vote up
@Override
    public void reportAmbiguity(
            Parser recognizer,
            DFA dfa,
            int startIndex,
            int stopIndex,
            boolean exact,
            BitSet ambigAlts,
            ATNConfigSet configs) {
        hasAmbiguity = true;
        ambiguityCount++;
//        allFields.put("__Ambiguity__",new AgentField("true"));
    }
 
Example 13
Project: yauaa   File: UserAgent.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        BitSet conflictingAlts,
        ATNConfigSet configs) {
}
 
Example 14
Project: yauaa   File: UserAgent.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        int prediction,
        ATNConfigSet configs) {

}
 
Example 15
Project: yauaa   File: MatcherAction.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        boolean exact,
        BitSet ambigAlts,
        ATNConfigSet configs) {
    // Ignore this type of problem
}
 
Example 16
Project: yauaa   File: MatcherAction.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        BitSet conflictingAlts,
        ATNConfigSet configs) {
    // Ignore this type of problem
}
 
Example 17
Project: yauaa   File: MatcherAction.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        int prediction,
        ATNConfigSet configs) {
    // Ignore this type of problem
}
 
Example 18
Project: libraries   File: JSSDReader.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(
    final Parser recognizer,
    final DFA dfa,
    final int startIndex,
    final int stopIndex,
    final int prediction,
    final ATNConfigSet configs) {
  this.messages
      .add("Context sensitivity violation, at " + startIndex + " until " + stopIndex + ", " + recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
 
Example 19
Project: libraries   File: JSSDReader.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(
    final Parser recognizer,
    final DFA dfa,
    final int startIndex,
    final int stopIndex,
    final boolean exact,
    final BitSet ambigAlts,
    final ATNConfigSet configs) {
  this.messages
      .add("ambiguity, at " + startIndex + " until " + stopIndex + ", " + recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
 
Example 20
Project: inmemantlr   File: InmemantlrErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(Parser recognizer,
                            DFA dfa,
                            int startIndex,
                            int stopIndex,
                            boolean exact,
                            BitSet ambigAlts,
                            ATNConfigSet configs)
{
    log.put(Type.AMBIGUITY, "Ambiguity " + startIndex + " " + stopIndex);
}
 
Example 21
Project: inmemantlr   File: InmemantlrErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(Parser recognizer,
                                        DFA dfa,
                                        int startIndex,
                                        int stopIndex,
                                        BitSet conflictingAlts,
                                        ATNConfigSet configs)
{
    log.put(Type.FULL_CTX, "Attempting full Context " + startIndex + " " +
            stopIndex);
}
 
Example 22
Project: inmemantlr   File: InmemantlrErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(Parser recognizer,
                                     DFA dfa,
                                     int startIndex,
                                     int stopIndex,
                                     int prediction,
                                     ATNConfigSet configs)
{
    log.put(Type.CTX_SSTV, "Context Sensitivity " + startIndex + " " +
            stopIndex);
}
 
Example 23
Project: antioch   File: QueryErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
  LOG.warn("reportAmbiguity:");
  LOG.warn("recognizer={}", recognizer);
  LOG.warn("dfa={}", dfa);
  LOG.warn("startIndex={}", startIndex);
  LOG.warn("stopIndex={}", stopIndex);
  LOG.warn("exact={}", exact);
  LOG.warn("ambigAlts={}", ambigAlts);
  LOG.warn("configs={}", configs);
  parseErrors.add("ambiguity at (" + startIndex + ".." + stopIndex + ")");
}
 
Example 24
Project: antioch   File: QueryErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, ATNConfigSet configs) {
  LOG.warn("reportContextSensitivity:");
  LOG.warn("recognizer={}", recognizer);
  LOG.warn("dfa={}", dfa);
  LOG.warn("startIndex={}", startIndex);
  LOG.warn("stopIndex={}", stopIndex);
  LOG.warn("prediction={}", prediction);
  LOG.warn("configs={}", configs);
  parseErrors.add("contextSensitivity at (" + startIndex + ".." + stopIndex + ")");
}
 
Example 25
Project: antioch   File: QueryErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, ATNConfigSet configs) {
  LOG.warn("reportAttemptingFullContext:");
  LOG.warn("recognizer={}", recognizer);
  LOG.warn("dfa={}", dfa);
  LOG.warn("startIndex={}", startIndex);
  LOG.warn("stopIndex={}", stopIndex);
  LOG.warn("conflictingAlts={}", conflictingAlts);
  LOG.warn("configs={}", configs);
  parseErrors.add("attemptingFullContext at (" + startIndex + ".." + stopIndex + ")");
}
 
Example 26
Project: srclib-basic   File: DefaultErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(Parser parser,
                            DFA dfa,
                            int i,
                            int i1,
                            boolean b,
                            BitSet bitSet,
                            ATNConfigSet atnConfigSet) {

}
 
Example 27
Project: srclib-basic   File: DefaultErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(Parser parser,
                                        DFA dfa,
                                        int i,
                                        int i1,
                                        BitSet bitSet,
                                        ATNConfigSet atnConfigSet) {

}
 
Example 28
Project: archie   File: ADLErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
    String input = recognizer.getInputStream().getText(new Interval(startIndex, stopIndex));
    String warning = String.format("FULL AMBIGUITY: %d-%d, exact: %b, input: %s", startIndex, stopIndex, exact, input);
    logger.debug(warning);
    errors.addWarning(warning);
}
 
Example 29
Project: MiniJCompiler   File: Parser.java   View source code 5 votes vote down vote up
@Override
public void reportAttemptingFullContext(
		org.antlr.v4.runtime.Parser recognizer, DFA dfa,
		int startIndex, int stopIndex, BitSet conflictingAlts,
		ATNConfigSet configs) {
	errorOccurred = true;
}
 
Example 30
Project: MiniJCompiler   File: Parser.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(
		org.antlr.v4.runtime.Parser recognizer, DFA dfa,
		int startIndex, int stopIndex, int prediction,
		ATNConfigSet configs) {
	errorOccurred = true;
}
 
Example 31
Project: antlr4-regressionTestRig   File: PrintStreamErrorListener.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 * <p>
 * We simply increment the number of Ambiguity warnings.
 */
 @Override
public void reportAmbiguity(Parser recognizer,
                      DFA dfa,
                      int startIndex,
                      int stopIndex,
                      boolean exact,
                      BitSet ambigAlts,
                      ATNConfigSet configs) {
    numAmbiguityWarnings++;
  }
 
Example 32
Project: antlr4-regressionTestRig   File: PrintStreamErrorListener.java   View source code 5 votes vote down vote up
/**
* {@inheritDoc}
* <p>
* We simply increment the number of Strong Context warnings.
*/
@Override
public void reportAttemptingFullContext(Parser recognizer,
                                  DFA dfa,
                                  int startIndex,
                                  int stopIndex,
                                  BitSet conflictingAlts,
                                  ATNConfigSet configs) {
   numStrongContextWarnings++;
 }
 
Example 33
Project: antlr4-regressionTestRig   File: PrintStreamErrorListener.java   View source code 5 votes vote down vote up
/**
* {@inheritDoc}
* <p>
* We simply increment the number of Weak Context warnings.
*/
@Override
public void reportContextSensitivity(Parser recognizer,
                              DFA dfa,
                              int startIndex,
                              int stopIndex,
                              int prediction,
                              ATNConfigSet configs) {
   numWeakContextWarnings++;
 }
 
Example 34
Project: goworks   File: StatisticsParserErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
    BitSet sllPredictions = getConflictingAlts(_sllConflict, _sllConfigs);
    int sllPrediction = sllPredictions.nextSetBit(0);
    BitSet llPredictions = getConflictingAlts(ambigAlts, configs);
    int llPrediction = llPredictions.cardinality() == 0 ? ATN.INVALID_ALT_NUMBER : llPredictions.nextSetBit(0);
    if (recognizer.getInterpreter() instanceof StatisticsParserATNSimulator) {
        if (sllPrediction != llPrediction) {
            ((StatisticsParserATNSimulator)recognizer.getInterpreter()).nonSll[dfa.decision]++;
        }

        ((StatisticsParserATNSimulator)recognizer.getInterpreter()).ambiguousResult[dfa.decision]++;
    }
}
 
Example 35
Project: goworks   File: StatisticsParserErrorListener.java   View source code 5 votes vote down vote up
@Override
public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, SimulatorState acceptState) {
    BitSet sllPredictions = getConflictingAlts(_sllConflict, _sllConfigs);
    int sllPrediction = sllPredictions.nextSetBit(0);
    if (sllPrediction != prediction && recognizer.getInterpreter() instanceof StatisticsParserATNSimulator) {
        ((StatisticsParserATNSimulator)recognizer.getInterpreter()).nonSll[dfa.decision]++;
    }
}
 
Example 36
Project: goworks   File: StatisticsParserATNSimulator.java   View source code 5 votes vote down vote up
@Override
protected int execDFA(DFA dfa, TokenStream input, int startIndex, SimulatorState state) {
    int result = super.execDFA(dfa, input, startIndex, state);
    if (!reportedLookahead) {
        int stopIndex = input.index();
        int k;
        if (startIndex == stopIndex) {
            k = 1;
        } else if (startIndex == stopIndex - 1) {
            k = 2;
        } else {
            k = 0;
            for (int i = startIndex; i <= stopIndex; i++) {
                input.seek(i);
                if (input.LT(1).getChannel() == Token.DEFAULT_CHANNEL) {
                    k++;
                }
            }
        }

        if (!state.useContext) {
            totalLookaheadSll[dfa.decision] += k;
            minLookaheadSll[dfa.decision] = Math.min(minLookaheadSll[dfa.decision], k);
            maxLookaheadSll[dfa.decision] = Math.max(maxLookaheadSll[dfa.decision], k);
        }
        else {
            totalLookaheadLl[dfa.decision] += k;
            minLookaheadLl[dfa.decision] = Math.min(minLookaheadLl[dfa.decision], k);
            maxLookaheadLl[dfa.decision] = Math.max(maxLookaheadLl[dfa.decision], k);
        }

        reportedLookahead = true;
    }

    return result;
}
 
Example 37
Project: goworks   File: StatisticsParserATNSimulator.java   View source code 5 votes vote down vote up
@Override
protected int execATN(DFA dfa, TokenStream input, int startIndex, SimulatorState initialState) {
    int result = super.execATN(dfa, input, startIndex, initialState);
    if (!reportedLookahead) {
        int stopIndex = input.index();
        int k;
        if (startIndex == stopIndex) {
            k = 1;
        } else if (startIndex == stopIndex - 1) {
            k = 2;
        } else {
            k = 0;
            for (int i = startIndex; i <= stopIndex; i++) {
                input.seek(i);
                if (input.LT(1).getChannel() == Token.DEFAULT_CHANNEL) {
                    k++;
                }
            }
        }

        if (!initialState.useContext) {
            totalLookaheadSll[dfa.decision] += k;
            minLookaheadSll[dfa.decision] = Math.min(minLookaheadSll[dfa.decision], k);
            maxLookaheadSll[dfa.decision] = Math.max(maxLookaheadSll[dfa.decision], k);
        }
        else {
            totalLookaheadLl[dfa.decision] += k;
            minLookaheadLl[dfa.decision] = Math.min(minLookaheadLl[dfa.decision], k);
            maxLookaheadLl[dfa.decision] = Math.max(maxLookaheadLl[dfa.decision], k);
        }

        reportedLookahead = true;
    }

    return result;
}
 
Example 38
Project: goworks   File: StatisticsParserATNSimulator.java   View source code 5 votes vote down vote up
@Override
protected SimulatorState computeReachSet(DFA dfa, SimulatorState previous, int t, PredictionContextCache contextCache) {
    if (previous.useContext) {
        totalTransitions[decision]++;
        computedTransitions[decision]++;
        fullContextTransitions[decision]++;
    }

    return super.computeReachSet(dfa, previous, t, contextCache);
}
 
Example 39
Project: goworks   File: TreeCorrectionParserATNSimulator.java   View source code 5 votes vote down vote up
@Override
public SimulatorState getStartState(DFA dfa, TokenStream input, ParserRuleContext outerContext, boolean useContext) {
    // force execATN for special decisions
    if (getSuppressedSet(startIndex).isNil()) {
        return null;
    }

    return super.getStartState(dfa, input, outerContext, useContext);
}
 
Example 40
Project: goworks   File: TreeCorrectionParserATNSimulator.java   View source code 5 votes vote down vote up
@Override
protected DFAState addDFAEdge(DFA dfa, DFAState fromState, int t, IntegerList contextTransitions, ATNConfigSet toConfigs, PredictionContextCache contextCache) {
    if (!getSuppressedSet(startIndex).isNil()) {
        DFAState to = addDFAState(dfa, toConfigs, contextCache);
        return to;
    }

    return super.addDFAEdge(dfa, fromState, t, contextTransitions, toConfigs, contextCache);
}