diff --git a/alib2str/src/alphabet/string/InitialSymbol.cpp b/alib2str/src/alphabet/string/InitialSymbol.cpp new file mode 100644 index 0000000000000000000000000000000000000000..14e3be307ecc373cc97ddff89e4a09d48e0f1fbd --- /dev/null +++ b/alib2str/src/alphabet/string/InitialSymbol.cpp @@ -0,0 +1,36 @@ +/* + * InitialSymbol.cpp + * + * Created on: Nov 21, 2017 + * Author: Tomas Pecka + */ + +#include "InitialSymbol.h" +#include <alphabet/InitialSymbol.h> +#include <alphabet/Symbol.h> +#include <object/Object.h> + +#include <registration/StringRegistration.hpp> + +namespace alib { + +alphabet::InitialSymbol stringApi < alphabet::InitialSymbol >::parse ( std::istream & ) { + throw exception::CommonException ( "parsing InitialSymbol from string not implemented" ); +} + +bool stringApi < alphabet::InitialSymbol >::first ( std::istream & ) { + return false; +} + +void stringApi < alphabet::InitialSymbol >::compose ( std::ostream & output, const alphabet::InitialSymbol & ) { + output << "#I"; +} + +} /* namespace alib */ + +namespace { + +static auto stringWrite = registration::StringWriterRegister < alphabet::Symbol, alphabet::InitialSymbol > ( ); +static auto stringWrite2 = registration::StringWriterRegister < alib::Object, alphabet::InitialSymbol > ( ); + +} /* namespace */ diff --git a/alib2str/src/alphabet/string/InitialSymbol.h b/alib2str/src/alphabet/string/InitialSymbol.h new file mode 100644 index 0000000000000000000000000000000000000000..504441ad428a9d1b74f7683b48f107bc231c87f3 --- /dev/null +++ b/alib2str/src/alphabet/string/InitialSymbol.h @@ -0,0 +1,25 @@ +/* + * InitialSymbol.h + * + * Created on: Nov 21, 2017 + * Author: Tomas Pecka + */ + +#ifndef _STRING_INITIAL_SYMBOL_H_ +#define _STRING_INITIAL_SYMBOL_H_ + +#include <alphabet/InitialSymbol.h> +#include <core/stringApi.hpp> + +namespace alib { + +template < > +struct stringApi < alphabet::InitialSymbol > { + static alphabet::InitialSymbol parse ( std::istream & input ); + static bool first ( std::istream & input ); + static void compose ( std::ostream & output, const alphabet::InitialSymbol & symbol ); +}; + +} /* namespace alib */ + +#endif /* _STRING_INITIAL_SYMBOL_H_ */