summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/metaparse/example/getting_started/10.hpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/metaparse/example/getting_started/10.hpp
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/metaparse/example/getting_started/10.hpp')
-rw-r--r--src/boost/libs/metaparse/example/getting_started/10.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/boost/libs/metaparse/example/getting_started/10.hpp b/src/boost/libs/metaparse/example/getting_started/10.hpp
new file mode 100644
index 00000000..e8ed5f1c
--- /dev/null
+++ b/src/boost/libs/metaparse/example/getting_started/10.hpp
@@ -0,0 +1,42 @@
+#ifndef BOOST_METAPARSE_GETTING_STARTED_10_HPP
+#define BOOST_METAPARSE_GETTING_STARTED_10_HPP
+
+// Automatically generated header file
+
+// Definitions before section 9
+#include "9.hpp"
+
+// Definitions of section 9
+#include <boost/mpl/negate.hpp>
+
+using unary_exp1 =
+ foldr_start_with_parser<
+ minus_token,
+ int_token,
+ boost::mpl::lambda<boost::mpl::negate<boost::mpl::_1>>::type
+ >;
+
+using mult_exp4 =
+ foldl_start_with_parser<
+ sequence<one_of<times_token, divides_token>, unary_exp1>,
+ unary_exp1,
+ boost::mpl::quote2<binary_op>
+ >;
+
+using exp_parser18 =
+ build_parser<
+ foldl_start_with_parser<
+ sequence<one_of<plus_token, minus_token>, mult_exp4>,
+ mult_exp4,
+ boost::mpl::quote2<binary_op>
+ >
+ >;
+
+// query:
+// exp_parser18::apply<BOOST_METAPARSE_STRING("---13")>::type
+
+// query:
+// exp_parser18::apply<BOOST_METAPARSE_STRING("13")>::type
+
+#endif
+