Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:01:53

0001 /*=============================================================================
0002     Copyright (c) 1998-2003 Joel de Guzman
0003     Copyright (c) 2001 Daniel Nuffer
0004     Copyright (c) 2002 Hartmut Kaiser
0005     http://spirit.sourceforge.net/
0006 
0007     Use, modification and distribution is subject to the Boost Software
0008     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0009     http://www.boost.org/LICENSE_1_0.txt)
0010 =============================================================================*/
0011 #if !defined(BOOST_SPIRIT_ALTERNATIVE_IPP)
0012 #define BOOST_SPIRIT_ALTERNATIVE_IPP
0013 
0014 namespace boost { namespace spirit {
0015 
0016 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0017 
0018     ///////////////////////////////////////////////////////////////////////////
0019     //
0020     //  alternative class implementation
0021     //
0022     ///////////////////////////////////////////////////////////////////////////
0023     template <typename A, typename B>
0024     inline alternative<A, B>
0025     operator|(parser<A> const& a, parser<B> const& b)
0026     {
0027         return alternative<A, B>(a.derived(), b.derived());
0028     }
0029     
0030     template <typename A>
0031     inline alternative<A, chlit<char> >
0032     operator|(parser<A> const& a, char b)
0033     {
0034         return alternative<A, chlit<char> >(a.derived(), b);
0035     }
0036     
0037     template <typename B>
0038     inline alternative<chlit<char>, B>
0039     operator|(char a, parser<B> const& b)
0040     {
0041         return alternative<chlit<char>, B>(a, b.derived());
0042     }
0043     
0044     template <typename A>
0045     inline alternative<A, strlit<char const*> >
0046     operator|(parser<A> const& a, char const* b)
0047     {
0048         return alternative<A, strlit<char const*> >(a.derived(), b);
0049     }
0050     
0051     template <typename B>
0052     inline alternative<strlit<char const*>, B>
0053     operator|(char const* a, parser<B> const& b)
0054     {
0055         return alternative<strlit<char const*>, B>(a, b.derived());
0056     }
0057     
0058     template <typename A>
0059     inline alternative<A, chlit<wchar_t> >
0060     operator|(parser<A> const& a, wchar_t b)
0061     {
0062         return alternative<A, chlit<wchar_t> >(a.derived(), b);
0063     }
0064     
0065     template <typename B>
0066     inline alternative<chlit<wchar_t>, B>
0067     operator|(wchar_t a, parser<B> const& b)
0068     {
0069         return alternative<chlit<wchar_t>, B>(a, b.derived());
0070     }
0071     
0072     template <typename A>
0073     inline alternative<A, strlit<wchar_t const*> >
0074     operator|(parser<A> const& a, wchar_t const* b)
0075     {
0076         return alternative<A, strlit<wchar_t const*> >(a.derived(), b);
0077     }
0078     
0079     template <typename B>
0080     inline alternative<strlit<wchar_t const*>, B>
0081     operator|(wchar_t const* a, parser<B> const& b)
0082     {
0083         return alternative<strlit<wchar_t const*>, B>(a, b.derived());
0084     }
0085 
0086 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0087 
0088 }} // namespace boost::spirit
0089 
0090 #endif