static List<Token> tokenize(final String value) {
		final List<Token> tokens = new ArrayList<>();

		char pc = '\0';
		int pos = 0;
		final StringBuilder token = new StringBuilder();
		for (int i = 0; i < value.length(); ++i) {
			final char c = value.charAt(i);

			if (isTokenSeparator(c) && pc != ESCAPE_CHAR) {
				tokens.add(new Token(token.toString(), pos));
				tokens.add(new Token(Character.toString(c), i));
				token.setLength(0);
				pos = i;
			} else {
				token.append(c);
			}

			pc = c;
		}

		if (!token.isEmpty()) {
			tokens.add(new Token(token.toString(), pos));
		}

		return tokens;
	}
Tokenize the given parentheses string.

@param value the parentheses string
@return the parentheses string tokens
@throws NullPointerException if the given {@code value} is {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/util/ParenthesesTreeParser.java