diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/header.cxx | 36 | ||||
-rw-r--r-- | cli/header.hxx | 14 | ||||
-rw-r--r-- | cli/inline.cxx | 24 | ||||
-rw-r--r-- | cli/inline.hxx | 14 | ||||
-rw-r--r-- | cli/source.cxx | 24 | ||||
-rw-r--r-- | cli/source.hxx | 14 |
6 files changed, 126 insertions, 0 deletions
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 <boris@codesynthesis.com> +// 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); +} diff --git a/cli/header.hxx b/cli/header.hxx new file mode 100644 index 0000000..a546664 --- /dev/null +++ b/cli/header.hxx @@ -0,0 +1,14 @@ +// file : cli/header.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CLI_HEADER_HXX +#define CLI_HEADER_HXX + +#include "context.hxx" + +void +generate_header (context&); + +#endif // CLI_HEADER_HXX diff --git a/cli/inline.cxx b/cli/inline.cxx new file mode 100644 index 0000000..e376d76 --- /dev/null +++ b/cli/inline.cxx @@ -0,0 +1,24 @@ +// file : cli/inline.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include "inline.hxx" + +namespace +{ + +} + +void +generate_inline (context& ctx) +{ + traversal::cli_unit unit; + traversal::names unit_names; + namespace_ ns (ctx); + traversal::names ns_names; + + unit >> unit_names >> ns >> ns_names >> ns; + + unit.dispatch (ctx.unit); +} diff --git a/cli/inline.hxx b/cli/inline.hxx new file mode 100644 index 0000000..1e1e790 --- /dev/null +++ b/cli/inline.hxx @@ -0,0 +1,14 @@ +// file : cli/inline.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CLI_INLINE_HXX +#define CLI_INLINE_HXX + +#include "context.hxx" + +void +generate_inline (context&); + +#endif // CLI_INLINE_HXX diff --git a/cli/source.cxx b/cli/source.cxx new file mode 100644 index 0000000..75be8a3 --- /dev/null +++ b/cli/source.cxx @@ -0,0 +1,24 @@ +// file : cli/source.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include "source.hxx" + +namespace +{ + +} + +void +generate_source (context& ctx) +{ + traversal::cli_unit unit; + traversal::names unit_names; + namespace_ ns (ctx); + traversal::names ns_names; + + unit >> unit_names >> ns >> ns_names >> ns; + + unit.dispatch (ctx.unit); +} diff --git a/cli/source.hxx b/cli/source.hxx new file mode 100644 index 0000000..12caea3 --- /dev/null +++ b/cli/source.hxx @@ -0,0 +1,14 @@ +// file : cli/source.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CLI_SOURCE_HXX +#define CLI_SOURCE_HXX + +#include "context.hxx" + +void +generate_source (context&); + +#endif // CLI_SOURCE_HXX |