?? spirit_fwd.hpp
字號:
/*=============================================================================
Forward declarations
Spirit V1.2
Copyright (c) 2001, Joel de Guzman
This software is provided 'as-is', without any express or implied
warranty. In no event will the copyright holder be held liable for
any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute
it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
Acknowledgements:
Special thanks to Dan Nuffer, John (EBo) David, Chris Uzdavinis,
and Doug Gregor. These people are most instrumental in steering
Spirit in the right direction.
Special thanks also to people who have contributed to the code base
and sample code, ported Spirit to various platforms and compilers,
gave suggestions, reported and provided bug fixes. Alexander
Hirner, Andy Elvey, Bogdan Kushnir, Brett Calcott, Bruce Florman,
Changzhe Han, Colin McPhail, Hakki Dogusan, Jan Bares, Joseph
Smith, Martijn W. van der Lee, Raghavendra Satish, Remi Delcos, Tom
Spilman, Vladimir Prus, W. Scott Dillman, David A. Greene, Bob
Bailey, Hartmut Kaiser.
Finally special thanks also to people who gave feedback and
valuable comments, particularly members of Spirit's Source Forge
mailing list and boost.org.
URL: http://spirit.sourceforge.net/
=============================================================================*/
#ifndef SPIRIT_FWD_HPP
#define SPIRIT_FWD_HPP
#include "boost/tuple/tuple.hpp"
///////////////////////////////////////////////////////////////////////////////
namespace spirit {
// is this really necessary?
using boost::tuples::element;
///////////////////////////////////////////////////////////////////////////////
//
// Forward declarations. These are needed to minimize dependencies.
//
///////////////////////////////////////////////////////////////////////////////
template <typename IteratorT, typename MatchTraitsT>
class skipper;
//////////////////////////////////
template <typename IteratorT, typename MatchTraitsT>
class rule;
//////////////////////////////////
template <typename T, typename CharT, typename SetT>
class symbols;
//////////////////////////////////
class match_traits;
//////////////////////////////////
template <
typename IteratorT = char const*,
typename MatchTraitsT = match_traits,
typename SkipT = skipper<IteratorT, MatchTraitsT> >
class scanner;
//////////////////////////////////
template <typename IteratorT, typename MatchTraitsT, typename DerivedT>
class base_rule;
template <typename IteratorT = scanner<>, typename MatchTraitsT = match_traits>
class rule;
//////////////////////////////////
template <typename TupleT, int N>
class local;
//////////////////////////////////
template <
typename T0 = boost::tuples::null_type,
typename T1 = boost::tuples::null_type,
typename T2 = boost::tuples::null_type,
typename T3 = boost::tuples::null_type,
typename T4 = boost::tuples::null_type,
typename T5 = boost::tuples::null_type,
typename T6 = boost::tuples::null_type,
typename T7 = boost::tuples::null_type,
typename T8 = boost::tuples::null_type,
typename T9 = boost::tuples::null_type
>
class closure;
//////////////////////////////////
template <typename TupleT, typename ParserT>
class closure_parser;
//////////////////////////////////
struct closure_null_type {};
template<typename DerivedT, typename ReturnT = closure_null_type>
struct grammar;
//////////////////////////////////
class match;
//////////////////////////////////
template <typename TypeT, typename BaseT = class match>
class attr_match;
//////////////////////////////////
template <
typename ClosureT = closure<>,
typename IteratorT = scanner<>,
typename MatchTraitsT = match_traits>
struct attr_rule;
///////////////////////////////////////////////////////////////////////////////
//
// Utility meta-programs
//
///////////////////////////////////////////////////////////////////////////////
template <typename T> struct remove_ref
{ typedef T type; };
template <typename T> struct remove_ref<T&>
{ typedef T type; };
template <typename T> struct remove_ref<T const&>
{ typedef T const type; };
//////////////////////////////////
template <typename T> struct remove_wrap
{ typedef T type; };
template <typename TupleT, int N> struct remove_wrap<local<TupleT, N> >
{ typedef typename element<N, TupleT>::type type; };
template <typename TupleT, int N> struct remove_wrap<local<TupleT, N> const>
{ typedef typename element<N, TupleT>::type const type; };
///////////////////////////////////////////////////////////////////////////////
//
template <typename ParserT, typename IteratorT, typename BaseT>
struct list_action_iterator;
///////////////////////////////////////////////////////////////////////////////
//
// Helper template classes to distinguish plain parsers from parsers with an
// attached action or parsers, injecting a closure into the parsing context
//
// - plain parser has nothing special
// - binary parser has subject a and b (e.g. alternative)
// - unary parser has single subject (e.g. kleene star)
// - action parser is an attached action parser
// - exception parser throws an exception under some circumstances
// - closure parser injects a closure into the parsing context
// - parsers with parameters initialize the members of the embedded
// closure parsers
//
///////////////////////////////////////////////////////////////////////////////
struct plain_parser_category {};
struct binary_parser_category : public plain_parser_category {};
struct unary_parser_category : public plain_parser_category {};
struct action_parser_category : public unary_parser_category {};
struct exception_parser_category : public unary_parser_category {};
struct closure_parser_category : public unary_parser_category {};
struct param_parser_category : public closure_parser_category {};
///////////////////////////////////////////////////////////////////////////////
} // namespace Spirit
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -