ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Stark::Tools::Block Class Reference

An aggregate of script commands. More...

#include <block.h>

Collaboration diagram for Stark::Tools::Block:

List of all members.

Public Member Functions

 Block ()
void appendCommand (CFGCommand *command)
 Add a command at the end of the block, and set it as the command's block.
Common::Array< CFGCommand * > getLinearCommands () const
 Get the commands from the block that are not part of a condition.
CFGCommandgetConditionCommand () const
 Get the command from the block that plays as a condition in a control structure.
bool isEmpty () const
 Does the block contain commands?
bool isCondition () const
 Can the block branch?
void setBranches (Block *trueBranch, Block *falseBranch)
 Blocks are linked together in the block graph with these relationships:

  • follower: The natural follower of the block.

void setFollower (Block *follower)
void addPredecessor (Block *predecessor)
BlockgetTrueBranch () const
BlockgetFalseBranch () const
BlockgetFollower () const
void print () const
 Print a list of this block's commands to the debug output.
bool hasControlStructure () const
 The high level control structure this block has the main role in.
ControlStructuregetControlStructure () const
void setControlStructure (ControlStructure *controlStructure)
bool isInfiniteLoopStart () const
 Flag to indicate this block is the first in an unconditional infinite loop.
void setInfiniteLoopStart (bool infiniteLoopStart)
bool allowDuplication () const
 Can this block appear multiple times in the decompiled output?
bool hasPredecessor (Block *predecessor) const
bool hasSuccessor (Block *successor) const
BlockfindMergePoint (Block *other)
bool checkAllBranchesConverge (Block *junction) const

Private Member Functions

bool hasPredecessorIntern (Common::Array< const Block * > &visited, Block *predecessor) const
bool hasSuccessorIntern (Common::Array< const Block * > &visited, Block *successor) const
bool hasChildSuccessorIntern (Common::Array< const Block * > &visited, Block *child, Block *successor) const
BlockfindMergePointIntern (Common::Array< const Block * > &visited, Block *other)
BlockfindChildMergePoint (Common::Array< const Block * > &visited, Block *child, Block *other) const
bool checkAllBranchesConvergeIntern (Common::Array< const Block * > &visited, Block *junction) const
bool checkChildConvergeIntern (Common::Array< const Block * > &visited, Block *child, Block *junction) const
uint16 getFirstCommandIndex () const

Private Attributes

Common::Array< CFGCommand * > _commands
Block_follower
Block_trueBranch
Block_falseBranch
Common::Array< Block * > _predecessors
ControlStructure_controlStructure
bool _infiniteLoopStart

Detailed Description

An aggregate of script commands.

Commands in the same group are always executed in sequence.

This class is a node in the disassembly node graph.

Definition at line 41 of file block.h.


Constructor & Destructor Documentation

Stark::Tools::Block::Block (  ) 

Definition at line 32 of file block.cpp.


Member Function Documentation

void Stark::Tools::Block::addPredecessor ( Block predecessor  ) 

Definition at line 95 of file block.cpp.

bool Stark::Tools::Block::allowDuplication (  )  const

Can this block appear multiple times in the decompiled output?

Definition at line 310 of file block.cpp.

void Stark::Tools::Block::appendCommand ( CFGCommand command  ) 

Add a command at the end of the block, and set it as the command's block.

Definition at line 41 of file block.cpp.

bool Stark::Tools::Block::checkAllBranchesConverge ( Block junction  )  const

Definition at line 204 of file block.cpp.

bool Stark::Tools::Block::checkAllBranchesConvergeIntern ( Common::Array< const Block * > &  visited,
Block junction 
) const [private]

Definition at line 215 of file block.cpp.

bool Stark::Tools::Block::checkChildConvergeIntern ( Common::Array< const Block * > &  visited,
Block child,
Block junction 
) const [private]

Definition at line 238 of file block.cpp.

Block * Stark::Tools::Block::findChildMergePoint ( Common::Array< const Block * > &  visited,
Block child,
Block other 
) const [private]

