ast_value* left, ast_value* right)
{
ast_instantiate(ast_binary, ctx, ast_binary_delete);
- switch (op) {
- case INSTR_STORE_F:
- case INSTR_STORE_V:
- case INSTR_STORE_S:
- case INSTR_STORE_ENT:
- case INSTR_STORE_FLD:
- case INSTR_STORE_FNC:
- case INSTR_STOREP_F:
- case INSTR_STOREP_V:
- case INSTR_STOREP_S:
- case INSTR_STOREP_ENT:
- case INSTR_STOREP_FLD:
- case INSTR_STOREP_FNC:
-#if 0
- case INSTR_STORE_I:
- case INSTR_STORE_IF:
- case INSTR_STORE_FI:
- case INSTR_STOREP_I:
- case INSTR_STOREP_IF:
- case INSTR_STOREP_FI:
- case INSTR_STORE_P:
- case INSTR_STOREP_P:
- case INSTR_STOREP_C:
-#endif
- ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_bin_store_codegen);
- break;
- default:
- ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_binary_codegen);
- break;
- }
+ ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_binary_codegen);
self->op = op;
self->left = left;
mem_d(self);
}
+ast_store* ast_store_new(lex_ctx_t ctx, int op,
+ ast_value *dest, ast_value *source)
+{
+ ast_instantiate(ast_store, ctx, ast_store_delete);
+ ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_store_codegen);
+
+ self->op = op;
+ self->dest = dest;
+ self->source = source;
+
+ return self;
+}
+
+void ast_store_delete(ast_store *self)
+{
+ mem_d(self);
+}
+
ast_block* ast_block_new(lex_ctx_t ctx)
{
ast_instantiate(ast_block, ctx, ast_block_delete);
return false;
}
-bool ast_bin_store_codegen(ast_binary *self, ast_function *func, ir_value **out)
+bool ast_store_codegen(ast_store *self, ast_function *func, ir_value **out)
{
return false;
}