#ifndef SWIG_LIBWCCL_PARSEDEXPRESSION_I
#define SWIG_LIBWCCL_PARSEDEXPRESSION_I

%module libcclparsedexpression
%{
  #include <libwccl/ops/parsedexpression.h>
%}

%include "libcclvalue.i"

%include "libcclmatch.i"
%include "libcclbool.i"
%include "libccltset.i"
%include "libcclstrset.i"
%include "libcclposition.i"
%include "libcclexpression.i"

%include "std_string.i"
%include "boost_shared_ptr.i"

%rename(__op_get__) Wccl::ParsedExpression::operator[](const std::string& var_name) const;

namespace Wccl {
  class ParsedExpression : public Expression {
  public:
    const Value& operator[](const std::string& var_name) const;
    
    template<class T> T& get(const std::string& var_name);
    %template(get_bool) get<Bool>;
    %template(get_tset) get<TSet>;
    %template(get_strset) get<StrSet>;
    %template(get_position) get<Position>;
    %template(get_match) get<Match>;
    
    template<class T> void set(const std::string& var_name, const T& value);
    %template(set_bool) set<Bool>;
    %template(set_tset) set<TSet>;
    %template(set_strset) set<StrSet>;
    %template(set_position) set<Position>;
    %template(set_match) set<Match>;

    void clean();
    boost::shared_ptr<ParsedExpression> clone_ptr() const;
    boost::shared_ptr<ParsedExpression> clone_clean_ptr() const;
    std::string variables_string(const Corpus2::Tagset& tagset) const;
    std::ostream& dump_variables(std::ostream& ostream, const Corpus2::Tagset& tagset) const;

  protected:
    explicit ParsedExpression(const Variables& variables);
    virtual ParsedExpression* clone_internal() const = 0;
  };
}

using namespace std;
using namespace Wccl;

#endif /* SWIG_LIBWCCL_PARSEDEXPRESSION_I */