1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
pub struct ContextFreeGrammarProduction<TType> {
    pub input: TType,
    pub output: Vec<TType>,
}

impl<T: PartialEq<T>> ContextFreeGrammarProduction<T> {
    pub fn new(input: T, output: Vec<T>) -> Self {
        ContextFreeGrammarProduction { input, output }
    }
}

impl<TType: Clone + PartialEq> Clone for ContextFreeGrammarProduction<TType> {
    fn clone(&self) -> Self {
        Self::new(self.input.clone(), self.output.clone())
    }
}