This commit is contained in:
e.gavrin
2014-07-04 19:08:21 +04:00
parent e3e0167249
commit 7759e4b99f
5 changed files with 39 additions and 52 deletions
+10 -29
View File
@@ -23,37 +23,18 @@
#include "actuators.h"
void
gen_bytecode (FILE *src_file)
gen_bytecode ()
{
statement *st;
lexer_set_file (src_file);
parser_init ();
st = parser_parse_statement ();
assert (st);
while (st->type != STMT_EOF)
{
//pp_statement (st);
st = parser_parse_statement ();
assert (st);
}
//pp_finish ();
FILE *file = fopen (FILE_NAME, "w+b");
// 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);
save_op_data(file, get_op_loop_inf (1));
save_op_data(file, get_op_call_1(0, LED_GREEN));
save_op_data(file, get_op_call_1(0, LED_BLUE));
save_op_data(file, get_op_call_1(0, LED_ORANGE));
save_op_data(file, get_op_call_1(0, LED_RED));
save_op_data(file, get_op_jmp(0));
fclose (file);
}
void