Java 类org.antlr.v4.runtime.atn.ATNConfigSet 实例源码

项目:Scratch-ApuC    文件:DFA.java   
/**
 * Sets whether this is a precedence DFA. If the specified value differs
 * from the current DFA configuration, the following actions are taken;
 * otherwise no changes are made to the current DFA.
 *
 * <ul>
 * <li>The {@link #states} map is cleared</li>
 * <li>If {@code precedenceDfa} is {@code false}, the initial state
 * {@link #s0} is set to {@code null}; otherwise, it is initialized to a new
 * {@link DFAState} with an empty outgoing {@link DFAState#edges} array to
 * store the start states for individual precedence values.</li>
 * <li>The {@link #precedenceDfa} field is updated</li>
 * </ul>
 *
 * @param precedenceDfa {@code true} if this is a precedence DFA; otherwise,
 * {@code false}
 */
public final synchronized void setPrecedenceDfa(boolean precedenceDfa) {
    if (this.precedenceDfa != precedenceDfa) {
        this.states.clear();
        if (precedenceDfa) {
            DFAState precedenceState = new DFAState(new ATNConfigSet());
            precedenceState.edges = new DFAState[0];
            precedenceState.isAcceptState = false;
            precedenceState.requiresFullContext = false;
            this.s0 = precedenceState;
        }
        else {
            this.s0 = null;
        }

        this.precedenceDfa = precedenceDfa;
    }
}
项目:Scratch-ApuC    文件:DiagnosticErrorListener.java   
@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);
}
项目:digraph-parser    文件:GraphParser.java   
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
                            @NotNull DFA dfa,
                            int startIndex,
                            int stopIndex,
                            boolean exact,
                            @Nullable BitSet ambigAlts,
                            @NotNull ATNConfigSet configs)
{
}
项目:digraph-parser    文件:GraphParser.java   
@Override
public void reportAttemptingFullContext(@NotNull Parser recognizer,
                                        @NotNull DFA dfa,
                                        int startIndex,
                                        int stopIndex,
                                        @Nullable BitSet conflictingAlts,
                                        @NotNull ATNConfigSet configs)
{
}
项目:digraph-parser    文件:GraphParser.java   
@Override
public void reportContextSensitivity(@NotNull Parser recognizer,
                                     @NotNull DFA dfa,
                                     int startIndex,
                                     int stopIndex,
                                     int prediction,
                                     @NotNull ATNConfigSet configs)
{
}
项目:yauaa    文件:UserAgent.java   
@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"));
    }
