Assembler (#6)

Co-authored-by: Andre Wagner <WagnerAndre@JohnDeere.com>
Reviewed-on: https://192.168.5.48/andre/tyche/pulls/6
This commit was merged in pull request #6.
This commit is contained in:
2026-05-01 10:12:41 -05:00
parent b835dbb36e
commit a1aed4988a
13 changed files with 499 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
#ifndef TYCHE_BC_EXCEPTIONS_HH
#define TYCHE_BC_EXCEPTIONS_HH
#include <stdexcept>
namespace tyche::bc {
class BytecodeParsingError : public std::runtime_error {
public:
explicit BytecodeParsingError(std::string const& str) : std::runtime_error(str.c_str()) {}
};
}
#endif //TYCHE_BC_EXCEPTIONS_HH

View File

@@ -1,4 +1,6 @@
#include "bytecode.hh"
#include "bc_exceptions.hh"
#include "../common/overloaded.hh"
namespace tyche::bc {

View File

@@ -14,7 +14,7 @@ struct BytecodePrototype {
struct Function {
uint16_t n_pars;
uint16_t n_locals;
ByteArray code;
ByteArray code {};
Function(uint16_t n_pars_, uint16_t n_locals_) : n_pars(n_pars_), n_locals(n_locals_), code(ByteArray {}) {}
};