.
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
#define TYCHE_BYTECODE_HH
|
||||
|
||||
#include "bytearray.hh"
|
||||
#include "bytecodeprototype.hh"
|
||||
|
||||
namespace tyche {
|
||||
|
||||
class Bytecode {
|
||||
public:
|
||||
// reading
|
||||
|
||||
Bytecode(std::vector<uint8_t> data);
|
||||
Bytecode(BytecodePrototype const& bp);
|
||||
|
||||
[[nodiscard]] uint32_t n_constants() const;
|
||||
[[nodiscard]] uint32_t n_functions() const;
|
||||
@@ -25,19 +25,6 @@ public:
|
||||
[[nodiscard]] int32_t get_code_int(uint32_t function_id, uint32_t idx) const;
|
||||
[[nodiscard]] float get_code_float(uint32_t function_id, uint32_t idx) const;
|
||||
|
||||
// writing
|
||||
|
||||
Bytecode();
|
||||
|
||||
uint32_t add_constant(int32_t value);
|
||||
uint32_t add_constant(float value);
|
||||
uint32_t add_constant(std::string const& str);
|
||||
|
||||
uint32_t add_function(uint16_t n_params, uint16_t locals);
|
||||
|
||||
uint32_t add_code(uint8_t operation);
|
||||
uint32_t add_code(uint8_t operation, int32_t operand_);
|
||||
|
||||
// TODO - debugging info
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user