15 #ifndef Om_Language_Operand_
31 inline char const * Type_::GetName() {
37 inline Type_::Operand():
40 template <
typename TheProgram>
41 inline Type_::Operand(
42 std::auto_ptr<TheProgram> theProgram
44 thisProgram(theProgram) {}
46 inline Type_ & Type_::operator =(Operand theOperand) {
47 this->Swap(theOperand);
53 this->thisProgram.IsEmpty() ?
61 this->thisProgram.IsEmpty() ?
67 inline void Type_::Clear() {
68 this->thisProgram.
Clear();
71 inline bool Type_::Equals(Operand
const & theOperand)
const {
74 theOperand.IsEmpty() :
75 *this->GetProgram() == *theOperand.GetProgram()
80 return this->thisProgram.GetValue();
84 return this->thisProgram.GetValue();
87 inline bool Type_::IsEmpty()
const {
88 return !this->thisProgram;
91 inline void Type_::ParseElements(Reader & theReader) {
104 switch (*theReader) {
113 Reader theOperandReader(theCodePointSource);
114 this->ParseQuotedElements(theOperandReader);
133 inline void Type_::ParseQuotedElements(Reader & theReader) {
135 theLiteral.ParseElements(theReader);
136 this->TakeQuotedProducer(theLiteral);
139 template <
typename TheProgram>
140 inline void Type_::SetProgram(
141 std::auto_ptr<TheProgram> theProgram
143 this->thisProgram.SetValue(theProgram);
146 inline void Type_::Swap(Operand & theOperand) {
147 this->thisProgram.Swap(theOperand.thisProgram);
150 inline void Type_::TakeElements(Producer & theProducer) {
158 inline void Type_::TakeElements(Producer
const & theProducer) {
166 template <
typename TheOperand>
167 inline void Type_::TakeOperand(TheOperand & theOperand) {
171 this->Take(theOperand);
175 template <
typename TheOperator>
176 inline void Type_::TakeOperator(TheOperator &) {}
178 template <
typename TheProducer>
179 inline void Type_::TakeQuotedProducer(TheProducer & theProducer) {
184 theProducer.GiveProgram()
189 template <
typename TheSeparator>
190 inline void Type_::TakeSeparator(TheSeparator &) {}
195 Type_
const & theFirst,
196 Type_
const & theSecond
198 return theFirst.Equals(theSecond);
202 Type_
const & theFirst,
203 Type_
const & theSecond
205 return !theFirst.Equals(theSecond);
215 theFirst.Swap(theSecond);
virtual void TakeElements(Producer &)
Takes each Element of the argument.
The Program implementation.
Any object that items can be pulled from.
bool operator!=(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
bool operator==(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
void swap(Om::Language::Expression &, Om::Language::Expression &)
#define Om_Language_Operand_GetName_()