15 #ifndef Om_Language_Operation_FindOperation_
21 #ifndef Om_Macro_Precompilation_
23 #include "boost/test/unit_test.hpp"
33 BOOST_AUTO_TEST_SUITE(FindOperationTest)
35 BOOST_AUTO_TEST_CASE(DefinitionTest) {
42 BOOST_AUTO_TEST_CASE(SimpleTest) {
60 System::Get().Evaluate(
"find {a}lexicon{b{B} a{A}}")
123 BOOST_AUTO_TEST_SUITE_END()
137 #ifndef Om_Macro_Precompilation_
139 #include "boost/utility/in_place_factory.hpp"
146 Om::Language::Operation::FindOperation
150 inline char const * Type_::GetName() {
154 template <
typename TheFindOperation>
155 inline void Type_::GiveElements(
156 TheFindOperation & theFindOperation,
157 Consumer & theConsumer
159 theConsumer.TakeElement(
162 if (theFindOperation.thisOperator) {
163 theConsumer.TakeQuotedElements(*theFindOperation.thisOperator);
169 inline Type_::FindOperation():
172 template <
typename TheOperand>
173 inline bool Type_::TakeOperand(
174 Evaluation & theEvaluation,
175 TheOperand & theOperand
178 !theOperand.IsEmpty()
180 return this->TakeQuotedProducer(
182 *theOperand.GetProgram()
186 template <
typename TheProducer>
187 inline bool Type_::TakeQuotedProducer(
188 Evaluation & theEvaluation,
189 TheProducer & theProducer
191 if (this->thisOperator) {
193 theLexicon.TakeElements(theProducer);
195 Expression theExpression;
196 theLexicon.Find(*this->thisOperator).GiveElements(theExpression);
198 theEvaluation.TakeQuotedProducer(theExpression);
199 theEvaluation.TakeQuotedProducer(theLexicon);
202 this->thisOperator = boost::in_place();
203 assert(this->thisOperator);
204 this->thisOperator->TakeElements(theProducer);
#define Om_Language_Operation_FindOperation_GetName_()