项目:yauaa    文件:UserAgent.java   
@Override
public void reportAttemptingFullContext(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        BitSet conflictingAlts,
        ATNConfigSet configs) {
}
项目:yauaa    文件:UserAgent.java   
@Override
public void reportContextSensitivity(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        int prediction,
        ATNConfigSet configs) {

}
项目:yauaa    文件:MatcherAction.java   
@Override
public void reportAmbiguity(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        boolean exact,
        BitSet ambigAlts,
        ATNConfigSet configs) {
    // Ignore this type of problem
}
项目:yauaa    文件:MatcherAction.java   
@Override
public void reportAttemptingFullContext(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        BitSet conflictingAlts,
        ATNConfigSet configs) {
    // Ignore this type of problem
}
项目:yauaa    文件:MatcherAction.java   
@Override
public void reportContextSensitivity(
        Parser recognizer,
        DFA dfa,
        int startIndex,
        int stopIndex,
        int prediction,
        ATNConfigSet configs) {
    // Ignore this type of problem
}
项目:libraries    文件:JSSDReader.java   
@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$
}
项目:libraries    文件:JSSDReader.java   
@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$
}
项目:inmemantlr    文件:InmemantlrErrorListener.java   
@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);
}
项目:inmemantlr    文件:InmemantlrErrorListener.java   
@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);
}
项目:inmemantlr    文件:InmemantlrErrorListener.java   
@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);
}
项目:antioch    文件:QueryErrorListener.java   
@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 + ")");
}
项目:antioch    文件:QueryErrorListener.java   
@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 + ")");
}
项目:antioch    文件:QueryErrorListener.java   
@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 + ")");
}
项目:srclib-basic    文件:DefaultErrorListener.java   
@Override
public void reportAmbiguity(Parser parser,
                            DFA dfa,
                            int i,
                            int i1,
                            boolean b,
                            BitSet bitSet,
                            ATNConfigSet atnConfigSet) {

}
项目:srclib-basic    文件:DefaultErrorListener.java   
@Override
public void reportAttemptingFullContext(Parser parser,
                                        DFA dfa,
                                        int i,
                                        int i1,
                                        BitSet bitSet,
                                        ATNConfigSet atnConfigSet) {

}
项目:archie    文件:ADLErrorListener.java   
@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);
}
项目:MiniJCompiler    文件:Parser.java   
@Override
public void reportAttemptingFullContext(
        org.antlr.v4.runtime.Parser recognizer, DFA dfa,
        int startIndex, int stopIndex, BitSet conflictingAlts,
        ATNConfigSet configs) {
    errorOccurred = true;
}
项目:MiniJCompiler    文件:Parser.java   
@Override
public void reportContextSensitivity(
        org.antlr.v4.runtime.Parser recognizer, DFA dfa,
        int startIndex, int stopIndex, int prediction,
        ATNConfigSet configs) {
    errorOccurred = true;
}
项目:antlr4-regressionTestRig    文件:PrintStreamErrorListener.java   
/**
 * {@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++;
  }
项目:antlr4-regressionTestRig    文件:PrintStreamErrorListener.java   
/**
* {@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++;
 }
项目:antlr4-regressionTestRig    文件:PrintStreamErrorListener.java   
/**
* {@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++;
 }
项目:goworks    文件:StatisticsParserErrorListener.java   
@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]++;
    }
}
项目:goworks    文件:TreeCorrectionParserATNSimulator.java   
@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);
}
项目:goworks    文件:AbstractCompletionParserATNSimulator.java   
@Override
protected DFAState createDFAState(DFA dfa, ATNConfigSet configs) {
    int t = _input.LA(1);
    if (t == CaretToken.CARET_TOKEN_TYPE && !_computingStartState) {
        caretToken = (CaretToken)_input.LT(1);
        throw noViableAlt(_input, _outerContext, configs, _startIndex);
    }

    return super.createDFAState(dfa, configs);
}
项目:protobuf-el    文件:ErrorListeners.java   
@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) {
  for (final IBaseProtoErrorListener listener : delegates) {
    listener.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs);
  }
}
项目:protobuf-el    文件:ErrorListeners.java   
@Override
public void reportAttemptingFullContext(final Parser recognizer, final DFA dfa,
    final int startIndex, final int stopIndex, final BitSet conflictingAlts,
    final ATNConfigSet configs) {
  for (final IBaseProtoErrorListener listener : delegates) {
    listener.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex,
        conflictingAlts, configs);;
  }
}
项目:protobuf-el    文件:ErrorListeners.java   
@Override
public void reportContextSensitivity(final Parser recognizer, final DFA dfa,
    final int startIndex, final int stopIndex, final int prediction, final ATNConfigSet configs) {
  for (final IBaseProtoErrorListener listener : delegates) {
    listener.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction,
        configs);;
  }
}
项目:Scratch-ApuC    文件:ProxyErrorListener.java   
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
                            @NotNull DFA dfa,
                            int startIndex,
                            int stopIndex,
                            boolean exact,
                            @Nullable BitSet ambigAlts,
                            @NotNull ATNConfigSet configs)
{
    for (ANTLRErrorListener listener : delegates) {
        listener.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs);
    }
}
项目:Scratch-ApuC    文件:ProxyErrorListener.java   
@Override
public void reportAttemptingFullContext(@NotNull Parser recognizer,
                                        @NotNull DFA dfa,
                                        int startIndex,
                                        int stopIndex,
                                        @Nullable BitSet conflictingAlts,
                                        @NotNull ATNConfigSet configs)
{
    for (ANTLRErrorListener listener : delegates) {
        listener.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs);
    }
}
项目:Scratch-ApuC    文件:ProxyErrorListener.java   
@Override
public void reportContextSensitivity(@NotNull Parser recognizer,
                                     @NotNull DFA dfa,
                                     int startIndex,
                                     int stopIndex,
                                     int prediction,
                                     @NotNull ATNConfigSet configs)
{
    for (ANTLRErrorListener listener : delegates) {
        listener.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs);
    }
}
项目:Scratch-ApuC    文件:NoViableAltException.java   
public NoViableAltException(@NotNull Parser recognizer,
                            @NotNull TokenStream input,
                            @NotNull Token startToken,
                            @NotNull Token offendingToken,
                            @Nullable ATNConfigSet deadEndConfigs,
                            @NotNull ParserRuleContext ctx)
{
    super(recognizer, input, ctx);
    this.deadEndConfigs = deadEndConfigs;
    this.startToken = startToken;
    this.setOffendingToken(offendingToken);
}
项目:Scratch-ApuC    文件:BaseErrorListener.java   
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
                            @NotNull DFA dfa,
                            int startIndex,
                            int stopIndex,
                            boolean exact,
                            @Nullable BitSet ambigAlts,
                            @NotNull ATNConfigSet configs)
{
}
项目:Scratch-ApuC    文件:BaseErrorListener.java   
@Override
public void reportAttemptingFullContext(@NotNull Parser recognizer,
                                        @NotNull DFA dfa,
                                        int startIndex,
                                        int stopIndex,
                                        @Nullable BitSet conflictingAlts,
                                        @NotNull ATNConfigSet configs)
{
}
项目:Scratch-ApuC    文件:BaseErrorListener.java   
@Override
public void reportContextSensitivity(@NotNull Parser recognizer,
                                     @NotNull DFA dfa,
                                     int startIndex,
                                     int stopIndex,
                                     int prediction,
                                     @NotNull ATNConfigSet configs)
{
}