pub trait ExprVisitor {
type ExprId: Copy;
// Required methods
fn add_const_int(&mut self, ty: TypeId, val: i128) -> Self::ExprId;
fn add_const_prim(&mut self, ty: TypeId, val: Sym) -> Self::ExprId;
fn add_create_variant(
&mut self,
inputs: Vec<(Self::ExprId, TypeId)>,
ty: TypeId,
variant: VariantId,
) -> Self::ExprId;
fn add_construct(
&mut self,
inputs: Vec<(Self::ExprId, TypeId)>,
ty: TypeId,
term: TermId,
pure: bool,
infallible: bool,
multi: bool,
) -> Self::ExprId;
}
Expand description
Visitor interface for Exprs. Visitors can return an arbitrary identifier for each subexpression, which is threaded through to subsequent calls into the visitor.
Required Associated Types§
Required Methods§
sourcefn add_const_int(&mut self, ty: TypeId, val: i128) -> Self::ExprId
fn add_const_int(&mut self, ty: TypeId, val: i128) -> Self::ExprId
Construct a constant integer.
sourcefn add_const_prim(&mut self, ty: TypeId, val: Sym) -> Self::ExprId
fn add_const_prim(&mut self, ty: TypeId, val: Sym) -> Self::ExprId
Construct a primitive constant.