Parser: build methods and constructors.
[fail.git] / src / idl / parser / state.h
blobf9c4e79447b22d0df0328cda09ff2e2f384c46fe
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_STATE_H
20 #define FAIL_IDL_PARSER_STATE_H
22 namespace fail { namespace idlparser
24 struct State : pegtl::capture_map
26 State( shared_ptr< idlast::AST > pAST_ ) :
27 pAST( pAST_ ),
28 pCurrentNamespace( pAST_ ),
29 pCurrentFlags( &ClassFlags ),
30 bConstPointer( false ),
31 bVirtualMethod( false )
33 // TODO: implement actions in the grammar to track this
34 // using the directives inserted by the preprocessor
35 // Also wrap eol into a rule that apply an action that increments the line number
36 CurrentFilename = "filename_nyi";
37 CurrentLine = 1;
40 std::string CurrentFilename;
41 int CurrentLine;
43 shared_ptr< idlast::AST > pAST;
44 shared_ptr< idlast::Namespace > pCurrentNamespace;
46 shared_ptr< idlast::Class > pCurrentClass;
47 shared_ptr< idlast::ClassRef > pCurrentClassRef;
49 shared_ptr< idlast::Enum > pCurrentEnum;
50 shared_ptr< idlast::EnumRef > pCurrentEnumRef;
52 idlast::Flags ClassFlags;
53 idlast::Flags MembersFlags;
54 idlast::Flags* pCurrentFlags;
56 shared_ptr< idlast::Type > pCurrentType;
57 stack< shared_ptr< idlast::Type > > TypeStack;
58 bool bConstPointer;
60 shared_ptr< idlast::ParamList > pCurrentParamList;
61 bool bVirtualMethod;
65 #endif