aboutsummaryrefslogtreecommitdiff
path: root/include/bytecode.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/bytecode.h')
-rw-r--r--include/bytecode.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/include/bytecode.h b/include/bytecode.h
index a194517..06ebf19 100644
--- a/include/bytecode.h
+++ b/include/bytecode.h
@@ -29,40 +29,42 @@ typedef enum {
} TslOpcode;
typedef struct {
- TslBuffer buffer;
-} TslBytecodeWriter;
+ TslBuffer /*TslInstruction*/ buffer;
+} TslBytecode;
typedef struct {
- TslOpcodeType opcode;
+ TslOpcode opcode;
int value;
} TslInstructionType1;
typedef struct {
- TslOpcodeType opcode;
+ TslOpcode opcode;
double value;
} TslInstructionType2;
typedef struct {
- TslOpcodeType opcode;
+ TslOpcode opcode;
TslBool value;
} TslInstructionType3;
typedef struct {
- TslOpcodeType opcode;
+ TslOpcode opcode;
TslStringView value;
} TslInstructionType4;
typedef struct {
- TslOpcodeType opcode;
+ TslOpcode opcode;
} TslInstructionType5;
-void tsl_bytecode_writer_init(TslBytecodeWriter *self);
-void tsl_bytecode_writer_deinit(TslBytecodeWriter *self);
+const char* tsl_opcode_to_string(TslOpcode opcode);
-int tsl_bytecode_writer_add_ins1(TslBytecodeWriter *self, TslOpcode opcode, int value);
-int tsl_bytecode_writer_add_ins2(TslBytecodeWriter *self, TslOpcode opcode, double value);
-int tsl_bytecode_writer_add_ins3(TslBytecodeWriter *self, TslOpcode opcode, TslBool value);
-int tsl_bytecode_writer_add_ins4(TslBytecodeWriter *self, TslOpcode opcode, TslStringView *value);
-int tsl_bytecode_writer_add_ins5(TslBytecodeWriter *self, TslOpcode opcode);
+void tsl_bytecode_init(TslBytecode *self);
+void tsl_bytecode_deinit(TslBytecode *self);
+
+int tsl_bytecode_add_ins1(TslBytecode *self, TslOpcode opcode, int value);
+int tsl_bytecode_add_ins2(TslBytecode *self, TslOpcode opcode, double value);
+int tsl_bytecode_add_ins3(TslBytecode *self, TslOpcode opcode, TslBool value);
+int tsl_bytecode_add_ins4(TslBytecode *self, TslOpcode opcode, TslStringView *value);
+int tsl_bytecode_add_ins5(TslBytecode *self, TslOpcode opcode);
#endif /* TSL_BYTECODE_H */