Om
null.hpp
Go to the documentation of this file.
1 
26 #ifndef Om_Language_Null_
27 
28  #define Om_Language_Null_ \
29  Om::Language::Null
30 
31  #include "om/code_point.hpp"
33 
34  #ifndef Om_Macro_Precompilation_
35 
36  #include "boost/swap.hpp"
37 
38  #endif
39 
40  #define Om_Language_Null_GetName_() \
41  "null"
42 
43 namespace Om {
44 
45  namespace Language {
46 
47  // MARK: - Om::Language::Null
48 
53  class Null:
54  public DefaultElement<Null> {
55 
56  public: // MARK: public (static)
57 
62  static Null & Get();
63 
64  static char const * GetName();
65 
66  public: // MARK: public (non-static)
67 
68  Null();
69 
74  explicit Null(
76  );
77 
78  Null & operator =(Null const &);
79 
80  virtual Program & operator *();
81 
82  virtual Program const & operator *() const;
83 
84  virtual void Clear();
85 
86  virtual bool Equals(Element const &) const;
87 
88  virtual bool Equals(Program const &) const;
89 
90  virtual std::auto_ptr<
93 
94  virtual std::auto_ptr<
96  > GetElementRange() const;
97 
98  virtual void GiveElements(Consumer &);
99 
100  virtual void GiveElements(Consumer &) const;
101 
102  virtual bool IsEmpty() const;
103 
104  virtual bool Merge(Operator &);
105 
106  virtual bool Merge(Operator const &);
107 
108  virtual bool Merge(Separator &);
109 
110  virtual bool Merge(Separator const &);
111 
112  virtual void ParseElements(Reader &);
113 
114  virtual void ParseQuotedElements(Reader &);
115 
116  virtual void Swap(Null &);
117 
118  virtual void TakeElements(Producer &);
119 
120  virtual void TakeElements(Producer const &);
121 
122  template <typename TheOperand>
123  void TakeOperand(TheOperand &);
124 
125  template <typename TheOperator>
126  void TakeOperator(TheOperator &);
127 
128  template <typename TheProducer>
129  void TakeQuotedProducer(TheProducer &);
130 
131  template <typename TheSeparator>
132  void TakeSeparator(TheSeparator &);
133 
134  };
135 
136  }
137 
138 }
139 
140 namespace boost {
141 
142  // MARK: - boost::
143 
144  template <>
145  void swap(
148  );
149 
150 }
151 
152  #include "om/language/null.cpp"
153 
154 #endif
An Element taker; takes at the back.
Definition: consumer.hpp:42
A partial implementation of Element.
A Program that contains a single elemental item (or none, when IsEmpty() returns true).
Definition: element.hpp:33
The Null Element implementation.
Definition: null.hpp:54
virtual bool Merge(Operator const &)
virtual void Swap(Null &)
virtual std::auto_ptr< Om::Source::Source< Element > > GetElementRange()
virtual void GiveElements(Consumer &)
virtual bool Equals(Program const &) const
virtual void Clear()
virtual bool IsEmpty() const
virtual bool Equals(Element const &) const
virtual void TakeElements(Producer &)
Takes each Element of the argument.
void TakeOperand(TheOperand &)
virtual bool Merge(Separator const &)
virtual Program & operator*()
virtual bool Merge(Separator &)
void TakeSeparator(TheSeparator &)
virtual void ParseQuotedElements(Reader &)
virtual void TakeElements(Producer const &)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static Null & Get()
virtual bool Merge(Operator &)
virtual void ParseElements(Reader &)
static char const * GetName()
Null(Om::Source::Source< CodePoint const > &)
Swallows the next CodePoint in the Source.
void TakeOperator(TheOperator &)
virtual std::auto_ptr< Om::Source::Source< Element const > > GetElementRange() const
virtual void GiveElements(Consumer &) const
Null & operator=(Null const &)
void TakeQuotedProducer(TheProducer &)
The Operator implementation.
Definition: operator.hpp:60
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
The Separator implementation.
Definition: separator.hpp:53
Any object that items can be pulled from.
Definition: source.hpp:31
Om header file.
Om header file.
The Om library.
Definition: code_point.hpp:26
void swap(Om::Language::Expression &, Om::Language::Expression &)
Om source file.