1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Recursive descent parser for `.llev` rule files.
//!
//! This parser transforms a stream of tokens into an AST representing
//! the `.llev` file structure including directives, metadata, and rules.
//!
//! # Grammar Overview
//!
//! ```text
//! llev_file ::= (directive | rule_definition | NEWLINE)*
//! directive ::= "@" DIRECTIVE_NAME directive_value
//! rule_definition ::= metadata_block? rewrite_rule TERMINATOR?
//! rewrite_rule ::= pattern ARROW replacement context? weight_suffix?
//! pattern ::= expression
//! replacement ::= expression | EMPTY
//! context ::= "/" left_context? "_" right_context?
//! expression ::= alternation
//! alternation ::= concatenation ("|" concatenation)*
//! concatenation ::= quantified*
//! quantified ::= primary quantifier?
//! primary ::= char | char_class | group | any | symbol_ref | boundary
//! ```
use HashMap;
use Expression;
use Lexer;
pub use parse_expression;
pub use ;
/// Parser for `.llev` files.