From 64ff415ed33a733f9a297b1526403bfb8f391c63 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 23 Mar 2010 12:34:58 +0200 Subject: Semantic graph and parsing code Currently covers/handles namespace, class definitions (including bases and data members), and typedefs in namespace-scopes. --- odb/semantics/class.cxx | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 odb/semantics/class.cxx (limited to 'odb/semantics/class.cxx') diff --git a/odb/semantics/class.cxx b/odb/semantics/class.cxx new file mode 100644 index 0000000..5575745 --- /dev/null +++ b/odb/semantics/class.cxx @@ -0,0 +1,49 @@ +// file : odb/semantics/class.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +#include + +namespace semantics +{ + // type info + // + namespace + { + struct init + { + init () + { + using compiler::type_info; + + // data_member + // + { + type_info ti (typeid (data_member)); + ti.add_base (typeid (nameable)); + ti.add_base (typeid (instance)); + insert (ti); + } + + // inherits + // + { + type_info ti (typeid (inherits)); + ti.add_base (typeid (edge)); + insert (ti); + } + + // class_ + // + { + type_info ti (typeid (class_)); + ti.add_base (typeid (scope)); + insert (ti); + } + } + } init_; + } +} -- cgit v1.1