]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/metaparse/example/parsing_error/main.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / metaparse / example / parsing_error / main.cpp
CommitLineData
7c673cae
FG
1// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5
6#include <boost/metaparse/repeated.hpp>
7#include <boost/metaparse/sequence.hpp>
8#include <boost/metaparse/lit_c.hpp>
9#include <boost/metaparse/debug_parsing_error.hpp>
10
11#include <boost/metaparse/build_parser.hpp>
12#include <boost/metaparse/string.hpp>
13
14#include <boost/mpl/apply.hpp>
15
16using boost::metaparse::sequence;
17using boost::metaparse::lit_c;
18using boost::metaparse::repeated;
19using boost::metaparse::build_parser;
20using boost::metaparse::debug_parsing_error;
21
22using boost::mpl::apply;
23
24/*
25 * The grammar
26 *
27 * s ::= a*b
28 */
29typedef sequence<repeated<lit_c<'a'> >, lit_c<'b'> > s;
30
31typedef build_parser<s> test_parser;
32
b32b8144 33#if BOOST_METAPARSE_STD < 2011
7c673cae
FG
34
35typedef boost::metaparse::string<'a','a','a','c'> invalid_input;
36
37#else
38
39typedef BOOST_METAPARSE_STRING("aaac") invalid_input;
40
41#endif
42
43debug_parsing_error<test_parser, invalid_input> debug;
44
45int main()
46{
47 // This causes an error
48 // apply<test_parser, invalid_input>::type();
49}
50
51