From ddb77e1407eeaf0f18390cb49d915ca50ac2b528 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 20 Sep 2009 07:06:51 +0200 Subject: Add header, inline, and source generators All they currently do is output the namespace structure plus the included C++ files for header. --- cli/header.cxx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cli/header.cxx (limited to 'cli/header.cxx') diff --git a/cli/header.cxx b/cli/header.cxx new file mode 100644 index 0000000..21f70f2 --- /dev/null +++ b/cli/header.cxx @@ -0,0 +1,36 @@ +// file : cli/header.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include "header.hxx" + +namespace +{ + struct includes: traversal::cxx_includes, context + { + includes (context& c) : context (c) {} + + virtual void + traverse (semantics::cxx_includes& i) + { + os << "#include " << i.file () << endl + << endl; + } + }; +} + +void +generate_header (context& ctx) +{ + traversal::cli_unit unit; + includes includes (ctx); + traversal::names unit_names; + namespace_ ns (ctx); + traversal::names ns_names; + + unit >> includes; + unit >> unit_names >> ns >> ns_names >> ns; + + unit.dispatch (ctx.unit); +} -- cgit v1.1