]> git.lyx.org Git - lyx.git/blob - boost/boost/regex/v4/regbase.hpp
update boost to version 1.36
[lyx.git] / boost / boost / regex / v4 / regbase.hpp
1 /*
2  *
3  * Copyright (c) 1998-2002
4  * John Maddock
5  *
6  * Use, modification and distribution are subject to the 
7  * Boost Software License, Version 1.0. (See accompanying file 
8  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9  *
10  */
11
12  /*
13   *   LOCATION:    see http://www.boost.org for most recent version.
14   *   FILE         regbase.cpp
15   *   VERSION      see <boost/version.hpp>
16   *   DESCRIPTION: Declares class regbase.
17   */
18
19 #ifndef BOOST_REGEX_V4_REGBASE_HPP
20 #define BOOST_REGEX_V4_REGBASE_HPP
21
22 #ifdef BOOST_MSVC
23 #pragma warning(push)
24 #pragma warning(disable: 4103)
25 #endif
26 #ifdef BOOST_HAS_ABI_HEADERS
27 #  include BOOST_ABI_PREFIX
28 #endif
29 #ifdef BOOST_MSVC
30 #pragma warning(pop)
31 #endif
32
33 namespace boost{
34 //
35 // class regbase
36 // handles error codes and flags
37 //
38 class BOOST_REGEX_DECL regbase
39 {
40 public:
41    enum flag_type_
42    {
43       //
44       // Divide the flags up into logical groups:
45       // bits 0-7 indicate main synatx type.
46       // bits 8-15 indicate syntax subtype.
47       // bits 16-31 indicate options that are common to all
48       // regex syntaxes.
49       // In all cases the default is 0.
50       //
51       // Main synatx group:
52       //
53       perl_syntax_group = 0,                      // default
54       basic_syntax_group = 1,                     // POSIX basic
55       literal = 2,                                // all characters are literals
56       main_option_type = literal | basic_syntax_group | perl_syntax_group, // everything!
57       //
58       // options specific to perl group:
59       //
60       no_bk_refs = 1 << 8,                        // \d not allowed
61       no_perl_ex = 1 << 9,                        // disable perl extensions
62       no_mod_m = 1 << 10,                         // disable Perl m modifier
63       mod_x = 1 << 11,                            // Perl x modifier
64       mod_s = 1 << 12,                            // force s modifier on (overrides match_not_dot_newline)
65       no_mod_s = 1 << 13,                         // force s modifier off (overrides match_not_dot_newline)
66
67       //
68       // options specific to basic group:
69       //
70       no_char_classes = 1 << 8,                   // [[:CLASS:]] not allowed
71       no_intervals = 1 << 9,                      // {x,y} not allowed
72       bk_plus_qm = 1 << 10,                       // uses \+ and \?
73       bk_vbar = 1 << 11,                          // use \| for alternatives
74       emacs_ex = 1 << 12,                         // enables emacs extensions
75
76       //
77       // options common to all groups:
78       //
79       no_escape_in_lists = 1 << 16,                     // '\' not special inside [...]
80       newline_alt = 1 << 17,                            // \n is the same as |
81       no_except = 1 << 18,                              // no exception on error
82       failbit = 1 << 19,                                // error flag
83       icase = 1 << 20,                                  // characters are matched regardless of case
84       nocollate = 0,                                    // don't use locale specific collation (deprecated)
85       collate = 1 << 21,                                // use locale specific collation
86       nosubs = 1 << 22,                                 // don't mark sub-expressions
87       optimize = 0,                                     // not really supported
88       
89
90
91       basic = basic_syntax_group | collate | no_escape_in_lists,
92       extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists,
93       normal = 0,
94       emacs = basic_syntax_group | collate | emacs_ex | bk_vbar,
95       awk = no_bk_refs | collate | no_perl_ex,
96       grep = basic | newline_alt,
97       egrep = extended | newline_alt,
98       sed = basic,
99       perl = normal,
100       ECMAScript = normal,
101       JavaScript = normal,
102       JScript = normal
103    };
104    typedef unsigned int flag_type;
105
106    enum restart_info
107    {
108       restart_any = 0,
109       restart_word = 1,
110       restart_line = 2,
111       restart_buf = 3,
112       restart_continue = 4,
113       restart_lit = 5,
114       restart_fixed_lit = 6, 
115       restart_count = 7
116    };
117 };
118
119 //
120 // provide std lib proposal compatible constants:
121 //
122 namespace regex_constants{
123
124    enum flag_type_
125    {
126
127       no_except = ::boost::regbase::no_except,
128       failbit = ::boost::regbase::failbit,
129       literal = ::boost::regbase::literal,
130       icase = ::boost::regbase::icase,
131       nocollate = ::boost::regbase::nocollate,
132       collate = ::boost::regbase::collate,
133       nosubs = ::boost::regbase::nosubs,
134       optimize = ::boost::regbase::optimize,
135       bk_plus_qm = ::boost::regbase::bk_plus_qm,
136       bk_vbar = ::boost::regbase::bk_vbar,
137       no_intervals = ::boost::regbase::no_intervals,
138       no_char_classes = ::boost::regbase::no_char_classes,
139       no_escape_in_lists = ::boost::regbase::no_escape_in_lists,
140       no_mod_m = ::boost::regbase::no_mod_m,
141       mod_x = ::boost::regbase::mod_x,
142       mod_s = ::boost::regbase::mod_s,
143       no_mod_s = ::boost::regbase::no_mod_s,
144
145       basic = ::boost::regbase::basic,
146       extended = ::boost::regbase::extended,
147       normal = ::boost::regbase::normal,
148       emacs = ::boost::regbase::emacs,
149       awk = ::boost::regbase::awk,
150       grep = ::boost::regbase::grep,
151       egrep = ::boost::regbase::egrep,
152       sed = basic,
153       perl = normal,
154       ECMAScript = normal,
155       JavaScript = normal,
156       JScript = normal
157    };
158    typedef ::boost::regbase::flag_type syntax_option_type;
159
160 } // namespace regex_constants
161
162 } // namespace boost
163
164 #ifdef BOOST_MSVC
165 #pragma warning(push)
166 #pragma warning(disable: 4103)
167 #endif
168 #ifdef BOOST_HAS_ABI_HEADERS
169 #  include BOOST_ABI_SUFFIX
170 #endif
171 #ifdef BOOST_MSVC
172 #pragma warning(pop)
173 #endif
174
175 #endif
176