12#ifndef ARK_COMPILER_BYTECODEREADER_HPP
13#define ARK_COMPILER_BYTECODEREADER_HPP
60 std::vector<bytecode_t>
pages {};
84 void feed(
const std::string& file);
97 [[nodiscard]]
bool checkMagic()
const;
104 [[nodiscard]]
const bytecode_t& bytecode() noexcept;
110 [[nodiscard]]
Version version() const;
117 [[nodiscard]]
unsigned long long timestamp() const;
123 [[nodiscard]] std::vector<
unsigned char> sha256() const;
129 [[nodiscard]]
Symbols symbols() const;
141 [[nodiscard]]
Code code(const
Values& values) const;
152 std::optional<uint16_t> sStart = std::nullopt,
153 std::optional<uint16_t> sEnd = std::nullopt,
154 std::optional<uint16_t> cPage = std::nullopt) const;
167 [[nodiscard]] uint16_t readNumber(std::
size_t& i) const;
Common code for the compiler.
This class is just a helper to.
BytecodeReader()=default
Construct a new Bytecode Reader object.
Ark state to handle the dirty job of loading and compiling ArkScript code.
std::vector< uint8_t > bytecode_t
std::vector< bytecode_t > pages
std::size_t start
Point to the CODE_SEGMENT_START byte in the bytecode.
std::vector< std::string > symbols
std::size_t end
Point to the byte following the last byte of the table in the bytecode.
std::size_t start
Point to the SYM_TABLE_START byte in the bytecode.
std::vector< Value > values
std::size_t end
Point to the byte following the last byte of the table in the bytecode.
std::size_t start
Point to the VAL_TABLE_START byte in the bytecode.