Package ghidra.app.util.cparser.C
Class CParserUtils
- java.lang.Object
-
- ghidra.app.util.cparser.C.CParserUtils
-
public class CParserUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
handleParseProblem(java.lang.Throwable t, java.lang.String functionString)
Given a throwable, attempt pull out the significant error parts to generate a user-friendly error message.static FunctionDefinitionDataType
parseSignature(DataTypeManagerService service, Program program, java.lang.String signatureText)
Parse the given function signature text.static FunctionDefinitionDataType
parseSignature(DataTypeManagerService service, Program program, java.lang.String signatureText, boolean handleExceptions)
Parse the given function signature text.static FunctionDefinitionDataType
parseSignature(ServiceProvider serviceProvider, Program program, java.lang.String signatureText)
Parse the given function signature text.
-
-
-
Method Detail
-
parseSignature
public static FunctionDefinitionDataType parseSignature(ServiceProvider serviceProvider, Program program, java.lang.String signatureText)
Parse the given function signature text. Any exceptions will be handled herein by showing an error dialog (null is returned in that case).- Parameters:
serviceProvider
- the service provider used to access DataTypeManagersprogram
- the program against which data types will be resolvedsignatureText
- the signature to parse- Returns:
- the data type that is created as a result of parsing; null if there was a problem
- See Also:
parseSignature(DataTypeManagerService, Program, String)
,parseSignature(DataTypeManagerService, Program, String, boolean)
-
parseSignature
public static FunctionDefinitionDataType parseSignature(DataTypeManagerService service, Program program, java.lang.String signatureText)
Parse the given function signature text. Any exceptions will be handled herein by showing an error dialog (null is returned in that case).- Parameters:
service
- the service used to access DataTypeManagers or null to use only the program's data type manager.program
- the program against which data types will be resolvedsignatureText
- the signature to parse- Returns:
- the data type that is created as a result of parsing; null if there was a problem
- See Also:
parseSignature(DataTypeManagerService, Program, String, boolean)
-
parseSignature
public static FunctionDefinitionDataType parseSignature(DataTypeManagerService service, Program program, java.lang.String signatureText, boolean handleExceptions) throws ParseException
Parse the given function signature text. Any exceptions will be handled herein by showing an error dialog (null is returned in that case).- Parameters:
service
- the service used to access DataTypeManagers or null to use only the program's data type manager.program
- the program against which data types will be resolvedsignatureText
- the signature to parsehandleExceptions
- true signals that this method should deal with exceptions, showing error messages as necessary; false signals to throw any encountered parsing exceptions. This allows clients to perform exception handling that better matches their workflow.- Returns:
- the data type that is created as a result of parsing; null if there was a problem
- Throws:
ParseException
-
handleParseProblem
public static java.lang.String handleParseProblem(java.lang.Throwable t, java.lang.String functionString)
Given a throwable, attempt pull out the significant error parts to generate a user-friendly error message.- Parameters:
t
- the throwable to examine, originating from theCParser
.functionString
- the full function signature text that was parsed by the parser.- Returns:
- a user-friendly error message, or null if this class did not know how to handle the given exception.
-
-