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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLanguageCompilerSpecPair(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 TypeMethodDescriptionintbooleanGets theCompilerSpecfor this object'sCompilerSpecID.getCompilerSpec(LanguageService languageService) Gets theCompilerSpecfor this object'sCompilerSpecID, using the given language service to do the lookup.Gets theCompilerSpecDescriptionfor this object'sCompilerSpecID.getCompilerSpecDescription(LanguageService languageService) Gets theCompilerSpecDescriptionfor this object'sCompilerSpecID.Get the compiler spec IDGets theLanguagefor this object'sLanguageID.getLanguage(LanguageService languageService) Gets theLanguagefor this object'sLanguageID, using the given language service to do the lookup.Gets theLanguageDescriptionfor this object'sLanguageID.getLanguageDescription(LanguageService languageService) Gets theLanguageDescriptionfor this object'sLanguageID.Get the language IDinthashCode()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 theLanguagefor this object'sLanguageID.- Returns:
- The
Languagefor this object'sLanguageID. - Throws:
LanguageNotFoundException- if noLanguagecould be found for this object'sLanguageID.
-
getCompilerSpec
public CompilerSpec getCompilerSpec() throws CompilerSpecNotFoundException, LanguageNotFoundExceptionGets theCompilerSpecfor this object'sCompilerSpecID.- Returns:
- The
CompilerSpecfor this object'sCompilerSpecID. - Throws:
LanguageNotFoundException- if noLanguagecould be found for this object'sLanguageID.CompilerSpecNotFoundException- if noCompilerSpeccould be found for this object'sCompilerSpecID.
-
getLanguage
Gets theLanguagefor this object'sLanguageID, using the given language service to do the lookup.- Parameters:
languageService- The language service to use for language lookup.- Returns:
- The
Languagefor this object'sLanguageID, using the given language service to do the lookup. - Throws:
LanguageNotFoundException- if noLanguagecould be found for this object'sLanguageIDusing the given language service.
-
getCompilerSpec
public CompilerSpec getCompilerSpec(LanguageService languageService) throws CompilerSpecNotFoundException, LanguageNotFoundException Gets theCompilerSpecfor this object'sCompilerSpecID, using the given language service to do the lookup.- Parameters:
languageService- The language service to use for compiler lookup.- Returns:
- The
CompilerSpecfor this object'sCompilerSpecID, using the given language service to do the lookup. - Throws:
LanguageNotFoundException- if noLanguagecould be found for this object'sLanguageIDusing the given language service.CompilerSpecNotFoundException- if noCompilerSpeccould be found for this object'sCompilerSpecIDusing the given language service.
-
getLanguageDescription
Gets theLanguageDescriptionfor this object'sLanguageID.- Returns:
- The
LanguageDescriptionfor this object'sLanguageID. - Throws:
LanguageNotFoundException- if noLanguageDescriptioncould be found for this object'sLanguageID.
-
getCompilerSpecDescription
public CompilerSpecDescription getCompilerSpecDescription() throws LanguageNotFoundException, CompilerSpecNotFoundExceptionGets theCompilerSpecDescriptionfor this object'sCompilerSpecID.- Returns:
- The
CompilerSpecDescriptionfor this object'sCompilerSpecID. - Throws:
LanguageNotFoundException- if noLanguageDescriptioncould be found for this object'sLanguageID.CompilerSpecNotFoundException- if noCompilerSpecDescriptioncould be found for this object'sCompilerSpecID.
-
getLanguageDescription
public LanguageDescription getLanguageDescription(LanguageService languageService) throws LanguageNotFoundException Gets theLanguageDescriptionfor this object'sLanguageID.- Parameters:
languageService- The language service to use for description lookup.- Returns:
- The
LanguageDescriptionfor this object'sLanguageID. - Throws:
LanguageNotFoundException- if noLanguageDescriptioncould be found for this object'sLanguageIDusing the given language service.
-
getCompilerSpecDescription
public CompilerSpecDescription getCompilerSpecDescription(LanguageService languageService) throws LanguageNotFoundException, CompilerSpecNotFoundException Gets theCompilerSpecDescriptionfor this object'sCompilerSpecID.- Parameters:
languageService- The language service to use for description lookup.- Returns:
- The
CompilerSpecDescriptionfor this object'sCompilerSpecID. - Throws:
LanguageNotFoundException- if noLanguageDescriptioncould be found for this object'sLanguageID.CompilerSpecNotFoundException- if noCompilerSpecDescriptioncould be found for this object'sCompilerSpecIDusing the given language service.
-
hashCode
public int hashCode() -
equals
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<LanguageCompilerSpecPair>
-