extern crate html5ever;
extern crate tendril;
use std::io;
use std::default::Default;
use tendril::{ByteTendril, ReadExt};
use html5ever::tokenizer::{TokenSink, Token};
use html5ever::driver::{tokenize_to, one_input};
struct Sink(Vec<Token>);
impl TokenSink for Sink {
fn process_token(&mut self, token: Token) {
self.0.push(token);
}
}
fn main() {
let mut input = ByteTendril::new();
io::stdin().read_to_tendril(&mut input).unwrap();
let input = input.try_reinterpret().unwrap();
tokenize_to(Sink(Vec::new()), one_input(input), Default::default());
}