Diff of /trunk/Soul/Soul.Parsing/ParsingDomain.cpp [000000] .. [r1]  Maximize  Restore

Switch to side-by-side view

--- a
+++ b/trunk/Soul/Soul.Parsing/ParsingDomain.cpp
@@ -0,0 +1,33 @@
+/*========================================================================
+    Copyright (c) 2011 Seppo Laakko
+    http://sourceforge.net/projects/soulparsing/
+ 
+    Distributed under the GNU General Public License, version 3 (GPLv3).
+    (See accompanying LICENSE.txt or http://www.gnu.org/licenses/gpl.html)
+
+========================================================================*/
+
+#include <Soul.Parsing/ParsingDomain.hpp>
+
+namespace Soul { namespace Parsing {
+
+GrammarPtr ParsingDomain::GetGrammar(const String& grammarName)
+{
+    GrammarMapIt i = grammarMap.find(grammarName);
+    if (i != grammarMap.end())
+    {
+        return i->second;
+    }
+    return GrammarPtr();
+}
+
+void ParsingDomain::AddGrammar(const GrammarPtr& grammar)
+{
+    GrammarMapIt i = grammarMap.find(grammar->FullName());
+    if (i == grammarMap.end())
+    {
+        grammarMap[grammar->FullName()] = grammar;
+    }
+}
+
+} } // namespace Soul.Parsing

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks