#ifndef VHDL_EXP_TRAV_H
#define VHDL_EXP_TRAV_H
#include "hub/hub.h"
#include "hub/structural.h"
#include "hub/behavioral.h"
#include "trav.h"
#include "export.h"
#include "hub/location.h"
#include <string>

class VhdlExpTravClient : public TopTraverserClient {	
public:
	virtual void havePortClause(void);
	virtual void endPortClause(void);
    virtual ~VhdlExpTravClient();
};

class VhdlStructTravClient : public StructArchTravClient {
public:
	virtual void haveNet (hub::StructArch* arch,hub::Net*);
	virtual void haveComponent(hub::Entity*);
	virtual void endComponent(void);
	virtual void havePortClause(void);  //declaration of component ports
	virtual void endPortClause(void);
	virtual void havePortProto(hub::PortProto*); //component port
	virtual void havePrimInst(hub::Instance*);

	~VhdlStructTravClient();
};

// ======================================================================
class VhdlExpTrav: public hub::Location {
    
    VhdlExpTravClient* client_;

    void travLib (hub::Library*);
    void travEnt (hub::Entity*);
	void travPorts(hub::Entity*);

public:
    void operator() (void);
    VhdlExpTrav (hub::Hub* h, VhdlExpTravClient* client): 
    hub::Location (h),
    client_(client) 
    {}
    VhdlExpTrav& operator = (const Location& loc) { Location::operator = (loc); return *this; }
};

// ----------------------------------------------------------------------
class VhdlStructTraverser {
    hub::StructArch* archImpl_;
    VhdlStructTravClient* client_;

public:
    void travNets (void);
    void travPorts (void);
    void travInsts (void);
	void travComponents(void);

	bool isPrimitive(hub::Instance* inst);

    VhdlStructTraverser (hub::StructArch* archImpl, VhdlStructTravClient* client):
    archImpl_(archImpl),
    client_(client) {} 
};



#endif
