code: public ParserTokenType lookAheadType(int distance) {
        ParserToken token = lookAhead(distance);
        return token == null ? null : token.type;
     }
docs: Looks ahead to determine the type of the token a given distance from the front of the stream.
  
  @param distance The number of tokens from the front of the stream
  @return The token type