/*
 * MinimalEndSymbol.h
 *
 *  Created on: 19. 02. 2021
 *      Author: Martin Prokopic
 */

#include "MinimalEndSymbol.h"
#include <object/Object.h>

#include <registration/XmlRegistration.hpp>

namespace core {

alphabet::MinimalEndSymbol xmlApi < alphabet::MinimalEndSymbol >::parse ( ext::deque < sax::Token >::iterator & input ) {
	sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) );
	sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, xmlTagName ( ) );
	return alphabet::MinimalEndSymbol ( );
}

bool xmlApi < alphabet::MinimalEndSymbol >::first ( const ext::deque < sax::Token >::const_iterator & input ) {
	return sax::FromXMLParserHelper::isToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) );
}

std::string xmlApi < alphabet::MinimalEndSymbol >::xmlTagName ( ) {
	return "MinimalEndSymbol";
}

void xmlApi < alphabet::MinimalEndSymbol >::compose ( ext::deque < sax::Token > & output, const alphabet::MinimalEndSymbol & ) {
	output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::START_ELEMENT );
	output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::END_ELEMENT );
}

} /* namespace core */

namespace {

auto xmlWrite = registration::XmlWriterRegister < alphabet::MinimalEndSymbol > ( );
auto xmlRead = registration::XmlReaderRegister < alphabet::MinimalEndSymbol > ( );

auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, alphabet::MinimalEndSymbol > ( );

} /* namespace */
