#ifndef EDIF_ERR_H
#define EDIF_ERR_H
#include <stdexcept>
#include <string>

#include "hub/err.h"
#include "hub/named.h"
#include "hub/location.h"

// ==========================================================================
class UndefReason {
    std::string thing_;
    std::string kind_;
public:
    UndefReason (const std::string&, const std::string&);
    UndefReason (const char*, const char*);
    UndefReason (const UndefReason &);
    std::string tell (void) const;
};
// ==========================================================================
class RedefReason {
    std::string thing_;
    std::string kind_;
public:
    RedefReason (const std::string&, const std::string&);
    RedefReason (const char*, const char*);
    RedefReason (const RedefReason &);
    std::string tell (void) const;
};
// ==========================================================================
class OthReason {
    std::string thing_;
    std::string kind_;
    std::string rsn_;
public:
    OthReason (const std::string&, const std::string&, const std::string&);
    OthReason (const char*, const char*, const char*);
    OthReason (const OthReason &);
    std::string tell (void) const;
};
// ==========================================================================
class CircCtx {
    const hub::Named* lib_;
    const hub::Named* ent_; 
    const hub::Named* arch_;
public:
    CircCtx (const hub::Location&);
    CircCtx (const hub::Named* =NULL, const hub::Named* =NULL, const hub::Named* =NULL);
    CircCtx (int);
    CircCtx (const CircCtx &);
    std::string tell (void) const;
};
// ==========================================================================
typedef hub::CException <std::runtime_error, UndefReason, hub::FilePosition, CircCtx> UndefException;
typedef hub::CException <std::runtime_error, RedefReason, hub::FilePosition, CircCtx> RedefException;
typedef hub::CException <std::runtime_error, OthReason,   hub::FilePosition, CircCtx> OthException;

//---------------------------------------------------------------------------
#endif
