本文整理匯總了Java中org.antlr.v4.runtime.atn.ATNConfigSet類的典型用法代碼示例。如果您正苦於以下問題:Java ATNConfigSet類的具體用法?Java ATNConfigSet怎麽用?Java ATNConfigSet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ATNConfigSet類屬於org.antlr.v4.runtime.atn包,在下文中一共展示了ATNConfigSet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setPrecedenceDfa
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
/**
* 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;
}
}
示例2: reportAmbiguity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@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);
}
示例3: reportAmbiguity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
@NotNull DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
@Nullable BitSet ambigAlts,
@NotNull ATNConfigSet configs)
{
}
示例4: reportAttemptingFullContext
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportAttemptingFullContext(@NotNull Parser recognizer,
@NotNull DFA dfa,
int startIndex,
int stopIndex,
@Nullable BitSet conflictingAlts,
@NotNull ATNConfigSet configs)
{
}
示例5: reportContextSensitivity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportContextSensitivity(@NotNull Parser recognizer,
@NotNull DFA dfa,
int startIndex,
int stopIndex,
int prediction,
@NotNull ATNConfigSet configs)
{
}
示例6: reportAmbiguity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@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"));
}
示例7: reportAttemptingFullContext
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportAttemptingFullContext(
Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) {
}
示例8: reportContextSensitivity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportContextSensitivity(
Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) {
}
示例9: reportAmbiguity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportAmbiguity(
Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) {
// Ignore this type of problem
}
示例10: reportAttemptingFullContext
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportAttemptingFullContext(
Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) {
// Ignore this type of problem
}
示例11: reportContextSensitivity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@Override
public void reportContextSensitivity(
Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) {
// Ignore this type of problem
}
示例12: reportContextSensitivity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@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$
}
示例13: reportAmbiguity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@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$
}
示例14: reportAmbiguity
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@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);
}
示例15: reportAttemptingFullContext
import org.antlr.v4.runtime.atn.ATNConfigSet; //導入依賴的package包/類
@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);
}