remove output from lexer, fixes

This commit is contained in:
e.gavrin
2014-07-04 17:11:06 +04:00
parent e4122522ae
commit e3e0167249
7 changed files with 59 additions and 40 deletions
+18 -18
View File
@@ -32,28 +32,28 @@ gen_bytecode (FILE *src_file)
assert (st);
while (st->type != STMT_EOF)
{
pp_statement (st);
//pp_statement (st);
st = parser_parse_statement ();
assert (st);
}
pp_finish ();
//pp_finish ();
FILE *file = fopen (FILE_NAME, "w+b");
OPCODE op0;
save_op_loop_inf (file, op0, 1);
save_op_call_1 (file, op0, 0, LED_GREEN);
save_op_call_1 (file, op0, 0, LED_BLUE);
save_op_call_1 (file, op0, 0, LED_ORANGE);
save_op_call_1 (file, op0, 0, LED_RED);
save_op_call_1 (file, op0, 0, LED_GREEN);
save_op_call_1 (file, op0, 0, LED_BLUE);
save_op_call_1 (file, op0, 0, LED_ORANGE);
save_op_call_1 (file, op0, 0, LED_RED);
save_op_jmp (file, op0, 0);
fclose (file);
// FILE *file = fopen (FILE_NAME, "w+b");
//
// OPCODE op0;
//
// save_op_loop_inf (file, op0, 1);
// save_op_call_1 (file, op0, 0, LED_GREEN);
// save_op_call_1 (file, op0, 0, LED_BLUE);
// save_op_call_1 (file, op0, 0, LED_ORANGE);
// save_op_call_1 (file, op0, 0, LED_RED);
// save_op_call_1 (file, op0, 0, LED_GREEN);
// save_op_call_1 (file, op0, 0, LED_BLUE);
// save_op_call_1 (file, op0, 0, LED_ORANGE);
// save_op_call_1 (file, op0, 0, LED_RED);
// save_op_jmp (file, op0, 0);
//
// fclose (file);
}
void
+8 -4
View File
@@ -39,9 +39,12 @@ OP_DEF (jmp)
OP_DEF (decl) { };
OP_DEF (named_func_decl) { };
OP_DEF (decl_func_named)
{
OP_TYPE_IDX name_literal_idx;
};
OP_DEF (anon_func_decl) { };
OP_DEF (decl_func_anon) { };
OP_DEF (decl_var_global) { };
@@ -108,10 +111,11 @@ union __opdata
OP (nop);
} data;
OPCODE {
OPCODE{
opfunc opfunc_ptr;
union __opdata data;
} __packed;
}
__packed;
void save_op_jmp (FILE *, OPCODE, int);
void save_op_call_1 (FILE *, OPCODE, int, int);