#ifndef TOBI_OP_H #define TOBI_OP_H #include typedef enum tobi_op_kind { TOBI_OP_SIMPLE, TOBI_OP_PKG, TOBI_OP_NAMED, TOBI_OP_EXPR, TOBI_OP_CONTROL, TOBI_OP_EXT } tobi_op_kind; typedef struct tobi_op { uint16_t code; const char *name; tobi_op_kind kind; int has_pkg_len; } tobi_op; typedef struct tobi_op_desc { uint16_t code; const char *operands; } tobi_op_desc; typedef struct tobi_op_expr { uint16_t code; const char *ir_name; unsigned arg_count; unsigned target_count; unsigned name_count; } tobi_op_expr; const tobi_op *tobi_op_find(uint8_t op); const tobi_op *tobi_op_find_ext(uint8_t ext); const tobi_op *tobi_op_find_code(uint16_t code); const char *tobi_op_operands(uint16_t code); const tobi_op_expr *tobi_op_expr_find(uint16_t code); const tobi_op_expr *tobi_op_expr_find_name(const char *name); #endif