Пример #1
0
  /**
   * Squashes a list of tokens into one.
   *
   * @param tokenType is the type of the new token.
   * @param tokens is the list of tokens to be concatenated.
   * @return the new token.
   */
  public static Token concat(final TokenType tokenType, final List<Token> tokens) {
    final Token first = tokens.get(0);

    for (int i = 1; i < tokens.size(); i++) {
      first.addAfter(tokenType, tokens.get(i));
    }

    return first;
  }