Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::ScriptInterpreter::Instruction Struct Reference

Executable instruction as result of interpreting the script. More...

#include <ScriptInterpreter.h>

Collaboration diagram for sf::ScriptInterpreter::Instruction:

Public Types

enum  EInstr {
  eiGoto = -3 , eiContinue = -2 , eiBreak = -1 , eiNone = 0 ,
  eiCalculate , eiTestJump , eiJump , eiCall ,
  eiRetFunction , eiLastEntry
}
 Interpreter available instructions. More...
 

Public Member Functions

 Instruction ()=default
 Default constructor.
 
 Instruction (EInstr instr, ip_type ip, const CodePos &pos, std::string script=std::string())
 Initializing constructor.
 
const char * getMnemonic () const
 Gets the mnemonic of the current instruction.
 
ip_type getJumpIp () const
 Gets the jump ip from this instruction when applicable.
 

Public Attributes

EInstr _instr {eiNone}
 Operation instruction.
 
CodePos _codePos {0, 0}
 Position in the source.
 
std::string _script {}
 Partial script to calculate and to be used for a decision to jump or not.
 
ip_type _absIp {-1}
 Absolute instruction pointer address for jump instruction.
 

Detailed Description

Executable instruction as result of interpreting the script.

Member Enumeration Documentation

◆ EInstr

Interpreter available instructions.

Enumerator
eiGoto 
eiContinue 
eiBreak 
eiNone 
eiCalculate 
eiTestJump 
eiJump 
eiCall 
eiRetFunction 
eiLastEntry 

Constructor & Destructor Documentation

◆ Instruction() [1/2]

sf::ScriptInterpreter::Instruction::Instruction ( )
default

Default constructor.

◆ Instruction() [2/2]

sf::ScriptInterpreter::Instruction::Instruction ( EInstr  instr,
ip_type  ip,
const CodePos pos,
std::string  script = std::string() 
)

Initializing constructor.

Member Function Documentation

◆ getJumpIp()

ip_type sf::ScriptInterpreter::Instruction::getJumpIp ( ) const

Gets the jump ip from this instruction when applicable.

Returns
-1 when not applicable.

◆ getMnemonic()

const char * sf::ScriptInterpreter::Instruction::getMnemonic ( ) const

Gets the mnemonic of the current instruction.

Member Data Documentation

◆ _absIp

ip_type sf::ScriptInterpreter::Instruction::_absIp {-1}

Absolute instruction pointer address for jump instruction.

◆ _codePos

CodePos sf::ScriptInterpreter::Instruction::_codePos {0, 0}

Position in the source.

◆ _instr

EInstr sf::ScriptInterpreter::Instruction::_instr {eiNone}

Operation instruction.

◆ _script

std::string sf::ScriptInterpreter::Instruction::_script {}

Partial script to calculate and to be used for a decision to jump or not.


The documentation for this struct was generated from the following file: