ArkScript
A small, fast, functional and scripting language for video games
Ark::internal::IR::Entity Class Reference

#include <Entity.hpp>

Collaboration diagram for Ark::internal::IR::Entity:
[legend]

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 }
 

Detailed Description

Definition at line 38 of file Entity.hpp.

Constructor & Destructor Documentation

◆ Entity() [1/3]

Ark::internal::IR::Entity::Entity ( Kind kind)
explicit

Definition at line 5 of file Entity.cpp.

Referenced by Goto(), GotoIf(), and Label().

◆ Entity() [2/3]

Ark::internal::IR::Entity::Entity ( Instruction inst,
uint16_t arg = 0 )
explicit

Definition at line 10 of file Entity.cpp.

◆ Entity() [3/3]

Ark::internal::IR::Entity::Entity ( Instruction inst,
uint16_t primary_arg,
uint16_t secondary_arg )

Definition at line 15 of file Entity.cpp.

Member Function Documentation

◆ bytecode()

Word Ark::internal::IR::Entity::bytecode ( ) const
nodiscard

◆ filename()

const std::string & Ark::internal::IR::Entity::filename ( ) const
inlinenodiscard

Definition at line 69 of file Entity.hpp.

References m_source_file.

Referenced by setSourceLocation().

◆ Goto()

Entity Ark::internal::IR::Entity::Goto ( const Entity & label)
static

◆ GotoIf()

Entity Ark::internal::IR::Entity::GotoIf ( const Entity & label,
bool cond )
static

◆ hasValidSourceLocation()

bool Ark::internal::IR::Entity::hasValidSourceLocation ( ) const
inlinenodiscard

Definition at line 67 of file Entity.hpp.

References m_source_file.

◆ inst()

Instruction Ark::internal::IR::Entity::inst ( ) const
inlinenodiscard

Definition at line 59 of file Entity.hpp.

References m_inst.

◆ kind()

Kind Ark::internal::IR::Entity::kind ( ) const
inlinenodiscard

Definition at line 57 of file Entity.hpp.

References m_kind.

◆ Label()

Entity Ark::internal::IR::Entity::Label ( label_t value)
static

◆ label()

label_t Ark::internal::IR::Entity::label ( ) const
inlinenodiscard

Definition at line 55 of file Entity.hpp.

References m_label.

Referenced by Goto(), and GotoIf().

◆ primaryArg()

uint16_t Ark::internal::IR::Entity::primaryArg ( ) const
inlinenodiscard

Definition at line 61 of file Entity.hpp.

References m_primary_arg.

◆ secondaryArg()

uint16_t Ark::internal::IR::Entity::secondaryArg ( ) const
inlinenodiscard

Definition at line 63 of file Entity.hpp.

References m_secondary_arg.

◆ setSourceLocation()

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.

◆ sourceLine()

std::size_t Ark::internal::IR::Entity::sourceLine ( ) const
inlinenodiscard

Definition at line 71 of file Entity.hpp.

References m_source_line.

Member Data Documentation

◆ m_inst

Instruction Ark::internal::IR::Entity::m_inst { NOP }
private

Definition at line 76 of file Entity.hpp.

Referenced by bytecode(), and inst().

◆ m_kind

Kind Ark::internal::IR::Entity::m_kind
private

Definition at line 74 of file Entity.hpp.

Referenced by bytecode(), and kind().

◆ m_label

label_t Ark::internal::IR::Entity::m_label { 0 }
private

Definition at line 75 of file Entity.hpp.

Referenced by label().

◆ m_primary_arg

uint16_t Ark::internal::IR::Entity::m_primary_arg { 0 }
private

Definition at line 77 of file Entity.hpp.

Referenced by bytecode(), and primaryArg().

◆ m_secondary_arg

uint16_t Ark::internal::IR::Entity::m_secondary_arg { 0 }
private

Definition at line 78 of file Entity.hpp.

Referenced by bytecode(), and secondaryArg().

◆ m_source_file

std::string Ark::internal::IR::Entity::m_source_file
private

Definition at line 79 of file Entity.hpp.

Referenced by filename(), hasValidSourceLocation(), and setSourceLocation().

◆ m_source_line

std::size_t Ark::internal::IR::Entity::m_source_line { 0 }
private

Definition at line 80 of file Entity.hpp.

Referenced by setSourceLocation(), and sourceLine().


The documentation for this class was generated from the following files: