Package ghidra.program.model.lang
Class OldLanguageMappingService
java.lang.Object
ghidra.program.model.lang.OldLanguageMappingService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected LanguageCompilerSpecPair
doLookupMagicString
(String magicString, boolean languageReplacementOK) static LanguageCompilerSpecPair
lookupMagicString
(String magicString, boolean languageReplacementOK) Check for a mapping of an old language-name magicString to a LanguageID/CompilerSpec pair.static LanguageCompilerSpecPair
processXmlLanguageString
(String languageString) Parse the language string from an XML language name into the most appropriate LanguageID/CompilerSpec pair.protected static LanguageCompilerSpecPair
-
Constructor Details
-
OldLanguageMappingService
public OldLanguageMappingService()
-
-
Method Details
-
lookupMagicString
public static LanguageCompilerSpecPair lookupMagicString(String magicString, boolean languageReplacementOK) Check for a mapping of an old language-name magicString to a LanguageID/CompilerSpec pair. If returnLanguageReplacement is false, the returned LanguageID/CompilerSpec pair may no longer exist and may require use of an OldLanguage and translation process.- Parameters:
magicString
- old language name magic stringlanguageReplacementOK
- if true the LanguageID/CompilerSpec pair corresponding to the latest language implementation will be returned if found, otherwise the a deprecated LanguageID/CompilerSpec pair may be returned. This parameter should be false if there is a sensitivity to the language implementation (e.g., instruction prototypes, etc.)- Returns:
- LanguageID/CompilerSpec pair or null if entry not found.
-
doLookupMagicString
protected LanguageCompilerSpecPair doLookupMagicString(String magicString, boolean languageReplacementOK) -
validatePair
-
processXmlLanguageString
Parse the language string from an XML language name into the most appropriate LanguageID/CompilerSpec pair. The language name may either be an old name (i.e., magicString) or a new<language-id>:<compiler-spec-id>
string. If an old language name magic-string is provided, its replacement language will be returned if known. The returned pair may or may not be available based upon available language implementations.- Parameters:
languageString
- old or new language string- Returns:
- LanguageID/CompilerSpec pair or null if no old name mapping could be found.
-