pub trait LanguageMapper<L, A>{
type L2: Language;
type A2: Analysis<Self::L2>;
// Required methods
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;
// Provided methods
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.
Required Associated Types§
Required Methods§
Sourcefn map_discriminant(
&self,
discriminant: L::Discriminant,
) -> <Self::L2 as Language>::Discriminant
fn map_discriminant( &self, discriminant: L::Discriminant, ) -> <Self::L2 as Language>::Discriminant
Translate L::Discriminant into L2::Discriminant
Sourcefn map_analysis(&self, analysis: A) -> Self::A2
fn map_analysis(&self, analysis: A) -> Self::A2
Translate an analysis of type A into an analysis of A2.