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

#include <block.h>

Public Member Functions

void appendCommand (CFGCommand *command)
 
Common::Array< CFGCommand * > getLinearCommands () const
 
CFGCommandgetConditionCommand () const
 
bool isEmpty () const
 
bool isCondition () const
 
void setBranches (Block *trueBranch, Block *falseBranch)
 
void setFollower (Block *follower)
 
void addPredecessor (Block *predecessor)
 
BlockgetTrueBranch () const
 
BlockgetFalseBranch () const
 
BlockgetFollower () const
 
void print () const
 
bool hasControlStructure () const
 
ControlStructuregetControlStructure () const
 
void setControlStructure (ControlStructure *controlStructure)
 
bool isInfiniteLoopStart () const
 
void setInfiniteLoopStart (bool infiniteLoopStart)
 
bool allowDuplication () const
 
bool hasPredecessor (Block *predecessor) const
 
bool hasSuccessor (Block *successor) const
 
BlockfindMergePoint (Block *other)
 
bool checkAllBranchesConverge (Block *junction) const
 

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.

Member Function Documentation

◆ appendCommand()

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

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

◆ getLinearCommands()

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

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

◆ getConditionCommand()

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

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

◆ isEmpty()

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

Does the block contain commands?

◆ isCondition()

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

Can the block branch?

◆ setBranches()

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.

◆ print()

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

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

◆ hasControlStructure()

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

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

◆ isInfiniteLoopStart()

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

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

◆ allowDuplication()

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

Can this block appear multiple times in the decompiled output?


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