-
Notifications
You must be signed in to change notification settings - Fork 2
/
ast.hpp
49 lines (35 loc) · 755 Bytes
/
ast.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2009-2010 Roman Neuhauser
// Distributed under the MIT license (see LICENSE file)
// vim: sw=4 sts=4 et fdm=marker cms=\ //\ %s
#ifndef INIPHILE_INCLUDE_AST_HPP
#define INIPHILE_INCLUDE_AST_HPP
#include <map>
#include <string>
#include <boost/variant.hpp>
#include "declspec.hpp"
#include "astfwd.hpp"
#include "metagram.hpp"
namespace iniphile
{
namespace ast
{
struct leaf
{ // {{{
metagram::optval value;
}; // }}}
struct branch;
typedef boost::variant<
boost::recursive_wrapper<branch>
, leaf
> node;
struct branch
{ // {{{
typedef std::map<std::string, node> type;
type children;
}; // }}}
} // namespace ast
DLLEXPORT
ast::node
normalize(metagram::config const & cst);
} // namespace iniphile
#endif