Started implementing SAS to ASP translator.

This commit is contained in:
2016-05-21 02:43:07 +02:00
parent 57a64f3af9
commit 17685b68fb
4 changed files with 252 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
#ifndef __SAS__TRANSLATOR_ASP_H
#define __SAS__TRANSLATOR_ASP_H
#include <plasp/sas/Description.h>
#include <iosfwd>
namespace plasp
{
namespace sas
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// TranslatorASP
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class TranslatorASP
{
public:
explicit TranslatorASP(const Description &description);
void translate(std::ostream &ostream) const;
private:
void checkSupport() const;
const Description &m_description;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
#endif

View File

@@ -0,0 +1,56 @@
#ifndef __SAS__TRANSLATOR_EXCEPTION_H
#define __SAS__TRANSLATOR_EXCEPTION_H
#include <exception>
#include <string>
namespace plasp
{
namespace sas
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// TranslatorException
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class TranslatorException: public std::exception
{
public:
explicit TranslatorException()
{
}
explicit TranslatorException(const char *message)
: m_message(message)
{
}
explicit TranslatorException(const std::string &message)
: m_message(message)
{
}
~TranslatorException() throw()
{
}
const char *what() const throw()
{
if (m_message.empty())
return "Unspecified error while translating SAS description";
return m_message.c_str();
}
private:
std::string m_message;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
#endif