#ifdef VHDL

/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Vhdl.h"

#include <sstream>
using namespace std;

namespace morpheo              {
namespace behavioural          {
  
#undef  FUNCTION
#define FUNCTION "Vhdl::get_list"
  string Vhdl::get_list (list<string> liste                ,
			 uint32_t     depth                ,
			 string       separator            ,
			 bool         last_separator       )
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    list<string>::iterator i     = liste.begin();
    bool                   empty = liste.empty();

    string                 tab   = string(depth,'\t');
    ostringstream          text;

    if (not empty)
      {
	// First
	if (i != liste.end())
	  {
	    text << tab << *i;
	    ++i;
	  }
	
	while (i != liste.end())
	  {
	    text << separator << endl;
	    text << tab << *i;
	    ++i;
	  }
	
	if (last_separator)
	  text << separator << endl;
      }

    log_printf(FUNC,Behavioural,FUNCTION,"End");

    return text.str();
  };
  
}; // end namespace behavioural          
}; // end namespace morpheo              

#endif
