OKlibrary  0.2.1.6
ParserBase.hpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 24.5.2005 (Swansea)
00002 /* Copyright 2005 - 2007, 2009 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00014 #ifndef PARSERBASE_9Hhn67u
00015 #define PARSERBASE_9Hhn67u
00016 #define BOOST_SPIRIT_USE_OLD_NAMESPACE
00017 
00018 #include <boost/spirit/include/classic_core.hpp>
00019 
00020 
00021 
00022 namespace OKlib {
00023   namespace Parser {
00024 
00025     template <typename CharT = char, typename ParseIterator_ = const CharT*>
00026     class ParserBase {
00027     public :
00028       typedef CharT char_type;
00029       typedef ParseIterator_ ParseIterator; // ToDo: ParseIterator -> parse_iterator;
00030       typedef boost::spirit::scanner<ParseIterator> scanner_type;
00031       typedef boost::spirit::rule<scanner_type> Rule; // ToDo: ->  rule_type;
00032 
00033       const Rule& parser() const { return parser_; }
00034       virtual ~ParserBase() {}
00035     protected :
00036       Rule parser_;
00037     };
00038 
00039   }
00040 
00041 }
00042 
00043 #endif