Grammar WIP.
[fail.git] / src / idl / parser / grammar_type.h
blobe494e56a5fa75424cae2994c6ee6e33da8cb6a9d
1 /*
2 Fail game engine
3 Copyright 2007-2009 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef FAIL_IDL_PARSER_GRAMMAR_TYPE_H
20 #define FAIL_IDL_PARSER_GRAMMAR_TYPE_H
22 namespace fail { namespace idlparser
24 struct BasicType;
25 struct PointerType;
26 struct STLType;
27 struct ClassRef;
29 struct Type :
30 seq<
31 opt< Spacing >,
32 sor< BasicType, PointerType, STLType, ClassRef >,
33 opt< Spacing >
34 > {};
36 struct BasicType :
37 sor<
38 KWuint8_t,
39 KWint8_t,
40 KWuint16_t,
41 KWint16_t,
42 KWuint32_t,
43 KWint32_t,
44 KWuint64_t,
45 KWint64_t,
47 KWbool,
48 KWfloat,
49 KWdouble,
50 KWstring,
52 KWdynamicbuffer
53 > {};
55 struct PointerType :
56 seq<
57 KWshared_ptr,
58 Less,
59 opt< Padded< KWconst > >,
60 ClassRef,
61 Greater
62 > {};
64 struct MapType : seq< KWmap, Less, Type, Comma, Type, Greater > {};
66 struct STLType :
67 MapType {};
70 #endif