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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user