00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _BML_OPCODE_DICT_H_
00020 #define _BML_OPCODE_DICT_H_
00021
00022 #include <stdio.h>
00023
00030 opcode_dict_t opcode_dict_new();
00031 void opcode_dict_free(opcode_dict_t);
00032 void opcode_dict_init(opcode_dict_t);
00033 void opcode_dict_deinit(opcode_dict_t);
00034
00035 void opcode_dict_add(opcode_dict_t, opcode_arg_t, const char*, opcode_stub_t);
00036
00037 opcode_stub_t opcode_stub_by_name(opcode_dict_t, opcode_arg_t, const char*);
00038 opcode_stub_t opcode_stub_by_code(opcode_dict_t, word_t);
00039 word_t opcode_code_by_stub(opcode_dict_t, opcode_stub_t);
00040 const char* opcode_name_by_stub(opcode_dict_t, opcode_stub_t);
00041
00042 int opcode_dict_link_stubs(opcode_dict_t target, opcode_dict_t src);
00043 int opcode_dict_resolve_stubs(opcode_dict_t src);
00044
00045
00046 void opcode_dict_serialize(opcode_dict_t od, writer_t);
00047 void opcode_dict_unserialize(opcode_dict_t od, reader_t, void*);
00048
00049 opcode_dict_t opcode_dict_optimize(vm_t vm, program_t prog);
00050
00051
00054 #endif
00055