#ifdef VHDL

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

#include "Behavioural/include/Vhdl.h"

#include <sstream>
using namespace std;

namespace morpheo              {
namespace behavioural          {
  
  string Vhdl::get_list (list<string> liste                ,
			 uint32_t     depth                ,
			 string       separator            ,
			 bool         last_separator       )
  {
    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;
      }

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

#endif
