Om
operand.hpp
Go to the documentation of this file.
1 
26 #ifndef Om_Language_Operand_
27 
28  #define Om_Language_Operand_ \
29  Om::Language::Operand
30 
32  #include "om/owner.hpp"
33 
34  #ifndef Om_Macro_Precompilation_
35 
36  #include "boost/swap.hpp"
37 
38  #endif
39 
40  #define Om_Language_Operand_GetName_() \
41  "operand"
42 
43 namespace Om {
44 
45  namespace Language {
46 
47  // MARK: - Om::Language::Operand
48 
55  class Operand:
56  public DefaultElement<Operand> {
57 
58  public: // MARK: public (static)
59 
60  static char const * GetName();
61 
62  public: // MARK: public (non-static)
63 
65 
66  template <typename TheProgram>
67  explicit Operand(
68  std::auto_ptr<TheProgram>
69  );
70 
72 
77  virtual Program & operator *();
78 
82  virtual Program const & operator *() const;
83 
84  virtual void Clear();
85 
87 
88  bool Equals(Operand const &) const;
89 
95 
99  Program const * GetProgram() const;
100 
105  virtual bool IsEmpty() const;
106 
107  virtual void ParseElements(Reader &);
108 
109  virtual void ParseQuotedElements(Reader &);
110 
115  template <typename TheProgram>
117  std::auto_ptr<TheProgram>
118  );
119 
120  void Swap(Operand &);
121 
122  virtual void TakeElements(Producer &);
123 
124  virtual void TakeElements(Producer const &);
125 
126  template <typename TheOperand>
127  void TakeOperand(TheOperand &);
128 
129  template <typename TheOperator>
130  void TakeOperator(TheOperator &);
131 
132  template <typename TheProducer>
133  void TakeQuotedProducer(TheProducer &);
134 
135  template <typename TheSeparator>
136  void TakeSeparator(TheSeparator &);
137 
138  private: // MARK: private (non-static)
139 
141 
142  };
143 
144  // MARK: - Om::Language::
145 
147  Operand const &,
148  Operand const &
149  );
150 
152  Operand const &,
153  Operand const &
154  );
155 
156  }
157 
158 }
159 
160 namespace boost {
161 
162  // MARK: - boost::
163 
164  template <>
165  void swap(
168  );
169 
170 }
171 
172  #include "om/language/operand.cpp"
173 
174 #endif
A partial implementation of Element.
The Operand implementation.
Definition: operand.hpp:56
virtual void Clear()
bool Equals(Operand const &) const
void SetProgram(std::auto_ptr< TheProgram >)
Replaces the Program owned by this Operand with the argument.
virtual bool IsEmpty() const
void TakeOperator(TheOperator &)
Operand & operator=(Operand)
static char const * GetName()
Operand(std::auto_ptr< TheProgram >)
virtual void TakeElements(Producer &)
Takes each Element of the argument.
Program * GetProgram()
void TakeSeparator(TheSeparator &)
Program const * GetProgram() const
void TakeQuotedProducer(TheProducer &)
Owner< Program > thisProgram
Definition: operand.hpp:140
virtual Program & operator*()
virtual void TakeElements(Producer const &)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void ParseElements(Reader &)
void TakeOperand(TheOperand &)
void Swap(Operand &)
virtual void ParseQuotedElements(Reader &)
An Element giver; gives from the front.
Definition: producer.hpp:40
The Program implementation.
Definition: program.hpp:62
Produces each CodePoint until the end of the Source.
Definition: reader.hpp:37
A polymorphic object with value semantics.
Definition: owner.hpp:43
Om header file.
bool operator!=(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
bool operator==(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
The Om library.
Definition: code_point.hpp:26
void swap(Om::Language::Expression &, Om::Language::Expression &)
Om source file.
Om header file.