Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

parser_strategy.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004-2006 by Radko Mihal                                *
00003  *   rmihal@pobox.sk                                                       *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.              *
00019  ***************************************************************************/
00020 #ifndef GRAMMAR_TO_PARSERPARSER_STRATEGY_H
00021 #define GRAMMAR_TO_PARSERPARSER_STRATEGY_H
00022 
00023 #include <list>
00024 
00025 namespace grammar_to_parser {
00026 
00027 
00035 template< typename E > class basic_parser;
00036 
00037 template< typename E >
00038 class basic_parser_strategy
00039 {
00040 public:
00041 typedef grammar_to_parser::basic_parser<E> parser;
00042 typedef std::list< parser * > parser_list;
00043 
00045     basic_parser_strategy()
00046         {};
00048     ~basic_parser_strategy()
00049         {};
00050         
00055         virtual bool parse_all( typename parser_list::iterator first,
00056                                                         typename parser_list::iterator last,
00057                                                         const E *buf,
00058                                                         const unsigned long buf_length,
00059                                                         unsigned long &parsed_size ) = 0;
00064         virtual bool parse_choice( typename parser_list::iterator first,
00065                                                         typename parser_list::iterator last,
00066                                                         const E *buf,
00067                                                         const unsigned long buf_length,
00068                                                         unsigned long &parsed_size ) = 0;
00069 
00070 };
00071 
00072 typedef basic_parser_strategy<char> parser_strategy;
00073 typedef basic_parser_strategy<wchar_t> wparser_strategy;
00074 
00075 };
00076 
00077 #endif

Generated on Sun Jul 2 18:39:43 2006 for grammar2parser.kdevelop by  doxygen 1.4.1