ArkScript
A small, fast, functional and scripting language for video games
|
This class is just a helper to. More...
#include <BytecodeReader.hpp>
Public Member Functions | |
BytecodeReader ()=default | |
Construct a new Bytecode Reader object. | |
void | feed (const std::string &file) |
Construct needed data before displaying information about a given file. | |
const bytecode_t & | bytecode () noexcept |
Return the bytecode object constructed. | |
unsigned long long | timestamp () |
Return the read timestamp from the bytecode file. | |
void | display (BytecodeSegment segment=BytecodeSegment::All, std::optional< uint16_t > sStart=std::nullopt, std::optional< uint16_t > sEnd=std::nullopt, std::optional< uint16_t > cPage=std::nullopt) |
Display the bytecode opcode in a human friendly way. | |
Private Member Functions | |
uint16_t | readNumber (std::size_t &i) |
Read a number from the bytecode, under the instruction pointer i. | |
Private Attributes | |
bytecode_t | m_bytecode |
This class is just a helper to.
Definition at line 42 of file BytecodeReader.hpp.
|
default |
Construct a new Bytecode Reader object.
|
noexcept |
Return the bytecode object constructed.
Definition at line 32 of file BytecodeReader.cpp.
References m_bytecode.
Referenced by display(), Ark::State::feed(), and timestamp().
void Ark::BytecodeReader::display | ( | BytecodeSegment | segment = BytecodeSegment::All , |
std::optional< uint16_t > | sStart = std::nullopt , |
||
std::optional< uint16_t > | sEnd = std::nullopt , |
||
std::optional< uint16_t > | cPage = std::nullopt |
||
) |
Display the bytecode opcode in a human friendly way.
segment | selected bytecode segment that will be displayed |
sStart | start of the segment slice to display (Ignored in code segment if no page is available) |
sEnd | end of the segment slice to display (Ignored in code segment if no page is available) |
cPage | selected page of the code segment (Used only for the code segment) |
Definition at line 71 of file BytecodeReader.cpp.
References Ark::All, Ark::internal::Builtins::builtins, bytecode(), Ark::Code, Ark::HeadersOnly, m_bytecode, readNumber(), Ark::Symbols, timestamp(), and Ark::Values.
Referenced by main().
void Ark::BytecodeReader::feed | ( | const std::string & | file | ) |
Construct needed data before displaying information about a given file.
file | filename of the bytecode file |
Definition at line 15 of file BytecodeReader.cpp.
References m_bytecode.
Referenced by Ark::State::doFile(), Ark::State::feed(), and main().
|
private |
Read a number from the bytecode, under the instruction pointer i.
i | this parameter is being modified to point to the next value |
Definition at line 628 of file BytecodeReader.cpp.
References m_bytecode.
Referenced by display(), and timestamp().
unsigned long long Ark::BytecodeReader::timestamp | ( | ) |
Return the read timestamp from the bytecode file.
Definition at line 37 of file BytecodeReader.cpp.
References bytecode(), m_bytecode, readNumber(), and timestamp().
Referenced by display(), Ark::State::doFile(), and timestamp().
|
private |
Definition at line 86 of file BytecodeReader.hpp.
Referenced by bytecode(), display(), feed(), readNumber(), and timestamp().