use std::collections::HashMap; pub type Grammar = HashMap; #[derive(Debug, PartialEq, Eq, Clone)] pub enum Expression { Alternative { first: Box, second: Box, rest: Vec, }, Sequence { first: Box, second: Box, rest: Vec, }, Optional(Box), Repeated(Box), Factor { count: usize, primary: Box, }, Exception { subject: Box, restriction: Box, }, Nonterminal(String), Terminal(String), Special(String), Empty, }