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 intCOMMENT_COLORstatic intCONST_COLORstatic intDEFAULT_COLORstatic intFUNCTION_COLORstatic intGLOBAL_COLORstatic intKEYWORD_COLORstatic intPARAMETER_COLORstatic intTYPE_COLORstatic intVARIABLE_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 ClangTokenbuildSpacer(ClangNode par, int indent, java.lang.String indentStr)static ClangTokenbuildToken(ClangNode par, XmlPullParser parser, PcodeFactory pfactory)ClangNodeChild(int i)voidflatten(java.util.List<ClangNode> list)ClangFunctiongetClangFunction()static intgetColor(java.lang.String col)java.awt.ColorgetHighlight()HighVariablegetHighVariable()Get the high-level variable associate with this token or null otherwiseClangLinegetLineParent()AddressgetMaxAddress()AddressgetMinAddress()PcodeOpgetPcodeOp()Many tokens directly represent a pcode operator in the data-flowintgetSyntaxType()java.lang.StringgetText()VarnodegetVarnode()Many tokens directly represent a variable in the data-flowbooleanisMatchingToken()booleanisVariableRef()intnumChildren()ClangNodeParent()voidrestoreFromXML(XmlElement el, XmlElement end, PcodeFactory pfactory)voidsetHighlight(java.awt.Color val)voidsetLineParent(ClangLine line)voidsetMatchingToken(boolean matchingToken)java.lang.StringtoString()
-
-
-
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:
getMinAddressin interfaceClangNode
-
getMaxAddress
public Address getMaxAddress()
- Specified by:
getMaxAddressin interfaceClangNode
-
numChildren
public int numChildren()
- Specified by:
numChildrenin interfaceClangNode
-
getClangFunction
public ClangFunction getClangFunction()
- Specified by:
getClangFunctionin interfaceClangNode
-
setHighlight
public void setHighlight(java.awt.Color val)
- Specified by:
setHighlightin 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:
toStringin 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
-
-