Package ghidra.program.model.lang
Class LanguageCompilerSpecPair
java.lang.Object
ghidra.program.model.lang.LanguageCompilerSpecPair
- All Implemented Interfaces:
Comparable<LanguageCompilerSpecPair>
public final class LanguageCompilerSpecPair
extends Object
implements Comparable<LanguageCompilerSpecPair>
Represents an opinion's processor language and compiler.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLanguageCompilerSpecPair
(LanguageID languageID, CompilerSpecID compilerSpecID) Creates a new language and compiler pair.LanguageCompilerSpecPair
(String languageID, String compilerSpecID) Creates a new language and compiler pair. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Gets theCompilerSpec
for this object'sCompilerSpecID
.getCompilerSpec
(LanguageService languageService) Gets theCompilerSpec
for this object'sCompilerSpecID
, using the given language service to do the lookup.Gets theCompilerSpecDescription
for this object'sCompilerSpecID
.getCompilerSpecDescription
(LanguageService languageService) Gets theCompilerSpecDescription
for this object'sCompilerSpecID
.Get the compiler spec IDGets theLanguage
for this object'sLanguageID
.getLanguage
(LanguageService languageService) Gets theLanguage
for this object'sLanguageID
, using the given language service to do the lookup.Gets theLanguageDescription
for this object'sLanguageID
.getLanguageDescription
(LanguageService languageService) Gets theLanguageDescription
for this object'sLanguageID
.Get the language IDint
hashCode()
toString()
-
Field Details
-
languageID
-
compilerSpecID
-
-
Constructor Details
-
LanguageCompilerSpecPair
Creates a new language and compiler pair.- Parameters:
languageID
- The language ID string (x86:LE:32:default, 8051:BE:16:default, etc).compilerSpecID
- The compiler spec ID string (gcc, borlandcpp, etc).- Throws:
IllegalArgumentException
- if the language or compiler ID strings are null or empty.
-
LanguageCompilerSpecPair
Creates a new language and compiler pair.- Parameters:
languageID
- The language ID.compilerSpecID
- The compiler spec ID.- Throws:
IllegalArgumentException
- if the language or compiler ID is null.
-
-
Method Details
-
getLanguageID
Get the language ID- Returns:
- language ID
-
getCompilerSpecID
Get the compiler spec ID- Returns:
- compiler spec ID
-
getLanguage
Gets theLanguage
for this object'sLanguageID
.- Returns:
- The
Language
for this object'sLanguageID
. - Throws:
LanguageNotFoundException
- if noLanguage
could be found for this object'sLanguageID
.
-
getCompilerSpec
public CompilerSpec getCompilerSpec() throws CompilerSpecNotFoundException, LanguageNotFoundExceptionGets theCompilerSpec
for this object'sCompilerSpecID
.- Returns:
- The
CompilerSpec
for this object'sCompilerSpecID
. - Throws:
LanguageNotFoundException
- if noLanguage
could be found for this object'sLanguageID
.CompilerSpecNotFoundException
- if noCompilerSpec
could be found for this object'sCompilerSpecID
.
-
getLanguage
Gets theLanguage
for this object'sLanguageID
, using the given language service to do the lookup.- Parameters:
languageService
- The language service to use for language lookup.- Returns:
- The
Language
for this object'sLanguageID
, using the given language service to do the lookup. - Throws:
LanguageNotFoundException
- if noLanguage
could be found for this object'sLanguageID
using the given language service.
-
getCompilerSpec
public CompilerSpec getCompilerSpec(LanguageService languageService) throws CompilerSpecNotFoundException, LanguageNotFoundException Gets theCompilerSpec
for this object'sCompilerSpecID
, using the given language service to do the lookup.- Parameters:
languageService
- The language service to use for compiler lookup.- Returns:
- The
CompilerSpec
for this object'sCompilerSpecID
, using the given language service to do the lookup. - Throws:
LanguageNotFoundException
- if noLanguage
could be found for this object'sLanguageID
using the given language service.CompilerSpecNotFoundException
- if noCompilerSpec
could be found for this object'sCompilerSpecID
using the given language service.
-
getLanguageDescription
Gets theLanguageDescription
for this object'sLanguageID
.- Returns:
- The
LanguageDescription
for this object'sLanguageID
. - Throws:
LanguageNotFoundException
- if noLanguageDescription
could be found for this object'sLanguageID
.
-
getCompilerSpecDescription
public CompilerSpecDescription getCompilerSpecDescription() throws LanguageNotFoundException, CompilerSpecNotFoundExceptionGets theCompilerSpecDescription
for this object'sCompilerSpecID
.- Returns:
- The
CompilerSpecDescription
for this object'sCompilerSpecID
. - Throws:
LanguageNotFoundException
- if noLanguageDescription
could be found for this object'sLanguageID
.CompilerSpecNotFoundException
- if noCompilerSpecDescription
could be found for this object'sCompilerSpecID
.
-
getLanguageDescription
public LanguageDescription getLanguageDescription(LanguageService languageService) throws LanguageNotFoundException Gets theLanguageDescription
for this object'sLanguageID
.- Parameters:
languageService
- The language service to use for description lookup.- Returns:
- The
LanguageDescription
for this object'sLanguageID
. - Throws:
LanguageNotFoundException
- if noLanguageDescription
could be found for this object'sLanguageID
using the given language service.
-
getCompilerSpecDescription
public CompilerSpecDescription getCompilerSpecDescription(LanguageService languageService) throws LanguageNotFoundException, CompilerSpecNotFoundException Gets theCompilerSpecDescription
for this object'sCompilerSpecID
.- Parameters:
languageService
- The language service to use for description lookup.- Returns:
- The
CompilerSpecDescription
for this object'sCompilerSpecID
. - Throws:
LanguageNotFoundException
- if noLanguageDescription
could be found for this object'sLanguageID
.CompilerSpecNotFoundException
- if noCompilerSpecDescription
could be found for this object'sCompilerSpecID
using the given language service.
-
hashCode
public int hashCode() -
equals
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<LanguageCompilerSpecPair>
-