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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddTokenGroup(ClangNode obj) Add additional text to this groupChild(int i) Get the i-th child groupingvoiddecode(Decoder decoder, PcodeFactory pfactory) Decode this text from an encoded stream.voidFlatten 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()intReturn the number of immediate groupings this text breaks up intoParent()Get the immediate grouping (parent) containing this text element.voidsetHighlight(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, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ClangTokenGroup
-
-
Method Details
-
getMinAddress
Description copied from interface:ClangNodeGet the smallest Program address associated with the code that this text represents- Specified by:
getMinAddressin interfaceClangNode- Returns:
- the smallest Address
-
getMaxAddress
Description copied from interface:ClangNodeGet the biggest Program address associated with the code that this text represents- Specified by:
getMaxAddressin interfaceClangNode- Returns:
- the biggest Address
-
AddTokenGroup
Add additional text to this group- Parameters:
obj- is the additional text
-
Parent
Description copied from interface:ClangNodeGet 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:ClangNodeReturn the number of immediate groupings this text breaks up into- Specified by:
numChildrenin interfaceClangNode- Returns:
- the number of child groupings
-
Child
Description copied from interface:ClangNodeGet the i-th child grouping -
getClangFunction
Description copied from interface:ClangNodeGet the text representing an entire function of which this is part.- Specified by:
getClangFunctionin interfaceClangNode- Returns:
- text for the whole function
-
setHighlight
Description copied from interface:ClangNodeSet a highlighting background color for all text elements- Specified by:
setHighlightin interfaceClangNode- Parameters:
val- is the color to set
-
flatten
Description copied from interface:ClangNodeFlatten 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
-