From c0e3638bcc1c3ee518ce082b05436bfebb54a95b Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Mon, 14 Jul 2014 19:46:49 +0200
Subject: [PATCH] fix doc comments

---
 alib2/src/grammar/ContextFree/GNF.h | 2 +-
 alib2/src/grammar/ContextFree/LG.h  | 2 +-
 alib2/src/grammar/Regular/LeftLG.h  | 2 +-
 alib2/src/grammar/Regular/LeftRG.h  | 2 +-
 alib2/src/grammar/Regular/RightLG.h | 2 +-
 alib2/src/grammar/Regular/RightRG.h | 7 ++++++-
 6 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/alib2/src/grammar/ContextFree/GNF.h b/alib2/src/grammar/ContextFree/GNF.h
index c336fed2a0..0ee796328c 100644
--- a/alib2/src/grammar/ContextFree/GNF.h
+++ b/alib2/src/grammar/ContextFree/GNF.h
@@ -15,7 +15,7 @@
 namespace grammar {
 
 /**
- * Context free grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
+ * Context free grammar in greibach normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
  */
 class GNF : public std::element<GNF, GrammarBase>, public TerminalNonterminalAlphabetInitialSymbol {
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules;
diff --git a/alib2/src/grammar/ContextFree/LG.h b/alib2/src/grammar/ContextFree/LG.h
index 0394114760..f957ec1a11 100644
--- a/alib2/src/grammar/ContextFree/LG.h
+++ b/alib2/src/grammar/ContextFree/LG.h
@@ -15,7 +15,7 @@
 namespace grammar {
 
 /**
- * Context free grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
+ * Linear grammar. Type 2 in Chomsky hierarchy. Produces context free languages.
  */
 class LG : public std::element<LG, GrammarBase>, public TerminalNonterminalAlphabetInitialSymbol {
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules;
diff --git a/alib2/src/grammar/Regular/LeftLG.h b/alib2/src/grammar/Regular/LeftLG.h
index 47a30c2517..807756dd64 100644
--- a/alib2/src/grammar/Regular/LeftLG.h
+++ b/alib2/src/grammar/Regular/LeftLG.h
@@ -15,7 +15,7 @@
 namespace grammar {
 
 /**
- * Context free grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
+ * Left linear grammar in chomsky normal form. Type 3 in Chomsky hierarchy. Produces regular languages.
  */
 class LeftLG : public std::element<LeftLG, GrammarBase>, public TerminalNonterminalAlphabetInitialSymbol {
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules;
diff --git a/alib2/src/grammar/Regular/LeftRG.h b/alib2/src/grammar/Regular/LeftRG.h
index 1a1591d5ea..b5f180483c 100644
--- a/alib2/src/grammar/Regular/LeftRG.h
+++ b/alib2/src/grammar/Regular/LeftRG.h
@@ -15,7 +15,7 @@
 namespace grammar {
 
 /**
- * Context free grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
+ * Left regular grammar in chomsky normal form. Type 3 in Chomsky hierarchy. Produces regular languages.
  */
 class LeftRG : public std::element<LeftRG, GrammarBase>, public TerminalNonterminalAlphabetInitialSymbol {
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules;
diff --git a/alib2/src/grammar/Regular/RightLG.h b/alib2/src/grammar/Regular/RightLG.h
index 3684031378..e4ed7f764b 100644
--- a/alib2/src/grammar/Regular/RightLG.h
+++ b/alib2/src/grammar/Regular/RightLG.h
@@ -15,7 +15,7 @@
 namespace grammar {
 
 /**
- * Context free grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
+ * Right linear grammar in chomsky normal form. Type 3 in Chomsky hierarchy. Produces regular languages.
  */
 class RightLG : public std::element<RightLG, GrammarBase>, public TerminalNonterminalAlphabetInitialSymbol {
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules;
diff --git a/alib2/src/grammar/Regular/RightRG.h b/alib2/src/grammar/Regular/RightRG.h
index 73648b49fb..c4f6bb5422 100644
--- a/alib2/src/grammar/Regular/RightRG.h
+++ b/alib2/src/grammar/Regular/RightRG.h
@@ -15,7 +15,12 @@
 namespace grammar {
 
 /**
- * Context free grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces context free languages.
+ * Right regular grammar in chomsky normal form. Type 2 in Chomsky hierarchy. Produces regular languages.
+ * G = (N, T, P, S)
+ * N = nonempty finite set of nonterminal symbols
+ * T = finite set of terminal symbols - having this empty wont allow much though
+ * P = set of production rules of the form A -> aB or A -> a (where A, B \in N and a \in T) or S -> \varepsilon (when S is not on the right hand side of any rule)
+ * S = initial nonterminal symbol
  */
 class RightRG : public std::element<RightRG, GrammarBase>, public TerminalNonterminalAlphabetInitialSymbol {
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules;
-- 
GitLab