Skip to main content

GenCompiler

Struct GenCompiler 

Source
struct GenCompiler {
    ops: Vec<GOp>,
    dests: Vec<Dest>,
    ctx: Option<Rc<Ctx>>,
    handlers: u32,
    scopes: u32,
    pending_labels: Vec<Rc<str>>,
    ok: bool,
}

Fields§

§ops: Vec<GOp>§dests: Vec<Dest>§ctx: Option<Rc<Ctx>>§handlers: u32§scopes: u32§pending_labels: Vec<Rc<str>>§ok: bool

Implementations§

Source§

impl GenCompiler

Source

fn fail(&mut self)

Source

fn here(&self) -> u32

Source

fn new_dest(&mut self) -> u32

Source

fn place_dest(&mut self, d: u32)

飛び先を今の位置・今の深さに決める。

Source

fn emit(&mut self, op: GOp) -> usize

Source

fn patch(&mut self, at: usize)

at の命令の飛び先を今の位置にする。

Source

fn patch_to(&mut self, at: usize, to: u32)

Source

fn push_ctx(&mut self, labels: Vec<Rc<str>>, kind: u8, brk: u32, cont: u32)

Source

fn pop_ctx(&mut self)

Source

fn stmts(&mut self, list: &[Statement])

Source

fn stmt(&mut self, s: &Statement)

Source

fn switch(&mut self, discriminant: &Expression, cases: &Vec<SwitchCase>)

Source

fn try_stmt(&mut self, t: &TryStmt)

Source

fn expr(&mut self, e: &Expression)

Source

fn list_args(&mut self, items: &[Expression])

配列(引数の列・配列リテラル)を積む。展開(...x)にも対応。

Source

fn call(&mut self, callee: &Expression, arguments: &[Expression])

Source

fn assign(&mut self, op: &str, target: &Expression, value: &Expression)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.