Change how create/delete path argument is parsed

The handler for create/delete was an inherited class from
presenceContainerPathHandler class, so that the code is shared between
create/delete. However, this means that it is impossible to change the
grammar for create/delete to include other types of paths (because the
handler was hardcoded to presence containers). This change ties the
handler to the "path" rule rather than to the create/delete rule. This
method is also in line with the "set" command where the path is checked
in the "leafPath" rule rather than in the "set" rule.

Change-Id: Ic41aa26bf4bc93f762435f43312489e10472e475
diff --git a/src/ast_handlers.hpp b/src/ast_handlers.hpp
index b32330e..c937eee 100644
--- a/src/ast_handlers.hpp
+++ b/src/ast_handlers.hpp
@@ -288,7 +288,7 @@
     }
 };
 
-struct presenceContainerPathHandler {
+struct presenceContainerPath_class {
     template <typename T, typename Iterator, typename Context>
     void on_success(Iterator const&, Iterator const&, T& ast, Context const& context)
     {
@@ -296,9 +296,9 @@
         const auto& schema = parserContext.m_schema;
         try {
             boost::optional<std::string> module;
-            if (ast.m_path.m_nodes.back().m_prefix)
-                module = ast.m_path.m_nodes.back().m_prefix.value().m_name;
-            container_ cont = boost::get<container_>(ast.m_path.m_nodes.back().m_suffix);
+            if (ast.m_nodes.back().m_prefix)
+                module = ast.m_nodes.back().m_prefix.value().m_name;
+            container_ cont = boost::get<container_>(ast.m_nodes.back().m_suffix);
             schemaPath_ location = pathWithoutLastNode(parserContext.m_curPath);
 
             if (!schema.isPresenceContainer(location, {module, cont.m_name})) {
@@ -310,7 +310,9 @@
             _pass(context) = false;
         }
     }
+};
 
+struct create_class {
     template <typename Iterator, typename Exception, typename Context>
     x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const&, Context const& context)
     {
@@ -321,10 +323,15 @@
     }
 };
 
-struct create_class : public presenceContainerPathHandler {
-};
-
-struct delete_class : public presenceContainerPathHandler {
+struct delete_class {
+    template <typename Iterator, typename Exception, typename Context>
+    x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const&, Context const& context)
+    {
+        auto& parserContext = x3::get<parser_context_tag>(context);
+        if (parserContext.m_errorMsg.empty())
+            parserContext.m_errorMsg = "Couldn't parse create/delete command.";
+        return x3::error_handler_result::rethrow;
+    }
 };
 
 struct leaf_path_class {