Class TokenIterator

java.lang.Object
ghidra.app.decompiler.TokenIterator
All Implemented Interfaces:
Iterator<ClangToken>

public class TokenIterator extends Object implements 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 Details

    • TokenIterator

      public TokenIterator(ClangToken token, boolean forward)
      Initialize an iterator to a point to a specific ClangToken, which may be anywhere in the sequence.
      Parameters:
      token - is the specific ClangToken
      forward - is true for a forward iterator, false for a backward iterator
    • TokenIterator

      public TokenIterator(ClangTokenGroup group, boolean forward)
      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 ClangTokenGroup
      forward - is true for a forward iterator, false for a backward iterator
  • Method Details