public void restoreFrom(TokenStream other) {
        this.buffer = new LinkedList<Character>();
        for (Character c : other.buffer)
            buffer.addLast(c);
        currentToken = other.currentToken;
        putback = other.putback;
        putbackToken = other.putbackToken;
    }