[r1]: trunk / Soul / Soul.Parsing / ParsingDomain.cpp Maximize Restore History

Download this file

ParsingDomain.cpp    34 lines (26 with data), 961 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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