pub struct Block<'a> {
pub param_count: usize,
pub return_type: DataType,
pub local_typ: Vec<DataType>,
pub ilist: Vec<Instruction>,
pub break_id: usize,
pub db: DB,
pub from: Option<CTableExpression>,
pub parse_only: bool,
/* private fields */
}
Expand description
Compilation block ( body of function or batch section ).
Fields
param_count: usize
return_type: DataType
local_typ: Vec<DataType>
ilist: Vec<Instruction>
break_id: usize
db: DB
Database.
from: Option<CTableExpression>
Current table in scope by FROM clause( or UPDATE statment ).
parse_only: bool
Implementations
sourceimpl<'a> Block<'a>
impl<'a> Block<'a>
sourcepub fn resolve_jumps(&mut self)
pub fn resolve_jumps(&mut self)
Check labels are all defined and patch jump instructions.
sourcepub fn add(&mut self, s: Instruction)
pub fn add(&mut self, s: Instruction)
Add an instruction to the instruction list.
sourcepub fn check_types(&self, r: &Rc<Function>, pkinds: &[DataKind])
pub fn check_types(&self, r: &Rc<Function>, pkinds: &[DataKind])
Check the parameter kinds match the function.
sourcepub fn def_local(&mut self, name: &'a [u8], dt: DataType)
pub fn def_local(&mut self, name: &'a [u8], dt: DataType)
Define a local variable ( parameter or declared ).
sourcepub fn get_local(&self, name: &[u8]) -> Option<&usize>
pub fn get_local(&self, name: &[u8]) -> Option<&usize>
Get the number of a local variable from a name.
sourcepub fn local_name(&self, num: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn local_name(&self, num: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Get the name of a local variable from a number.
sourcepub fn get_jump_id(&mut self) -> usize
pub fn get_jump_id(&mut self) -> usize
Get a local jump id.
sourcepub fn get_loop_id(&mut self) -> usize
pub fn get_loop_id(&mut self) -> usize
Get a local jump id to current location.
sourcepub fn get_goto_label(&mut self, s: &'a [u8]) -> usize
pub fn get_goto_label(&mut self, s: &'a [u8]) -> usize
Get a number for a local goto label.
sourcepub fn set_goto_label(&mut self, s: &'a [u8])
pub fn set_goto_label(&mut self, s: &'a [u8])
Set the local for a local goto lable.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Block<'a>
impl<'a> !Send for Block<'a>
impl<'a> !Sync for Block<'a>
impl<'a> Unpin for Block<'a>
impl<'a> !UnwindSafe for Block<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more