1pub mod atn;
4pub mod char_stream;
5pub mod dfa;
6pub mod errors;
7pub mod generated;
8pub mod int_stream;
9pub mod lexer;
10pub mod parser;
11#[cfg(feature = "perf-counters")]
12pub mod perf;
13pub mod prediction;
14pub mod recognizer;
15pub mod semir;
16pub mod token;
17pub mod token_stream;
18pub mod tree;
19pub mod vocabulary;
20
21pub use atn::parser::{ParserAtnPrediction, ParserAtnSimulator, ParserAtnSimulatorError};
22pub use char_stream::{CharStream, InputStream, TextInterval};
23pub use dfa::{Dfa, DfaState};
24pub use errors::{AntlrError, ConsoleErrorListener, ErrorListener};
25pub use generated::{GeneratedLexer, GeneratedParser, GrammarMetadata};
26pub use int_stream::{EOF, IntStream, UNKNOWN_SOURCE_NAME};
27pub use lexer::{BaseLexer, Lexer, LexerCustomAction, LexerMode, LexerPredicate, LexerSemCtx};
28pub use parser::{
29 BailErrorStrategy, BaseParser, ExpectedTokenSet, NoSemanticHooks, Parser, ParserAction,
30 ParserMemberAction, ParserPredicate, ParserReturnAction, ParserRuleArg, ParserRuntimeOptions,
31 ParserSemCtx, ParserSemanticAction, ParserSemanticPredicate, ParserSemantics, PredictionMode,
32 SemanticHooks, UnknownSemanticPolicy,
33};
34#[cfg(feature = "perf-counters")]
35pub use perf::{dump as dump_prediction_perf_counters, reset as reset_prediction_perf_counters};
36pub use prediction::{
37 AtnConfig, AtnConfigSet, PredictionContext, PredictionContextMergeCache, SemanticContext,
38};
39pub use recognizer::{Recognizer, RecognizerData};
40pub use token::{
41 CommonToken, CommonTokenFactory, DEFAULT_CHANNEL, HIDDEN_CHANNEL, INVALID_TOKEN_TYPE,
42 TOKEN_EOF, Token, TokenChannel, TokenFactory, TokenSource,
43};
44pub use token_stream::CommonTokenStream;
45pub use tree::{
46 ErrorNode, FromRuleContext, GeneratedAttrs, ParseTree, ParseTreeDescendants, ParseTreeListener,
47 ParseTreeWalker, ParserRuleContext, RuleNode, TerminalNode,
48};
49pub use vocabulary::Vocabulary;
50
51pub fn java_style_list<T: std::fmt::Display>(items: &[T]) -> String {
59 let mut out = String::from("[");
60 for (index, item) in items.iter().enumerate() {
61 if index > 0 {
62 out.push_str(", ");
63 }
64 use std::fmt::Write;
65 write!(out, "{item}").expect("writing to a string cannot fail");
66 }
67 out.push(']');
68 out
69}