1 | /*=============================================================================
|
---|
2 | Copyright (c) 1998-2003 Joel de Guzman
|
---|
3 | Copyright (c) 2001 Daniel Nuffer
|
---|
4 | Copyright (c) 2002 Hartmut Kaiser
|
---|
5 | http://spirit.sourceforge.net/
|
---|
6 |
|
---|
7 | Use, modification and distribution is subject to the Boost Software
|
---|
8 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
9 | http://www.boost.org/LICENSE_1_0.txt)
|
---|
10 | =============================================================================*/
|
---|
11 | #if !defined(BOOST_SPIRIT_DIFFERENCE_IPP)
|
---|
12 | #define BOOST_SPIRIT_DIFFERENCE_IPP
|
---|
13 |
|
---|
14 | namespace boost { namespace spirit {
|
---|
15 |
|
---|
16 | ///////////////////////////////////////////////////////////////////////////
|
---|
17 | //
|
---|
18 | // difference class implementation
|
---|
19 | //
|
---|
20 | ///////////////////////////////////////////////////////////////////////////
|
---|
21 | template <typename A, typename B>
|
---|
22 | inline difference<A, B>
|
---|
23 | operator-(parser<A> const& a, parser<B> const& b)
|
---|
24 | {
|
---|
25 | return difference<A, B>(a.derived(), b.derived());
|
---|
26 | }
|
---|
27 |
|
---|
28 | template <typename A>
|
---|
29 | inline difference<A, chlit<char> >
|
---|
30 | operator-(parser<A> const& a, char b)
|
---|
31 | {
|
---|
32 | return difference<A, chlit<char> >(a.derived(), b);
|
---|
33 | }
|
---|
34 |
|
---|
35 | template <typename B>
|
---|
36 | inline difference<chlit<char>, B>
|
---|
37 | operator-(char a, parser<B> const& b)
|
---|
38 | {
|
---|
39 | return difference<chlit<char>, B>(a, b.derived());
|
---|
40 | }
|
---|
41 |
|
---|
42 | template <typename A>
|
---|
43 | inline difference<A, strlit<char const*> >
|
---|
44 | operator-(parser<A> const& a, char const* b)
|
---|
45 | {
|
---|
46 | return difference<A, strlit<char const*> >(a.derived(), b);
|
---|
47 | }
|
---|
48 |
|
---|
49 | template <typename B>
|
---|
50 | inline difference<strlit<char const*>, B>
|
---|
51 | operator-(char const* a, parser<B> const& b)
|
---|
52 | {
|
---|
53 | return difference<strlit<char const*>, B>(a, b.derived());
|
---|
54 | }
|
---|
55 |
|
---|
56 | template <typename A>
|
---|
57 | inline difference<A, chlit<wchar_t> >
|
---|
58 | operator-(parser<A> const& a, wchar_t b)
|
---|
59 | {
|
---|
60 | return difference<A, chlit<wchar_t> >(a.derived(), b);
|
---|
61 | }
|
---|
62 |
|
---|
63 | template <typename B>
|
---|
64 | inline difference<chlit<wchar_t>, B>
|
---|
65 | operator-(wchar_t a, parser<B> const& b)
|
---|
66 | {
|
---|
67 | return difference<chlit<wchar_t>, B>(a, b.derived());
|
---|
68 | }
|
---|
69 |
|
---|
70 | template <typename A>
|
---|
71 | inline difference<A, strlit<wchar_t const*> >
|
---|
72 | operator-(parser<A> const& a, wchar_t const* b)
|
---|
73 | {
|
---|
74 | return difference<A, strlit<wchar_t const*> >(a.derived(), b);
|
---|
75 | }
|
---|
76 |
|
---|
77 | template <typename B>
|
---|
78 | inline difference<strlit<wchar_t const*>, B>
|
---|
79 | operator-(wchar_t const* a, parser<B> const& b)
|
---|
80 | {
|
---|
81 | return difference<strlit<wchar_t const*>, B>(a, b.derived());
|
---|
82 | }
|
---|
83 |
|
---|
84 | }} // namespace boost::spirit
|
---|
85 |
|
---|
86 | #endif
|
---|