Om
operator.hpp
Go to the documentation of this file.
1 
26 #ifndef Om_Language_Operator_
27 
28  #define Om_Language_Operator_ \
29  Om::Language::Operator
30 
35 
36  #ifndef Om_Macro_Precompilation_
37 
38  #include "boost/locale/boundary.hpp"
39 
40  #endif
41 
42  #define Om_Language_Operator_GetName_() \
43  "operator"
44 
45 namespace Om {
46 
47  namespace Language {
48 
49  // MARK: - Om::Language::Operator
50 
59  class Operator:
60  public DefaultAtom<Operator> {
61 
62  public: // MARK: public (static)
63 
64  static char const * GetName();
65 
66  public: // MARK: public (non-static)
67 
68  Operator();
69 
74  explicit Operator(std::string const &);
75 
80  explicit Operator(
81  char const theCodeUnitIterator[]
82  );
83 
84  explicit Operator(
86  );
87 
88  explicit Operator(Symbol::OperandSymbol const);
89 
90  explicit Operator(Symbol::OperatorSymbol const);
91 
92  explicit Operator(Symbol::SeparatorSymbol const);
93 
95 
100  void BackGiveCodePoint(Consumer &);
101 
106  template <boost::locale::boundary::boundary_type theSegment>
107  void BackGiveSegment(Consumer &);
108 
113  template <typename TheConsumer>
114  void Decode(TheConsumer &) const;
115 
120  template <typename TheProducer>
121  void Encode(TheProducer &);
122 
128 
133  template <boost::locale::boundary::boundary_type theSegment>
134  void FrontGiveSegment(Consumer &);
135 
140  void Normalize();
141 
142  virtual void ParseElements(Reader &);
143 
144  virtual void ParseQuotedElements(Reader &);
145 
146  template <typename TheOperand>
147  void TakeOperand(TheOperand &);
148 
149  template <typename TheOperator>
150  void TakeOperator(TheOperator &);
151 
152  template <typename TheProducer>
153  void TakeQuotedProducer(TheProducer &);
154 
155  template <typename TheSeparator>
156  void TakeSeparator(TheSeparator &);
157 
158  };
159 
160  }
161 
162 }
163 
164 namespace boost {
165 
166  // MARK: - boost::
167 
168  template <>
169  void swap(
172  );
173 
174 }
175 
176  #include "om/language/operator.cpp"
177 
178 #endif
Om::Language::Symbol::OperatorSymbol
OperatorSymbol
An Operator symbol.
Definition: operator_symbol.hpp:48
Om::Language::Operator::BackGiveSegment
void BackGiveSegment(Consumer &)
Gives the last segment of the given type to the Consumer.
Om::Language::Operator::TakeOperand
void TakeOperand(TheOperand &)
separator_symbol.hpp
Om header file.
Om::Language::DefaultAtom
A partial implementation of Atom.
Definition: default_atom.hpp:42
Om::Language::Operator::TakeSeparator
void TakeSeparator(TheSeparator &)
Om::Language::Operator::BackGiveCodePoint
void BackGiveCodePoint(Consumer &)
Gives the last CodePoint as an Atom.
default_atom.hpp
Om header file.
Om::Language::Operator
The Operator implementation.
Definition: operator.hpp:59
Om::Language::Operator::operator=
Operator & operator=(Operator)
Om::Language::Operator::Encode
void Encode(TheProducer &)
Encodes the elements and replaces the contents of this Operator with the result.
Om::Language::Operator::FrontGiveCodePoint
void FrontGiveCodePoint(Consumer &)
Gives the first CodePoint as an Atom.
boost
Definition: expression.hpp:281
Om::Language::Operator::TakeQuotedProducer
void TakeQuotedProducer(TheProducer &)
Om::Language::Symbol::OperandSymbol
OperandSymbol
An Operand symbol.
Definition: operand_symbol.hpp:72
operand_symbol.hpp
Om header file.
Om::Language::Consumer
An Element taker; takes at the back.
Definition: consumer.hpp:42
operator.cpp
Om source file.
Om::Language::Operator::TakeOperator
void TakeOperator(TheOperator &)
Om::Language::Symbol::SeparatorSymbol
SeparatorSymbol
A Separator symbol.
Definition: separator_symbol.hpp:89
Om::Language::Reader
Produces each CodePoint until the end of the Source.
Definition: reader.hpp:33
Om::Language::Operator::ParseQuotedElements
virtual void ParseQuotedElements(Reader &)
operator_symbol.hpp
Om header file.
Om::Language::Operator::ParseElements
virtual void ParseElements(Reader &)
Om::Language::Operator::FrontGiveSegment
void FrontGiveSegment(Consumer &)
Gives the first segment of the given type to the Consumer.
Om
The Om library.
Definition: code_point.hpp:26
Om::Language::Operator::Normalize
void Normalize()
Applies Unicode compatibility normalization.
Om::Source::Source
Any object that items can be pulled from.
Definition: source.hpp:31
boost::swap
void swap(Om::Language::Expression &, Om::Language::Expression &)
Om::Language::Operator::GetName
static const char * GetName()
Om::Language::Operator::Decode
void Decode(TheConsumer &) const
Decodes this Operator and gives each resulting Element to the argument.
Om::Language::Operator::Operator
Operator()