15 #ifndef Om_Language_Environment_
24 Om::Language::Environment
28 inline Type_::Environment():
29 thisTranslatorVector() {}
31 inline void Type_::GiveElements(Consumer & theConsumer)
const {
35 typedef TranslatorVector::const_iterator Iterator;
36 Iterator
const theEnd = this->thisTranslatorVector.end();
38 Iterator theCurrent = this->thisTranslatorVector.begin();
40 theConsumer.TakeElement(
41 Separator::GetLineSeparator()
45 Translator
const & theTranslator = **theCurrent;
47 !theTranslator.IsEmpty()
49 theTranslator.GiveElements(theConsumer);
50 if (theEnd == ++theCurrent) {
57 inline bool Type_::IsEmpty()
const {
58 return this->thisTranslatorVector.empty();
61 inline void Type_::Push(Translator
const & theTranslator) {
62 Translator
const * theTranslatorPointer = &theTranslator;
64 std::stack<Translator const *> theStack;
68 assert(theTranslatorPointer);
71 Environment
const *
const theEnvironment =
dynamic_cast<Environment
const *
>(theTranslatorPointer)
73 typedef TranslatorVector::const_reverse_iterator Iterator;
74 Iterator
const theEnd = theEnvironment->thisTranslatorVector.rend();
76 Iterator theCurrent = theEnvironment->thisTranslatorVector.rbegin();
82 !(*theCurrent)->IsEmpty()
84 theStack.push(*theCurrent);
88 this->thisTranslatorVector.back() != theTranslatorPointer
90 this->thisTranslatorVector.push_back(theTranslatorPointer);
99 theTranslatorPointer = theStack.top();
103 inline bool Type_::Translate(
104 Evaluation & theEvaluation,
105 Operator
const & theOperator
107 typedef TranslatorVector::const_reverse_iterator Iterator;
108 Iterator
const theEnd = this->thisTranslatorVector.rend();
110 Iterator theCurrent = this->thisTranslatorVector.rbegin();
111 theEnd != theCurrent;
115 (*theCurrent)->Translate(