Skip to main content

parol_runtime/parser/
mod.rs

1///
2/// Index of a DFA state within the slice of states of a LookaheadDFA
3///
4pub type StateIndex = usize;
5
6///
7/// Index of a production within the slice of productions of a generated parser
8///
9pub type ProductionIndex = usize;
10
11///
12/// Index of a production within the slice of productions of a generated parser
13///
14pub type CompiledProductionIndex = i32;
15
16/// Invalid production number
17/// It usually denotes the absence of a valid production number after applying a transition
18pub const INVALID_PROD: CompiledProductionIndex = -1;
19
20///
21/// Index of a non-terminal within the slice of lookahead automatons of a
22/// generated parser. Also used to index into the slice of non-terminal names
23/// in the generated parser.
24///
25pub type NonTerminalIndex = usize;
26
27///
28/// The index of a scanner configuration
29///
30pub type ScannerIndex = usize;
31
32///
33/// Module with types used to handle the parse tree that is build during runs of
34/// the generated parsers.
35///
36#[forbid(missing_docs)]
37pub mod parse_tree_type;
38pub use parse_tree_type::ParseTreeType;
39
40///
41/// Module with types used to predict the next productions to choose during runs
42/// of generated parsers.
43///
44#[forbid(missing_docs)]
45pub mod lookahead_dfa;
46pub use lookahead_dfa::{LookaheadDFA, Trans};
47
48///
49/// Module with types used in the parse stack.
50///
51#[forbid(missing_docs)]
52pub mod parse_type;
53pub use parse_type::{ParseStack, ParseType};
54
55///
56/// Module with the actual parser types and some supporting types.
57///
58#[forbid(missing_docs)]
59pub mod parser_types;
60pub use parser_types::{LLKParser, ParseTree, Production};
61
62///
63/// Module with the UserActionsTrait type.
64///
65#[forbid(missing_docs)]
66pub mod user_access;
67pub use user_access::UserActionsTrait;
68
69///
70/// Module with recovery algorithms
71///
72pub(crate) mod recovery;
73// pub(crate) use recovery::Recovery;