pub trait SemanticContext {
Show 17 methods
// Required methods
fn expression_value(&mut self, expression: Value, register_number: u64);
fn expression_const(&mut self, expression: Constant, register_number: u64);
fn expression_struct_value(
&mut self,
expression: Value,
index: u32,
register_number: u64,
);
fn expression_operation(
&mut self,
operation: ExpressionOperations,
left_value: ExpressionResult,
right_value: ExpressionResult,
register_number: u64,
);
fn call(
&mut self,
call: Function,
params: Vec<ExpressionResult>,
register_number: u64,
);
fn let_binding(&mut self, let_decl: Value, expr_result: ExpressionResult);
fn binding(&mut self, val: Value, expr_result: ExpressionResult);
fn expression_function_return(&mut self, expr_result: ExpressionResult);
fn expression_function_return_with_label(
&mut self,
expr_result: ExpressionResult,
);
fn set_label(&mut self, label: LabelName);
fn jump_to(&mut self, label: LabelName);
fn if_condition_expression(
&mut self,
expr_result: ExpressionResult,
label_if_begin: LabelName,
label_if_end: LabelName,
);
fn condition_expression(
&mut self,
left_result: ExpressionResult,
right_result: ExpressionResult,
condition: Condition,
register_number: u64,
);
fn jump_function_return(&mut self, expr_result: ExpressionResult);
fn logic_condition(
&mut self,
logic_condition: LogicCondition,
left_register_result: u64,
right_register_result: u64,
register_number: u64,
);
fn if_condition_logic(
&mut self,
label_if_begin: LabelName,
label_if_end: LabelName,
result_register: u64,
);
fn function_arg(&mut self, value: Value, func_arg: FunctionParameter);
}
Expand description
Semantic Context trait contain instructions set functions for the Stack context.