Package ghidra.app.decompiler
Class ClangToken
- java.lang.Object
-
- ghidra.app.decompiler.ClangToken
-
- All Implemented Interfaces:
ClangNode
- Direct Known Subclasses:
ClangBreak
,ClangCommentToken
,ClangFieldToken
,ClangFuncNameToken
,ClangLabelToken
,ClangOpToken
,ClangSyntaxToken
,ClangTypeToken
,ClangVariableToken
public class ClangToken extends java.lang.Object implements ClangNode
Class representing a C code language token May contain links back to pcode object
-
-
Field Summary
Fields Modifier and Type Field Description static int
COMMENT_COLOR
static int
CONST_COLOR
static int
DEFAULT_COLOR
static int
FUNCTION_COLOR
static int
GLOBAL_COLOR
static int
KEYWORD_COLOR
static int
PARAMETER_COLOR
static int
TYPE_COLOR
static int
VARIABLE_COLOR
-
Constructor Summary
Constructors Constructor Description ClangToken(ClangNode par)
ClangToken(ClangNode par, java.lang.String txt)
ClangToken(ClangNode par, java.lang.String txt, java.lang.String col)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClangToken
buildSpacer(ClangNode par, int indent, java.lang.String indentStr)
static ClangToken
buildToken(ClangNode par, XmlPullParser parser, PcodeFactory pfactory)
ClangNode
Child(int i)
void
flatten(java.util.List<ClangNode> list)
ClangFunction
getClangFunction()
static int
getColor(java.lang.String col)
java.awt.Color
getHighlight()
HighVariable
getHighVariable()
Get the high-level variable associate with this token or null otherwiseClangLine
getLineParent()
Address
getMaxAddress()
Address
getMinAddress()
PcodeOp
getPcodeOp()
Many tokens directly represent a pcode operator in the data-flowint
getSyntaxType()
java.lang.String
getText()
Varnode
getVarnode()
Many tokens directly represent a variable in the data-flowboolean
isMatchingToken()
boolean
isVariableRef()
int
numChildren()
ClangNode
Parent()
void
restoreFromXML(XmlElement el, XmlElement end, PcodeFactory pfactory)
void
setHighlight(java.awt.Color val)
void
setLineParent(ClangLine line)
void
setMatchingToken(boolean matchingToken)
java.lang.String
toString()
-
-
-
Field Detail
-
KEYWORD_COLOR
public static final int KEYWORD_COLOR
- See Also:
- Constant Field Values
-
TYPE_COLOR
public static final int TYPE_COLOR
- See Also:
- Constant Field Values
-
FUNCTION_COLOR
public static final int FUNCTION_COLOR
- See Also:
- Constant Field Values
-
COMMENT_COLOR
public static final int COMMENT_COLOR
- See Also:
- Constant Field Values
-
VARIABLE_COLOR
public static final int VARIABLE_COLOR
- See Also:
- Constant Field Values
-
CONST_COLOR
public static final int CONST_COLOR
- See Also:
- Constant Field Values
-
PARAMETER_COLOR
public static final int PARAMETER_COLOR
- See Also:
- Constant Field Values
-
GLOBAL_COLOR
public static final int GLOBAL_COLOR
- See Also:
- Constant Field Values
-
DEFAULT_COLOR
public static final int DEFAULT_COLOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLineParent
public ClangLine getLineParent()
-
setLineParent
public void setLineParent(ClangLine line)
-
getMinAddress
public Address getMinAddress()
- Specified by:
getMinAddress
in interfaceClangNode
-
getMaxAddress
public Address getMaxAddress()
- Specified by:
getMaxAddress
in interfaceClangNode
-
numChildren
public int numChildren()
- Specified by:
numChildren
in interfaceClangNode
-
getClangFunction
public ClangFunction getClangFunction()
- Specified by:
getClangFunction
in interfaceClangNode
-
setHighlight
public void setHighlight(java.awt.Color val)
- Specified by:
setHighlight
in interfaceClangNode
-
getHighlight
public java.awt.Color getHighlight()
-
setMatchingToken
public void setMatchingToken(boolean matchingToken)
-
isMatchingToken
public boolean isMatchingToken()
-
isVariableRef
public boolean isVariableRef()
-
getSyntaxType
public int getSyntaxType()
-
getText
public java.lang.String getText()
-
restoreFromXML
public void restoreFromXML(XmlElement el, XmlElement end, PcodeFactory pfactory)
-
flatten
public void flatten(java.util.List<ClangNode> list)
-
buildToken
public static ClangToken buildToken(ClangNode par, XmlPullParser parser, PcodeFactory pfactory)
-
getColor
public static int getColor(java.lang.String col)
-
buildSpacer
public static ClangToken buildSpacer(ClangNode par, int indent, java.lang.String indentStr)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getHighVariable
public HighVariable getHighVariable()
Get the high-level variable associate with this token or null otherwise- Returns:
- HighVariable
-
getVarnode
public Varnode getVarnode()
Many tokens directly represent a variable in the data-flow- Returns:
- the variable (Varnode) associated with this token or null
-
getPcodeOp
public PcodeOp getPcodeOp()
Many tokens directly represent a pcode operator in the data-flow- Returns:
- the operation (PcodeOp) associated with this token or null
-
-