diff --git a/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp b/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp index b3a10d6ede6a41c13e0278c4f3f008b5eb3cd596..86355be0519d793e31338a5fefa260e0be1cbf10 100644 --- a/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp +++ b/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp @@ -9,8 +9,6 @@ #include "LRParser.h" -#include <label/LR0ItemsLabel.h> - #include <queue> namespace grammar { diff --git a/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp b/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp index 408cd90ee13878c3c61e4842c4f2e08b6b380678..1d3993cd18877344de13dd7cb0eb02fd49fb32c1 100644 --- a/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp +++ b/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp @@ -12,7 +12,6 @@ #include "Follow.h" #include <exception/CommonException.h> -#include <label/LR0ItemsLabel.h> namespace grammar { diff --git a/alib2algo_experimental/test-src/grammar/parsing/LR0Parser.cpp b/alib2algo_experimental/test-src/grammar/parsing/LR0Parser.cpp index 457e4dda2b523c2b26f39900f0ef2a108385661a..ba5b4df136963067dcb83ad140258b85fd3b6cf6 100644 --- a/alib2algo_experimental/test-src/grammar/parsing/LR0Parser.cpp +++ b/alib2algo_experimental/test-src/grammar/parsing/LR0Parser.cpp @@ -3,8 +3,6 @@ #include "grammar/parsing/LRParser.h" #include "grammar/parsing/LR0Parser.h" -#include <label/LR0ItemsLabel.h> - #include <alib/vector> CPPUNIT_TEST_SUITE_NAMED_REGISTRATION ( LR0Parser, "grammar" ); diff --git a/alib2algo_experimental/test-src/grammar/parsing/LRParser.cpp b/alib2algo_experimental/test-src/grammar/parsing/LRParser.cpp index 1d7c11cb716d1c16106c31c49b0c543fa394f6a4..a5bb9c5fb6cccff735ec23f454ac9a6a198adb98 100644 --- a/alib2algo_experimental/test-src/grammar/parsing/LRParser.cpp +++ b/alib2algo_experimental/test-src/grammar/parsing/LRParser.cpp @@ -3,8 +3,6 @@ #include "grammar/parsing/LRParser.h" #include "grammar/parsing/SLR1ParseTable.h" -#include <label/LR0ItemsLabel.h> - #include <alib/vector> CPPUNIT_TEST_SUITE_NAMED_REGISTRATION ( LRParser, "grammar" ); diff --git a/alib2algo_experimental/test-src/grammar/parsing/SLR1ParseTable.cpp b/alib2algo_experimental/test-src/grammar/parsing/SLR1ParseTable.cpp index 59dc916c51ae1cd4eca559ce65e4311c983b6d05..832dfc56dc13f843467a44ab85bc1e8607a24765 100644 --- a/alib2algo_experimental/test-src/grammar/parsing/SLR1ParseTable.cpp +++ b/alib2algo_experimental/test-src/grammar/parsing/SLR1ParseTable.cpp @@ -3,8 +3,6 @@ #include "grammar/parsing/LRParser.h" #include "grammar/parsing/SLR1ParseTable.h" -#include <label/LR0ItemsLabel.h> - #include <alib/variant> #include <alib/vector> diff --git a/alib2data/src/PrimitiveRegistrator.cpp b/alib2data/src/PrimitiveRegistrator.cpp index 0099f20b6f88e3d3f3114b11d8563a5c248e153e..25b0232c34cb9a9606b7a06a8c5049e64ec79a6f 100644 --- a/alib2data/src/PrimitiveRegistrator.cpp +++ b/alib2data/src/PrimitiveRegistrator.cpp @@ -76,7 +76,6 @@ public: core::xmlApi < object::Object >::template registerXmlWriter < object::AnyObject < ext::vector < ext::variant < object::Object, object::Object > > > > ( ); core::xmlApi < object::Object >::template registerXmlWriter < object::AnyObject < ext::set < object::Object > > > ( ); core::xmlApi < object::Object >::template registerXmlWriter < object::AnyObject < unsigned int > > ( ); - core::xmlApi < object::Object >::template registerXmlWriter < container::ObjectsPair < object::Object, unsigned > > ( ); core::xmlApi < object::Object >::template registerXmlWriter < object::AnyObject < common::ranked_symbol < object::Object, primitive::Unsigned > > > ( ); core::xmlApi < object::Object >::template registerXmlWriter < object::AnyObject < ext::pair < unsigned int, unsigned int > > > ( ); core::xmlApi < object::Object >::template registerXmlWriter < object::AnyObject < ext::pair < object::Object, object::Object > > > ( ); diff --git a/alib2data_experimental/src/label/LR0ItemsLabel.cpp b/alib2data_experimental/src/label/LR0ItemsLabel.cpp deleted file mode 100644 index 63cd7de4c5950aa600aafc56a121cfd5fae20aff..0000000000000000000000000000000000000000 --- a/alib2data_experimental/src/label/LR0ItemsLabel.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * LR0ItemsLabel.cpp - * - * Created on: 29. 4. 2016 - * Author: Martin Kocicka - */ - -#include "LR0ItemsLabel.h" - -#include <object/Object.h> -#include <object/UniqueObject.h> - -#include <registration/ValuePrinterRegistration.hpp> - -namespace label { - -LR0ItemsLabel::LR0ItemsLabel ( grammar::parsing::LR0Items items ) : m_items ( items ) { -} - -LR0ItemsLabel::LR0ItemsLabel ( ) { -} - -LabelBase* LR0ItemsLabel::clone ( ) const & { - return new LR0ItemsLabel ( *this ); -} - -LabelBase* LR0ItemsLabel::clone ( ) && { - return new LR0ItemsLabel ( std::move ( *this ) ); -} - -bool LR0ItemsLabel::operator < ( const LR0ItemsLabel & other ) const { - return this->compare(other) < 0; -} - -int LR0ItemsLabel::compare ( const LR0ItemsLabel & other ) const { - if ( m_items < other.m_items ) { - return -1; - } else if ( m_items > other.m_items ) { - return 1; - } else { - return 0; - } -} - -void LR0ItemsLabel::operator>>(std::ostream & out) const { - out << "(LR0ItemsLabel " << m_items << ")"; -} - -LR0ItemsLabel::operator std::string ( ) const { - std::stringstream ss; - ss << *this; - return ss.str ( ); -} - -object::ObjectBase* LR0ItemsLabel::inc ( ) && { - return new object::UniqueObject ( object::Object ( std::move ( *this ) ), primitive::Integer ( 0 ) ); -} - -} /* namespace label */ - -namespace { - -static auto valuePrinter = registration::ValuePrinterRegister < label::LR0ItemsLabel > ( ); - -} /* namespace */ diff --git a/alib2data_experimental/src/label/LR0ItemsLabel.h b/alib2data_experimental/src/label/LR0ItemsLabel.h deleted file mode 100644 index 52311c976fd3848dd7e149bb8c3975c28f0e110c..0000000000000000000000000000000000000000 --- a/alib2data_experimental/src/label/LR0ItemsLabel.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * LR0ItemsLabel.h - * - * Created on: 29. 4. 2016 - * Author: Martin Kocicka - */ - -#ifndef LR0ITEMS_LABEL_H_ -#define LR0ITEMS_LABEL_H_ - -#include <label/LabelBase.h> -#include <grammar/parsing/LRParserTypes.h> - -namespace label { - -/** - * Represents symbol in an alphabet. - */ -class LR0ItemsLabel final : public LabelBase { -protected: - grammar::parsing::LR0Items m_items; - -public: - /** - * Creates new symbol with given name. - * @param symbol name of the symbol - */ - explicit LR0ItemsLabel ( grammar::parsing::LR0Items items ); - - /** - * Creates new symbol with given name. - * @param symbol name of the symbol - */ - explicit LR0ItemsLabel ( ); - - virtual LabelBase * clone ( ) const &; - - virtual LabelBase * clone ( ) &&; - - const grammar::parsing::LR0Items & getItems ( ) const { - return m_items; - } - - grammar::parsing::LR0Items & getItems ( ) { - return m_items; - } - - virtual int compare ( const ObjectBase & other ) const { - if ( ext::type_index ( typeid ( * this ) ) == ext::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); - - return ext::type_index ( typeid ( * this ) ) - ext::type_index ( typeid ( other ) ); - } - - virtual int compare ( const LR0ItemsLabel & other ) const; - - bool operator < (const LR0ItemsLabel& other) const; - - virtual void operator >>( std::ostream & ) const; - - virtual explicit operator std::string ( ) const; - - virtual object::ObjectBase * inc ( ) &&; -}; - -} /* namespace label */ - -#endif /* LR0ITEMS_LABEL_H_ */ diff --git a/alib2data_experimental/src/label/xml/LR0ItemsLabel.cpp b/alib2data_experimental/src/label/xml/LR0ItemsLabel.cpp deleted file mode 100644 index d038fa53e5e4bba03697123e80dbb38758e840e0..0000000000000000000000000000000000000000 --- a/alib2data_experimental/src/label/xml/LR0ItemsLabel.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * LR0ItemsLabel.cpp - * - * Created on: 29. 4. 2016 - * Author: Martin Kocicka - */ - -#include "LR0ItemsLabel.h" -#include <label/Label.h> -#include <object/Object.h> - -#include <container/ObjectsMap.h> -#include <container/ObjectsSet.h> -#include <container/ObjectsVector.h> -#include <primitive/Unsigned.h> - -#include <container/xml/ObjectsMap.h> -#include <container/xml/ObjectsSet.h> -#include <container/xml/ObjectsVector.h> -#include <container/xml/ObjectsVariant.h> -#include <primitive/xml/Unsigned.h> - -#include <registration/XmlRegistration.hpp> - -namespace core { - -label::LR0ItemsLabel xmlApi < label::LR0ItemsLabel >::parse ( ext::deque < sax::Token >::iterator & input ) { - sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName() ); - label::LR0ItemsLabel data ( core::xmlApi < grammar::parsing::LR0Items > ::parse ( input ) ); - sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, xmlTagName() ); - return data; -} - -bool xmlApi < label::LR0ItemsLabel >::first ( const ext::deque < sax::Token >::const_iterator & input ) { - return sax::FromXMLParserHelper::isToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) ); -} - -const std::string & xmlApi < label::LR0ItemsLabel >::xmlTagName ( ) { - static std::string xmlTagName = "LR0ItemsLabel"; - - return xmlTagName; -} - -void xmlApi < label::LR0ItemsLabel >::compose ( ext::deque < sax::Token > & output, const label::LR0ItemsLabel & label ) { - output.emplace_back ( xmlTagName(), sax::Token::TokenType::START_ELEMENT ); - core::xmlApi < grammar::parsing::LR0Items > ::compose ( output, label.getItems ( ) ); - output.emplace_back ( xmlTagName(), sax::Token::TokenType::END_ELEMENT ); -} - -} /* namespace core */ - -namespace { - -static auto xmlWrite = registration::XmlWriterRegister < label::LR0ItemsLabel > ( ); -static auto xmlRead = registration::XmlReaderRegister < label::LR0ItemsLabel > ( ); - -static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < label::Label, label::LR0ItemsLabel > ( ); -static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, label::LR0ItemsLabel > ( ); - -} /* namespace */ diff --git a/alib2data_experimental/src/label/xml/LR0ItemsLabel.h b/alib2data_experimental/src/label/xml/LR0ItemsLabel.h deleted file mode 100644 index 6a0102da1039302fc0d30d6d067d1a1f11aec74f..0000000000000000000000000000000000000000 --- a/alib2data_experimental/src/label/xml/LR0ItemsLabel.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * LR0ItemsLabel.h - * - * Created on: Apr 10, 2013 - * Author: Stepan Plachy - */ - -#ifndef _XML_LR0ITEMS_LABEL_H_ -#define _XML_LR0ITEMS_LABEL_H_ - -#include <label/LR0ItemsLabel.h> -#include <core/xmlApi.hpp> - -namespace core { - -template < > -struct xmlApi < label::LR0ItemsLabel > { - static label::LR0ItemsLabel parse ( ext::deque < sax::Token >::iterator & input ); - static bool first ( const ext::deque < sax::Token >::const_iterator & input ); - static const std::string & xmlTagName ( ); - static void compose ( ext::deque < sax::Token > & output, const label::LR0ItemsLabel & data ); -}; - -} /* namespace core */ - -#endif /* _XML_LR0ITEMS_LABEL_H_ */