![]() |
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) | |
| Entity (Instruction inst, uint8_t inst2, uint8_t inst3, uint8_t inst4) | |
| Word | bytecode () const |
| label_t | label () const |
| Kind | kind () const |
| Instruction | inst () const |
| uint16_t | primaryArg () const |
| uint16_t | secondaryArg () const |
| uint16_t | tertiaryArg () 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 } |
| uint16_t | m_tertiary_arg { 0 } |
| std::string | m_source_file |
| std::size_t | m_source_line { 0 } |
Definition at line 40 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.
| Ark::internal::IR::Entity::Entity | ( | Instruction | inst, |
| uint8_t | inst2, | ||
| uint8_t | inst3, | ||
| uint8_t | inst4 ) |
Definition at line 20 of file Entity.cpp.
|
nodiscard |
Definition at line 57 of file Entity.cpp.
References m_inst, m_kind, m_primary_arg, m_secondary_arg, m_tertiary_arg, Ark::internal::IR::Opcode, Ark::internal::IR::Opcode2Args, and Ark::internal::IR::Opcode3Args.
|
inlinenodiscard |
Definition at line 77 of file Entity.hpp.
References m_source_file.
Referenced by setSourceLocation().
|
static |
Definition at line 33 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 52 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 42 of file Entity.cpp.
References Entity(), Ark::internal::IR::GotoWithArg, inst(), and label().
Referenced by Ark::internal::IROptimizer::IROptimizer().
|
inlinenodiscard |
Definition at line 75 of file Entity.hpp.
References m_source_file.
|
inlinenodiscard |
Definition at line 65 of file Entity.hpp.
References m_inst.
Referenced by Goto(), and GotoWithArg().
|
inlinenodiscard |
Definition at line 63 of file Entity.hpp.
References m_kind.
Definition at line 25 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 61 of file Entity.hpp.
References m_label.
Referenced by Goto(), GotoIf(), and GotoWithArg().
|
inlinenodiscard |
Definition at line 67 of file Entity.hpp.
References m_primary_arg.
Referenced by Ark::internal::IROptimizer::canBeOptimizedSafely().
|
inlinenodiscard |
Definition at line 69 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 72 of file Entity.cpp.
References filename(), m_source_file, and m_source_line.
|
inlinenodiscard |
Definition at line 79 of file Entity.hpp.
References m_source_line.
|
inlinenodiscard |
Definition at line 71 of file Entity.hpp.
References m_tertiary_arg.
|
private |
Definition at line 84 of file Entity.hpp.
Referenced by bytecode(), and inst().
|
private |
Definition at line 82 of file Entity.hpp.
Referenced by bytecode(), and kind().
|
private |
Definition at line 83 of file Entity.hpp.
Referenced by label().
|
private |
Definition at line 85 of file Entity.hpp.
Referenced by bytecode(), and primaryArg().
|
private |
Definition at line 86 of file Entity.hpp.
Referenced by bytecode(), and secondaryArg().
|
private |
Definition at line 88 of file Entity.hpp.
Referenced by filename(), hasValidSourceLocation(), and setSourceLocation().
|
private |
Definition at line 89 of file Entity.hpp.
Referenced by setSourceLocation(), and sourceLine().
|
private |
Definition at line 87 of file Entity.hpp.
Referenced by bytecode(), and tertiaryArg().