Struct BytecodeGenerator

Source
pub struct BytecodeGenerator { /* private fields */ }

Implementations§

Source§

impl BytecodeGenerator

Source

pub fn new() -> Self

Source§

impl BytecodeGenerator

Source

pub fn generate(&mut self, ast: &Node) -> Vec<Instruction>

Source

pub fn get_constants(&self) -> &Vec<String>

Trait Implementations§

Source§

impl ArithmeticCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl ArrayCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl AssignmentCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl ClassCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl ComparisonCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl ConstantCore for BytecodeGenerator

Source§

impl ControlFlowCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

fn push_loop_label(&mut self, break_address: CodeAddress)

Source§

fn pop_loop_label(&mut self)

Source§

fn get_current_break_address(&self) -> Option<CodeAddress>

Source§

impl Default for BytecodeGenerator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FunctionCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl FunctionLiteralCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl LabelManager for BytecodeGenerator

Source§

impl LogicalCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl ObjectCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl ScopeCore for BytecodeGenerator

Source§

impl UnaryCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

Source§

impl VariableCore for BytecodeGenerator

Source§

fn instructions(&mut self) -> &mut Vec<Instruction>

Source§

fn visit_node(&mut self, node: &Node)

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> ArithmeticGenerator for T
where T: ArithmeticCore,

Source§

impl<T> ArrayGenerator for T
where T: ArrayCore,

Source§

fn generate_array_literal(&mut self, node: &Node)

Source§

impl<T> AssignmentGenerator for T

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> ClassGenerator for T
where T: ClassCore,

Source§

impl<T> ComparisonGenerator for T
where T: ComparisonCore,

Source§

impl<T> ConstantManager for T
where T: ConstantCore,

Source§

impl<T> ControlFlowGenerator for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FunctionGenerator for T

Source§

impl<T> FunctionLiteralGenerator for T

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> LogicalGenerator for T
where T: LogicalCore,

Source§

impl<T> ObjectGenerator for T
where T: ObjectCore,

Source§

fn generate_object_literal(&mut self, node: &Node)

Source§

fn generate_property(&mut self, node: &Node)

Source§

impl<T> ScopeManager for T
where T: ScopeCore,

Source§

fn get_or_create_local(&mut self, name: &str) -> LocalIndex

Source§

fn get_local(&self, name: &str) -> Option<&LocalIndex>

Source§

fn is_array_variable(&self, name: &str) -> bool

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> UnaryGenerator for T

Source§

impl<T> VariableGenerator for T