Move rule tag definitions

Spirit's x3::rule needs some class type so that it can recognize rules.
This class can have some on_success handler which adds some more logic
to the parser. However, some of the classes don't have on_success
handlers. That means that they can be directly declared in the
x3::rule's definition. This indicates that the reader of the code
doesn't have to search for the definition (and check whether there's an
on_success handler).

I'm pretty sure that this can't really be enforced, so really, it's just
a convention.

Change-Id: Ib6e5e76174ad19737242dd8c074a0bbc867e195c
diff --git a/src/ast_handlers.hpp b/src/ast_handlers.hpp
index 5cbb993..7fadd29 100644
--- a/src/ast_handlers.hpp
+++ b/src/ast_handlers.hpp
@@ -47,8 +47,6 @@
     }
 };
 
-struct node_identifier_class;
-
 boost::optional<std::string> optModuleToOptString(const boost::optional<module_> module);
 
 struct key_identifier_class {
@@ -69,8 +67,6 @@
     }
 };
 
-struct module_identifier_class;
-
 struct listSuffix_class {
     template <typename T, typename Iterator, typename Context>
     void on_success(Iterator const&, Iterator const&, T& ast, Context const& context)
@@ -140,10 +136,6 @@
     }
 };
 
-struct discard_class;
-
-struct ls_class;
-
 struct cd_class {
     template <typename Iterator, typename Exception, typename Context>
     x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const& x, Context const& context)
@@ -267,14 +259,6 @@
     }
 };
 
-struct rpcPath_class;
-
-struct actionPath_class;
-
-struct cdPath_class;
-
-struct getPath_class;
-
 struct set_class {
     template <typename Iterator, typename Exception, typename Context>
     x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const& x, Context const& context)
@@ -287,32 +271,6 @@
     }
 };
 
-struct commit_class;
-
-struct describe_class;
-
-struct help_class;
-
-struct get_class;
-
-struct copy_class;
-
-struct move_class;
-
-struct dump_class;
-
-struct prepare_class;
-
-struct action_class;
-
-struct exec_class;
-
-struct switch_class;
-
-struct cancel_class;
-
-struct quit_class;
-
 struct command_class {
     template <typename Iterator, typename Exception, typename Context>
     x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const& x, Context const& context)
@@ -339,8 +297,6 @@
     }
 };
 
-struct trailingSlash_class;
-
 std::set<Completion> generateMissingKeyCompletionSet(std::set<std::string> keysNeeded, ListInstance currentSet);
 
 struct createKeySuggestions_class {
diff --git a/src/common_parsers.hpp b/src/common_parsers.hpp
index d51f9b8..14a2755 100644
--- a/src/common_parsers.hpp
+++ b/src/common_parsers.hpp
@@ -13,10 +13,10 @@
 auto const completing = x3::rule<completing_class, x3::unused_type>{"completing"} =
     x3::eps;
 
-auto const node_identifier = x3::rule<node_identifier_class, std::string>{"node_identifier"} =
+auto const node_identifier = x3::rule<struct node_identifier_class, std::string>{"node_identifier"} =
     ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")));
 
-auto const module_identifier = x3::rule<module_identifier_class, std::string>{"module_identifier"} =
+auto const module_identifier = x3::rule<struct module_identifier_class, std::string>{"module_identifier"} =
     ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")));
 
 auto const module = x3::rule<module_class, module_>{"module"} =
diff --git a/src/grammars.hpp b/src/grammars.hpp
index 67cf792..540201c 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -64,7 +64,7 @@
     }
 } const ls_options;
 
-auto const ls = x3::rule<ls_class, ls_>{"ls"} =
+auto const ls = x3::rule<struct ls_class, ls_>{"ls"} =
     ls_::name >> *(space_separator >> ls_options) >> -(space_separator > (anyPath | (module >> "*")));
 
 auto const cd = x3::rule<cd_class, cd_>{"cd"} =
@@ -103,7 +103,7 @@
     }
 } const ds_target_table;
 
-auto const get = x3::rule<get_class, get_>{"get"} =
+auto const get = x3::rule<struct get_class, get_>{"get"} =
     get_::name
     >> -(space_separator >> "-" > staticSuggestions({"-datastore"}) > "-datastore" > space_separator > dsTargetSuggestions > ds_target_table)
     >> -(space_separator > getPath);
@@ -111,10 +111,10 @@
 auto const set = x3::rule<set_class, set_>{"set"} =
     set_::name >> space_separator > writableLeafPath > space_separator > leaf_data;
 
-auto const commit = x3::rule<commit_class, commit_>{"commit"} =
+auto const commit = x3::rule<struct commit_class, commit_>{"commit"} =
     commit_::name >> x3::attr(commit_());
 
