bytecode2 (#2)

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-04-28 19:50:48 -05:00
parent 3f097b0ba8
commit d8130272a0
11 changed files with 529 additions and 68 deletions

View File

@@ -0,0 +1,30 @@
#ifndef TYCHE_BYTECODEPROTOTYPE_HH
#define TYCHE_BYTECODEPROTOTYPE_HH
#include <cstdint>
#include <string>
#include <variant>
#include <vector>
namespace tyche {
struct BytecodePrototype {
using ConstantValue = std::variant<int32_t, float, std::string>;
struct Function {
uint16_t n_pars;
uint16_t n_locals;
ByteArray code;
Function(uint16_t n_pars_, uint16_t n_locals_) : n_pars(n_pars_), n_locals(n_locals_), code(ByteArray {}) {}
};
std::vector<ConstantValue> constants {};
std::vector<Function> functions {};
// TODO - debugging info
};
}
#endif //TYCHE_BYTECODEPROTOTYPE_HH