From 55df757e98329e8e09afffe274ce2ceab269f8b3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 19 Sep 2011 16:19:25 +0200 Subject: Make processing top-level action, like validation and generation --- odb/plugin.cxx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'odb/plugin.cxx') diff --git a/odb/plugin.cxx b/odb/plugin.cxx index 5364425..aba5e78 100644 --- a/odb/plugin.cxx +++ b/odb/plugin.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -109,13 +110,23 @@ gate_callback (void*, void*) parser p (*options_, loc_pragmas_, decl_pragmas_); auto_ptr u (p.parse (global_namespace, file_)); + // Validate. // - // - validator v; - if (!v.validate (*options_, *u, file_)) - r = 1; + { + validator v; + if (!v.validate (*options_, *u, file_)) + r = 1; + } + // Process. // + if (r == 0) + { + processor p; + p.process (*options_, *u, file_); + } + + // Generate. // if (r == 0) { @@ -129,6 +140,12 @@ gate_callback (void*, void*) // r = 1; } + catch (processor::failed const&) + { + // Diagnostics has aready been issued. + // + r = 1; + } catch (generator::failed const&) { // Diagnostics has aready been issued. -- cgit v1.1