-auto const discard = x3::rule<discard_class, discard_>{"discard"} =
+auto const discard = x3::rule<struct discard_class, discard_>{"discard"} =
     discard_::name >> x3::attr(discard_());
 
 struct command_names_table : x3::symbols<decltype(help_::m_cmd)> {
@@ -129,7 +129,7 @@
 auto const createCommandSuggestions = x3::rule<createCommandSuggestions_class, x3::unused_type>{"createCommandSuggestions"} =
     x3::eps;
 
-auto const help = x3::rule<help_class, help_>{"help"} =
+auto const help = x3::rule<struct help_class, help_>{"help"} =
     help_::name > createCommandSuggestions >> -command_names;
 
 struct datastore_symbol_table : x3::symbols<Datastore> {
@@ -174,10 +174,10 @@
     }
 } const copy_args;
 
-auto const copy = x3::rule<copy_class, copy_>{"copy"} =
+auto const copy = x3::rule<struct copy_class, copy_>{"copy"} =
     copy_::name > space_separator > copy_args;
 
-auto const describe = x3::rule<describe_class, describe_>{"describe"} =
+auto const describe = x3::rule<struct describe_class, describe_>{"describe"} =
     describe_::name >> space_separator > anyPath;
 
 struct move_mode_table : x3::symbols<MoveMode> {
@@ -275,7 +275,7 @@
     }
 } const move_args;
 
-auto const move = x3::rule<move_class, move_>{"move"} =
+auto const move = x3::rule<struct move_class, move_>{"move"} =
     move_::name >> space_separator >> move_args;
 
 struct format_table : x3::symbols<DataFormat> {
@@ -303,22 +303,22 @@
     }
 } const dump_args;
 
-auto const prepare = x3::rule<prepare_class, prepare_>{"prepare"} =
+auto const prepare = x3::rule<struct prepare_class, prepare_>{"prepare"} =
     prepare_::name > space_separator > as<dataPath_>[RpcActionPath<AllowInput::Yes>{}];
 
-auto const exec = x3::rule<exec_class, exec_>{"exec"} =
+auto const exec = x3::rule<struct exec_class, exec_>{"exec"} =
     exec_::name > -(space_separator > -as<dataPath_>[RpcActionPath<AllowInput::No>{}]);
 
-auto const switch_rule = x3::rule<switch_class, switch_>{"switch"} =
+auto const switch_rule = x3::rule<struct switch_class, switch_>{"switch"} =
     switch_::name > space_separator > dsTargetSuggestions > ds_target_table;
 
-auto const cancel = x3::rule<cancel_class, cancel_>{"cancel"} =
+auto const cancel = x3::rule<struct cancel_class, cancel_>{"cancel"} =
     cancel_::name >> x3::attr(cancel_{});
 
-auto const dump = x3::rule<dump_class, dump_>{"dump"} =
+auto const dump = x3::rule<struct dump_class, dump_>{"dump"} =
     dump_::name > space_separator >> dump_args;
 
-auto const quit = x3::rule<quit_class, quit_>{"quit"} =
+auto const quit = x3::rule<struct quit_class, quit_>{"quit"} =
     quit_::name >> x3::attr(quit_{});
 
 auto const command = x3::rule<command_class, command_>{"command"} =
diff --git a/src/path_parser.hpp b/src/path_parser.hpp
index e06c6f1..f682def 100644
--- a/src/path_parser.hpp
+++ b/src/path_parser.hpp
@@ -274,7 +274,7 @@
     using type = dataPath_;
 };
 
-auto const trailingSlash = x3::rule<trailingSlash_class, x3::unused_type>{"trailingSlash"} =
+auto const trailingSlash = x3::rule<struct trailingSlash_class, x3::unused_type>{"trailingSlash"} =
     x3::omit['/'];
 
 // A "nothing" parser, which is used to indicate we tried to parse a path
@@ -447,11 +447,11 @@
     return nodeType != yang::NodeTypes::Rpc && nodeType != yang::NodeTypes::Action;
 };
 
-auto const getPath = x3::rule<getPath_class, decltype(get_::m_path)::value_type>{"getPath"} =
+auto const getPath = x3::rule<struct getPath_class, decltype(get_::m_path)::value_type>{"getPath"} =
     PathParser<PathParserMode::DataPathListEnd, CompletionMode::Data>{noRpcOrAction} |
     (module >> "*");
 
-auto const cdPath = x3::rule<cdPath_class, dataPath_>{"cdPath"} =
+auto const cdPath = x3::rule<struct cdPath_class, dataPath_>{"cdPath"} =
     PathParser<PathParserMode::DataPath, CompletionMode::Data>{[] (const Schema& schema, const std::string& path) {
         return noRpcOrAction(schema, path) && schema.nodeType(path) != yang::NodeTypes::Leaf;
     }};