ScummVM API documentation
Stark::Tools::CFGCommand Class Reference

#include <command.h>

Inheritance diagram for Stark::Tools::CFGCommand:
Stark::Tools::Command

Public Member Functions

 CFGCommand (Resources::Command *resource)
 
bool isEntryPoint () const
 
bool isBranch () const
 
bool isBranchTarget () const
 
CFGCommandgetFollower () const
 
CFGCommandgetTrueBranch () const
 
CFGCommandgetFalseBranch () const
 
BlockgetBlock () const
 
void setBlock (Block *block)
 
void linkBranches (const Common::Array< CFGCommand *> &commands)
 
- Public Member Functions inherited from Stark::Tools::Command
 Command (Command *command)
 
 Command (Resources::Command *resource)
 
void printCall () const
 
uint16 getIndex () const
 
Resources::Command::SubType getSubType () const
 
bool hasSubtypeDescription () const
 
ArgumentArray getEffectiveArguments () const
 

Protected Member Functions

void initBranches ()
 
- Protected Member Functions inherited from Stark::Tools::Command
Common::String describeArguments (DefinitionRegistry *definitions) const
 

Static Protected Member Functions

static CFGCommandfindCommandWithIndex (const Common::Array< CFGCommand *> &commands, int32 index)
 
- Static Protected Member Functions inherited from Stark::Tools::Command
static const SubTypeDescsearchSubTypeDesc (Resources::Command::SubType subType)
 

Protected Attributes

int32 _followerIndex
 
int32 _trueBranchIndex
 
int32 _falseBranchIndex
 
CFGCommand_follower
 
CFGCommand_trueBranch
 
CFGCommand_falseBranch
 
Common::Array< CFGCommand * > _predecessors
 
Block_block
 
- Protected Attributes inherited from Stark::Tools::Command
uint16 _index
 
Resources::Command::SubType _subType
 
const SubTypeDesc_subTypeDesc
 
ArgumentArray _arguments
 

Additional Inherited Members

- Public Types inherited from Stark::Tools::Command
enum  ControlFlowType { kFlowNormal, kFlowBranch, kFlowEnd }
 
typedef Common::Array< Resources::Command::ArgumentArgumentArray
 

Detailed Description

A script command with control flow information

This class is a node in the disassembly command control flow graph. It is referenced by the blocks in the block control flow graph.

Member Function Documentation

◆ isEntryPoint()

bool Stark::Tools::CFGCommand::isEntryPoint ( ) const

Is this command an entry point for the whole script?

◆ isBranch()

bool Stark::Tools::CFGCommand::isBranch ( ) const

Can this command influence the control flow?

◆ isBranchTarget()

bool Stark::Tools::CFGCommand::isBranchTarget ( ) const

Is this command a jump target?

◆ getFollower()

CFGCommand* Stark::Tools::CFGCommand::getFollower ( ) const

Commands are linked together in the command graph with these relationships:

  • follower: The natural follower of the command. Used when the command is not a branch, nor an end point.
  • true branch: The next command when the command's condition evaluates to true.
  • false branch: The next command when the command's condition evaluates to false.
  • predecessors: A list of commands whose execution can lead to this command.

◆ getBlock()

Block* Stark::Tools::CFGCommand::getBlock ( ) const

Commands are aggregated into blocks

◆ linkBranches()

void Stark::Tools::CFGCommand::linkBranches ( const Common::Array< CFGCommand *> &  commands)

Add the command to the command graph

This sets the graph edges concerning this command.

◆ initBranches()

void Stark::Tools::CFGCommand::initBranches ( )
protected

Set the link indices from the argument values

◆ findCommandWithIndex()

static CFGCommand* Stark::Tools::CFGCommand::findCommandWithIndex ( const Common::Array< CFGCommand *> &  commands,
int32  index 
)
staticprotected

Gets the command with the specifed index


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