Package ghidra.program.util
Class DefaultLanguageService
- java.lang.Object
- 
- ghidra.program.util.DefaultLanguageService
 
- 
- All Implemented Interfaces:
- LanguageService,- java.util.EventListener,- javax.swing.event.ChangeListener
 
 public class DefaultLanguageService extends java.lang.Object implements LanguageService, javax.swing.event.ChangeListener Default Language service used gather up all the languages that were found during the class search (search was for language providers)
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LanguagegetDefaultLanguage(Processor processor)Returns the default Language to use for the given processor;static java.util.List<java.lang.String>getDefinedExternalToolNames(java.lang.String languageId, java.lang.String tool, boolean includeDeprecated)Returns external names for specified language associated with other tools.java.util.List<LanguageDescription>getExternalLanguageDescriptions(java.lang.String externalProcessorName, java.lang.String externalTool, Endian endianess, java.lang.Integer size)LanguagegetLanguage(LanguageID languageID)Returns the language with the given language IDjava.util.List<LanguageCompilerSpecPair>getLanguageCompilerSpecPairs(ExternalLanguageCompilerSpecQuery query)Returns all known language/compiler spec pairs which satisfy the criteria identify by the non-null parameters.java.util.List<LanguageCompilerSpecPair>getLanguageCompilerSpecPairs(LanguageCompilerSpecQuery query)Returns all known language/compiler spec pairs which satisfy the criteria identify by the non-null parameters.LanguageDescriptiongetLanguageDescription(LanguageID languageID)Get language information for the given language ID.java.util.List<LanguageDescription>getLanguageDescriptions(boolean includeDeprecatedLanguages)Returns all known language Descriptionsjava.util.List<LanguageDescription>getLanguageDescriptions(Processor processor)Returns all language Descriptions associated with the given processor.java.util.List<LanguageDescription>getLanguageDescriptions(Processor processor, Endian endianess, java.lang.Integer size, java.lang.String variant)Returns all known language descriptions which satisfy the criteria identify by the non-null parameters.static LanguageServicegetLanguageService()Returns the single instance of the DefaultLanguageService.static LanguageServicegetLanguageService(ResourceFile sleighLdefsFile)Return the single instance of the DefaultLanguageService.voidstateChanged(javax.swing.event.ChangeEvent e)
 
- 
- 
- 
Method Detail- 
getLanguageServicepublic static LanguageService getLanguageService() Returns the single instance of the DefaultLanguageService.- Returns:
- the language service
 
 - 
getLanguageServicepublic static LanguageService getLanguageService(ResourceFile sleighLdefsFile) throws java.lang.Exception Return the single instance of the DefaultLanguageService. If not already instantiated in the default mode, the factory will be lazy and limit it set of languages to those defined by the specified Sleigh language definition file (*.ldefs) or those provided by subsequent calls to this method.- Parameters:
- sleighLdefsFile- sleigh language definition file
- Returns:
- language factory instance
- Throws:
- java.lang.Exception- if an error occurs while parsing the specified definition file
 
 - 
getLanguagepublic Language getLanguage(LanguageID languageID) throws LanguageNotFoundException Description copied from interface:LanguageServiceReturns the language with the given language ID- Specified by:
- getLanguagein interface- LanguageService
- Parameters:
- languageID- the ID of language to retrieve
- Returns:
- the Languagematching the given ID
- Throws:
- LanguageNotFoundException- if no language can be found for the given ID
 
 - 
getLanguageDescriptionpublic LanguageDescription getLanguageDescription(LanguageID languageID) throws LanguageNotFoundException Description copied from interface:LanguageServiceGet language information for the given language ID.- Specified by:
- getLanguageDescriptionin interface- LanguageService
- Parameters:
- languageID- the id for the language.
- Returns:
- language information for the given language ID.
- Throws:
- LanguageNotFoundException- if there is no language for the given ID.
 
 - 
getLanguageDescriptionspublic java.util.List<LanguageDescription> getLanguageDescriptions(boolean includeDeprecatedLanguages) Description copied from interface:LanguageServiceReturns all known language Descriptions- Specified by:
- getLanguageDescriptionsin interface- LanguageService
- Parameters:
- includeDeprecatedLanguages- TODO
- Returns:
- all know language Descriptions.
 
 - 
getLanguageDescriptionspublic java.util.List<LanguageDescription> getLanguageDescriptions(Processor processor, Endian endianess, java.lang.Integer size, java.lang.String variant) Description copied from interface:LanguageServiceReturns all known language descriptions which satisfy the criteria identify by the non-null parameters. A null value implies a don't-care wildcard value.- Specified by:
- getLanguageDescriptionsin interface- LanguageService
- Parameters:
- processor- the processor for which to get a language
- endianess- big or little
- size- processor address space size (in bits)
- variant- the processor version (usually 'default')
- Returns:
- the language descriptions that fit the parameters
 
 - 
getExternalLanguageDescriptionspublic java.util.List<LanguageDescription> getExternalLanguageDescriptions(java.lang.String externalProcessorName, java.lang.String externalTool, Endian endianess, java.lang.Integer size) 
 - 
getLanguageCompilerSpecPairspublic java.util.List<LanguageCompilerSpecPair> getLanguageCompilerSpecPairs(LanguageCompilerSpecQuery query) Description copied from interface:LanguageServiceReturns all known language/compiler spec pairs which satisfy the criteria identify by the non-null parameters. A null value implies a don't-care wildcard value. OMITS DEPRECATED LANGUAGES.- Specified by:
- getLanguageCompilerSpecPairsin interface- LanguageService
- Parameters:
- query- TODO
- Returns:
 
 - 
getLanguageCompilerSpecPairspublic java.util.List<LanguageCompilerSpecPair> getLanguageCompilerSpecPairs(ExternalLanguageCompilerSpecQuery query) Description copied from interface:LanguageServiceReturns all known language/compiler spec pairs which satisfy the criteria identify by the non-null parameters. A null value implies a don't-care wildcard value. OMITS DEPRECATED LANGUAGES. This uses an ExternalLanguageCompilerSpecQuery rather than a LanguageCompilerSpecQuery.- Specified by:
- getLanguageCompilerSpecPairsin interface- LanguageService
- Returns:
 
 - 
getLanguageDescriptionspublic java.util.List<LanguageDescription> getLanguageDescriptions(Processor processor) Description copied from interface:LanguageServiceReturns all language Descriptions associated with the given processor.- Specified by:
- getLanguageDescriptionsin interface- LanguageService
- Parameters:
- processor- the processor for which to retrieve all know language descriptions.
 
 - 
getDefinedExternalToolNamespublic static java.util.List<java.lang.String> getDefinedExternalToolNames(java.lang.String languageId, java.lang.String tool, boolean includeDeprecated)Returns external names for specified language associated with other tools. For example, x86 languages are usually referred to as "metapc" by IDA-PRO.- Parameters:
- languageId- language to search against
- tool- name of external tool to search against
- includeDeprecated- include deprecated LanguageDescriptions
- Returns:
- external names for this language associated with tool
 
 - 
getDefaultLanguagepublic Language getDefaultLanguage(Processor processor) throws LanguageNotFoundException Description copied from interface:LanguageServiceReturns the default Language to use for the given processor;- Specified by:
- getDefaultLanguagein interface- LanguageService
- Parameters:
- processor- the processor for which to get a language.
- Throws:
- LanguageNotFoundException- if there is no languages at all for the given processor.
 
 - 
stateChangedpublic void stateChanged(javax.swing.event.ChangeEvent e) - Specified by:
- stateChangedin interface- javax.swing.event.ChangeListener
 
 
- 
 
-