Class TokenIndexer


  • class TokenIndexer
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) Token[] array
      The token of array, modified by the preprocessor as we go.
      (package private) int counter
      Counter for the special predefined __COUNTER__ macro.
      (package private) int index
      The current index, in the array of tokens.
      (package private) InfoMap infoMap
      The set of Info objects to use during preprocessing.
      (package private) boolean isCFile
      Whether the file came from the C-include path
      (package private) boolean raw
      Set to true to disable temporarily the preprocessor.
    • Constructor Summary

      Constructors 
      Constructor Description
      TokenIndexer​(InfoMap infoMap, Token[] array, boolean isCFile)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) Token[] expand​(Token[] array, int index, java.util.HashSet<java.lang.String> alreadyExpanded)  
      (package private) Token[] filter​(Token[] array, int index)  
      (package private) Token get()
      Returns get(0).
      (package private) Token get​(int i)
      Returns array[index + i].
      (package private) Token next()
      Increments index and returns array[index].
      (package private) int preprocess​(int index, int count)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • raw

        boolean raw
        Set to true to disable temporarily the preprocessor.
      • infoMap

        InfoMap infoMap
        The set of Info objects to use during preprocessing.
      • array

        Token[] array
        The token of array, modified by the preprocessor as we go.
      • index

        int index
        The current index, in the array of tokens. Used by get(int) and next().
      • isCFile

        final boolean isCFile
        Whether the file came from the C-include path
      • counter

        int counter
        Counter for the special predefined __COUNTER__ macro.
    • Constructor Detail

      • TokenIndexer

        TokenIndexer​(InfoMap infoMap,
                     Token[] array,
                     boolean isCFile)
    • Method Detail

      • filter

        Token[] filter​(Token[] array,
                       int index)
      • expand

        Token[] expand​(Token[] array,
                       int index,
                       java.util.HashSet<java.lang.String> alreadyExpanded)
      • preprocess

        int preprocess​(int index,
                       int count)
      • get

        Token get()
        Returns get(0).
      • get

        Token get​(int i)
        Returns array[index + i]. After preprocessing if raw == false.
      • next

        Token next()
        Increments index and returns array[index]. After preprocessing if raw == false.