mirror of
https://github.com/Noratrieb/regex.git
synced 2026-01-16 09:25:02 +01:00
compilation start
This commit is contained in:
parent
c88ad1e9e1
commit
cf69572604
2 changed files with 22 additions and 0 deletions
21
src/compile.rs
Normal file
21
src/compile.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
use crate::parse::Regex;
|
||||||
|
|
||||||
|
struct Transition {
|
||||||
|
char: char,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Node {
|
||||||
|
end: bool,
|
||||||
|
transitions: Vec<Transition>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct RegexFsm {
|
||||||
|
nodes: Vec<Node>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compiles the parsed Regex into a FSM
|
||||||
|
fn compile(regex: Regex) -> RegexFsm {
|
||||||
|
let mut nodes = Vec::new();
|
||||||
|
|
||||||
|
RegexFsm { nodes }
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
mod compile;
|
||||||
mod parse;
|
mod parse;
|
||||||
|
|
||||||
pub fn no_unused_code(regex: &str) {
|
pub fn no_unused_code(regex: &str) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue