Skip to content
Snippets Groups Projects
Commit 1d89fcc0 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

+explicit to all constructors; parse/compose State

parent b3a26853
No related branches found
No related tags found
No related merge requests found
Showing
with 42 additions and 36 deletions
......@@ -21,11 +21,8 @@ namespace label {
class ObjectLabel : public std::acceptor<ObjectLabel, VisitableLabelBase, std::acceptor<ObjectLabel, alib::VisitableObjectBase, LabelBase> > {
protected:
alib::Object label;
public:
virtual LabelBase* clone() const;
virtual LabelBase* plunder() &&;
 
public:
/**
* Creates new symbol with given name.
* @param symbol name of the symbol
......@@ -34,6 +31,10 @@ public:
 
explicit ObjectLabel(alib::Object&& label);
 
virtual LabelBase* clone() const;
virtual LabelBase* plunder() &&;
virtual bool operator<(const alib::ObjectBase& other) const;
virtual bool operator>(const alib::ObjectBase& other) const;
......
......@@ -21,18 +21,20 @@ namespace label {
class PrimitiveLabel : public std::acceptor<PrimitiveLabel, VisitableLabelBase, std::acceptor<PrimitiveLabel, alib::VisitableObjectBase, LabelBase> > {
protected:
primitive::Primitive primitive;
public:
virtual LabelBase* clone() const;
virtual LabelBase* plunder() &&;
 
public:
/**
* Creates new symbol with given name.
* @param symbol name of the symbol
*/
explicit PrimitiveLabel(const primitive::Primitive& primitive);
explicit PrimitiveLabel(primitive::Primitive&& primitive);
 
virtual LabelBase* clone() const;
virtual LabelBase* plunder() &&;
virtual bool operator<(const alib::ObjectBase& other) const;
virtual bool operator>(const alib::ObjectBase& other) const;
......
......@@ -21,17 +21,18 @@ namespace primitive {
class Character : public std::acceptor<Character, VisitablePrimitiveBase, std::acceptor<Character, alib::VisitableObjectBase, PrimitiveBase> > {
protected:
char data;
public:
virtual PrimitiveBase* clone() const;
virtual PrimitiveBase* plunder() &&;
 
public:
/**
* Creates new symbol with given name.
* @param symbol name of the symbol
*/
explicit Character(char data);
 
virtual PrimitiveBase* clone() const;
virtual PrimitiveBase* plunder() &&;
virtual bool operator<(const alib::ObjectBase& other) const;
 
virtual bool operator>(const alib::ObjectBase& other) const;
......
......@@ -20,17 +20,18 @@ namespace primitive {
class Integer : public std::acceptor<Integer, VisitablePrimitiveBase, std::acceptor<Integer, alib::VisitableObjectBase, PrimitiveBase> > {
protected:
int data;
public:
virtual PrimitiveBase* clone() const;
virtual PrimitiveBase* plunder() &&;
 
public:
/**
* Creates new symbol with given name.
* @param symbol name of the symbol
*/
explicit Integer(int data);
 
virtual PrimitiveBase* clone() const;
virtual PrimitiveBase* plunder() &&;
virtual bool operator<(const alib::ObjectBase& other) const;
virtual bool operator>(const alib::ObjectBase& other) const;
......
......@@ -21,11 +21,8 @@ namespace primitive {
class String : public std::acceptor<String, VisitablePrimitiveBase, std::acceptor<String, alib::VisitableObjectBase, PrimitiveBase> > {
protected:
std::string data;
public:
virtual PrimitiveBase* clone() const;
virtual PrimitiveBase* plunder() &&;
 
public:
/**
* Creates new symbol with given name.
* @param symbol name of the symbol
......@@ -34,6 +31,10 @@ public:
 
explicit String(std::string&& data);
 
virtual PrimitiveBase* clone() const;
virtual PrimitiveBase* plunder() &&;
virtual bool operator<(const alib::ObjectBase& other) const;
 
virtual bool operator>(const alib::ObjectBase& other) const;
......
......@@ -41,10 +41,10 @@ public:
*/
virtual RegExpBase* plunder() &&;
 
FormalRegExp();
explicit FormalRegExp();
explicit FormalRegExp(const UnboundedRegExp& other);
FormalRegExp(const std::set<alphabet::Symbol>& alphabet, const FormalRegExpElement& regExp);
FormalRegExp(std::set<alphabet::Symbol>&& alphabet, FormalRegExpElement&& regExp);
explicit FormalRegExp(const std::set<alphabet::Symbol>& alphabet, const FormalRegExpElement& regExp);
explicit FormalRegExp(std::set<alphabet::Symbol>&& alphabet, FormalRegExpElement&& regExp);
explicit FormalRegExp(const FormalRegExpElement& regExp);
explicit FormalRegExp(FormalRegExpElement&& regExp);
 
......
......@@ -60,7 +60,7 @@ protected:
virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const = 0;
public:
FormalRegExpElement();
explicit FormalRegExpElement();
/**
* Creates copy of the element.
......
......@@ -38,7 +38,7 @@ protected:
virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const;
 
public:
FormalRegExpEmpty();
explicit FormalRegExpEmpty();
FormalRegExpEmpty(const FormalRegExpEmpty& other);
FormalRegExpEmpty(FormalRegExpEmpty&& other) noexcept;
FormalRegExpEmpty& operator =(const FormalRegExpEmpty& other);
......
......@@ -39,7 +39,7 @@ protected:
 
public:
 
FormalRegExpEpsilon();
explicit FormalRegExpEpsilon();
FormalRegExpEpsilon(const FormalRegExpEpsilon& other);
FormalRegExpEpsilon(FormalRegExpEpsilon&& other) noexcept;
FormalRegExpEpsilon& operator=(const FormalRegExpEpsilon& other);
......
......@@ -41,10 +41,10 @@ public:
*/
virtual RegExpBase* plunder() &&;
 
UnboundedRegExp();
explicit UnboundedRegExp();
explicit UnboundedRegExp(const FormalRegExp& other);
UnboundedRegExp(const std::set<alphabet::Symbol>& alphabet, const UnboundedRegExpElement& regExp);
UnboundedRegExp(std::set<alphabet::Symbol>&& alphabet, UnboundedRegExpElement&& regExp);
explicit UnboundedRegExp(const std::set<alphabet::Symbol>& alphabet, const UnboundedRegExpElement& regExp);
explicit UnboundedRegExp(std::set<alphabet::Symbol>&& alphabet, UnboundedRegExpElement&& regExp);
explicit UnboundedRegExp(const UnboundedRegExpElement& regExp);
explicit UnboundedRegExp(UnboundedRegExpElement&& regExp);
 
......
......@@ -44,7 +44,7 @@ protected:
virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const;
 
public:
UnboundedRegExpAlternation();
explicit UnboundedRegExpAlternation();
 
UnboundedRegExpAlternation(const UnboundedRegExpAlternation& other);
UnboundedRegExpAlternation(UnboundedRegExpAlternation&& other) noexcept;
......
......@@ -45,7 +45,7 @@ protected:
virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const;
 
public:
UnboundedRegExpConcatenation();
explicit UnboundedRegExpConcatenation();
UnboundedRegExpConcatenation(const UnboundedRegExpConcatenation& other);
UnboundedRegExpConcatenation(UnboundedRegExpConcatenation&& other) noexcept;
......
......@@ -60,7 +60,7 @@ protected:
virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const = 0;
public:
UnboundedRegExpElement();
explicit UnboundedRegExpElement();
/**
* Creates copy of the element.
......
......@@ -38,7 +38,7 @@ protected:
virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const;
 
public:
UnboundedRegExpEmpty();
explicit UnboundedRegExpEmpty();
UnboundedRegExpEmpty(const UnboundedRegExpEmpty& other);
UnboundedRegExpEmpty(UnboundedRegExpEmpty&& other) noexcept;
UnboundedRegExpEmpty& operator =(const UnboundedRegExpEmpty& other);
......
......@@ -39,7 +39,7 @@ protected:
 
public:
 
UnboundedRegExpEpsilon();
explicit UnboundedRegExpEpsilon();
UnboundedRegExpEpsilon(const UnboundedRegExpEpsilon& other);
UnboundedRegExpEpsilon(UnboundedRegExpEpsilon&& other) noexcept;
UnboundedRegExpEpsilon& operator=(const UnboundedRegExpEpsilon& other);
......
......@@ -26,7 +26,7 @@ namespace string {
class CyclicString : public std::acceptor<CyclicString, VisitableStringBase, std::acceptor<CyclicString, alib::VisitableObjectBase, StringBase> >, public StringAlphabet {
std::vector<alphabet::Symbol> m_Data;
public:
CyclicString();
explicit CyclicString();
explicit CyclicString(const std::set<alphabet::Symbol>& alphabet, const std::vector<alphabet::Symbol>& data);
explicit CyclicString(std::set<alphabet::Symbol>&& alphabet, std::vector<alphabet::Symbol>&& data);
explicit CyclicString(const std::vector<alphabet::Symbol>& data);
......
......@@ -27,7 +27,7 @@ class LinearString : public std::acceptor<LinearString, VisitableStringBase, std
std::vector<alphabet::Symbol> m_Data;
 
public:
LinearString();
explicit LinearString();
explicit LinearString(const std::set<alphabet::Symbol>& alphabet, const std::vector<alphabet::Symbol>& data);
explicit LinearString(std::set<alphabet::Symbol>&& alphabet, std::vector<alphabet::Symbol>&& data);
explicit LinearString(const std::vector<alphabet::Symbol>& data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment