Class TokenIndexer


  • class TokenIndexer
    extends Object
    Author:
    Samuel Audet
    • 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)  
    • 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)
      • 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.