Parser WIP.
[fail.git] / src / idl / parser / parser.cpp
blob10f42d21e2d2d5003400fc43bbf4e7317749c381
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 #include "parser.h"
20 #include "grammar.h"
21 #include "state.h"
23 using namespace fail::idlparser;
25 shared_ptr< const fail::idlast::AST > fail::idlparser::Parse( const char* pFilename )
27 std::shared_ptr< idlast::AST > pAST( new idlast::AST );
29 //pegtl::basic_parse_string< Grammar >( " namespace // ffff" );
31 State s( pAST );
32 pegtl::trace_parse_file< Grammar >( false, pFilename, s );
34 //std::cout << "captured class name: " << captures[ cap_ClassName ] << std::endl;
36 pAST->resolveRefs();
37 return pAST;