Class SourceLanguageService
java.lang.Object
ghidra.app.util.sourcelanguage.SourceLanguageService
A service for applying source language-related
ExtensionPoints to a Program-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSpecExtensions(Program program, Set<SourceLanguageID> sourceLanguageIDs, MessageLog log, TaskMonitor monitor) Adds anySourceLanguageSpecExtensions that are compatible with the given set ofSourceLanguageIDs to theProgramstatic Set<SourceLanguageID> find(Program program, MessageLog log, TaskMonitor monitor) static List<ResourceFile> getDataArchives(Program program, Set<SourceLanguageID> sourceLanguageIDs, MessageLog log, TaskMonitor monitor) Adds anySourceLanguageDataArchives that are compatible with the given set ofSourceLanguageIDs to theProgram
-
Constructor Details
-
SourceLanguageService
public SourceLanguageService()
-
-
Method Details
-
find
public static Set<SourceLanguageID> find(Program program, MessageLog log, TaskMonitor monitor) throws CancelledException Finds anySourceLanguages thatexist inthe given program, and returns theirSourceLanguageIDs.NOTE: This method does a fresh scan using
SourceLanguage.existsIn(Program, TaskMonitor)and does not checkProgram.getSourceLanguageIDs(), so it may be slow.- Parameters:
program- TheProgramlog- The error logmonitor- TheTaskMonitor- Returns:
- The
SourceLanguageIDs of the foundSourceLanguages - Throws:
CancelledException- if the user cancelled the operation
-
addSpecExtensions
public static void addSpecExtensions(Program program, Set<SourceLanguageID> sourceLanguageIDs, MessageLog log, TaskMonitor monitor) Adds anySourceLanguageSpecExtensions that are compatible with the given set ofSourceLanguageIDs to theProgram- Parameters:
program- TheProgramsourceLanguageIDs- TheSourceLanguageIDslog- The error logmonitor- TheTaskMonitor
-
getDataArchives
public static List<ResourceFile> getDataArchives(Program program, Set<SourceLanguageID> sourceLanguageIDs, MessageLog log, TaskMonitor monitor) Adds anySourceLanguageDataArchives that are compatible with the given set ofSourceLanguageIDs to theProgram- Parameters:
program- TheProgramsourceLanguageIDs- TheSourceLanguagelog- The error logmonitor- TheTaskMonitor- Returns:
- The number of data archives that were added to the
Program
-