Om
system.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Language_System_
16 
17  #define Om_Language_System_ \
18  Om::Language::System
19 
21 
22  #ifndef Om_Macro_Precompilation_
23 
24  #include <map>
25 
26  #endif
27 
28 namespace Om {
29 
30  namespace Language {
31 
33  class Evaluation;
34 
35  class Lexicon;
36 
37  class Operator;
39 
40  // MARK: - Om::Language::System
41 
48  class System:
49  public Translator {
50 
51  public: // MARK: public (static)
52 
53  template <typename ThisOperation>
54  class Definition;
55 
60  static System & Get();
61 
62  public: // MARK: public (non-static)
63 
68  Lexicon const & GetLexicon() const;
69 
70  virtual void GiveElements(Consumer &) const;
71 
80  void Initialize(
81  char const theLocaleCodeUnitIterator[]
82  );
83 
84  virtual bool IsEmpty() const;
85 
92  virtual bool Translate(
93  Evaluation &,
94  Operator const &
95  ) const;
96 
97  private: // MARK: private (static)
98 
103  typedef std::map<
104  std::string,
105  void (*)(Evaluation &)
106  > Map;
107 
108  private: // MARK: private (non-static)
109 
110  System();
111 
112  System(System const &);
113 
114  System const & operator =(System const &);
115 
117 
118  };
119 
120  // MARK: - Om::Language::System::Definition
121 
128  template <typename ThisOperation>
129  class System::Definition {
130 
131  public: // MARK: public (non-static)
132 
139  Definition();
140 
141  };
142 
143  }
144 
145 }
146 
147  #include "om/language/system.cpp"
148 
149 #endif
virtual bool IsEmpty() const
Translates an Operator to an Operation.
Definition: system.hpp:48
Definition()
Inserts the Operation into the System.
System const & operator=(System const &)
The Om library.
Definition: code_point.hpp:26
Om source file.
std::map< std::string, void(*)(Evaluation &) > Map
Maps the name to a function that gives the Operation with this name to the Evaluation.
Definition: system.hpp:106
An Element taker; takes at the back.
Definition: consumer.hpp:42
The current evaluation.
Definition: evaluation.hpp:42
Lexicon const & GetLexicon() const
An inserter of an Operation into the static System instance.
Definition: system.hpp:54
virtual void GiveElements(Consumer &) const
void Initialize(char const theLocaleCodeUnitIterator[])
Initializes the System.
The Lexicon Program implementation.
Definition: lexicon.hpp:65
static System & Get()
Om header file.
An Operator lookup for use by an Evaluator.
Definition: translator.hpp:62
The Operator implementation.
Definition: operator.hpp:59
virtual bool Translate(Evaluation &, Operator const &) const
If there is an Operation mapped to the Operator, its implementation is given to the Evaluation.