本文整理汇总了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);
}