V-Gears 0
Free Final Fantasy VII engine.
Engine Class Referenceabstract

Base class for engines. More...

#include <Engine.h>

Inheritance diagram for Engine:

Public Member Functions

virtual ~Engine ()=default
 
virtual std::unique_ptr< DisassemblerGetDisassembler (InstVec &insts, const std::vector< unsigned char > &c)
 
virtual std::unique_ptr< DisassemblerGetDisassembler (InstVec &insts)=0
 Retrieve the disassembler for the engine. More...
 
virtual std::unique_ptr< CodeGeneratorGetCodeGenerator (const InstVec &insts, std::ostream &output)=0
 Retrieve the code generator for the engine. More...
 
virtual void PostCFG (InstVec &insts, Graph graph)
 Post-processing step after CFG analysis. More...
 
virtual bool SupportsCodeFlow () const
 Whether or not code flow analysis is supported for this engine. More...
 
virtual bool SupportsCodeGen () const
 Whether or not code generation is supported for this engine. More...
 
virtual void GetVariants (std::vector< std::string > &variants) const
 Retrieves the names of all variants supported for this engine. More...
 
virtual bool UsePureGrouping () const
 Whether or not to use "pure" grouping during code flow analysis. More...
 

Public Attributes

FuncMap functions
 Map to functions in the current script, indexed by start address. More...
 

Protected Attributes

std::string variant_
 Engine variant to use for the script. More...
 

Detailed Description

Base class for engines.

Constructor & Destructor Documentation

◆ ~Engine()

virtual Engine::~Engine ( )
virtualdefault

Member Function Documentation

◆ GetCodeGenerator()

virtual std::unique_ptr< CodeGenerator > Engine::GetCodeGenerator ( const InstVec insts,
std::ostream &  output 
)
pure virtual

Retrieve the code generator for the engine.

Parameters
[in]instsThe list of instructions.
[out]outputStream to output the code to.
Returns
Pointer to a CodeGenerator for the engine.

Implemented in FieldEngine, and WorldEngine.

◆ GetDisassembler() [1/2]

virtual std::unique_ptr< Disassembler > Engine::GetDisassembler ( InstVec insts)
pure virtual

Retrieve the disassembler for the engine.

Parameters
[out]instsVector to place the Instructions in.
Returns
Pointer to a disassembler for the engine.

Implemented in FieldEngine, and WorldEngine.

◆ GetDisassembler() [2/2]

std::unique_ptr< Disassembler > Engine::GetDisassembler ( InstVec insts,
const std::vector< unsigned char > &  c 
)
virtual

Reimplemented in FieldEngine.

◆ GetVariants()

void Engine::GetVariants ( std::vector< std::string > &  variants) const
virtual

Retrieves the names of all variants supported for this engine.

If variants are not used by this engine, it will be empty (default implementation).

Parameters
[out]variantsVector with the supported variants.

Reimplemented in WorldEngine.

◆ PostCFG()

void Engine::PostCFG ( InstVec insts,
Graph  graph 
)
virtual

Post-processing step after CFG analysis.

Parameters
[out]instsVector to place the Instructions in.
[in]graphGraph generated from the CFG analysis.

Reimplemented in FieldEngine, and WorldEngine.

◆ SupportsCodeFlow()

bool Engine::SupportsCodeFlow ( ) const
virtual

Whether or not code flow analysis is supported for this engine.

Returns
True if supported, false if not. If false is returned, code flow analysis should not take place.

◆ SupportsCodeGen()

bool Engine::SupportsCodeGen ( ) const
virtual

Whether or not code generation is supported for this engine.

Returns
True if supported, false if not. If false is returned, code generation should not take place.

◆ UsePureGrouping()

bool Engine::UsePureGrouping ( ) const
virtual

Whether or not to use "pure" grouping during code flow analysis.

With pure grouping, code flow analysis only looks at branches when merging. This method may be more appropriate for non-stack-based engines.

Returns
True if pure grouping should be used, false if not.

Reimplemented in FieldEngine, and WorldEngine.

Member Data Documentation

◆ functions

FuncMap Engine::functions

Map to functions in the current script, indexed by start address.

◆ variant_

std::string Engine::variant_
protected

Engine variant to use for the script.


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