Definition at line 193 of file block.cpp.

Block * Stark::Tools::Block::findMergePoint ( Block other  ) 

Definition at line 158 of file block.cpp.

Block * Stark::Tools::Block::findMergePointIntern ( Common::Array< const Block * > &  visited,
Block other 
) [private]

Definition at line 164 of file block.cpp.

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

Get the command from the block that plays as a condition in a control structure.

Definition at line 301 of file block.cpp.

ControlStructure * Stark::Tools::Block::getControlStructure (  )  const

Definition at line 273 of file block.cpp.

Block * Stark::Tools::Block::getFalseBranch (  )  const

Definition at line 257 of file block.cpp.

uint16 Stark::Tools::Block::getFirstCommandIndex (  )  const [private]

Definition at line 261 of file block.cpp.

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

Definition at line 249 of file block.cpp.

Common::Array< CFGCommand * > Stark::Tools::Block::getLinearCommands (  )  const

Get the commands from the block that are not part of a condition.

Definition at line 285 of file block.cpp.

Block * Stark::Tools::Block::getTrueBranch (  )  const

Definition at line 253 of file block.cpp.

bool Stark::Tools::Block::hasChildSuccessorIntern ( Common::Array< const Block * > &  visited,
Block child,
Block successor 
) const [private]

Definition at line 149 of file block.cpp.

bool Stark::Tools::Block::hasControlStructure (  )  const

The high level control structure this block has the main role in.

Definition at line 265 of file block.cpp.

bool Stark::Tools::Block::hasPredecessor ( Block predecessor  )  const

Definition at line 103 of file block.cpp.

bool Stark::Tools::Block::hasPredecessorIntern ( Common::Array< const Block * > &  visited,
Block predecessor 
) const [private]

Definition at line 108 of file block.cpp.

bool Stark::Tools::Block::hasSuccessor ( Block successor  )  const

Definition at line 130 of file block.cpp.

bool Stark::Tools::Block::hasSuccessorIntern ( Common::Array< const Block * > &  visited,
Block successor 
) const [private]

Definition at line 135 of file block.cpp.

bool Stark::Tools::Block::isCondition (  )  const

Can the block branch?

Definition at line 99 of file block.cpp.

bool Stark::Tools::Block::isEmpty (  )  const

Does the block contain commands?

Definition at line 46 of file block.cpp.

bool Stark::Tools::Block::isInfiniteLoopStart (  )  const

Flag to indicate this block is the first in an unconditional infinite loop.

Definition at line 281 of file block.cpp.

void Stark::Tools::Block::print (  )  const

Print a list of this block's commands to the debug output.

Definition at line 50 of file block.cpp.

void Stark::Tools::Block::setBranches ( Block trueBranch,
Block falseBranch 
)

Blocks are linked together in the block graph with these relationships:

  • follower: The natural follower of the block.

Used when the block is not a branch, nor an end point.

  • true branch: The next block when the block's condition evaluates to true.
  • false branch: The next block when the block's condition evaluates to false.
  • predecessors: A list of blocks whose execution can lead to this block.

Definition at line 82 of file block.cpp.

void Stark::Tools::Block::setControlStructure ( ControlStructure controlStructure  ) 

Definition at line 269 of file block.cpp.

void Stark::Tools::Block::setFollower ( Block follower  ) 

Definition at line 90 of file block.cpp.

void Stark::Tools::Block::setInfiniteLoopStart ( bool  infiniteLoopStart  ) 

Definition at line 277 of file block.cpp.


Member Data Documentation

Definition at line 110 of file block.h.

Definition at line 117 of file block.h.

Definition at line 114 of file block.h.

Definition at line 112 of file block.h.

Definition at line 118 of file block.h.

Definition at line 115 of file block.h.

Definition at line 113 of file block.h.


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


Generated on Sat May 25 2019 05:07:07 for ResidualVM by doxygen 1.7.1
curved edge   curved edge