![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
#include <Entity.hpp>
Public Member Functions | |
Entity (Kind kind) | |
Entity (Instruction inst, uint16_t arg=0) | |
Entity (Instruction inst, uint16_t primary_arg, uint16_t secondary_arg) | |
Word | bytecode () const |
label_t | label () const |
Kind | kind () const |
Instruction | inst () const |
uint16_t | primaryArg () const |
uint16_t | secondaryArg () const |
void | setSourceLocation (const std::string &filename, std::size_t line) |
bool | hasValidSourceLocation () const |
const std::string & | filename () const |
std::size_t | sourceLine () const |
Static Public Member Functions | |
static Entity | Label (label_t value) |
static Entity | Goto (const Entity &label) |
static Entity | GotoIf (const Entity &label, bool cond) |
Private Attributes | |
Kind | m_kind |
label_t | m_label { 0 } |
Instruction | m_inst { NOP } |
uint16_t | m_primary_arg { 0 } |
uint16_t | m_secondary_arg { 0 } |
std::string | m_source_file |
std::size_t | m_source_line { 0 } |
Definition at line 38 of file Entity.hpp.
|
explicit |
Definition at line 5 of file Entity.cpp.
|
explicit |
Definition at line 10 of file Entity.cpp.
Ark::internal::IR::Entity::Entity | ( | Instruction | inst, |
uint16_t | primary_arg, | ||
uint16_t | secondary_arg ) |
Definition at line 15 of file Entity.cpp.
|
nodiscard |
Definition at line 44 of file Entity.cpp.
References m_inst, m_kind, m_primary_arg, m_secondary_arg, Ark::internal::IR::Opcode, and Ark::internal::IR::Opcode2Args.
|
inlinenodiscard |
Definition at line 69 of file Entity.hpp.
References m_source_file.
Referenced by setSourceLocation().
Definition at line 28 of file Entity.cpp.
References Entity(), Ark::internal::IR::Goto, and label().
Referenced by Ark::internal::ASTLowerer::compileIf(), and Ark::internal::ASTLowerer::compileWhile().
Definition at line 36 of file Entity.cpp.
References Entity(), Ark::internal::IR::GotoIfFalse, Ark::internal::IR::GotoIfTrue, and label().
Referenced by Ark::internal::ASTLowerer::compileIf(), Ark::internal::ASTLowerer::compileWhile(), and Ark::internal::ASTLowerer::handleCalls().
|
inlinenodiscard |
Definition at line 67 of file Entity.hpp.
References m_source_file.
|
inlinenodiscard |
Definition at line 59 of file Entity.hpp.
References m_inst.
|
inlinenodiscard |
Definition at line 57 of file Entity.hpp.
References m_kind.
Definition at line 20 of file Entity.cpp.
References Entity(), and Ark::internal::IR::Label.
Referenced by Ark::internal::ASTLowerer::compileIf(), Ark::internal::ASTLowerer::compileWhile(), and Ark::internal::ASTLowerer::handleCalls().
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 61 of file Entity.hpp.
References m_primary_arg.
|
inlinenodiscard |
Definition at line 63 of file Entity.hpp.
References m_secondary_arg.
void Ark::internal::IR::Entity::setSourceLocation | ( | const std::string & | filename, |
std::size_t | line ) |
Definition at line 53 of file Entity.cpp.
References filename(), m_source_file, and m_source_line.
|
inlinenodiscard |
Definition at line 71 of file Entity.hpp.
References m_source_line.
|
private |
Definition at line 76 of file Entity.hpp.
Referenced by bytecode(), and inst().
|
private |
Definition at line 74 of file Entity.hpp.
Referenced by bytecode(), and kind().
|
private |
Definition at line 75 of file Entity.hpp.
Referenced by label().
|
private |
Definition at line 77 of file Entity.hpp.
Referenced by bytecode(), and primaryArg().
|
private |
Definition at line 78 of file Entity.hpp.
Referenced by bytecode(), and secondaryArg().
|
private |
Definition at line 79 of file Entity.hpp.
Referenced by filename(), hasValidSourceLocation(), and setSourceLocation().
|
private |
Definition at line 80 of file Entity.hpp.
Referenced by setSourceLocation(), and sourceLine().