[−][src]Struct lincoln_ir::PreCompileProgram
Methods
impl PreCompileProgram
[src]
pub fn merge(&mut self, other: &PreCompileProgram) -> Result<(), Error>
[src]
merge the instructions from another program
pub fn set_export(&mut self, label: impl StringLike) -> Result<(), Error>
[src]
Set an entry to be exported
pub fn delete_ent(&mut self, label: impl StringLike) -> Result<(), Error>
[src]
pub fn define_jmp(
&mut self,
label: impl StringLike,
cont: impl StringLike,
per: impl AsPermutation
) -> Result<EntryRef, Error>
[src]
&mut self,
label: impl StringLike,
cont: impl StringLike,
per: impl AsPermutation
) -> Result<EntryRef, Error>
Define a jmp instruction
A jmp instruction performs a specific permutation on its values. Then it will jump to another entry.
label: the name of the entry cont: the entry this instruction will jump to per: how to permutate the values
pub fn define_call(
&mut self,
label: impl StringLike,
callee: impl StringLike,
callcnt: u8,
callcont: impl StringLike
) -> Result<EntryRef, Error>
[src]
&mut self,
label: impl StringLike,
callee: impl StringLike,
callcnt: u8,
callcont: impl StringLike
) -> Result<EntryRef, Error>
Define a call instruction
A Call instruction will seperate the current context into two. One of them will be put in a closure and add to the other as a single value. Then it will jump to another entry.
label: the name of this entry callee: the entry this entry will jump to callcnt: how many values the current context will keep callcont: an entry to keep the rest of context
pub fn define_ret(
&mut self,
label: impl StringLike,
variant: u8
) -> Result<EntryRef, Error>
[src]
&mut self,
label: impl StringLike,
variant: u8
) -> Result<EntryRef, Error>
Define a return instruction
The first value of the context will be picked up and treat as a closure. Its captured context released and merged into the current context. Then the closure's group entry reference will contain some variants. The specified variant will be used as the return target.
variant: which element of the group should be refer to
pub fn define_group(
&mut self,
label: impl StringLike,
elements: &[impl StringLike]
) -> Result<EntryRef, Error>
[src]
&mut self,
label: impl StringLike,
elements: &[impl StringLike]
) -> Result<EntryRef, Error>
Define a group of instructions
A group of entries contains zero of more variants. When called with a specific variants, it will be picked up and being used as the execution target.
label: the name of this group entry elements: the variant entries
pub fn externs(&self) -> Vec<(String, EntryRef)>
[src]
Returns all defined external entries, including the name
pub fn compile(
&self,
externs: impl Iterator<Item = ExternEntry>
) -> Result<Program, Error>
[src]
&self,
externs: impl Iterator<Item = ExternEntry>
) -> Result<Program, Error>
Compile this program with a set of external functions
Trait Implementations
impl Default for PreCompileProgram
[src]
fn default() -> PreCompileProgram
[src]
impl Display for PreCompileProgram
[src]
impl Debug for PreCompileProgram
[src]
impl Serialize for PreCompileProgram
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for PreCompileProgram
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'a> Access<'a, PreCompileProgram> for EntryRef
[src]
type Target = Result<&'a Entry, Error>
fn access<'b>(&self, src: &'b PreCompileProgram) -> Self::Target where
'b: 'a,
[src]
'b: 'a,
impl<'a> AccessMut<'a, PreCompileProgram> for EntryRef
[src]
type Target = Result<&'a mut Entry, Error>
fn access_mut<'b>(&self, src: &'b mut PreCompileProgram) -> Self::Target where
'b: 'a,
[src]
'b: 'a,
Auto Trait Implementations
impl Send for PreCompileProgram
impl Sync for PreCompileProgram
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> AnyDebugDisplay for T where
T: Any + Debug + Display,
[src]
T: Any + Debug + Display,