Rework x3::rule parser

It's possible to define x3::rule's grammar directly. There's no need to
use the BOOST_SPIRIT_DEFINE macro and all the "*_def" stuff. The new
syntax has less boilerplate and is more concise. Some rules had to be
moved around, because now they aren't all defined at the begining of the
file.

There is also one big advantage to this: if you're browsing the parser
code and you're looking at a specifing grammar and want to see the
definition of some other used, you can use your IDE's "Go to
definition". Before you would have to also search the "_def" variable to
actually see the grammar. This is very useful.

Change-Id: I0994603171321a24b9cdf5d67057d5942001a970
diff --git a/src/leaf_data.hpp b/src/leaf_data.hpp
index e945fda..0e0e499 100644
--- a/src/leaf_data.hpp
+++ b/src/leaf_data.hpp
@@ -17,10 +17,6 @@
 template <typename TYPE>
 struct leaf_data_class;
 
-x3::rule<struct leaf_data_class<yang::IdentityRef>, identityRef_> const leaf_data_identityRef = "leaf_data_identityRef";
-x3::rule<struct leaf_data_class<yang::Binary>, binary_> const leaf_data_binary = "leaf_data_binary";
-x3::rule<struct leaf_data_class<yang::String>, std::string> const leaf_data_string = "leaf_data_string";
-
 using x3::char_;
 
 struct bool_symbol_table : x3::symbols<bool> {
@@ -32,14 +28,14 @@
     }
 } const bool_symbols;
 
-auto const leaf_data_string_def =
+auto const leaf_data_string = x3::rule<struct leaf_data_class<yang::String>, std::string>{"leaf_data_string"} =
     '\'' >> *(char_-'\'') >> '\'' |
     '\"' >> *(char_-'\"') >> '\"';
 
-auto const leaf_data_binary_def =
+auto const leaf_data_binary = x3::rule<struct leaf_data_class<yang::Binary>, binary_>{"leaf_data_binary"} =
     as<std::string>[+(x3::alnum | char_('+') | char_('/')) >> -char_('=') >> -char_('=')];
 
-auto const leaf_data_identityRef_def =
+auto const leaf_data_identityRef = x3::rule<struct leaf_data_class<yang::IdentityRef>, identityRef_>{"leaf_data_identityRef"} =
     -module >> node_identifier;
 
 template <typename It, typename Ctx, typename RCtx, typename Attr>
@@ -210,7 +206,3 @@
 };
 
 auto const leaf_data = LeafData();
-
-BOOST_SPIRIT_DEFINE(leaf_data_string)
-BOOST_SPIRIT_DEFINE(leaf_data_binary)
-BOOST_SPIRIT_DEFINE(leaf_data_identityRef)