diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 16:19:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 16:19:25 +0200 |
commit | 55df757e98329e8e09afffe274ce2ceab269f8b3 (patch) | |
tree | 738b3a5b1c46e3b1b04184cfd9aeb32eb21af48a /odb/generator.cxx | |
parent | 6c01cad9cbfb6e69121d106226b2c50026f86fa9 (diff) |
Make processing top-level action, like validation and generation
Diffstat (limited to 'odb/generator.cxx')
-rw-r--r-- | odb/generator.cxx | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/odb/generator.cxx b/odb/generator.cxx index 0064b5c..50abbe9 100644 --- a/odb/generator.cxx +++ b/odb/generator.cxx @@ -21,11 +21,6 @@ #include <odb/generate.hxx> #include <odb/tracer/generate.hxx> #include <odb/relational/generate.hxx> -#include <odb/relational/type-processor.hxx> - -#include <odb/relational/mysql/context.hxx> -#include <odb/relational/pgsql/context.hxx> -#include <odb/relational/sqlite/context.hxx> using namespace std; using namespace cutl; @@ -93,56 +88,11 @@ namespace } } -generator:: -generator () -{ -} - -static auto_ptr<context> -create_context (ostream& os, semantics::unit& unit, options const& ops) -{ - auto_ptr<context> r; - - switch (ops.database ()) - { - case database::mysql: - { - r.reset (new relational::mysql::context (os, unit, ops)); - break; - } - case database::pgsql: - { - r.reset (new relational::pgsql::context (os, unit, ops)); - break; - } - case database::sqlite: - { - r.reset (new relational::sqlite::context (os, unit, ops)); - break; - } - case database::tracer: - { - r.reset (new context (os, unit, ops)); - break; - } - } - - return r; -} - void generator:: generate (options const& ops, semantics::unit& unit, path const& p) { try { - // Process types. - // - if (ops.database () != database::tracer) - { - auto_ptr<context> ctx (create_context (cerr, unit, ops)); - relational::process_types (); - } - // Output files. // path file (p.leaf ()); @@ -439,13 +389,13 @@ generate (options const& ops, semantics::unit& unit, path const& p) auto_rm.cancel (); } - catch (const generation_failed&) + catch (generation_failed const&) { // Code generation failed. Diagnostics has already been issued. // throw failed (); } - catch (const re::format& e) + catch (re::format const& e) { cerr << "error: invalid regex: '" << e.regex () << "': " << e.description () << endl; |