summaryrefslogtreecommitdiff
path: root/cli/semantics/option.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-08 14:51:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-27 11:38:53 +0300
commit720c5a33b6a49cf328fdd7611f49153cf8f60247 (patch)
tree9725f3d1f42ec90fde84520f49647edea013ce5e /cli/semantics/option.hxx
parent3183f3bb927a90783ae0aeaf190a0919377aabe4 (diff)
Separate tests and examples into individual packages
Also make cli module to be explicitly enabled via the config.cli configuration variable.
Diffstat (limited to 'cli/semantics/option.hxx')
-rw-r--r--cli/semantics/option.hxx189
1 files changed, 0 insertions, 189 deletions
diff --git a/cli/semantics/option.hxx b/cli/semantics/option.hxx
deleted file mode 100644
index a9bb963..0000000
--- a/cli/semantics/option.hxx
+++ /dev/null
@@ -1,189 +0,0 @@
-// file : cli/semantics/option.hxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// license : MIT; see accompanying LICENSE file
-
-#ifndef CLI_SEMANTICS_OPTION_HXX
-#define CLI_SEMANTICS_OPTION_HXX
-
-#include <cli/semantics/elements.hxx>
-
-namespace semantics
-{
- //
- //
- class option;
-
- //
- //
- class belongs: public edge
- {
- public:
- typedef semantics::type type_type;
- typedef semantics::option option_type;
-
- option_type&
- option () const
- {
- return *option_;
- }
-
- type_type&
- type () const
- {
- return *type_;
- }
-
- public:
- void
- set_left_node (option_type& n)
- {
- option_ = &n;
- }
-
- void
- set_right_node (type_type& n)
- {
- type_ = &n;
- }
-
- private:
- option_type* option_;
- type_type* type_;
- };
-
- //
- //
- class expression;
-
- //
- //
- class initialized: public edge
- {
- public:
- typedef semantics::option option_type;
- typedef semantics::expression expression_type;
-
- option_type&
- option () const
- {
- return *option_;
- }
-
- expression_type&
- expression () const
- {
- return *expression_;
- }
-
- public:
- void
- set_left_node (option_type& n)
- {
- option_ = &n;
- }
-
- void
- set_right_node (expression_type& n)
- {
- expression_ = &n;
- }
-
- private:
- option_type* option_;
- expression_type* expression_;
- };
-
- //
- //
- class option: public nameable
- {
- public:
- typedef semantics::belongs belongs_type;
- typedef semantics::type type_type;
-
- belongs_type&
- belongs () const
- {
- return *belongs_;
- }
-
- type_type&
- type () const
- {
- return belongs_->type ();
- }
-
- public:
- typedef semantics::initialized initialized_type;
-
- bool
- initialized_p () const
- {
- return initialized_ != 0;
- }
-
- initialized_type&
- initialized () const
- {
- return *initialized_;
- }
-
- expression&
- initializer () const
- {
- return initialized_->expression ();
- }
-
- public:
- typedef doc_strings::const_iterator doc_iterator;
-
- doc_iterator
- doc_begin () const
- {
- return doc_.begin ();
- }
-
- doc_iterator
- doc_end () const
- {
- return doc_.end ();
- }
-
- doc_strings const&
- doc () const
- {
- return doc_;
- }
-
- doc_strings&
- doc ()
- {
- return doc_;
- }
-
- public:
- option (path const& file, size_t line, size_t column)
- : node (file, line, column), initialized_ (0)
- {
- }
-
- void
- add_edge_left (belongs_type& e)
- {
- belongs_ = &e;
- }
-
- void
- add_edge_left (initialized_type& e)
- {
- initialized_ = &e;
- }
-
- private:
- belongs_type* belongs_;
- initialized_type* initialized_;
- doc_strings doc_;
- };
-}
-
-#endif // CLI_SEMANTICS_OPTION_HXX