Package ghidra.app.decompiler
Class TokenIterator
java.lang.Object
ghidra.app.decompiler.TokenIterator
- All Implemented Interfaces:
Iterator<ClangToken>
An iterator over ClangToken objects. The iterator walks a tree of ClangNode objects based on
the Parent() and Child() methods, returning successive ClangNode leaf objects that are also
ClangToken objects. The iterator can run either forward or backward over the tokens.
The constructor TokenIterator(ClangToken,int) initializes the iterator to start at the given
token, which can be in the middle of the sequence.
-
Constructor Summary
ConstructorDescriptionTokenIterator
(ClangTokenGroup group, boolean forward) Create iterator across all tokens under the given ClangTokenGroup.TokenIterator
(ClangToken token, boolean forward) Initialize an iterator to a point to a specific ClangToken, which may be anywhere in the sequence. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
TokenIterator
Initialize an iterator to a point to a specific ClangToken, which may be anywhere in the sequence.- Parameters:
token
- is the specific ClangTokenforward
- is true for a forward iterator, false for a backward iterator
-
TokenIterator
Create iterator across all tokens under the given ClangTokenGroup. The iterator will walk the entire tree of token groups under the given group. The iterator will run over tokens in display order (forward=true) or in reverse of display order (forward=false)- Parameters:
group
- is the given ClangTokenGroupforward
- is true for a forward iterator, false for a backward iterator
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<ClangToken>
-
next
- Specified by:
next
in interfaceIterator<ClangToken>
-