|
1 /////////////////////////////////////////////////////////////////////////////// |
|
2 // detail_fwd.hpp |
|
3 // |
|
4 // Copyright 2004 Eric Niebler. Distributed under the Boost |
|
5 // Software License, Version 1.0. (See accompanying file |
|
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
|
7 |
|
8 #ifndef BOOST_XPRESSIVE_DETAIL_DETAIL_FWD_HPP_EAN_10_04_2005 |
|
9 #define BOOST_XPRESSIVE_DETAIL_DETAIL_FWD_HPP_EAN_10_04_2005 |
|
10 |
|
11 // MS compatible compilers support #pragma once |
|
12 #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|
13 # pragma once |
|
14 #endif |
|
15 |
|
16 #include <climits> // for INT_MAX |
|
17 #include <boost/mpl/bool.hpp> |
|
18 #include <boost/mpl/size_t.hpp> |
|
19 #include <boost/xpressive/xpressive_fwd.hpp> |
|
20 |
|
21 namespace boost { namespace xpressive { namespace detail |
|
22 { |
|
23 typedef unsigned int uint_t; |
|
24 |
|
25 template<uint_t Min, uint_t Max> |
|
26 struct generic_quant_tag; |
|
27 |
|
28 struct modifier_tag; |
|
29 |
|
30 typedef mpl::size_t<INT_MAX / 2 - 1> unknown_width; |
|
31 |
|
32 /////////////////////////////////////////////////////////////////////////////// |
|
33 // placeholders |
|
34 // |
|
35 template<typename Char, bool Not = false> |
|
36 struct literal_placeholder; |
|
37 |
|
38 template<typename Char> |
|
39 struct string_placeholder; |
|
40 |
|
41 struct mark_placeholder; |
|
42 |
|
43 template<typename BidiIter, bool ByRef> |
|
44 struct regex_placeholder; |
|
45 |
|
46 struct posix_charset_placeholder; |
|
47 |
|
48 template<typename Cond> |
|
49 struct assert_word_placeholder; |
|
50 |
|
51 template<typename Char> |
|
52 struct range_placeholder; |
|
53 |
|
54 struct assert_bol_placeholder; |
|
55 |
|
56 struct assert_eol_placeholder; |
|
57 |
|
58 struct logical_newline_placeholder; |
|
59 |
|
60 struct self_placeholder; |
|
61 |
|
62 /////////////////////////////////////////////////////////////////////////////// |
|
63 // matchers |
|
64 // |
|
65 struct end_matcher; |
|
66 |
|
67 struct assert_bos_matcher; |
|
68 |
|
69 struct assert_eos_matcher; |
|
70 |
|
71 template<typename Traits> |
|
72 struct assert_bol_matcher; |
|
73 |
|
74 template<typename Traits> |
|
75 struct assert_eol_matcher; |
|
76 |
|
77 template<typename Cond, typename Traits> |
|
78 struct assert_word_matcher; |
|
79 |
|
80 struct true_matcher; |
|
81 |
|
82 template<typename Alternates, typename Traits> |
|
83 struct alternate_matcher; |
|
84 |
|
85 struct alternate_end_matcher; |
|
86 |
|
87 template<typename Traits> |
|
88 struct posix_charset_matcher; |
|
89 |
|
90 template<typename BidiIter> |
|
91 struct alternates_factory; |
|
92 |
|
93 template<typename BidiIter> |
|
94 struct sequence; |
|
95 |
|
96 template<typename Traits, bool ICase> |
|
97 struct mark_matcher; |
|
98 |
|
99 struct mark_begin_matcher; |
|
100 |
|
101 struct mark_end_matcher; |
|
102 |
|
103 template<typename BidiIter> |
|
104 struct regex_matcher; |
|
105 |
|
106 template<typename BidiIter> |
|
107 struct regex_byref_matcher; |
|
108 |
|
109 template<typename Traits> |
|
110 struct compound_charset; |
|
111 |
|
112 template<typename Traits, bool ICase, typename CharSet = compound_charset<Traits> > |
|
113 struct charset_matcher; |
|
114 |
|
115 template<typename Traits, bool ICase> |
|
116 struct range_matcher; |
|
117 |
|
118 template<typename Traits, int Size> |
|
119 struct set_matcher; |
|
120 |
|
121 template<typename Xpr, bool Greedy> |
|
122 struct simple_repeat_matcher; |
|
123 |
|
124 struct repeat_begin_matcher; |
|
125 |
|
126 template<bool Greedy> |
|
127 struct repeat_end_matcher; |
|
128 |
|
129 template<typename Traits, bool ICase, bool Not> |
|
130 struct literal_matcher; |
|
131 |
|
132 template<typename Traits, bool ICase> |
|
133 struct string_matcher; |
|
134 |
|
135 template<typename Action> |
|
136 struct action_matcher; |
|
137 |
|
138 template<typename Xpr> |
|
139 struct is_modifiable; |
|
140 |
|
141 template<typename Alternates> |
|
142 struct alternates_list; |
|
143 |
|
144 template<typename Modifier> |
|
145 struct modifier_op; |
|
146 |
|
147 template<typename Left, typename Right> |
|
148 struct modifier_sequencer; |
|
149 |
|
150 struct icase_modifier; |
|
151 |
|
152 template<typename BidiIter, typename ICase, typename Traits> |
|
153 struct xpression_visitor; |
|
154 |
|
155 template<typename BidiIter> |
|
156 struct regex_impl; |
|
157 |
|
158 template<typename BidiIter> |
|
159 struct regex_matcher; |
|
160 |
|
161 struct epsilon_matcher; |
|
162 |
|
163 struct epsilon_mark_matcher; |
|
164 |
|
165 template<typename BidiIter> |
|
166 struct nested_results; |
|
167 |
|
168 template<typename BidiIter> |
|
169 struct regex_id_filter_predicate; |
|
170 |
|
171 template<typename Xpr> |
|
172 struct keeper_matcher; |
|
173 |
|
174 template<typename Xpr> |
|
175 struct lookahead_matcher; |
|
176 |
|
177 template<typename Xpr> |
|
178 struct lookbehind_matcher; |
|
179 |
|
180 template<typename Cond> |
|
181 struct assert_word_placeholder; |
|
182 |
|
183 template<bool IsBoundary> |
|
184 struct word_boundary; |
|
185 |
|
186 template<typename BidiIter, typename Matcher> |
|
187 sequence<BidiIter> make_dynamic_xpression(Matcher const &matcher); |
|
188 |
|
189 template<typename Char> |
|
190 struct xpression_linker; |
|
191 |
|
192 template<typename Char> |
|
193 struct xpression_peeker; |
|
194 |
|
195 typedef proto::unary_op<mark_placeholder, proto::noop_tag> mark_tag; |
|
196 |
|
197 struct any_matcher; |
|
198 |
|
199 template<typename Traits> |
|
200 struct logical_newline_matcher; |
|
201 |
|
202 typedef proto::unary_op<logical_newline_placeholder, proto::noop_tag> logical_newline_xpression; |
|
203 |
|
204 struct set_initializer; |
|
205 |
|
206 typedef proto::unary_op<set_initializer, proto::noop_tag> set_initializer_type; |
|
207 |
|
208 struct seq_tag; |
|
209 |
|
210 template<bool Positive> |
|
211 struct lookahead_tag; |
|
212 |
|
213 template<bool Positive> |
|
214 struct lookbehind_tag; |
|
215 |
|
216 struct keeper_tag; |
|
217 |
|
218 template<typename Locale> |
|
219 struct locale_modifier; |
|
220 |
|
221 template<typename Matcher> |
|
222 struct matcher_wrapper; |
|
223 |
|
224 template<typename Locale, typename BidiIter> |
|
225 struct regex_traits_type; |
|
226 |
|
227 /////////////////////////////////////////////////////////////////////////////// |
|
228 // Misc. |
|
229 struct no_next; |
|
230 |
|
231 template<typename BidiIter> |
|
232 struct core_access; |
|
233 |
|
234 template<typename BidiIter> |
|
235 struct state_type; |
|
236 |
|
237 template<typename BidiIter> |
|
238 struct matchable; |
|
239 |
|
240 template<typename Matcher, typename BidiIter> |
|
241 struct dynamic_xpression; |
|
242 |
|
243 template<typename Matcher, typename Next> |
|
244 struct static_xpression; |
|
245 |
|
246 typedef static_xpression<end_matcher, no_next> end_xpression; |
|
247 |
|
248 typedef static_xpression<alternate_end_matcher, no_next> alternate_end_xpression; |
|
249 |
|
250 typedef static_xpression<true_matcher, no_next> true_xpression; |
|
251 |
|
252 template<typename Matcher, typename Next = end_xpression> |
|
253 struct static_xpression; |
|
254 |
|
255 template<typename Top, typename Next> |
|
256 struct stacked_xpression; |
|
257 |
|
258 template<typename Xpr> |
|
259 struct is_static_xpression; |
|
260 |
|
261 template<typename BidiIter> |
|
262 struct sub_match_impl; |
|
263 |
|
264 template<typename BidiIter> |
|
265 struct results_cache; |
|
266 |
|
267 template<typename T> |
|
268 struct sequence_stack; |
|
269 |
|
270 template<typename BidiIter> |
|
271 struct results_extras; |
|
272 |
|
273 template<typename BidiIter> |
|
274 struct match_context; |
|
275 |
|
276 template<typename BidiIter> |
|
277 struct sub_match_vector; |
|
278 |
|
279 struct action_state; |
|
280 |
|
281 template<typename Xpr, bool IsOp = proto::is_op<Xpr>::value> |
|
282 struct as_xpr_type; |
|
283 |
|
284 template<typename Traits, typename BidiIter> |
|
285 Traits const &traits_cast(state_type<BidiIter> const &state); |
|
286 |
|
287 template<typename Char> |
|
288 struct basic_chset; |
|
289 |
|
290 template<typename BidiIter> |
|
291 struct memento; |
|
292 |
|
293 template<typename Char, typename Traits> |
|
294 void set_char(compound_charset<Traits> &chset, Char ch, Traits const &traits, bool icase); |
|
295 |
|
296 template<typename Char, typename Traits> |
|
297 void set_range(compound_charset<Traits> &chset, Char from, Char to, Traits const &traits, bool icase); |
|
298 |
|
299 template<typename Traits> |
|
300 void set_class(compound_charset<Traits> &chset, typename Traits::char_class_type char_class, bool no, Traits const &traits); |
|
301 |
|
302 template<typename Char, typename Traits> |
|
303 void set_char(basic_chset<Char> &chset, Char ch, Traits const &traits, bool icase); |
|
304 |
|
305 template<typename Char, typename Traits> |
|
306 void set_range(basic_chset<Char> &chset, Char from, Char to, Traits const &traits, bool icase); |
|
307 |
|
308 template<typename Char, typename Traits> |
|
309 void set_class(basic_chset<Char> &chset, typename Traits::char_class_type char_class, bool no, Traits const &traits); |
|
310 |
|
311 template<typename Matcher> |
|
312 static_xpression<Matcher> const |
|
313 make_static_xpression(Matcher const &matcher); |
|
314 |
|
315 template<typename Matcher, typename Next> |
|
316 static_xpression<Matcher, Next> const |
|
317 make_static_xpression(Matcher const &matcher, Next const &next); |
|
318 |
|
319 int get_mark_number(mark_tag const &); |
|
320 |
|
321 template<typename Xpr, typename BidiIter> |
|
322 void static_compile(Xpr const &xpr, regex_impl<BidiIter> &impl); |
|
323 |
|
324 }}} // namespace boost::xpressive::detail |
|
325 |
|
326 /// INTERNAL ONLY |
|
327 namespace boost { namespace xpressive |
|
328 { |
|
329 |
|
330 /// INTERNAL ONLY |
|
331 template<typename Traits, std::size_t N> |
|
332 typename Traits::char_class_type |
|
333 lookup_classname(Traits const &traits, char const (&cname)[N], bool icase = false); |
|
334 |
|
335 }} // namespace boost::xpressive |
|
336 |
|
337 #endif |