Ghidra Decompiler Analysis Engine
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
PrintLanguageCapability Class Referenceabstract

Base class for high-level language capabilities. More...

#include <printlanguage.hh>

Inheritance diagram for PrintLanguageCapability:
Inheritance graph
[legend]
Collaboration diagram for PrintLanguageCapability:
Collaboration graph
[legend]

Public Member Functions

virtual void initialize (void)
 Complete initialization of an extension point. More...
 
virtual PrintLanguagebuildLanguage (Architecture *glb)=0
 Build the main PrintLanguage object corresponding to this capability. More...
 

Static Public Member Functions

static PrintLanguageCapabilitygetDefault (void)
 Retrieve the default language capability. More...
 
static PrintLanguageCapabilityfindCapability (const string &name)
 Find a language capability by name. More...
 
- Static Public Member Functions inherited from CapabilityPoint
static void initializeAll (void)
 Finish initialization for all extension points. More...
 

Protected Attributes

string name
 Unique identifier for language capability.
 
bool isdefault
 Set to true to treat this as the default language.
 

Additional Inherited Members

- Protected Member Functions inherited from CapabilityPoint
 CapabilityPoint (void)
 Construct extension capability exactly once. More...
 

Detailed Description

Base class for high-level language capabilities.

This class is overridden to introduce a new high-level language back-end to the system. A static singleton is instantiated to automatically register the new capability with the system. A static array keeps track of all the registered capabilities.

The singleton is registered with a name, which the user can use to select the language, and it acts as a factory for the main language printing class for the capability, which must be derived from PrintLanguage. The factory method for the capability to override is buildLanguage().

Member Function Documentation

◆ buildLanguage()

virtual PrintLanguage* PrintLanguageCapability::buildLanguage ( Architecture glb)
pure virtual

Build the main PrintLanguage object corresponding to this capability.

An Architecture will call this once. All decompiling from this Architecture will use this same emitter.

Parameters
glbis the Architecture that will own the new emitter
Returns
the instantiated PrintLanguage emittter

Implemented in PrintCCapability, and PrintJavaCapability.

◆ findCapability()

PrintLanguageCapability * PrintLanguageCapability::findCapability ( const string &  name)
static

Find a language capability by name.

Parameters
nameis the language name to search for
Returns
the matching language capability or NULL

◆ getDefault()

PrintLanguageCapability * PrintLanguageCapability::getDefault ( void  )
static

Retrieve the default language capability.

This retrieves the capability with its isdefault field set or the first capability registered.

Returns
the default language capability

◆ initialize()

void PrintLanguageCapability::initialize ( void  )
virtual

Complete initialization of an extension point.

This method is implemented by each extension so it can do specialized integration

Implements CapabilityPoint.


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