本文整理了Java中org.antlr.v4.runtime.misc.Nullable
类的一些代码示例,展示了Nullable
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nullable
类的具体详情如下:
包路径:org.antlr.v4.runtime.misc.Nullable
类名称:Nullable
暂无
代码示例来源: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
/**
* 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
/**
* 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
/**
* Gets the {@link Recognizer} where this exception occurred.
*
* <p>If the recognizer is not available, this method returns {@code null}.</p>
*
* @return The recognizer where this exception occurred, or {@code null} if
* the recognizer is not available.
*/
@Nullable
public Recognizer<?, ?> getRecognizer() {
return recognizer;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
@Nullable
public ATNConfigSet getDeadEndConfigs() {
return deadEndConfigs;
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
/**
* Get the {@link CharStream} from which this token source is currently
* providing tokens.
*
* @return The {@link CharStream} associated with the current position in
* the input, or {@code null} if no input stream is available for the token
* source.
*/
@Nullable
public CharStream getInputStream();
代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime
@Override
@Nullable
public String getSymbolicName(int tokenType) {
if (tokenType >= 0 && tokenType < symbolicNames.length) {
return symbolicNames[tokenType];
}
if (tokenType == Token.EOF) {
return "EOF";
}
return 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
protected void addDFAEdge(@Nullable DFAState p, int t, @Nullable DFAState q) {
if ( p!=null ) {
p.setTarget(t, q);
}
}
代码示例来源: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
/** Call this method to view a parse tree in a dialog box visually. */
public static Future<JDialog> inspect(@Nullable Tree t, @Nullable Parser parser) {
List<String> ruleNames = parser != null ? Arrays.asList(parser.getRuleNames()) : null;
return inspect(t, ruleNames);
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4
/** Save this tree in a postscript file using a particular font name and size */
public static void save(Tree t,
@Nullable List<String> ruleNames, String fileName,
String fontName, int fontSize)
throws IOException
{
writePS(t, ruleNames, fileName, fontName, fontSize);
}
代码示例来源:origin: com.tunnelvisionlabs/antlr4
public static void writePS(Tree t, @Nullable List<String> ruleNames, String fileName)
throws IOException
{
writePS(t, ruleNames, fileName, "Helvetica", 11);
}
内容来源于网络,如有侵权,请联系作者删除!