More grammar work, all idl files are now parsed entirely again.
[fail.git] / src / idl / parser / grammar_type.h
blob0004a4d671bad541b7e82fdacdf9338252b8606c
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 EnumType;
26 struct PointerType;
27 struct STLType;
28 struct ClassRef;
30 struct Type :
31 seq<
32 opt< Spacing >,
33 sor< EnumType, BasicType, PointerType, STLType, ClassRef >,
34 opt< Spacing >
35 > {};
37 struct BasicType :
38 sor<
39 KWuint8_t,
40 KWint8_t,
41 KWuint16_t,
42 KWint16_t,
43 KWuint32_t,
44 KWint32_t,
45 KWuint64_t,
46 KWint64_t,
48 KWbool,
49 KWfloat,
50 KWdouble,
51 KWstring,
53 KWdynamicbuffer
54 > {};
56 struct PointerType :
57 seq<
58 KWshared_ptr,
59 Less,
60 opt< Padded< KWconst > >,
61 ClassRef,
62 Greater
63 > {};
65 struct VectorType : seq< KWvector, Less, Type, Greater > {};
66 struct ListType : seq< KWlist, Less, Type, Greater > {};
67 struct PairType : seq< KWpair, Less, Type, Comma, Type, Greater > {};
68 struct MapType : seq< KWmap, Less, Type, Comma, Type, Greater > {};
70 struct STLType : sor< VectorType, ListType, PairType, MapType > {};
72 struct EnumType : seq< Padded< KWenum >, EnumRef > {};
75 #endif