Package ghidra.program.model.lang

# Class OldLanguageMappingService

java.lang.Object
ghidra.program.model.lang.OldLanguageMappingService

public class OldLanguageMappingService extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OldLanguageMappingService()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected 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`
  `validatePair(LanguageCompilerSpecPair pair)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 string
      `languageReplacementOK` - 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

    protected static LanguageCompilerSpecPair validatePair(LanguageCompilerSpecPair pair)

  - ### processXmlLanguageString

    public static LanguageCompilerSpecPair processXmlLanguageString(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.