Move leaf_data into a separate file

grammars.hpp is starting to get a little too big for me. I split
leaf_data parser into a separate file.

Change-Id: I23143218e03a85a81d04e559562ac94f94e722ad
diff --git a/src/common_parsers.hpp b/src/common_parsers.hpp
new file mode 100644
index 0000000..bab3886
--- /dev/null
+++ b/src/common_parsers.hpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/
+ *
+ * Written by Václav Kubernát <kubernat@cesnet.cz>
+ *
+*/
+
+#pragma once
+#include <boost/spirit/home/x3.hpp>
+#include "ast_handlers.hpp"
+x3::rule<module_identifier_class, std::string> const module_identifier = "module_identifier";
+x3::rule<module_class, module_> const module = "module";
+x3::rule<node_identifier_class, std::string> const node_identifier = "node_identifier";
+auto const node_identifier_def =
+    x3::lexeme[
+            ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")))
+    ];
+
+auto const module_def =
+    module_identifier >> x3::no_skip[':'] >> !x3::no_skip[x3::space];
+
+auto const module_identifier_def =
+    x3::lexeme[
+            ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")))
+    ];
+
+BOOST_SPIRIT_DEFINE(node_identifier)
+BOOST_SPIRIT_DEFINE(module)
+BOOST_SPIRIT_DEFINE(module_identifier)