From 823026b58211a4166de06ac243d978dcb9930271 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 22 Jan 2024 15:58:08 +0300 Subject: Turn odb repository into muti-package repository Also remove the autoconf/make-based build system. --- odb/semantics/unit.hxx | 183 ------------------------------------------------- 1 file changed, 183 deletions(-) delete mode 100644 odb/semantics/unit.hxx (limited to 'odb/semantics/unit.hxx') diff --git a/odb/semantics/unit.hxx b/odb/semantics/unit.hxx deleted file mode 100644 index cfccbff..0000000 --- a/odb/semantics/unit.hxx +++ /dev/null @@ -1,183 +0,0 @@ -// file : odb/semantics/unit.hxx -// license : GNU GPL v3; see accompanying LICENSE file - -#ifndef ODB_SEMANTICS_UNIT_HXX -#define ODB_SEMANTICS_UNIT_HXX - -#include - -#include -#include - -namespace semantics -{ - class unit: public graph, public namespace_ - { - public: - unit (path const&); - - private: - unit (unit const&); - unit& operator= (unit const&); - - // Mapping from tree nodes to semantic graph nodes. - // - public: - node* - find (tree key) const - { - tree_node_map::const_iterator i (tree_node_map_.find (key)); - return i != tree_node_map_.end () ? i->second : 0; - } - - void - insert (tree key, node& value) - { - tree_node_map_[key] = &value; - } - - using namespace_::find; - - // Mapping from tree nodes to name hints. - // - public: - names* - find_hint (tree key) const - { - name_hint_map::const_iterator i (name_hint_map_.find (key)); - return i != name_hint_map_.end () ? i->second : 0; - } - - void - insert_hint (tree key, names& name) - { - name_hint_map_[key] = &name; - } - - public: - template - T& - new_node (path const& file, size_t line, size_t column) - { - T& r (graph_.new_node (file, line, column)); - r.unit (*this); - return r; - } - - template - T& - new_node (path const& file, size_t line, size_t column, A0 const& a0) - { - T& r (graph_.new_node (file, line, column, a0)); - r.unit (*this); - return r; - } - - template - T& - new_node (path const& file, size_t line, size_t column, - A0 const& a0, A1 const& a1) - { - T& r (graph_.new_node (file, line, column, a0, a1)); - r.unit (*this); - return r; - } - - template - T& - new_node (path const& file, size_t line, size_t column, - A0 const& a0, A1 const& a1, A2 const& a2) - { - T& r (graph_.new_node (file, line, column, a0, a1, a2)); - r.unit (*this); - return r; - } - - template - T& - new_node (path const& file, size_t line, size_t column, - A0 const& a0, A1 const& a1, A2 const& a2, A3 const& a3) - { - T& r (graph_.new_node (file, line, column, a0, a1, a2, a3)); - r.unit (*this); - return r; - } - - template - T& - new_node (path const& file, size_t line, size_t column, - A0 const& a0, A1 const& a1, A2 const& a2, A3 const& a3, - A4 const& a4) - { - T& r (graph_.new_node (file, line, column, a0, a1, a2, a3, a4)); - r.unit (*this); - return r; - } - - // For fundamental types. - // - template - T& - new_fund_node (tree tn) - { - T& r (graph_.new_node (tn)); - r.unit (*this); - return r; - } - - protected: - // Special names edge for the global namespace. - // - class global_names: public names - { - public: - global_names () - : names ("") - { - scope_ = 0; - } - - void - set_left_node (unit&) - { - } - - void - set_right_node (nameable& n) - { - named_ = &n; - } - - void - clear_left_node (unit&) - { - } - - void - clear_right_node (nameable& n) - { - assert (named_ == &n); - named_ = 0; - } - }; - - public: - void - add_edge_left (global_names&) - { - } - - using namespace_::add_edge_right; - - private: - graph& graph_; - - typedef std::map tree_node_map; - tree_node_map tree_node_map_; - - typedef std::map name_hint_map; - name_hint_map name_hint_map_; - }; -} - -#endif // ODB_SEMANTICS_UNIT_HXX -- cgit v1.1