pub trait LanguageMapper<L, A> where
    L: Language,
    A: Analysis<L>, 
{ type L2: Language; type A2: Analysis<Self::L2>; fn map_node(&self, node: L) -> Self::L2;
fn map_discriminant(
        &self,
        discriminant: L::Discriminant
    ) -> <Self::L2 as Language>::Discriminant;
fn map_analysis(&self, analysis: A) -> Self::A2;
fn map_data(&self, data: A::Data) -> <Self::A2 as Analysis<Self::L2>>::Data; fn map_eclass(
        &self,
        src_eclass: EClass<L, A::Data>
    ) -> EClass<Self::L2, <Self::A2 as Analysis<Self::L2>>::Data> { ... }
fn map_egraph(&self, src_egraph: EGraph<L, A>) -> EGraph<Self::L2, Self::A2> { ... } }
Expand description

Translates EGraph<L, A> into EGraph<L2, A2>. For common cases, you don’t need to implement this manually. See the provided SimpleLanguageMapper.

Associated Types

The target language to translate into.

The target analysis to transate into.

Required methods

Translate a node of L into a node of L2.

Translate L::Discriminant into L2::Discriminant

Translate an analysis of type A into an analysis of A2.

Translate A::Data into A2::Data.

Provided methods

Translate an EClass over L into an EClass over L2.

Map an EGraph over L into an EGraph over L2.

Implementors