Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:25

0001 /*
0002  *
0003  * Copyright (c) 1998-2002
0004  * John Maddock
0005  *
0006  * Use, modification and distribution are subject to the 
0007  * Boost Software License, Version 1.0. (See accompanying file 
0008  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009  *
0010  */
0011 
0012  /*
0013   *   LOCATION:    see http://www.boost.org for most recent version.
0014   *   FILE         regbase.cpp
0015   *   VERSION      see <boost/version.hpp>
0016   *   DESCRIPTION: Declares class regbase.
0017   */
0018 
0019 #ifndef BOOST_REGEX_V4_REGBASE_HPP
0020 #define BOOST_REGEX_V4_REGBASE_HPP
0021 
0022 #ifdef BOOST_MSVC
0023 #pragma warning(push)
0024 #pragma warning(disable: 4103)
0025 #endif
0026 #ifdef BOOST_HAS_ABI_HEADERS
0027 #  include BOOST_ABI_PREFIX
0028 #endif
0029 #ifdef BOOST_MSVC
0030 #pragma warning(pop)
0031 #endif
0032 
0033 namespace boost{
0034 //
0035 // class regbase
0036 // handles error codes and flags
0037 //
0038 class BOOST_REGEX_DECL regbase
0039 {
0040 public:
0041    enum flag_type_
0042    {
0043       //
0044       // Divide the flags up into logical groups:
0045       // bits 0-7 indicate main synatx type.
0046       // bits 8-15 indicate syntax subtype.
0047       // bits 16-31 indicate options that are common to all
0048       // regex syntaxes.
0049       // In all cases the default is 0.
0050       //
0051       // Main synatx group:
0052       //
0053       perl_syntax_group = 0,                      // default
0054       basic_syntax_group = 1,                     // POSIX basic
0055       literal = 2,                                // all characters are literals
0056       main_option_type = literal | basic_syntax_group | perl_syntax_group, // everything!
0057       //
0058       // options specific to perl group:
0059       //
0060       no_bk_refs = 1 << 8,                        // \d not allowed
0061       no_perl_ex = 1 << 9,                        // disable perl extensions
0062       no_mod_m = 1 << 10,                         // disable Perl m modifier
0063       mod_x = 1 << 11,                            // Perl x modifier
0064       mod_s = 1 << 12,                            // force s modifier on (overrides match_not_dot_newline)
0065       no_mod_s = 1 << 13,                         // force s modifier off (overrides match_not_dot_newline)
0066 
0067       //
0068       // options specific to basic group:
0069       //
0070       no_char_classes = 1 << 8,                   // [[:CLASS:]] not allowed
0071       no_intervals = 1 << 9,                      // {x,y} not allowed
0072       bk_plus_qm = 1 << 10,                       // uses \+ and \?
0073       bk_vbar = 1 << 11,                          // use \| for alternatives
0074       emacs_ex = 1 << 12,                         // enables emacs extensions
0075 
0076       //
0077       // options common to all groups:
0078       //
0079       no_escape_in_lists = 1 << 16,                     // '\' not special inside [...]
0080       newline_alt = 1 << 17,                            // \n is the same as |
0081       no_except = 1 << 18,                              // no exception on error
0082       failbit = 1 << 19,                                // error flag
0083       icase = 1 << 20,                                  // characters are matched regardless of case
0084       nocollate = 0,                                    // don't use locale specific collation (deprecated)
0085       collate = 1 << 21,                                // use locale specific collation
0086       nosubs = 1 << 22,                                 // don't mark sub-expressions
0087       save_subexpression_location = 1 << 23,            // save subexpression locations
0088       no_empty_expressions = 1 << 24,                   // no empty expressions allowed
0089       optimize = 0,                                     // not really supported
0090       
0091 
0092 
0093       basic = basic_syntax_group | collate | no_escape_in_lists,
0094       extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists,
0095       normal = 0,
0096       emacs = basic_syntax_group | collate | emacs_ex | bk_vbar,
0097       awk = no_bk_refs | collate | no_perl_ex,
0098       grep = basic | newline_alt,
0099       egrep = extended | newline_alt,
0100       sed = basic,
0101       perl = normal,
0102       ECMAScript = normal,
0103       JavaScript = normal,
0104       JScript = normal
0105    };
0106    typedef unsigned int flag_type;
0107 
0108    enum restart_info
0109    {
0110       restart_any = 0,
0111       restart_word = 1,
0112       restart_line = 2,
0113       restart_buf = 3,
0114       restart_continue = 4,
0115       restart_lit = 5,
0116       restart_fixed_lit = 6, 
0117       restart_count = 7
0118    };
0119 };
0120 
0121 //
0122 // provide std lib proposal compatible constants:
0123 //
0124 namespace regex_constants{
0125 
0126    enum flag_type_
0127    {
0128 
0129       no_except = ::boost::regbase::no_except,
0130       failbit = ::boost::regbase::failbit,
0131       literal = ::boost::regbase::literal,
0132       icase = ::boost::regbase::icase,
0133       nocollate = ::boost::regbase::nocollate,
0134       collate = ::boost::regbase::collate,
0135       nosubs = ::boost::regbase::nosubs,
0136       optimize = ::boost::regbase::optimize,
0137       bk_plus_qm = ::boost::regbase::bk_plus_qm,
0138       bk_vbar = ::boost::regbase::bk_vbar,
0139       no_intervals = ::boost::regbase::no_intervals,
0140       no_char_classes = ::boost::regbase::no_char_classes,
0141       no_escape_in_lists = ::boost::regbase::no_escape_in_lists,
0142       no_mod_m = ::boost::regbase::no_mod_m,
0143       mod_x = ::boost::regbase::mod_x,
0144       mod_s = ::boost::regbase::mod_s,
0145       no_mod_s = ::boost::regbase::no_mod_s,
0146       save_subexpression_location = ::boost::regbase::save_subexpression_location,
0147       no_empty_expressions = ::boost::regbase::no_empty_expressions,
0148 
0149       basic = ::boost::regbase::basic,
0150       extended = ::boost::regbase::extended,
0151       normal = ::boost::regbase::normal,
0152       emacs = ::boost::regbase::emacs,
0153       awk = ::boost::regbase::awk,
0154       grep = ::boost::regbase::grep,
0155       egrep = ::boost::regbase::egrep,
0156       sed = basic,
0157       perl = normal,
0158       ECMAScript = normal,
0159       JavaScript = normal,
0160       JScript = normal
0161    };
0162    typedef ::boost::regbase::flag_type syntax_option_type;
0163 
0164 } // namespace regex_constants
0165 
0166 } // namespace boost
0167 
0168 #ifdef BOOST_MSVC
0169 #pragma warning(push)
0170 #pragma warning(disable: 4103)
0171 #endif
0172 #ifdef BOOST_HAS_ABI_HEADERS
0173 #  include BOOST_ABI_SUFFIX
0174 #endif
0175 #ifdef BOOST_MSVC
0176 #pragma warning(pop)
0177 #endif
0178 
0179 #endif
0180