pub trait ExprVisitor {
    type ExprId: Copy;

    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,
        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§

The type of subexpression identifiers.

Required Methods§

Construct a constant integer.

Construct a primitive constant.

Construct an enum variant with the given inputs assigned to the variant’s fields in order.

Call an external constructor with the given inputs as arguments.

Implementors§