| 1 | /*============================================================================= |
|---|---|
| 2 | Copyright (c) 2001-2015 Joel de Guzman |
| 3 | |
| 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | =============================================================================*/ |
| 7 | #if !defined(BOOST_SPIRIT_X3_REPR_AST_HPP) |
| 8 | #define BOOST_SPIRIT_X3_REPR_AST_HPP |
| 9 | |
| 10 | #include <boost/spirit/home/x3/support/ast/position_tagged.hpp> |
| 11 | #include <boost/spirit/home/x3/support/ast/variant.hpp> |
| 12 | |
| 13 | #include <map> |
| 14 | |
| 15 | namespace rexpr { namespace ast |
| 16 | { |
| 17 | /////////////////////////////////////////////////////////////////////////// |
| 18 | // The AST |
| 19 | /////////////////////////////////////////////////////////////////////////// |
| 20 | namespace x3 = boost::spirit::x3; |
| 21 | |
| 22 | struct rexpr; |
| 23 | |
| 24 | struct rexpr_value : x3::variant< |
| 25 | std::string |
| 26 | , x3::forward_ast<rexpr> |
| 27 | > |
| 28 | { |
| 29 | using base_type::base_type; |
| 30 | using base_type::operator=; |
| 31 | }; |
| 32 | |
| 33 | typedef std::map<std::string, rexpr_value> rexpr_map; |
| 34 | typedef std::pair<std::string, rexpr_value> rexpr_key_value; |
| 35 | |
| 36 | struct rexpr : x3::position_tagged |
| 37 | { |
| 38 | rexpr_map entries; |
| 39 | }; |
| 40 | }} |
| 41 | |
| 42 | #endif |
| 43 |
