Package ghidra.app.decompiler
Class ClangTokenGroup
java.lang.Object
ghidra.app.decompiler.ClangTokenGroup
- Direct Known Subclasses:
ClangFuncProto
,ClangFunction
,ClangReturnType
,ClangStatement
,ClangVariableDecl
A sequence of tokens that form a meaningful group in source code. This group may
break up into subgroups and may be part of a larger group.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
AddTokenGroup
(ClangNode obj) Add additional text to this groupChild
(int i) Get the i-th child groupingvoid
decode
(Decoder decoder, PcodeFactory pfactory) Decode this text from an encoded stream.void
Flatten this text into a list of tokens (see ClangToken)Get the text representing an entire function of which this is part.Get the biggest Program address associated with the code that this text representsGet the smallest Program address associated with the code that this text representsiterator()
int
Return the number of immediate groupings this text breaks up intoParent()
Get the immediate grouping (parent) containing this text element.void
setHighlight
(Color val) Set a highlighting background color for all text elementsstream()
Gets a stream over this group's childrentokenIterator
(boolean forward) Create iterator across all ClangToken objects in this group.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ClangTokenGroup
-
-
Method Details
-
getMinAddress
Description copied from interface:ClangNode
Get the smallest Program address associated with the code that this text represents- Specified by:
getMinAddress
in interfaceClangNode
- Returns:
- the smallest Address
-
getMaxAddress
Description copied from interface:ClangNode
Get the biggest Program address associated with the code that this text represents- Specified by:
getMaxAddress
in interfaceClangNode
- Returns:
- the biggest Address
-
AddTokenGroup
Add additional text to this group- Parameters:
obj
- is the additional text
-
Parent
Description copied from interface:ClangNode
Get the immediate grouping (parent) containing this text element. If this is a complete document, null is returned. -
numChildren
public int numChildren()Description copied from interface:ClangNode
Return the number of immediate groupings this text breaks up into- Specified by:
numChildren
in interfaceClangNode
- Returns:
- the number of child groupings
-
Child
Description copied from interface:ClangNode
Get the i-th child grouping -
getClangFunction
Description copied from interface:ClangNode
Get the text representing an entire function of which this is part.- Specified by:
getClangFunction
in interfaceClangNode
- Returns:
- text for the whole function
-
setHighlight
Description copied from interface:ClangNode
Set a highlighting background color for all text elements- Specified by:
setHighlight
in interfaceClangNode
- Parameters:
val
- is the color to set
-
flatten
Description copied from interface:ClangNode
Flatten this text into a list of tokens (see ClangToken) -
decode
Decode this text from an encoded stream.- Parameters:
decoder
- is the decoder for the streampfactory
- is used to look up p-code attributes to associate with tokens- Throws:
DecoderException
- for problems decoding the stream
-
toString
-
iterator
-
tokenIterator
Create iterator across all ClangToken objects in this group. The iterator will run over tokens in display order (forward=true) or in reverse of display order (forward=false)- Parameters:
forward
- is true for a forward iterator, false for a backward iterator- Returns:
- the iterator
-
stream
Gets a stream over this group's children- Returns:
- a stream of this group's children
-