From 4974b4763bd60eb875f93a71dbe2fe82ecfed9fc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 5 Sep 2009 16:29:23 +0200 Subject: Add semantic graph and traversal mechanism The parser now builds the semantic graph. --- cli/semantics/option.cxx | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cli/semantics/option.cxx (limited to 'cli/semantics/option.cxx') diff --git a/cli/semantics/option.cxx b/cli/semantics/option.cxx new file mode 100644 index 0000000..94b02a2 --- /dev/null +++ b/cli/semantics/option.cxx @@ -0,0 +1,48 @@ +// file : cli/semantics/option.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include + +#include + +namespace semantics +{ + // type info + // + namespace + { + struct init + { + init () + { + using compiler::type_info; + + // belongs + // + { + type_info ti (typeid (belongs)); + ti.add_base (typeid (edge)); + insert (ti); + } + + // initializes + // + { + type_info ti (typeid (initialized)); + ti.add_base (typeid (edge)); + insert (ti); + } + + // option + // + { + type_info ti (typeid (option)); + ti.add_base (typeid (nameable)); + insert (ti); + } + } + } init_; + } +} -- cgit v1.1