Package ghidra.program.model.lang
Class OldLanguageMappingService
- java.lang.Object
-
- ghidra.program.model.lang.OldLanguageMappingService
-
public class OldLanguageMappingService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description OldLanguageMappingService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LanguageCompilerSpecPair
doLookupMagicString(java.lang.String magicString, boolean languageReplacementOK)
static LanguageCompilerSpecPair
lookupMagicString(java.lang.String magicString, boolean languageReplacementOK)
Check for a mapping of an old language-name magicString to a LanguageID/CompilerSpec pair.static LanguageCompilerSpecPair
processXmlLanguageString(java.lang.String languageString)
Parse the language string from an XML language name into the most appropriate LanguageID/CompilerSpec pair.protected static LanguageCompilerSpecPair
validatePair(LanguageCompilerSpecPair pair)
-
-
-
Method Detail
-
lookupMagicString
public static LanguageCompilerSpecPair lookupMagicString(java.lang.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(java.lang.String magicString, boolean languageReplacementOK)
-
validatePair
protected static LanguageCompilerSpecPair validatePair(LanguageCompilerSpecPair pair)
-
processXmlLanguageString
public static LanguageCompilerSpecPair processXmlLanguageString(java.lang.String languageString)
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.
-
-