public static LinkedList<HtmlTag> tokenize(String text) {
        StringBuffer buf = new StringBuffer(text);
        LinkedList<HtmlTag> queue = new LinkedList<HtmlTag>();

        while (true) {
            HtmlTag nextTag = nextTag(buf);
            if (nextTag == null) {
                break;
            } else {
                queue.add(nextTag);
            }
        }
        
        return queue;
    }