/** * 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; }
/** * 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; }
/** * 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; }
/** 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); }
/** * 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; }
/** * 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);
public RecognitionException(@Nullable Lexer lexer, CharStream input) { this.recognizer = lexer; this.input = input; this.ctx = null; }
/** * 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; }
@Nullable public ATNConfigSet getDeadEndConfigs() { return deadEndConfigs; }
/** * 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();
@Override @Nullable public String getSymbolicName(int tokenType) { if (tokenType >= 0 && tokenType < symbolicNames.length) { return symbolicNames[tokenType]; } if (tokenType == Token.EOF) { return "EOF"; } return null; }
/** 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); }
public static void writePS(Tree t, @Nullable List<String> ruleNames, String fileName) throws IOException { writePS(t, ruleNames, fileName, "Helvetica", 11); }