/*
 * This file is part of the Cforall project
 *
 * $Id: SemanticError.cc,v 1.1 2002/04/27 19:57:10 rcbilson Exp $
 *
 */

#include <iostream>
#include <list>
#include <string>
#include <algorithm>
#include <iterator>

#include "SemanticError.h"

SemanticError::SemanticError()
{
}

SemanticError::SemanticError( std::string error )
{
  errors.push_back( std::string( "Error: " ) + error );
}

void
SemanticError::append( SemanticError &other )
{
  errors.splice( errors.end(), other.errors );
}

bool
SemanticError::isEmpty() const
{
  return errors.empty();
}

void
SemanticError::print( std::ostream &os )
{
  std::copy( errors.begin(), errors.end(), std::ostream_iterator< std::string >( os, "\n" ) );
}
