@Override
    public TokenStream clone() {
        TokenStream other = new TokenStream();
        for (Character c : buffer) {
            other.buffer.addLast(c);
        }
        other.currentToken = currentToken;
        other.putback = putback;
        other.putbackToken = putbackToken;
        other.specialChars = specialChars;
        return other;
    }