First public contribution.
3 * Copyright (c) 1998-2002
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)
13 * LOCATION: see http://www.boost.org for most recent version.
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Declares class regbase.
19 #ifndef BOOST_REGEX_V4_REGBASE_HPP
20 #define BOOST_REGEX_V4_REGBASE_HPP
22 #ifdef BOOST_HAS_ABI_HEADERS
23 # include BOOST_ABI_PREFIX
29 // handles error codes and flags
31 class BOOST_REGEX_DECL regbase
37 // Divide the flags up into logical groups:
38 // bits 0-7 indicate main synatx type.
39 // bits 8-15 indicate syntax subtype.
40 // bits 16-31 indicate options that are common to all
42 // In all cases the default is 0.
46 perl_syntax_group = 0, // default
47 basic_syntax_group = 1, // POSIX basic
48 literal = 2, // all characters are literals
49 main_option_type = literal | basic_syntax_group | perl_syntax_group, // everything!
51 // options specific to perl group:
53 no_bk_refs = 1 << 8, // \d not allowed
54 no_perl_ex = 1 << 9, // disable perl extensions
55 no_mod_m = 1 << 10, // disable Perl m modifier
56 mod_x = 1 << 11, // Perl x modifier
57 mod_s = 1 << 12, // force s modifier on (overrides match_not_dot_newline)
58 no_mod_s = 1 << 13, // force s modifier off (overrides match_not_dot_newline)
61 // options specific to basic group:
63 no_char_classes = 1 << 8, // [[:CLASS:]] not allowed
64 no_intervals = 1 << 9, // {x,y} not allowed
65 bk_plus_qm = 1 << 10, // uses \+ and \?
66 bk_vbar = 1 << 11, // use \| for alternatives
67 emacs_ex = 1 << 12, // enables emacs extensions
70 // options common to all groups:
72 no_escape_in_lists = 1 << 16, // '\' not special inside [...]
73 newline_alt = 1 << 17, // \n is the same as |
74 no_except = 1 << 18, // no exception on error
75 failbit = 1 << 19, // error flag
76 icase = 1 << 20, // characters are matched regardless of case
77 nocollate = 0, // don't use locale specific collation (deprecated)
78 collate = 1 << 21, // use locale specific collation
79 nosubs = 1 << 22, // don't mark sub-expressions
80 optimize = 0, // not really supported
84 basic = basic_syntax_group | collate | no_escape_in_lists,
85 extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists,
87 emacs = basic_syntax_group | collate | emacs_ex | bk_vbar,
88 awk = no_bk_refs | collate | no_perl_ex,
89 grep = basic | newline_alt,
90 egrep = extended | newline_alt,
97 typedef unsigned int flag_type;
105 restart_continue = 4,
107 restart_fixed_lit = 6,
113 // provide std lib proposal compatible constants:
115 namespace regex_constants{
120 no_except = ::boost::regbase::no_except,
121 failbit = ::boost::regbase::failbit,
122 literal = ::boost::regbase::literal,
123 icase = ::boost::regbase::icase,
124 nocollate = ::boost::regbase::nocollate,
125 collate = ::boost::regbase::collate,
126 nosubs = ::boost::regbase::nosubs,
127 optimize = ::boost::regbase::optimize,
128 bk_plus_qm = ::boost::regbase::bk_plus_qm,
129 bk_vbar = ::boost::regbase::bk_vbar,
130 no_intervals = ::boost::regbase::no_intervals,
131 no_char_classes = ::boost::regbase::no_char_classes,
132 no_escape_in_lists = ::boost::regbase::no_escape_in_lists,
133 no_mod_m = ::boost::regbase::no_mod_m,
134 mod_x = ::boost::regbase::mod_x,
135 mod_s = ::boost::regbase::mod_s,
136 no_mod_s = ::boost::regbase::no_mod_s,
138 basic = ::boost::regbase::basic,
139 extended = ::boost::regbase::extended,
140 normal = ::boost::regbase::normal,
141 emacs = ::boost::regbase::emacs,
142 awk = ::boost::regbase::awk,
143 grep = ::boost::regbase::grep,
144 egrep = ::boost::regbase::egrep,
151 typedef ::boost::regbase::flag_type syntax_option_type;
153 } // namespace regex_constants
157 #ifdef BOOST_HAS_ABI_HEADERS
158 # include BOOST_ABI_SUFFIX