Package ghidra.app.util.cparser.CPP
Class DefineTable
java.lang.Object
ghidra.app.util.cparser.CPP.DefineTable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String def) See if the define table contains a definitiondo the final expansion of "##" concats in the define strings that protect normal macro substitution.do the final expansion of "##" concats in the define strings that protect normal macro substitution.expandDefine
(String defName) ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Vector
<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> static Long
Parse a C format integer valuegetDefineAt
(StringBuffer buf, int pos) getDefinitionPath
(String defName) getParams
(StringBuffer buf, int start, char endChar) boolean
Check if a define has args.boolean
Check if the token that defined this define was numericvoid
populateDefineEquate
(DataTypeManager[] openDTMgrs, DataTypeManager dtMgr, String category, String prefix, String defName, long value) void
populateDefineEquates
(DataTypeManager[] openDTMgrs, DataTypeManager dtMgr) Given a data type manager, populate defines with constant values as Enumsvoid
Associate a define "name" with a Preprocessor parser token match.void
Add an args definition for a define with arguments #define bubba(a,b) (a or b)ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Remove a definition from the known defines.Vector
<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> Get rid of args for a defineint
size()
Size of the define table.display a string for the named define.
-
Constructor Details
-
DefineTable
public DefineTable()
-
-
Method Details
-
get
- Parameters:
string
-- Returns:
-
getArgs
- Parameters:
currKey
-- Returns:
-
getDefineAt
- Parameters:
buf
- the buffer containing the definepos
- the position of the define- Returns:
- the define
-
put
Associate a define "name" with a Preprocessor parser token match.- Parameters:
string
- - name of defineval
- - token value from parsing
-
putArg
Add an args definition for a define with arguments #define bubba(a,b) (a or b)- Parameters:
string
- name of defineval
- set of arg token names
-
containsKey
See if the define table contains a definition- Parameters:
def
-- Returns:
-
size
public int size()Size of the define table.- Returns:
-
remove
Remove a definition from the known defines.- Parameters:
string
- name of define- Returns:
- return the defined token for the named define.
-
isArg
Check if a define has args.- Parameters:
string
- name of define- Returns:
-
removeArg
Get rid of args for a define- Parameters:
string
- name of define- Returns:
-
toString
display a string for the named define.- Parameters:
string
- named define- Returns:
-
getDefineNames
- Returns:
- an iterator over the defined string names
-
getValue
-
isNumeric
Check if the token that defined this define was numeric- Parameters:
defName
-- Returns:
-
getDefinitionPath
-
getParams
- Parameters:
buf
- the buffer containing the parametersstart
- the starting index of the parameters in the bufferendChar
- the delimiter for the parameters- Returns:
- the parameters
-
expand
do the final expansion of "##" concats in the define strings that protect normal macro substitution.- Parameters:
image
-join
-- Returns:
-
expand
do the final expansion of "##" concats in the define strings that protect normal macro substitution.- Parameters:
image
-join
-list
- of defines not to re-replace, stops recursive replacement on a define- Returns:
-
populateDefineEquates
Given a data type manager, populate defines with constant values as Enums -
populateDefineEquate
public void populateDefineEquate(DataTypeManager[] openDTMgrs, DataTypeManager dtMgr, String category, String prefix, String defName, long value) -
expandDefine
-
getCValue
Parse a C format integer value- Parameters:
strValue
- value to parse- Returns:
- long value if parsable as an integer, null otherwise
-