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
pub mod parametric;
use std::fmt::Debug;
pub trait Alphabet: Debug + PartialEq + Eq + Clone {}
impl Alphabet for &'static str {}
impl Alphabet for char {}
impl Alphabet for u8 {}
impl Alphabet for u16 {}
impl Alphabet for u32 {}
impl Alphabet for u64 {}
impl Alphabet for usize {}
pub trait DualAlphabet: Alphabet {
type Terminal;
type NonTerminal: PartialOrd + Ord + Clone;
fn nonterminal(&self) -> Option<&Self::NonTerminal>;
fn terminal(&self) -> Option<&Self::Terminal>;
}