本文整理了Java中org.antlr.v4.runtime.misc.Nullable.<init>()
方法的一些代码示例,展示了Nullable.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nullable.<init>()
方法的具体详情如下:
包路径:org.antlr.v4.runtime.misc.Nullable
类名称:Nullable
方法名:<init>
暂无
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/**
* Gets the label associated with the rule tag.
*
* @return The name of the label associated with the rule tag, or
* {@code null} if this is an unlabeled rule tag.
*/
@Nullable
public final String getLabel() {
return label;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/**
* Get the node at which we first detected a mismatch.
*
* @return the node at which we first detected a mismatch, or {@code null}
* if the match was successful.
*/
@Nullable
public ParseTree getMismatchedNode() {
return mismatchedNode;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/**
* Gets the {@link RuleContext} at the time this exception was thrown.
*
* <p>If the context is not available, this method returns {@code null}.</p>
*
* @return The {@link RuleContext} at the time this exception was thrown.
* If the context is not available, this method returns {@code null}.
*/
@Nullable
public RuleContext getContext() {
return ctx;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4
/** For testing; builds trees, does sem anal */
public Grammar(String fileName, String grammarText, @Nullable ANTLRToolListener listener)
throws org.antlr.runtime.RecognitionException
{
this(fileName, grammarText, null, listener);
}
代码示例来源:origin: org.hibernate.hql/hibernate-hql-testing
@Override
public void syntaxError(
Recognizer<?, ?> recognizer,
@Nullable Object offendingSymbol, int line, int charPositionInLine,
String msg, @Nullable RecognitionException e) {
syntaxErrorOccured = true;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/**
* Return a new {@link IntSet} object containing all elements that are
* present in both the current set and the specified set {@code a}.
*
* @param a The set to intersect with the current set. A {@code null}
* argument is treated as though it were an empty set.
* @return A new {@link IntSet} instance containing the intersection of the
* current set and {@code a}. The value {@code null} may be returned in
* place of an empty result set.
*/
@Nullable
IntSet and(@Nullable IntSet a);
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
public RecognitionException(@Nullable Lexer lexer,
CharStream input)
{
this.recognizer = lexer;
this.input = input;
this.ctx = null;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
public RecognitionException(@Nullable Recognizer<Token, ?> recognizer,
@Nullable IntStream input,
@Nullable ParserRuleContext ctx)
{
this.recognizer = recognizer;
this.input = input;
this.ctx = ctx;
if ( recognizer!=null ) this.offendingState = recognizer.getState();
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
public LexerNoViableAltException(@Nullable Lexer lexer,
@NotNull CharStream input,
int startIndex,
@Nullable ATNConfigSet deadEndConfigs) {
super(lexer, input);
this.startIndex = startIndex;
this.deadEndConfigs = deadEndConfigs;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
@NotNull
private static String formatMessage(@Nullable String predicate, @Nullable String message) {
if (message != null) {
return message;
}
return String.format(Locale.getDefault(), "failed predicate: {%s}?", predicate);
}
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
@Override
public <T extends Token> void syntaxError(@NotNull Recognizer<T, ?> recognizer,
@Nullable T offendingSymbol,
int line,
int charPositionInLine,
@NotNull String msg,
@Nullable RecognitionException e)
{
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/**
* @deprecated Use {@link #toString(Vocabulary)} instead.
*/
@Deprecated
public String toString(@Nullable String[] tokenNames) {
if ( s0.get()==null ) return "";
DFASerializer serializer = new DFASerializer(this,tokenNames);
return serializer.toString();
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4
/** Return the set of keys that collide from
* {@code this} and {@code other}.
*/
@NotNull
public Set<String> intersection(@Nullable AttributeDict other) {
if ( other==null || other.size()==0 || size()==0 ) {
return Collections.emptySet();
}
Set<String> result = new HashSet<String>(attributes.keySet());
result.retainAll(other.attributes.keySet());
return result;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4
@Nullable
public STGroup getTemplates() {
Target target = getTarget();
if (target == null) {
return null;
}
return target.getTemplates();
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
public String toString(@NotNull Vocabulary vocabulary, @Nullable String[] ruleNames) {
if (s0.get() == null) {
return "";
}
DFASerializer serializer = new DFASerializer(this, vocabulary, ruleNames, atnStartState.atn);
return serializer.toString();
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/** Print out a whole tree in LISP form. {@link #getNodeText} is used on the
* node payloads to get the text for the nodes. Detect
* parse trees and extract data appropriately.
*/
public static String toStringTree(@NotNull Tree t, @Nullable Parser recog) {
String[] ruleNames = recog != null ? recog.getRuleNames() : null;
List<String> ruleNamesList = ruleNames != null ? Arrays.asList(ruleNames) : null;
return toStringTree(t, ruleNamesList);
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
protected ActionATNConfig(LexerActionExecutor lexerActionExecutor, @NotNull ATNConfig c, @NotNull ATNState state, @Nullable PredictionContext context, boolean passedThroughNonGreedyDecision) {
super(c, state, context);
if (c.getSemanticContext() != SemanticContext.NONE) {
throw new UnsupportedOperationException();
}
this.lexerActionExecutor = lexerActionExecutor;
this.passedThroughNonGreedyDecision = passedThroughNonGreedyDecision;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
public ActionSemanticContextATNConfig(LexerActionExecutor lexerActionExecutor, @NotNull SemanticContext semanticContext, @NotNull ATNConfig c, @NotNull ATNState state, @Nullable PredictionContext context, boolean passedThroughNonGreedyDecision) {
super(semanticContext, c, state, context);
this.lexerActionExecutor = lexerActionExecutor;
this.passedThroughNonGreedyDecision = passedThroughNonGreedyDecision;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
@Override
public void reportAmbiguity(@NotNull Parser recognizer,
@NotNull DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
@Nullable BitSet ambigAlts,
@NotNull ATNConfigSet configs)
{
}
代码示例来源:origin: Borisvl/bigbash
@Override
public void syntaxError(@NotNull Recognizer<?, ?> recognizer, @Nullable Object offendingSymbol, int line,
int charPositionInLine, @NotNull String msg, @Nullable RecognitionException e) {
if (offendingSymbol instanceof Token) {
Token startToken = (Token) offendingSymbol;
SyntaxError error = new SyntaxError(new EditPosition(line, charPositionInLine, startToken.getStartIndex(),
startToken.getStopIndex() - startToken.getStartIndex() + 1), msg);
errors.add(error);
} else {
errors.add(new SyntaxError(new EditPosition(line, charPositionInLine, -1, 0), msg));
}
}
内容来源于网络,如有侵权,请联系作者删除!