Back to index

supertuxkart  0.5+dfsg1
parser.hpp
Go to the documentation of this file.
00001 //  $Id: parser.hpp 2111 2008-05-31 07:04:30Z cosmosninja $
00002 //
00003 //  TuxKart - a fun racing game with go-kart
00004 //  Copyright (C) 2004 Matthias Braun <matze@braunis.de>
00005 //  code in this file based on lispreader from Mark Probst
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 2
00010 //  of the License, or (at your option) any later version.
00011 //
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU General Public License
00018 //  along with this program; if not, write to the Free Software
00019 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 #ifndef __LISPPARSER_H__
00021 #define __LISPPARSER_H__
00022 
00023 #include <string>
00024 #include "lexer.hpp"
00025 
00026 namespace lisp
00027 {
00028 
00029     class Lisp;
00030 
00031     class Parser
00032     {
00033     public:
00034         Parser();
00035         ~Parser();
00036 
00037         Lisp* parse(const std::string& filename);
00038         Lisp* parse(std::istream& stream);
00039 
00040     private:
00041         Lisp* read();
00042         Lisp* readList();
00043 
00044         Lexer* m_lexer;
00045         Lexer::TokenType m_token;
00046     };
00047 
00048 } // end of namespace lisp
00049 
00050 #endif
00051