![]() |
ArkScript
A small, lisp-inspired, functional scripting language
|
#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, Instruction inst=Instruction::JUMP) |
static Entity | GotoWithArg (const Entity &label, Instruction inst, uint16_t primary_arg) |
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 37 of file Entity.hpp.
|
explicit |
Definition at line 5 of file Entity.cpp.
Referenced by Goto(), GotoWithArg(), and Label().
|
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 52 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 70 of file Entity.hpp.
References m_source_file.
Referenced by setSourceLocation().
|
static |
Definition at line 28 of file Entity.cpp.
References Entity(), Ark::internal::IR::Goto, inst(), and label().
Referenced by Ark::internal::ASTLowerer::compileIf(), Ark::internal::ASTLowerer::compileWhile(), and Ark::internal::ASTLowerer::handleCalls().
Definition at line 47 of file Entity.cpp.
References Ark::internal::IR::Goto, label(), Ark::internal::POP_JUMP_IF_FALSE, and Ark::internal::POP_JUMP_IF_TRUE.
Referenced by Ark::internal::ASTLowerer::compileIf(), and Ark::internal::ASTLowerer::compileWhile().
|
static |
Definition at line 37 of file Entity.cpp.
References Entity(), Ark::internal::IR::GotoWithArg, inst(), and label().
Referenced by Ark::internal::IROptimizer::IROptimizer().
|
inlinenodiscard |
Definition at line 68 of file Entity.hpp.
References m_source_file.
|
inlinenodiscard |
Definition at line 60 of file Entity.hpp.
References m_inst.
Referenced by Goto(), and GotoWithArg().
|
inlinenodiscard |
Definition at line 58 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 |
Definition at line 56 of file Entity.hpp.
References m_label.
Referenced by Goto(), GotoIf(), and GotoWithArg().
|
inlinenodiscard |
Definition at line 62 of file Entity.hpp.
References m_primary_arg.
Referenced by Ark::internal::IROptimizer::canBeOptimizedSafely().
|
inlinenodiscard |
Definition at line 64 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 61 of file Entity.cpp.
References filename(), m_source_file, and m_source_line.
|
inlinenodiscard |
Definition at line 72 of file Entity.hpp.
References m_source_line.
|
private |
Definition at line 77 of file Entity.hpp.
Referenced by bytecode(), and inst().
|
private |
Definition at line 75 of file Entity.hpp.
Referenced by bytecode(), and kind().
|
private |
Definition at line 76 of file Entity.hpp.
Referenced by label().
|
private |
Definition at line 78 of file Entity.hpp.
Referenced by bytecode(), and primaryArg().
|
private |
Definition at line 79 of file Entity.hpp.
Referenced by bytecode(), and secondaryArg().
|
private |
Definition at line 80 of file Entity.hpp.
Referenced by filename(), hasValidSourceLocation(), and setSourceLocation().
|
private |
Definition at line 81 of file Entity.hpp.
Referenced by setSourceLocation(), and sourceLine().