11#ifndef ARK_COMPILER_BYTECODEREADER_HPP
12#define ARK_COMPILER_BYTECODEREADER_HPP
75 std::vector<bytecode_t>
pages {};
99 void feed(
const std::string& file);
112 [[nodiscard]]
bool checkMagic()
const;
118 [[nodiscard]]
Version version()
const;
125 [[nodiscard]]
unsigned long long timestamp()
const;
131 [[nodiscard]] std::vector<unsigned char> sha256()
const;
137 [[nodiscard]]
Symbols symbols()
const;
172 std::optional<uint16_t> sStart = std::nullopt,
173 std::optional<uint16_t> sEnd = std::nullopt,
174 std::optional<uint16_t> cPage = std::nullopt)
const;
187 [[nodiscard]] uint16_t readNumber(std::size_t& i)
const;
Common code for the compiler.
Default value type handled by the virtual machine.
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::size_t end
Point to the byte following the last byte of the table in the bytecode.
std::vector< std::string > filenames
std::size_t start
Point to the FILENAMES_TABLE_START byte in the bytecode.
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 INST_LOC_TABLE_START byte in the bytecode.
std::vector< internal::InstLoc > locations
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.