VM basics (#5)

Co-authored-by: Andre Wagner <WagnerAndre@JohnDeere.com>
Reviewed-on: https://192.168.5.48/andre/tyche/pulls/5
This commit was merged in pull request #5.
This commit is contained in:
2026-04-30 13:34:49 -05:00
parent 71390b0f84
commit b835dbb36e
24 changed files with 366 additions and 47 deletions

View File

@@ -1,18 +1,30 @@
#ifndef TYCHE_CODE_HH
#define TYCHE_CODE_HH
#include "instruction.hh"
#include "location.hh"
#include "value.hh"
#include "../bytecode/bytecode.hh"
namespace tyche {
namespace tyche::vm {
struct Operation
{
Instruction instruction;
int32_t operator_;
Location next_location;
};
class Code {
public:
void import_bytecode(ByteArray incoming);
FunctionId import_bytecode(ByteArray incoming);
[[nodiscard]] std::string disassemble() const;
[[nodiscard]] Operation operation(Location const& location) const;
private:
Bytecode bytecode_;
bc::Bytecode bytecode_;
};
} // tyche