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 
69 
74  explicit Operator(std::string const &);
75 
80  explicit Operator(
81  char const theCodeUnitIterator[]
82  );
83 
84  explicit Operator(
86  );
87 
89 
91 
93 
95 
101 
106  template <boost::locale::boundary::boundary_type theSegment>
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>
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
An Element taker; takes at the back.
Definition: consumer.hpp:42
A partial implementation of Atom.
The Operator implementation.
Definition: operator.hpp:60
void Encode(TheProducer &)
Encodes the elements and replaces the contents of this Operator with the result.
void TakeQuotedProducer(TheProducer &)
void FrontGiveCodePoint(Consumer &)
Gives the first CodePoint as an Atom.
Operator(std::string const &)
Normalizes the string and copies directly into the Operator.
Operator(Symbol::OperatorSymbol const)
void TakeOperand(TheOperand &)
virtual void ParseQuotedElements(Reader &)
static char const * GetName()
void TakeSeparator(TheSeparator &)
Operator(Symbol::SeparatorSymbol const)
Operator(Om::Source::Source< CodePoint const > &)
Operator(char const theCodeUnitIterator[])
void FrontGiveSegment(Consumer &)
Gives the first segment of the given type to the Consumer.
Operator(Symbol::OperandSymbol const)
Operator & operator=(Operator)
void BackGiveSegment(Consumer &)
Gives the last segment of the given type to the Consumer.
void TakeOperator(TheOperator &)
void Decode(TheConsumer &) const
Decodes this Operator and gives each resulting Element to the argument.
virtual void ParseElements(Reader &)
void BackGiveCodePoint(Consumer &)
Gives the last CodePoint as an Atom.
void Normalize()
Applies Unicode compatibility normalization.
Produces each CodePoint until the end of the Source.
Definition: reader.hpp:37
Any object that items can be pulled from.
Definition: source.hpp:31
Om header file.
SeparatorSymbol
A Separator symbol.
OperatorSymbol
An Operator symbol.
OperandSymbol
An Operand symbol.
The Om library.
Definition: code_point.hpp:26
void swap(Om::Language::Expression &, Om::Language::Expression &)
Om header file.
Om source file.
Om header file.
Om header file.