sl@0: /* sl@0: * sl@0: * Copyright (c) 1998-2002 sl@0: * John Maddock sl@0: * sl@0: * Use, modification and distribution are subject to the sl@0: * Boost Software License, Version 1.0. (See accompanying file sl@0: * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: * sl@0: */ sl@0: sl@0: /* sl@0: * LOCATION: see http://www.boost.org for most recent version. sl@0: * FILE regbase.cpp sl@0: * VERSION see sl@0: * DESCRIPTION: Declares class regbase. sl@0: */ sl@0: sl@0: #ifndef BOOST_REGEX_V4_REGBASE_HPP sl@0: #define BOOST_REGEX_V4_REGBASE_HPP sl@0: sl@0: #ifdef BOOST_HAS_ABI_HEADERS sl@0: # include BOOST_ABI_PREFIX sl@0: #endif sl@0: sl@0: namespace boost{ sl@0: // sl@0: // class regbase sl@0: // handles error codes and flags sl@0: // sl@0: class BOOST_REGEX_DECL regbase sl@0: { sl@0: public: sl@0: enum flag_type_ sl@0: { sl@0: // sl@0: // Divide the flags up into logical groups: sl@0: // bits 0-7 indicate main synatx type. sl@0: // bits 8-15 indicate syntax subtype. sl@0: // bits 16-31 indicate options that are common to all sl@0: // regex syntaxes. sl@0: // In all cases the default is 0. sl@0: // sl@0: // Main synatx group: sl@0: // sl@0: perl_syntax_group = 0, // default sl@0: basic_syntax_group = 1, // POSIX basic sl@0: literal = 2, // all characters are literals sl@0: main_option_type = literal | basic_syntax_group | perl_syntax_group, // everything! sl@0: // sl@0: // options specific to perl group: sl@0: // sl@0: no_bk_refs = 1 << 8, // \d not allowed sl@0: no_perl_ex = 1 << 9, // disable perl extensions sl@0: no_mod_m = 1 << 10, // disable Perl m modifier sl@0: mod_x = 1 << 11, // Perl x modifier sl@0: mod_s = 1 << 12, // force s modifier on (overrides match_not_dot_newline) sl@0: no_mod_s = 1 << 13, // force s modifier off (overrides match_not_dot_newline) sl@0: sl@0: // sl@0: // options specific to basic group: sl@0: // sl@0: no_char_classes = 1 << 8, // [[:CLASS:]] not allowed sl@0: no_intervals = 1 << 9, // {x,y} not allowed sl@0: bk_plus_qm = 1 << 10, // uses \+ and \? sl@0: bk_vbar = 1 << 11, // use \| for alternatives sl@0: emacs_ex = 1 << 12, // enables emacs extensions sl@0: sl@0: // sl@0: // options common to all groups: sl@0: // sl@0: no_escape_in_lists = 1 << 16, // '\' not special inside [...] sl@0: newline_alt = 1 << 17, // \n is the same as | sl@0: no_except = 1 << 18, // no exception on error sl@0: failbit = 1 << 19, // error flag sl@0: icase = 1 << 20, // characters are matched regardless of case sl@0: nocollate = 0, // don't use locale specific collation (deprecated) sl@0: collate = 1 << 21, // use locale specific collation sl@0: nosubs = 1 << 22, // don't mark sub-expressions sl@0: optimize = 0, // not really supported sl@0: sl@0: sl@0: sl@0: basic = basic_syntax_group | collate | no_escape_in_lists, sl@0: extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists, sl@0: normal = 0, sl@0: emacs = basic_syntax_group | collate | emacs_ex | bk_vbar, sl@0: awk = no_bk_refs | collate | no_perl_ex, sl@0: grep = basic | newline_alt, sl@0: egrep = extended | newline_alt, sl@0: sed = basic, sl@0: perl = normal, sl@0: ECMAScript = normal, sl@0: JavaScript = normal, sl@0: JScript = normal sl@0: }; sl@0: typedef unsigned int flag_type; sl@0: sl@0: enum restart_info sl@0: { sl@0: restart_any = 0, sl@0: restart_word = 1, sl@0: restart_line = 2, sl@0: restart_buf = 3, sl@0: restart_continue = 4, sl@0: restart_lit = 5, sl@0: restart_fixed_lit = 6, sl@0: restart_count = 7 sl@0: }; sl@0: }; sl@0: sl@0: // sl@0: // provide std lib proposal compatible constants: sl@0: // sl@0: namespace regex_constants{ sl@0: sl@0: enum flag_type_ sl@0: { sl@0: sl@0: no_except = ::boost::regbase::no_except, sl@0: failbit = ::boost::regbase::failbit, sl@0: literal = ::boost::regbase::literal, sl@0: icase = ::boost::regbase::icase, sl@0: nocollate = ::boost::regbase::nocollate, sl@0: collate = ::boost::regbase::collate, sl@0: nosubs = ::boost::regbase::nosubs, sl@0: optimize = ::boost::regbase::optimize, sl@0: bk_plus_qm = ::boost::regbase::bk_plus_qm, sl@0: bk_vbar = ::boost::regbase::bk_vbar, sl@0: no_intervals = ::boost::regbase::no_intervals, sl@0: no_char_classes = ::boost::regbase::no_char_classes, sl@0: no_escape_in_lists = ::boost::regbase::no_escape_in_lists, sl@0: no_mod_m = ::boost::regbase::no_mod_m, sl@0: mod_x = ::boost::regbase::mod_x, sl@0: mod_s = ::boost::regbase::mod_s, sl@0: no_mod_s = ::boost::regbase::no_mod_s, sl@0: sl@0: basic = ::boost::regbase::basic, sl@0: extended = ::boost::regbase::extended, sl@0: normal = ::boost::regbase::normal, sl@0: emacs = ::boost::regbase::emacs, sl@0: awk = ::boost::regbase::awk, sl@0: grep = ::boost::regbase::grep, sl@0: egrep = ::boost::regbase::egrep, sl@0: sed = basic, sl@0: perl = normal, sl@0: ECMAScript = normal, sl@0: JavaScript = normal, sl@0: JScript = normal sl@0: }; sl@0: typedef ::boost::regbase::flag_type syntax_option_type; sl@0: sl@0: } // namespace regex_constants sl@0: sl@0: } // namespace boost sl@0: sl@0: #ifdef BOOST_HAS_ABI_HEADERS sl@0: # include BOOST_ABI_SUFFIX sl@0: #endif sl@0: sl@0: #endif sl@0: