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, PositionSummary, TextInterval};
23pub use dfa::{DfaStateId, DfaTransition, ParserDfa, ParserDfaStateView, ParserDfaStats};
24pub use errors::{AntlrError, ConsoleErrorListener, ErrorListener};
25pub use generated::{GeneratedLexer, GeneratedParser, GrammarMetadata};
26pub use int_stream::{EOF, IntStream, UNKNOWN_SOURCE_NAME};
27pub use lexer::{
28 BaseLexer, Lexer, LexerCustomAction, LexerLifecycleCtx, LexerMode, LexerPredicate, LexerSemCtx,
29};
30pub use parser::{
31 BailErrorStrategy, BaseParser, ExpectedTokenSet, NoSemanticHooks, Parser, ParserAction,
32 ParserMemberAction, ParserPredicate, ParserReturnAction, ParserRuleArg, ParserRuntimeOptions,
33 ParserSemCtx, ParserSemanticAction, ParserSemanticPredicate, ParserSemantics, PredictionMode,
34 RecognitionArenaStats, SemanticHooks, UnknownSemanticPolicy,
35};
36#[cfg(feature = "perf-counters")]
37pub use perf::{dump as dump_prediction_perf_counters, reset as reset_prediction_perf_counters};
38pub use prediction::{ContextId, PredictionContextStats, SemanticContext};
39pub use recognizer::{Recognizer, RecognizerData};
40pub use token::{
41 DEFAULT_CHANNEL, HIDDEN_CHANNEL, INVALID_TOKEN_TYPE, MAX_TOKEN_OFFSET, TOKEN_EOF, Token,
42 TokenChannel, TokenId, TokenSink, TokenSource, TokenSpec, TokenStore, TokenStoreError,
43 TokenView,
44};
45pub use token_stream::CommonTokenStream;
46pub use tree::{
47 ErrorNodeView, FromRuleNode, GeneratedAttrs, Node, NodeChildren, NodeId, NodeKind, ParseTree,
48 ParseTreeDescendants, ParseTreeListener, ParseTreeStats, ParseTreeStorage, ParseTreeWalker,
49 ParsedFile, ParserRuleContext, RuleNodeView, TerminalNodeView,
50};
51pub use vocabulary::Vocabulary;
52
53pub fn java_style_list<T: std::fmt::Display>(items: &[T]) -> String {
61 let mut out = String::from("[");
62 for (index, item) in items.iter().enumerate() {
63 if index > 0 {
64 out.push_str(", ");
65 }
66 use std::fmt::Write;
67 write!(out, "{item}").expect("writing to a string cannot fail");
68 }
69 out.push(']');
70 out
71}