pub struct LcnfBuilder { /* private fields */ }Expand description
A builder for constructing LCNF expressions incrementally.
Implementations§
Source§impl LcnfBuilder
impl LcnfBuilder
pub fn new() -> Self
pub fn with_start_id(start: u64) -> Self
pub fn fresh_var(&mut self, _name: &str, _ty: LcnfType) -> LcnfVarId
pub fn let_bind( &mut self, name: &str, ty: LcnfType, val: LcnfLetValue, ) -> LcnfVarId
pub fn let_app( &mut self, name: &str, ty: LcnfType, func: LcnfArg, args: Vec<LcnfArg>, ) -> LcnfVarId
pub fn let_ctor( &mut self, name: &str, ty: LcnfType, ctor: &str, tag: u32, args: Vec<LcnfArg>, ) -> LcnfVarId
pub fn let_proj( &mut self, name: &str, ty: LcnfType, type_name: &str, idx: u32, var: LcnfVarId, ) -> LcnfVarId
pub fn build_return(self, arg: LcnfArg) -> LcnfExpr
pub fn build_case( self, scrutinee: LcnfVarId, scrutinee_ty: LcnfType, alts: Vec<LcnfAlt>, default: Option<LcnfExpr>, ) -> LcnfExpr
pub fn build_tail_call(self, func: LcnfArg, args: Vec<LcnfArg>) -> LcnfExpr
pub fn peek_next_id(&self) -> u64
pub fn binding_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LcnfBuilder
impl RefUnwindSafe for LcnfBuilder
impl Send for LcnfBuilder
impl Sync for LcnfBuilder
impl Unpin for LcnfBuilder
impl UnsafeUnpin for LcnfBuilder
impl UnwindSafe for LcnfBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more