source: NonGTP/Boost/boost/spirit/utility/chset_operators.hpp @ 857

Revision 857, 11.7 KB checked in by igarcia, 18 years ago (diff)
Line 
1/*=============================================================================
2    Copyright (c) 2001-2003 Joel de Guzman
3    Copyright (c) 2001-2003 Daniel Nuffer
4    http://spirit.sourceforge.net/
5
6    Use, modification and distribution is subject to the Boost Software
7    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8    http://www.boost.org/LICENSE_1_0.txt)
9=============================================================================*/
10#ifndef BOOST_SPIRIT_CHSET_OPERATORS_HPP
11#define BOOST_SPIRIT_CHSET_OPERATORS_HPP
12
13///////////////////////////////////////////////////////////////////////////////
14#include <boost/spirit/utility/chset.hpp>
15
16///////////////////////////////////////////////////////////////////////////////
17namespace boost { namespace spirit {
18
19///////////////////////////////////////////////////////////////////////////////
20//
21//  chset free operators
22//
23//      Where a and b are both chsets, implements:
24//
25//          a | b, a & b, a - b, a ^ b
26//
27//      Where a is a chset, implements:
28//
29//          ~a
30//
31///////////////////////////////////////////////////////////////////////////////
32template <typename CharT>
33chset<CharT>
34operator~(chset<CharT> const& a);
35
36//////////////////////////////////
37template <typename CharT>
38chset<CharT>
39operator|(chset<CharT> const& a, chset<CharT> const& b);
40
41//////////////////////////////////
42template <typename CharT>
43chset<CharT>
44operator&(chset<CharT> const& a, chset<CharT> const& b);
45
46//////////////////////////////////
47template <typename CharT>
48chset<CharT>
49operator-(chset<CharT> const& a, chset<CharT> const& b);
50
51//////////////////////////////////
52template <typename CharT>
53chset<CharT>
54operator^(chset<CharT> const& a, chset<CharT> const& b);
55
56///////////////////////////////////////////////////////////////////////////////
57//
58//  range <--> chset free operators
59//
60//      Where a is a chset and b is a range, and vice-versa, implements:
61//
62//          a | b, a & b, a - b, a ^ b
63//
64///////////////////////////////////////////////////////////////////////////////
65template <typename CharT>
66chset<CharT>
67operator|(chset<CharT> const& a, range<CharT> const& b);
68
69//////////////////////////////////
70template <typename CharT>
71chset<CharT>
72operator&(chset<CharT> const& a, range<CharT> const& b);
73
74//////////////////////////////////
75template <typename CharT>
76chset<CharT>
77operator-(chset<CharT> const& a, range<CharT> const& b);
78
79//////////////////////////////////
80template <typename CharT>
81chset<CharT>
82operator^(chset<CharT> const& a, range<CharT> const& b);
83
84//////////////////////////////////
85template <typename CharT>
86chset<CharT>
87operator|(range<CharT> const& a, chset<CharT> const& b);
88
89//////////////////////////////////
90template <typename CharT>
91chset<CharT>
92operator&(range<CharT> const& a, chset<CharT> const& b);
93
94//////////////////////////////////
95template <typename CharT>
96chset<CharT>
97operator-(range<CharT> const& a, chset<CharT> const& b);
98
99//////////////////////////////////
100template <typename CharT>
101chset<CharT>
102operator^(range<CharT> const& a, chset<CharT> const& b);
103
104///////////////////////////////////////////////////////////////////////////////
105//
106//  chlit <--> chset free operators
107//
108//      Where a is a chset and b is a chlit, and vice-versa, implements:
109//
110//          a | b, a & b, a - b, a ^ b
111//
112///////////////////////////////////////////////////////////////////////////////
113template <typename CharT>
114chset<CharT>
115operator|(chset<CharT> const& a, chlit<CharT> const& b);
116
117//////////////////////////////////
118template <typename CharT>
119chset<CharT>
120operator&(chset<CharT> const& a, chlit<CharT> const& b);
121
122//////////////////////////////////
123template <typename CharT>
124chset<CharT>
125operator-(chset<CharT> const& a, chlit<CharT> const& b);
126
127//////////////////////////////////
128template <typename CharT>
129chset<CharT>
130operator^(chset<CharT> const& a, chlit<CharT> const& b);
131
132//////////////////////////////////
133template <typename CharT>
134chset<CharT>
135operator|(chlit<CharT> const& a, chset<CharT> const& b);
136
137//////////////////////////////////
138template <typename CharT>
139chset<CharT>
140operator&(chlit<CharT> const& a, chset<CharT> const& b);
141
142//////////////////////////////////
143template <typename CharT>
144chset<CharT>
145operator-(chlit<CharT> const& a, chset<CharT> const& b);
146
147//////////////////////////////////
148template <typename CharT>
149chset<CharT>
150operator^(chlit<CharT> const& a, chset<CharT> const& b);
151
152///////////////////////////////////////////////////////////////////////////////
153//
154//  negated_char_parser<range> <--> chset free operators
155//
156//      Where a is a chset and b is a range, and vice-versa, implements:
157//
158//          a | b, a & b, a - b, a ^ b
159//
160///////////////////////////////////////////////////////////////////////////////
161template <typename CharT>
162chset<CharT>
163operator|(chset<CharT> const& a, negated_char_parser<range<CharT> > const& b);
164
165//////////////////////////////////
166template <typename CharT>
167chset<CharT>
168operator&(chset<CharT> const& a, negated_char_parser<range<CharT> > const& b);
169
170//////////////////////////////////
171template <typename CharT>
172chset<CharT>
173operator-(chset<CharT> const& a, negated_char_parser<range<CharT> > const& b);
174
175//////////////////////////////////
176template <typename CharT>
177chset<CharT>
178operator^(chset<CharT> const& a, negated_char_parser<range<CharT> > const& b);
179
180//////////////////////////////////
181template <typename CharT>
182chset<CharT>
183operator|(negated_char_parser<range<CharT> > const& a, chset<CharT> const& b);
184
185//////////////////////////////////
186template <typename CharT>
187chset<CharT>
188operator&(negated_char_parser<range<CharT> > const& a, chset<CharT> const& b);
189
190//////////////////////////////////
191template <typename CharT>
192chset<CharT>
193operator-(negated_char_parser<range<CharT> > const& a, chset<CharT> const& b);
194
195//////////////////////////////////
196template <typename CharT>
197chset<CharT>
198operator^(negated_char_parser<range<CharT> > const& a, chset<CharT> const& b);
199
200///////////////////////////////////////////////////////////////////////////////
201//
202//  negated_char_parser<chlit> <--> chset free operators
203//
204//      Where a is a chset and b is a chlit, and vice-versa, implements:
205//
206//          a | b, a & b, a - b, a ^ b
207//
208///////////////////////////////////////////////////////////////////////////////
209template <typename CharT>
210chset<CharT>
211operator|(chset<CharT> const& a, negated_char_parser<chlit<CharT> > const& b);
212
213//////////////////////////////////
214template <typename CharT>
215chset<CharT>
216operator&(chset<CharT> const& a, negated_char_parser<chlit<CharT> > const& b);
217
218//////////////////////////////////
219template <typename CharT>
220chset<CharT>
221operator-(chset<CharT> const& a, negated_char_parser<chlit<CharT> > const& b);
222
223//////////////////////////////////
224template <typename CharT>
225chset<CharT>
226operator^(chset<CharT> const& a, negated_char_parser<chlit<CharT> > const& b);
227
228//////////////////////////////////
229template <typename CharT>
230chset<CharT>
231operator|(negated_char_parser<chlit<CharT> > const& a, chset<CharT> const& b);
232
233//////////////////////////////////
234template <typename CharT>
235chset<CharT>
236operator&(negated_char_parser<chlit<CharT> > const& a, chset<CharT> const& b);
237
238//////////////////////////////////
239template <typename CharT>
240chset<CharT>
241operator-(negated_char_parser<chlit<CharT> > const& a, chset<CharT> const& b);
242
243//////////////////////////////////
244template <typename CharT>
245chset<CharT>
246operator^(negated_char_parser<chlit<CharT> > const& a, chset<CharT> const& b);
247
248///////////////////////////////////////////////////////////////////////////////
249//
250//  literal primitives <--> chset free operators
251//
252//      Where a is a chset and b is a literal primitive,
253//      and vice-versa, implements:
254//
255//          a | b, a & b, a - b, a ^ b
256//
257///////////////////////////////////////////////////////////////////////////////
258template <typename CharT>
259chset<CharT>
260operator|(chset<CharT> const& a, CharT b);
261
262//////////////////////////////////
263template <typename CharT>
264chset<CharT>
265operator&(chset<CharT> const& a, CharT b);
266
267//////////////////////////////////
268template <typename CharT>
269chset<CharT>
270operator-(chset<CharT> const& a, CharT b);
271
272//////////////////////////////////
273template <typename CharT>
274chset<CharT>
275operator^(chset<CharT> const& a, CharT b);
276
277//////////////////////////////////
278template <typename CharT>
279chset<CharT>
280operator|(CharT a, chset<CharT> const& b);
281
282//////////////////////////////////
283template <typename CharT>
284chset<CharT>
285operator&(CharT a, chset<CharT> const& b);
286
287//////////////////////////////////
288template <typename CharT>
289chset<CharT>
290operator-(CharT a, chset<CharT> const& b);
291
292//////////////////////////////////
293template <typename CharT>
294chset<CharT>
295operator^(CharT a, chset<CharT> const& b);
296
297///////////////////////////////////////////////////////////////////////////////
298//
299//  anychar_parser <--> chset free operators
300//
301//      Where a is chset and b is a anychar_parser, and vice-versa, implements:
302//
303//          a | b, a & b, a - b, a ^ b
304//
305///////////////////////////////////////////////////////////////////////////////
306template <typename CharT>
307chset<CharT>
308operator|(chset<CharT> const& a, anychar_parser b);
309
310//////////////////////////////////
311template <typename CharT>
312chset<CharT>
313operator&(chset<CharT> const& a, anychar_parser b);
314
315//////////////////////////////////
316template <typename CharT>
317chset<CharT>
318operator-(chset<CharT> const& a, anychar_parser b);
319
320//////////////////////////////////
321template <typename CharT>
322chset<CharT>
323operator^(chset<CharT> const& a, anychar_parser b);
324
325//////////////////////////////////
326template <typename CharT>
327chset<CharT>
328operator|(anychar_parser a, chset<CharT> const& b);
329
330//////////////////////////////////
331template <typename CharT>
332chset<CharT>
333operator&(anychar_parser a, chset<CharT> const& b);
334
335//////////////////////////////////
336template <typename CharT>
337chset<CharT>
338operator-(anychar_parser a, chset<CharT> const& b);
339
340//////////////////////////////////
341template <typename CharT>
342chset<CharT>
343operator^(anychar_parser a, chset<CharT> const& b);
344
345///////////////////////////////////////////////////////////////////////////////
346//
347//  nothing_parser <--> chset free operators
348//
349//      Where a is chset and b is nothing_parser, and vice-versa, implements:
350//
351//          a | b, a & b, a - b, a ^ b
352//
353///////////////////////////////////////////////////////////////////////////////
354template <typename CharT>
355chset<CharT>
356operator|(chset<CharT> const& a, nothing_parser b);
357
358//////////////////////////////////
359template <typename CharT>
360chset<CharT>
361operator&(chset<CharT> const& a, nothing_parser b);
362
363//////////////////////////////////
364template <typename CharT>
365chset<CharT>
366operator-(chset<CharT> const& a, nothing_parser b);
367
368//////////////////////////////////
369template <typename CharT>
370chset<CharT>
371operator^(chset<CharT> const& a, nothing_parser b);
372
373//////////////////////////////////
374template <typename CharT>
375chset<CharT>
376operator|(nothing_parser a, chset<CharT> const& b);
377
378//////////////////////////////////
379template <typename CharT>
380chset<CharT>
381operator&(nothing_parser a, chset<CharT> const& b);
382
383//////////////////////////////////
384template <typename CharT>
385chset<CharT>
386operator-(nothing_parser a, chset<CharT> const& b);
387
388//////////////////////////////////
389template <typename CharT>
390chset<CharT>
391operator^(nothing_parser a, chset<CharT> const& b);
392
393///////////////////////////////////////////////////////////////////////////////
394}} // namespace boost::spirit
395
396#endif
397
398#include <boost/spirit/utility/impl/chset_operators.ipp>
Note: See TracBrowser for help on using the repository browser.