// -*- c++ -*-
#ifndef AKAXISO_CLOSURE_HANDLER_H__
#define AKAXISO_CLOSUER_HANDLER_H__

#include <akaxiso/parser/handler.h>
#include <akaxiso/parser/sequence_handler.h>

namespace aka2 {

  class closure_handler : public handler {
  public:
    closure_handler(const qname &tagname, sequence_handler *seq, int depth);
    virtual ~closure_handler(){}
    virtual parse_result query_element(const qname &tagname, const attribute_values &attrs, 
				       const global_attributes &gattrs);
    virtual parse_result end_element(const qname &tagname);

    virtual bool parse_entity(const std::string &entity, const global_attributes &gattrs);
    virtual parse_result find_particle(const qname &tagname, const attribute_values &attrs, 
				       const global_attributes &gattrs);

    virtual memberpair get_element();
    virtual void receive_child(const memberpair &mpair);

    virtual bool can_skip();
    virtual void abort(){}

  private:
    sequence_handler *seq_;
    sequence_handler *inner_;
    bool error_;
  };

}

#endif
