@Override
    public Token read(DocumentReader scanner) throws ScannerReadException {
        String buffer = "";
        while (scanner.hasMore()) {
            if (scanner.hasMore()) {
                buffer += scanner.next();
            }
            for (String delimiter : delimiters) {
                while (buffer.length() < delimiter.length()) {
                    if (!scanner.hasMore()) {
                        return getTokenFactory().getToken(buffer, scanner.getCursor() - buffer.length());
                    }
                    buffer += scanner.next();
                }
                if (buffer.endsWith(delimiter)) {
                    buffer = buffer.substring(0, buffer.length() - delimiter.length());
                    try {
                        scanner.rewind(delimiter.length());
                    } catch (ScannerException e) {
                        throw new ScannerReadException("Could not reset cursor for delimiter " + delimiter);
                    }
                    return getTokenFactory().getToken(buffer, scanner.getCursor() - buffer.length());
                }
            }
        }
        return getTokenFactory().getToken(buffer, scanner.getCursor() - buffer.length());
    }