15 #ifndef Om_Language_System_
24 #ifndef Om_Macro_Precompilation_
26 #include "boost/locale/generator.hpp"
27 #include "boost/locale/info.hpp"
38 inline Type_ & Type_::Get() {
39 static System theSystem;
46 static Lexicon theLexicon;
50 this->GiveElements(theLexicon);
55 inline void Type_::GiveElements(Consumer & theConsumer)
const {
59 Map::const_iterator
const theEnd = this->thisMap.end();
61 Map::const_iterator theCurrent = this->thisMap.begin();
63 theConsumer.TakeElement(
64 Separator::GetLineSeparator()
67 assert(theEnd != theCurrent);
68 Operator theOperator(theCurrent->first);
69 theConsumer.TakeElement(theOperator);
70 if (theEnd == ++theCurrent) {
77 inline void Type_::Initialize(
78 char const theLocaleCodeUnitIterator[]
82 boost::locale::generator theGenerator;
83 theGenerator.characters(boost::locale::char_facet);
85 theGenerator(theLocaleCodeUnitIterator)
88 std::use_facet<boost::locale::info>(
97 Map::const_iterator
const theEnd = this->thisMap.end();
99 Map::const_iterator theCurrent = this->thisMap.begin();
100 theEnd != theCurrent;
104 boost::locale::normalize(
106 boost::locale::norm_nfd
107 ) == theCurrent->first
114 inline bool Type_::IsEmpty()
const {
115 return this->thisMap.empty();
118 inline bool Type_::Translate(
119 Evaluation & theEvaluation,
120 Operator
const & theOperator
122 Map::const_iterator theIterator(
124 theOperator.GetString()
128 this->thisMap.end() == theIterator
132 assert(theIterator->second);
133 (*theIterator->second)(theEvaluation);
139 inline Type_::System():
147 template <typename ThisOperation>
150 Om::Language::System::Definition<ThisOperation>
155 inline Type_::Definition() {
156 System::Get().thisMap[
157 ThisOperation::GetName()
The Lexicon Program implementation.
std::auto_ptr< TheGiveable > Give(TheGiveable &)
Calls Move on the object.