root / src / models / ballWorldGrammar.h

View | Annotate | Download (1.6 KB)

1
/////////////////////////////////////////////////////////////////////////////
2
// Name:        models/ballWorldGrammar.h
3
// Purpose:     BallWorld grammar for the Spirit parser module
4
// Author:      Scott Halstvedt
5
// Copyright:   (c) 2011 NUI Group
6
/////////////////////////////////////////////////////////////////////////////
7
8
#ifndef _ballWorldGrammar_h
9
#define _ballWorldGrammar_h
10
11
#include "ccfMultimodalSyntaxTree.h"
12
#include <boost/spirit/include/qi.hpp>
13
#include <boost/spirit/include/phoenix_core.hpp>
14
#include <boost/spirit/include/phoenix_operator.hpp>
15
#include <boost/spirit/include/phoenix_object.hpp>
16
#include <boost/spirit/include/phoenix_fusion.hpp>
17
#include <boost/spirit/include/phoenix_stl.hpp>
18
#include <boost/fusion/include/adapt_struct.hpp>
19
#include <boost/fusion/include/io.hpp>
20
21
namespace client {
22
    namespace fusion = boost::fusion;
23
    namespace phoenix = boost::phoenix;
24
    namespace qi = boost::spirit::qi;
25
    namespace ascii = boost::spirit::ascii;
26
}
27
28
29
BOOST_FUSION_ADAPT_STRUCT(
30
                          client::multimodalSyntaxTree,
31
                          (std::string, val)
32
                          (std::string, type)
33
                          (std::vector<client::node>, children)
34
                          )
35
36
BOOST_FUSION_ADAPT_STRUCT(
37
                          client::multimodalLeafNode,
38
                          (std::string, type)
39
                          )
40
41
BOOST_FUSION_ADAPT_STRUCT(
42
                          client::unimodalLeafNode,
43
                          (std::string, val)
44
                          (std::string, type)
45
                          )
46
47
48
#endif