Package ghidra.program.util
Class LanguageTranslatorFactory
java.lang.Object
ghidra.program.util.LanguageTranslatorFactory
LanguageTranslatorFactory
manages all language translators within Ghidra.
Language translators support either a version translation for a single language, or a
language transition from one language to another. The following types of translators
are supported:
- Simple translators are established based upon a translator XML specification file (*.trans).
- Explicit translators are class implementations of the LanguageTranslator interface. The abstract LanguageTranslatorAdapter has been supplied for this purpose so that default mappings can be used if needed. Such custom translator classes should not be created within the 'ghidra.program.util' package since they will be ignored by the factory.
- Default translators can be instantiated for languages whose address spaces map to one-another. Such default translations may be lossy with register mappings and could result in lost register variables and references.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetLanguageTranslator
(LanguageID languageName, int majorVersion) Returns a language translation for a language version which is no longer supported.getLanguageTranslator
(Language fromLanguage, Language toLanguage) Returns a language translator for the transition from an oldLanguage to a newLanguage.static LanguageTranslatorFactory
Returns the single instance of the OldLanguageFactory.static void
-
Field Details
-
LANGUAGE_TRANSLATOR_FILE_EXT
- See Also:
-
-
Method Details
-
registerLanguageTranslatorFactoryMinion
-
getLanguageTranslatorFactory
Returns the single instance of the OldLanguageFactory. -
getLanguageTranslator
Returns a language translator for the transition from an oldLanguage to a newLanguage. The toLanguage may be a different language or a newer version of fromLanguage.- Parameters:
fromLanguage
- old languagetoLanguage
- new language- Returns:
- language translator if transition is supported, otherwise null is returned.
-
getLanguageTranslator
Returns a language translation for a language version which is no longer supported.- Parameters:
languageName
- old unsupported language namemajorVersion
- language major version within program- Returns:
- language translator if one can be determined, otherwise null is returned.
-