docs: void scanToken() {
  
          int character = charAt(currentPosition);
  
          resetState();
  
          token.tokenType = Tokens.X_IDENTIFIER;
  
          switch (character) {
  
  /*
              case '%' :
              case '^' :
              case '&' :
              case ':' :
              case '{' :
              case '}' :
                  break;
  */
              case '(' :
                  token.tokenString = Tokens.T_OPENBRACKET;
                  token.tokenType   = Tokens.OPENBRACKET;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case ')' :
                  token.tokenString = Tokens.T_CLOSEBRACKET;
                  token.tokenType   = Tokens.CLOSEBRACKET;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case ',' :
                  token.tokenString = Tokens.T_COMMA;
                  token.tokenType   = Tokens.COMMA;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '*' :
                  token.tokenString = Tokens.T_ASTERISK;
                  token.tokenType   = Tokens.ASTERISK;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '=' :
                  token.tokenString = Tokens.T_EQUALS;
                  token.tokenType   = Tokens.EQUALS;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case ';' :
                  token.tokenString = Tokens.T_SEMICOLON;
                  token.tokenType   = Tokens.SEMICOLON;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '+' :
                  token.tokenString = Tokens.T_PLUS;
                  token.tokenType   = Tokens.PLUS;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case ':' :
                  if (charAt(currentPosition + 1) == ':') {
                      currentPosition   += 2;
                      token.tokenString = Tokens.T_DOUBLE_COLON;
                      token.tokenType   = Tokens.COLON;
                      token.isDelimiter = true;
  
                      return;
                  } else {
                      token.tokenString = Tokens.T_COLON;
                      token.tokenType   = Tokens.COLON;
  
                      currentPosition++;
  
                      token.isDelimiter = true;
  
                      return;
                  }
              case '?' :
                  if (charAt(currentPosition + 1) == '?') {
                      if (charAt(currentPosition + 2) == '(') {
                          token.tokenString = Tokens.T_OPENBRACKET;
                          token.tokenType   = Tokens.OPENBRACKET;
                          currentPosition   += 3;
                          token.isDelimiter = true;
  
                          return;
                      } else if (charAt(currentPosition + 2) == ')') {
                          token.tokenString = Tokens.T_CLOSEBRACKET;
                          token.tokenType   = Tokens.CLOSEBRACKET;
                          currentPosition   += 3;
                          token.isDelimiter = true;
  
                          return;
                      }
                  }
  
                  token.tokenString = Tokens.T_QUESTION;
                  token.tokenType   = Tokens.QUESTION;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '!' :
                  if (charAt(currentPosition + 1) == '=') {
                      token.tokenString = Tokens.T_NOT_EQUALS;
                      token.tokenType   = Tokens.NOT_EQUALS;
                      currentPosition   += 2;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  token.tokenString = sqlString.substring(currentPosition,
                          currentPosition + 2);
                  token.tokenType   = Tokens.X_UNKNOWN_TOKEN;
                  token.isDelimiter = true;
  
                  return;
  
              case '<' :
                  if (charAt(currentPosition + 1) == '>') {
                      token.tokenString = Tokens.T_NOT_EQUALS;
                      token.tokenType   = Tokens.NOT_EQUALS;
                      currentPosition   += 2;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  if (charAt(currentPosition + 1) == '=') {
                      token.tokenString = Tokens.T_LESS_EQUALS;
                      token.tokenType   = Tokens.LESS_EQUALS;
                      currentPosition   += 2;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  token.tokenString = Tokens.T_LESS;
                  token.tokenType   = Tokens.LESS;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '>' :
                  if (charAt(currentPosition + 1) == '=') {
                      token.tokenString = Tokens.T_GREATER_EQUALS;
                      token.tokenType   = Tokens.GREATER_EQUALS;
                      currentPosition   += 2;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  token.tokenString = Tokens.T_GREATER;
                  token.tokenType   = Tokens.GREATER;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '|' :
                  if (charAt(currentPosition + 1) == '|') {
                      token.tokenString = Tokens.T_CONCAT;
                      token.tokenType   = Tokens.CONCAT;
                      currentPosition   += 2;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  token.tokenString = sqlString.substring(currentPosition,
                          currentPosition + 2);
                  token.tokenType   = Tokens.X_UNKNOWN_TOKEN;
                  token.isDelimiter = true;
  
                  return;
  
              case '/' :
                  if (charAt(currentPosition + 1) == '/') {
                      int pos = sqlString.indexOf('\r', currentPosition + 2);
  
                      if (pos == -1) {
                          pos = sqlString.indexOf('\n', currentPosition + 2);
                      }
  
                      if (pos == -1) {
                          pos = limit;
                      }
  
                      token.tokenString = sqlString.substring(currentPosition
                              + 2, pos);
                      token.tokenType   = Tokens.X_REMARK;
                      token.isDelimiter = true;
  
                      return;
                  } else if (charAt(currentPosition + 1) == '*') {
                      int pos = sqlString.indexOf("*/", currentPosition + 2);
  
                      if (pos == -1) {
                          token.tokenString =
                              sqlString.substring(currentPosition,
                                                  currentPosition + 2);
                          token.tokenType   = Tokens.X_UNKNOWN_TOKEN;
                          token.isDelimiter = true;
  
                          return;
                      }
  
                      token.tokenString = sqlString.substring(currentPosition
                              + 2, pos);
                      token.tokenType   = Tokens.X_REMARK;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  token.tokenString = Tokens.T_DIVIDE;
                  token.tokenType   = Tokens.DIVIDE;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '-' :
                  if (charAt(currentPosition + 1) == '-') {
                      int pos = sqlString.indexOf('\r', currentPosition + 2);
  
                      if (pos == -1) {
                          pos = sqlString.indexOf('\n', currentPosition + 2);
                      }
  
                      if (pos == -1) {
                          pos = limit;
                      }
  
                      token.tokenString = sqlString.substring(currentPosition
                              + 2, pos);
                      token.tokenType   = Tokens.X_REMARK;
                      token.isDelimiter = true;
  
                      return;
                  }
  
                  token.tokenString = Tokens.T_MINUS;
                  token.tokenType   = Tokens.MINUS;
  
                  currentPosition++;
  
                  token.isDelimiter = true;
  
                  return;
  
              case '\"' :
                  token.tokenType = Tokens.X_DELIMITED_IDENTIFIER;
                  break;
  
              case '\'' :
                  scanCharacterString();
  
                  token.dataType = CharacterType.getCharacterType(Types.SQL_CHAR,
                          token.tokenString.length());
                  token.tokenType   = Tokens.X_VALUE;
                  token.isDelimiter = true;
  
                  return;
  
              case 'x' :
              case 'X' :
                  if (charAt(currentPosition + 1) == '\'') {
                      currentPosition++;
  
                      scanBinaryString();
  
                      if (token.isMalformed) {
                          return;
                      }
  
                      token.dataType = BinaryType.getBinaryType(
                          Types.SQL_VARBINARY,
                          ((BinaryData) token.tokenValue).length(null));
                      token.tokenType = Tokens.X_VALUE;
  
                      return;
                  }
                  break;
  
              // A VoltDB extension -- disable broken handling for binary literals
              /* disable 19 lines ...
              case 'b' :
              case 'B' :
                  if (charAt(currentPosition + 1) == '\'') {
                      currentPosition++;
  
                      scanBitString();
  
                      if (token.isMalformed) {
                          return;
                      }
  
                      token.dataType = BitType.getBitType(
                          Types.SQL_BIT,
                          ((BinaryData) token.tokenValue).bitLength(null));
                      token.tokenType = Tokens.X_VALUE;
  
                      return;
                  }
                  break;
              ... disabled 19 lines */
              // End of VoltDB extension
  
              case 'n' :
              case 'N' :
                  if (charAt(currentPosition + 1) == '\'') {
                      currentPosition++;
  
                      scanCharacterString();
  
                      if (token.isMalformed) {
                          return;
                      }
  
                      token.dataType = CharacterType.getCharacterType(
                          Types.SQL_CHAR, token.tokenString.length());
                      token.tokenType = Tokens.X_VALUE;
  
                      return;
                  }
                  break;
  
              case 'u' :
              case 'U' :
                  if (charAt(currentPosition + 1) == '&') {
                      if (charAt(currentPosition + 2) == '\'') {
                          currentPosition += 2;
                          token.dataType  = Type.SQL_CHAR;
                          token.tokenType = Tokens.X_VALUE;
  
                          scanUnicodeString();
  
                          if (token.isMalformed) {
                              return;
                          }
  
                          token.dataType = CharacterType.getCharacterType(
                              Types.SQL_CHAR,
                              ((String) token.tokenValue).length());
  
                          return;
                      }
                  }
                  break;
  
              case '_' :
  
                  /**
                   * @todo 1.9.0 - review following
                   * identifier chain must not have catalog identifier
                   * character set specification to be included in the token.dataType
                   */
                  currentPosition++;
  
                  scanIdentifierChain();
  
                  if (token.isMalformed) {
                      return;
                  }
  
                  if (token.tokenType != Tokens.X_IDENTIFIER
                          || token.namePrePrefix != null) {
  
                      /** @todo 1.9.0 - review message malformed character set identifier */
                      token.tokenType   = Tokens.X_MALFORMED_STRING;
                      token.isMalformed = true;
  
                      return;
                  }
  
                  token.charsetSchema = token.namePrefix;
                  token.charsetName   = token.tokenString;
  
                  scanSeparator();
  
                  if (charAt(currentPosition) == '\'') {
                      scanCharacterString();
  
                      token.tokenType = Tokens.X_VALUE;
                      token.dataType = CharacterType.getCharacterType(
                          Types.SQL_CHAR, token.tokenString.length());
                      token.isDelimiter = true;
  
                      return;
                  }
                  break;
  
              case '0' :
              case '1' :
              case '2' :
              case '3' :
              case '4' :
              case '5' :
              case '6' :
              case '7' :
              case '8' :
              case '9' :
              case '.' :
                  token.tokenType = Tokens.X_VALUE;
  
                  scanNumber();
  
                  return;
          }
  
          scanIdentifierChain();
  
          if (token.tokenType == Tokens.X_IDENTIFIER) {
              token.isUndelimitedIdentifier = true;
              token.tokenType = Tokens.getKeywordID(token.tokenString,
                                                    Tokens.X_IDENTIFIER);
  
              if (token.tokenType == Tokens.X_IDENTIFIER) {
                  token.tokenType = Tokens.getNonKeywordID(token.tokenString,
                          Tokens.X_IDENTIFIER);
              } else {
                  token.isReservedIdentifier = true;
                  token.isCoreReservedIdentifier =
                      Tokens.isCoreKeyword(token.tokenType);
              }
          } else if (token.tokenType == Tokens.X_DELIMITED_IDENTIFIER) {
              token.isDelimitedIdentifier = true;
          }
      }