Package ghidra.program.model.lang
Class LanguageCompilerSpecPair
- java.lang.Object
-
- ghidra.program.model.lang.LanguageCompilerSpecPair
-
- All Implemented Interfaces:
java.lang.Comparable<LanguageCompilerSpecPair>
public final class LanguageCompilerSpecPair extends java.lang.Object implements java.lang.Comparable<LanguageCompilerSpecPair>
Represents an opinion's processor language and compiler.- See Also:
LanguageID
,CompilerSpecID
-
-
Field Summary
Fields Modifier and Type Field Description CompilerSpecID
compilerSpecID
LanguageID
languageID
-
Constructor Summary
Constructors Constructor Description LanguageCompilerSpecPair(LanguageID languageID, CompilerSpecID compilerSpecID)
Creates a new language and compiler pair.LanguageCompilerSpecPair(java.lang.String languageID, java.lang.String compilerSpecID)
Creates a new language and compiler pair.
-
Method Summary
-
-
-
Field Detail
-
languageID
public final LanguageID languageID
-
compilerSpecID
public final CompilerSpecID compilerSpecID
-
-
Constructor Detail
-
LanguageCompilerSpecPair
public LanguageCompilerSpecPair(java.lang.String languageID, java.lang.String compilerSpecID)
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:
java.lang.IllegalArgumentException
- if the language or compiler ID strings are null or empty.
-
LanguageCompilerSpecPair
public LanguageCompilerSpecPair(LanguageID languageID, CompilerSpecID compilerSpecID)
Creates a new language and compiler pair.- Parameters:
languageID
- The language ID.compilerSpecID
- The compiler spec ID.- Throws:
java.lang.IllegalArgumentException
- if the language or compiler ID is null.
-
-
Method Detail
-
getLanguage
public Language getLanguage() throws LanguageNotFoundException
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, LanguageNotFoundException
Gets 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
public Language getLanguage(LanguageService languageService) throws LanguageNotFoundException
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
public LanguageDescription getLanguageDescription() throws LanguageNotFoundException
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, CompilerSpecNotFoundException
Gets 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()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(LanguageCompilerSpecPair o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<LanguageCompilerSpecPair>
-
-