Om
consumer.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Language_Consumer_
16 
17  #define Om_Language_Consumer_ \
18  Om::Language::Consumer
19 
20 namespace Om {
21 
22  namespace Language {
23 
25  class Null;
26 
27  class Operand;
28 
29  class Operator;
30 
31  class Producer;
32 
33  class Reader;
34 
35  class Separator;
37 
42  class Consumer {
43 
44  public: // MARK: public (non-static)
45 
46  virtual ~Consumer() = 0;
47 
48  template<
49  typename TheOperator,
50  typename TheSeparator
51  >
52  void Parse(Reader &);
53 
54  virtual void ParseElements(Reader &) = 0;
55 
56  virtual void ParseQuotedElements(Reader &) = 0;
57 
62  void TakeElement(Null &);
63 
68  void TakeElement(Null const &);
69 
78  virtual void TakeElement(Operand &) = 0;
79 
84  virtual void TakeElement(Operand const &) = 0;
85 
90  virtual void TakeElement(Operator &) = 0;
91 
96  virtual void TakeElement(Operator const &) = 0;
97 
102  virtual void TakeElement(Separator &) = 0;
103 
108  virtual void TakeElement(Separator const &) = 0;
109 
114  virtual void TakeElements(Producer &) = 0;
115 
120  virtual void TakeElements(Producer const &) = 0;
121 
126  virtual void TakeQuotedElements(Producer &) = 0;
127 
132  virtual void TakeQuotedElements(Producer const &) = 0;
133 
134  private: // MARK: private (non-static)
135 
136  Consumer & operator =(Consumer const &);
137 
138  };
139 
140  }
141 
142 }
143 
144  #include "om/language/consumer.cpp"
145 
146 #endif
Om::Language::Consumer::Parse
void Parse(Reader &)
Om::Language::Separator
The Separator implementation.
Definition: separator.hpp:52
Om::Language::Producer
An Element giver; gives from the front.
Definition: producer.hpp:40
Om::Language::Operator
The Operator implementation.
Definition: operator.hpp:59
consumer.cpp
Om source file.
Om::Language::Consumer
An Element taker; takes at the back.
Definition: consumer.hpp:42
Om::Language::Consumer::~Consumer
virtual ~Consumer()=0
Om::Language::Consumer::TakeElements
virtual void TakeElements(Producer &)=0
Takes each Element of the argument.
Om::Language::Consumer::ParseQuotedElements
virtual void ParseQuotedElements(Reader &)=0
Om::Language::Reader
Produces each CodePoint until the end of the Source.
Definition: reader.hpp:33
Om::Language::Consumer::TakeQuotedElements
virtual void TakeQuotedElements(Producer &)=0
Constructs and takes an Operand, which takes each Element from the argument Producer.
Om::Language::Operand
The Operand implementation.
Definition: operand.hpp:55
Om
The Om library.
Definition: code_point.hpp:26
Om::Language::Consumer::TakeElement
void TakeElement(Null &)
Takes a Null Element, which is disregarded.
Om::Language::Consumer::operator=
Consumer & operator=(Consumer const &)
Om::Language::Null
The Null Element implementation.
Definition: null.hpp:53
Om::Language::Consumer::ParseElements
virtual void ParseElements(Reader &)=0