code: public String readToken(String remaining) {
          int start = 0;
          char c = remaining.charAt(0);
  
          int end;
          if (c == '<') {
              end = indexOfClose(remaining, start, '<', '>');
          }
          else if (c == '[' ){
              end = indexOfClose(remaining, start, '[', ']');
          }
          else {
              throw new IllegalStateException();
          }
  
          // make sure we found the end
          if (end == -1) {
              throw new TokenizationRegexException(
                      "bad token. Non-matching brackets (<> or []): " + start
                      + ":\"" + remaining.substring(start) + "\"");
          }
  
          String token = remaining.substring(start, end + 1);
          return token;
      }
docs: *
  Read a token from the remaining text and return it.
  
  This is a default implementation that is overridable.
  In the default implementation, the starting and ending
  token characters are not escapable.
  
  If this implemenation is overridden, A token MUST ALWAYS
  start with '<' or '[' and end with '>' or ']'.
  
  @param remaining
  @return