diff --git a/alib2data/src/grammar/Regular/LeftLG.h b/alib2data/src/grammar/Regular/LeftLG.h index 386d87d2522f9ab56aa899dc0a0fefbead94767c..8d9ca03fe8da39fbecf264e41ea53e65b7eb4577 100644 --- a/alib2data/src/grammar/Regular/LeftLG.h +++ b/alib2data/src/grammar/Regular/LeftLG.h @@ -60,7 +60,7 @@ class InitialSymbol; * G = (N, T, P, S), * N (NonterminalAlphabet) = nonempty finite set of nonterminal symbols, * T (TerminalAlphabet) = finite set of terminal symbols - having this empty won't let grammar do much though, - * P = set of production rules of the form A -> aB or A -> a, where A, B \in N and a \in T*, + * P = set of production rules of the form A -> Ba or A -> a, where A, B \in N and a \in T*, * S (InitialSymbol) = initial nonterminal symbol, * * \tparam SymbolType used for the terminal alphabet, the nonterminal alphabet, and the initial symbol of the grammar. @@ -102,7 +102,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> aB or A -> a, where A, B \in N and a \in T*. + * \details The rule is in a form of A -> Ba or A -> a, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -126,7 +126,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> aB, where A, B \in N and a \in T*. + * \details The rule is in a form of A -> Ba, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -138,7 +138,7 @@ public: /** * \brief Add new rules of a grammar. * - * \details The rules are in form of A -> aB | bC | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T*. + * \details The rules are in form of A -> Ba | Cb | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide a set of right hand sides of the rule @@ -160,7 +160,7 @@ public: ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, ext::pair < SymbolType, ext::vector < SymbolType > > > > > && getRules ( ) &&; /** - * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T*. + * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -180,7 +180,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); /** - * Remove a rule of a grammar in form of A -> aB, where A, B \in N and a \in T*. + * Remove a rule of a grammar in form of A -> Ba, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -190,7 +190,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const ext::pair < SymbolType, ext::vector < SymbolType > > & rightHandSide ); /** - * Add a new rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. + * Add a new rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -207,7 +207,7 @@ public: ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** - * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide + * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide * * \returns true if the rule was indeed removed, false othervise */ diff --git a/alib2data/src/grammar/Regular/LeftRG.h b/alib2data/src/grammar/Regular/LeftRG.h index f5ab6eaac0438d30cf9282709c176680c4218371..9ff7bfbec912a5b528ffcd4a2d8711ecee53cbf1 100644 --- a/alib2data/src/grammar/Regular/LeftRG.h +++ b/alib2data/src/grammar/Regular/LeftRG.h @@ -61,7 +61,7 @@ class InitialSymbol; * G = (N, T, P, S, E), * N (NonterminalAlphabet) = nonempty finite set of nonterminal symbols, * T (TerminalAlphabet) = finite set of terminal symbols - having this empty won't let grammar do much though, - * P = set of production rules of the form A -> aB or A -> a, where A, B \in N and a \in T, + * P = set of production rules of the form A -> Ba or A -> a, where A, B \in N and a \in T, * S (InitialSymbol) = initial nonterminal symbol, * E = boolean signaling wheter grammar generates empty string or don't. * @@ -111,7 +111,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> aB or A -> a, where A, B \in N and a \in T. + * \details The rule is in a form of A -> Ba or A -> a, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -135,7 +135,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> aB, where A, B \in N and a \in T. + * \details The rule is in a form of A -> Ba, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -147,7 +147,7 @@ public: /** * \brief Add new rules of a grammar. * - * \details The rules are in form of A -> aB | bC | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T. + * \details The rules are in form of A -> Ba | Cb | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide a set of right hand sides of the rule @@ -169,7 +169,7 @@ public: ext::map < SymbolType, ext::set < ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > > > && getRules ( ) &&; /** - * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T. + * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -189,7 +189,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const SymbolType & rightHandSide ); /** - * Remove a rule of a grammar in form of A -> aB, where A, B \in N and a \in T. + * Remove a rule of a grammar in form of A -> Ba, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -199,7 +199,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const ext::pair < SymbolType, SymbolType > & rightHandSide ); /** - * Add a new rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. + * Add a new rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -216,7 +216,7 @@ public: ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** - * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide + * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide * * \returns true if the rule was indeed removed, false othervise */ @@ -608,7 +608,7 @@ int LeftRG < SymbolType >::compare ( const LeftRG & other ) const { template < class SymbolType > void LeftRG < SymbolType >::operator >>( std::ostream & out ) const { - out << "(RightRG " + out << "(LeftRG " << "nonterminalAlphabet = " << getNonterminalAlphabet ( ) << "terminalAlphabet = " << getTerminalAlphabet ( ) << "initialSymbol = " << getInitialSymbol ( ) diff --git a/alib2data/src/grammar/Regular/RightLG.h b/alib2data/src/grammar/Regular/RightLG.h index 8e388407b48de86a35e3ac711de8c2ffb28ea28b..485b2ba4cbe529e53ec53411f9d4083e1a53e8ae 100644 --- a/alib2data/src/grammar/Regular/RightLG.h +++ b/alib2data/src/grammar/Regular/RightLG.h @@ -60,7 +60,7 @@ class InitialSymbol; * G = (N, T, P, S), * N (NonterminalAlphabet) = nonempty finite set of nonterminal symbols, * T (TerminalAlphabet) = finite set of terminal symbols - having this empty won't let grammar do much though, - * P = set of production rules of the form A -> Ba or A -> a, where A, B \in N and a \in T*, + * P = set of production rules of the form A -> aB or A -> a, where A, B \in N and a \in T*, * S (InitialSymbol) = initial nonterminal symbol, * * \tparam SymbolType used for the terminal alphabet, the nonterminal alphabet, and the initial symbol of the grammar. @@ -102,7 +102,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> Ba or A -> a, where A, B \in N and a \in T*. + * \details The rule is in a form of A -> aB or A -> a, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -126,7 +126,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> Ba, where A, B \in N and a \in T*. + * \details The rule is in a form of A -> aB, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -138,7 +138,7 @@ public: /** * \brief Add new rules of a grammar. * - * \details The rules are in form of A -> Ba | Cb | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T*. + * \details The rules are in form of A -> aB | bC | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide a set of right hand sides of the rule @@ -160,7 +160,7 @@ public: ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, ext::pair < ext::vector < SymbolType >, SymbolType > > > > && getRules ( ) &&; /** - * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T*. + * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -180,7 +180,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); /** - * Remove a rule of a grammar in form of A -> Ba, where A, B \in N and a \in T*. + * Remove a rule of a grammar in form of A -> aB, where A, B \in N and a \in T*. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -190,7 +190,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const ext::pair < ext::vector < SymbolType >, SymbolType > & rightHandSide ); /** - * Add a new rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. + * Add a new rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -207,7 +207,7 @@ public: ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** - * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide + * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide * * \returns true if the rule was indeed removed, false othervise */ @@ -563,7 +563,7 @@ int RightLG < SymbolType >::compare ( const RightLG & other ) const { template < class SymbolType > void RightLG < SymbolType >::operator >>( std::ostream & out ) const { - out << "(LeftLG " << "nonterminalAlphabet = " + out << "(RightLG " << "nonterminalAlphabet = " << getNonterminalAlphabet ( ) << "terminalAlphabet = " << getTerminalAlphabet ( ) << "initialSymbol = " << getInitialSymbol ( ) << "rules = " diff --git a/alib2data/src/grammar/Regular/RightRG.h b/alib2data/src/grammar/Regular/RightRG.h index d31b6def281161471cd92f0126051377a620a471..569ba4db90f501b017e6dc8e38481ccd84971dd9 100644 --- a/alib2data/src/grammar/Regular/RightRG.h +++ b/alib2data/src/grammar/Regular/RightRG.h @@ -61,7 +61,7 @@ class InitialSymbol; * G = (N, T, P, S, E), * N (NonterminalAlphabet) = nonempty finite set of nonterminal symbols, * T (TerminalAlphabet) = finite set of terminal symbols - having this empty won't let grammar do much though, - * P = set of production rules of the form A -> Ba or A -> a, where A, B \in N and a \in T, + * P = set of production rules of the form A -> aB or A -> a, where A, B \in N and a \in T, * S (InitialSymbol) = initial nonterminal symbol, * E = boolean signaling wheter grammar generates empty string or don't. * @@ -72,7 +72,7 @@ class InitialSymbol; template < class SymbolType > class RightRG final : public GrammarBase, public core::Components < RightRG < SymbolType >, ext::set < SymbolType >, component::Set, std::tuple < TerminalAlphabet, NonterminalAlphabet >, SymbolType, component::Value, InitialSymbol > { /** - * Rules function as mapping from nonterminal symbol on the left hand side to set of either terminal symbols or doublets of nonterminal symbol and terminal symbol. + * Rules function as mapping from nonterminal symbol on the left hand side to set of either terminal symbols or doublets of terminal symbol and nonterminal symbol. */ ext::map < SymbolType, ext::set < ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > > > rules; @@ -111,7 +111,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> Ba or A -> a, where A, B \in N and a \in T. + * \details The rule is in a form of A -> aB or A -> a, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -135,7 +135,7 @@ public: /** * \brief Add a new rule of a grammar. * - * \details The rule is in a form of A -> Ba, where A, B \in N and a \in T. + * \details The rule is in a form of A -> aB, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -147,7 +147,7 @@ public: /** * \brief Add new rules of a grammar. * - * \details The rules are in form of A -> Ba | Cb | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T. + * \details The rules are in form of A -> aB | bC | ... | a | b | ..., where A, B, C ... \in N and a, b ... \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide a set of right hand sides of the rule @@ -169,7 +169,7 @@ public: ext::map < SymbolType, ext::set < ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > > > && getRules ( ) &&; /** - * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T. + * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -189,7 +189,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const SymbolType & rightHandSide ); /** - * Remove a rule of a grammar in form of A -> Ba, where A, B \in N and a \in T. + * Remove a rule of a grammar in form of A -> aB, where A, B \in N and a \in T. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -199,7 +199,7 @@ public: bool removeRule ( const SymbolType & leftHandSide, const ext::pair < SymbolType, SymbolType > & rightHandSide ); /** - * Add a new rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. + * Add a new rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide represented as vector of symbols. * * \param leftHandSide the left hand side of the rule * \param rightHandSide the right hand side of the rule @@ -216,7 +216,7 @@ public: ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** - * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide + * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide * * \returns true if the rule was indeed removed, false othervise */