From f0f32bdda1792b263b9f0d8192ece72a864cfea6 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 17 May 2003 11:45:48 +0000 Subject: [PATCH] Merged regex-4 branch. [SVN r18430] --- build/Jamfile | 3 + build/vc6-stlport.mak | 3 +- build/vc6.mak | 4 +- build/vc7-stlport.mak | 576 +++++ build/vc7.mak | 3 +- build/vc71-stlport.mak | 576 +++++ build/vc71.mak | 512 ++++ build/vc_gen.sh | 22 + doc/Attic/bad_expression.html | 82 + doc/Attic/basic_regex.html | 1293 ++++++++++ doc/Attic/configuration.html | 232 ++ doc/Attic/contacts.html | 110 + doc/Attic/examples.html | 99 + doc/Attic/faq.html | 162 ++ doc/Attic/format_syntax.html | 272 ++ doc/Attic/headers.html | 52 + doc/Attic/history.html | 58 + doc/Attic/implementation.html | 45 + doc/Attic/install.html | 237 ++ doc/Attic/introduction.html | 176 ++ doc/Attic/localisation.html | 1032 ++++++++ doc/Attic/match_flag_type.html | 330 +++ doc/Attic/match_results.html | 511 ++++ doc/Attic/partial_matches.html | 185 ++ doc/Attic/performance.html | 54 + doc/Attic/posix_api.html | 288 +++ doc/Attic/redistributables.html | 84 + doc/Attic/reg_expression.html | 46 + doc/Attic/regbase.html | 91 + doc/Attic/regex.html | 620 +++++ doc/Attic/regex_format.html | 213 ++ doc/Attic/regex_grep.html | 386 +++ doc/Attic/regex_iterator.html | 427 ++++ doc/Attic/regex_match.html | 317 +++ doc/Attic/regex_merge.html | 47 + doc/Attic/regex_replace.html | 213 ++ doc/Attic/regex_search.html | 328 +++ doc/Attic/regex_split.html | 148 ++ doc/Attic/regex_token_iterator.html | 286 +++ doc/Attic/regex_traits.html | 48 + doc/bad_expression.html | 82 + doc/basic_regex.html | 1293 ++++++++++ doc/configuration.html | 232 ++ doc/contacts.html | 110 + doc/examples.html | 99 + doc/faq.html | 162 ++ doc/format_syntax.html | 272 ++ doc/gcc-performance.html | 539 ++++ doc/headers.html | 52 + doc/history.html | 58 + doc/implementation.html | 45 + doc/index.html | 127 + doc/install.html | 237 ++ doc/introduction.html | 176 ++ doc/localisation.html | 1032 ++++++++ doc/match_flag_type.html | 330 +++ doc/match_results.html | 511 ++++ doc/partial_matches.html | 185 ++ doc/performance.html | 54 + doc/posix_api.html | 288 +++ doc/redistributables.html | 84 + doc/reg_expression.html | 46 + doc/regbase.html | 91 + doc/regex.html | 620 +++++ doc/regex_format.html | 213 ++ doc/regex_grep.html | 386 +++ doc/regex_iterator.html | 427 ++++ doc/regex_match.html | 317 +++ doc/regex_merge.html | 47 + doc/regex_replace.html | 213 ++ doc/regex_search.html | 328 +++ doc/regex_split.html | 148 ++ doc/regex_token_iterator.html | 286 +++ doc/regex_traits.html | 48 + example/Jamfile | 5 +- example/jgrep/jgrep.cpp | 47 +- example/jgrep/main.cpp | 12 +- example/snippets/credit_card_example.cpp | 4 +- example/snippets/regex_grep_example_1.cpp | 4 +- example/snippets/regex_grep_example_2.cpp | 4 +- example/snippets/regex_grep_example_3.cpp | 6 +- example/snippets/regex_grep_example_4.cpp | 6 +- example/snippets/regex_merge_example.cpp | 4 +- example/snippets/regex_search_example.cpp | 4 +- example/snippets/regex_split_example_2.cpp | 2 +- include/boost/cregex.hpp | 8 + include/boost/regex.hpp | 8 + include/boost/regex/config.hpp | 295 +-- include/boost/regex/config/borland.hpp | 64 + include/boost/regex/config/cstring.hpp | 226 ++ include/boost/regex/config/cwchar.hpp | 187 ++ .../regex/config/regex_library_include.hpp | 205 ++ include/boost/regex/pattern_except.hpp | 2 + include/boost/regex/regex_traits.hpp | 14 +- include/boost/regex/user.hpp | 33 +- include/boost/regex/v3/cregex.hpp | 35 +- include/boost/regex/v3/regex_match.hpp | 6 +- include/boost/regex/v3/regex_traits.hpp | 3 + include/boost/regex/v4/basic_regex.hpp | 395 +++ include/boost/regex/v4/char_regex_traits.hpp | 85 + include/boost/regex/v4/cregex.hpp | 293 +++ include/boost/regex/v4/fileiter.hpp | 456 ++++ include/boost/regex/v4/instances.hpp | 135 + include/boost/regex/v4/iterator_category.hpp | 85 + include/boost/regex/v4/iterator_traits.hpp | 106 + include/boost/regex/v4/match_flags.hpp | 132 + include/boost/regex/v4/match_results.hpp | 320 +++ include/boost/regex/v4/mem_block_cache.hpp | 97 + include/boost/regex/v4/perl_matcher.hpp | 436 ++++ .../boost/regex/v4/perl_matcher_common.hpp | 832 +++++++ .../regex/v4/perl_matcher_non_recursive.hpp | 1230 ++++++++++ .../boost/regex/v4/perl_matcher_recursive.hpp | 661 +++++ include/boost/regex/v4/regbase.hpp | 151 ++ include/boost/regex/v4/regex.hpp | 196 ++ include/boost/regex/v4/regex_compile.hpp | 2180 +++++++++++++++++ include/boost/regex/v4/regex_cstring.hpp | 134 + include/boost/regex/v4/regex_format.hpp | 534 ++++ include/boost/regex/v4/regex_fwd.hpp | 72 + include/boost/regex/v4/regex_grep.hpp | 147 ++ include/boost/regex/v4/regex_iterator.hpp | 154 ++ include/boost/regex/v4/regex_kmp.hpp | 111 + include/boost/regex/v4/regex_match.hpp | 195 ++ include/boost/regex/v4/regex_merge.hpp | 82 + include/boost/regex/v4/regex_raw_buffer.hpp | 256 ++ include/boost/regex/v4/regex_replace.hpp | 91 + include/boost/regex/v4/regex_search.hpp | 196 ++ include/boost/regex/v4/regex_split.hpp | 152 ++ include/boost/regex/v4/regex_stack.hpp | 227 ++ include/boost/regex/v4/regex_synch.hpp | 213 ++ .../boost/regex/v4/regex_token_iterator.hpp | 215 ++ include/boost/regex/v4/regex_traits.hpp | 822 +++++++ include/boost/regex/v4/states.hpp | 233 ++ include/boost/regex/v4/sub_match.hpp | 337 +++ include/boost/regex_fwd.hpp | 8 + src/c_regex_traits.cpp | 6 + src/c_regex_traits_common.cpp | 5 + src/cpp_regex_traits.cpp | 33 +- src/cregex.cpp | 63 +- src/fileiter.cpp | 5 + src/posix_api.cpp | 23 +- src/regex.cpp | 72 +- src/regex_debug.cpp | 5 + src/regex_synch.cpp | 7 + src/w32_regex_traits.cpp | 6 + src/wide_posix_api.cpp | 23 +- test/Jamfile | 12 + test/regress/gcc.mak | 3 +- test/regress/parse.cpp | 50 +- test/regress/regex_test.cpp | 22 +- test/regress/regress.cpp | 8 +- test/regress/regress.h | 18 +- test/regress/tests.cpp | 154 +- test/regress/tests.txt | 330 ++- test/regress/wregex_test.cpp | 18 +- 154 files changed, 32893 insertions(+), 432 deletions(-) create mode 100644 build/vc7-stlport.mak create mode 100644 build/vc71-stlport.mak create mode 100644 build/vc71.mak create mode 100644 doc/Attic/bad_expression.html create mode 100644 doc/Attic/basic_regex.html create mode 100644 doc/Attic/configuration.html create mode 100644 doc/Attic/contacts.html create mode 100644 doc/Attic/examples.html create mode 100644 doc/Attic/faq.html create mode 100644 doc/Attic/format_syntax.html create mode 100644 doc/Attic/headers.html create mode 100644 doc/Attic/history.html create mode 100644 doc/Attic/implementation.html create mode 100644 doc/Attic/install.html create mode 100644 doc/Attic/introduction.html create mode 100644 doc/Attic/localisation.html create mode 100644 doc/Attic/match_flag_type.html create mode 100644 doc/Attic/match_results.html create mode 100644 doc/Attic/partial_matches.html create mode 100644 doc/Attic/performance.html create mode 100644 doc/Attic/posix_api.html create mode 100644 doc/Attic/redistributables.html create mode 100644 doc/Attic/reg_expression.html create mode 100644 doc/Attic/regbase.html create mode 100644 doc/Attic/regex.html create mode 100644 doc/Attic/regex_format.html create mode 100644 doc/Attic/regex_grep.html create mode 100644 doc/Attic/regex_iterator.html create mode 100644 doc/Attic/regex_match.html create mode 100644 doc/Attic/regex_merge.html create mode 100644 doc/Attic/regex_replace.html create mode 100644 doc/Attic/regex_search.html create mode 100644 doc/Attic/regex_split.html create mode 100644 doc/Attic/regex_token_iterator.html create mode 100644 doc/Attic/regex_traits.html create mode 100644 doc/bad_expression.html create mode 100644 doc/basic_regex.html create mode 100644 doc/configuration.html create mode 100644 doc/contacts.html create mode 100644 doc/examples.html create mode 100644 doc/faq.html create mode 100644 doc/format_syntax.html create mode 100644 doc/gcc-performance.html create mode 100644 doc/headers.html create mode 100644 doc/history.html create mode 100644 doc/implementation.html create mode 100644 doc/index.html create mode 100644 doc/install.html create mode 100644 doc/introduction.html create mode 100644 doc/localisation.html create mode 100644 doc/match_flag_type.html create mode 100644 doc/match_results.html create mode 100644 doc/partial_matches.html create mode 100644 doc/performance.html create mode 100644 doc/posix_api.html create mode 100644 doc/redistributables.html create mode 100644 doc/reg_expression.html create mode 100644 doc/regbase.html create mode 100644 doc/regex.html create mode 100644 doc/regex_format.html create mode 100644 doc/regex_grep.html create mode 100644 doc/regex_iterator.html create mode 100644 doc/regex_match.html create mode 100644 doc/regex_merge.html create mode 100644 doc/regex_replace.html create mode 100644 doc/regex_search.html create mode 100644 doc/regex_split.html create mode 100644 doc/regex_token_iterator.html create mode 100644 doc/regex_traits.html create mode 100644 include/boost/regex/config/borland.hpp create mode 100644 include/boost/regex/config/cstring.hpp create mode 100644 include/boost/regex/config/cwchar.hpp create mode 100644 include/boost/regex/config/regex_library_include.hpp create mode 100644 include/boost/regex/v4/basic_regex.hpp create mode 100644 include/boost/regex/v4/char_regex_traits.hpp create mode 100644 include/boost/regex/v4/cregex.hpp create mode 100644 include/boost/regex/v4/fileiter.hpp create mode 100644 include/boost/regex/v4/instances.hpp create mode 100644 include/boost/regex/v4/iterator_category.hpp create mode 100644 include/boost/regex/v4/iterator_traits.hpp create mode 100644 include/boost/regex/v4/match_flags.hpp create mode 100644 include/boost/regex/v4/match_results.hpp create mode 100644 include/boost/regex/v4/mem_block_cache.hpp create mode 100644 include/boost/regex/v4/perl_matcher.hpp create mode 100644 include/boost/regex/v4/perl_matcher_common.hpp create mode 100644 include/boost/regex/v4/perl_matcher_non_recursive.hpp create mode 100644 include/boost/regex/v4/perl_matcher_recursive.hpp create mode 100644 include/boost/regex/v4/regbase.hpp create mode 100644 include/boost/regex/v4/regex.hpp create mode 100644 include/boost/regex/v4/regex_compile.hpp create mode 100644 include/boost/regex/v4/regex_cstring.hpp create mode 100644 include/boost/regex/v4/regex_format.hpp create mode 100644 include/boost/regex/v4/regex_fwd.hpp create mode 100644 include/boost/regex/v4/regex_grep.hpp create mode 100644 include/boost/regex/v4/regex_iterator.hpp create mode 100644 include/boost/regex/v4/regex_kmp.hpp create mode 100644 include/boost/regex/v4/regex_match.hpp create mode 100644 include/boost/regex/v4/regex_merge.hpp create mode 100644 include/boost/regex/v4/regex_raw_buffer.hpp create mode 100644 include/boost/regex/v4/regex_replace.hpp create mode 100644 include/boost/regex/v4/regex_search.hpp create mode 100644 include/boost/regex/v4/regex_split.hpp create mode 100644 include/boost/regex/v4/regex_stack.hpp create mode 100644 include/boost/regex/v4/regex_synch.hpp create mode 100644 include/boost/regex/v4/regex_token_iterator.hpp create mode 100644 include/boost/regex/v4/regex_traits.hpp create mode 100644 include/boost/regex/v4/states.hpp create mode 100644 include/boost/regex/v4/sub_match.hpp diff --git a/build/Jamfile b/build/Jamfile index b69223f6..81199be6 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -9,6 +9,8 @@ lib boost_regex : ../src/$(SOURCES).cpp $(BOOST_ROOT) BOOST_REGEX_NO_LIB=1 BOOST_REGEX_STATIC_LINK=1 + multi + multi : debug release ; @@ -96,3 +98,4 @@ stage bin-stage : boost_regex boost_regex + diff --git a/build/vc6-stlport.mak b/build/vc6-stlport.mak index f3ecc4ad..a592d2fb 100644 --- a/build/vc6-stlport.mak +++ b/build/vc6-stlport.mak @@ -40,7 +40,7 @@ NULL=nul !ENDIF -ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp +ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/cregex.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_fwd.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp ../../../boost/regex/v3/regex_traits.hpp all : main_dir boost_regex_vc6-stlport_mss_dir ./vc6-stlport/boost_regex_vc6-stlport_mss.lib boost_regex_vc6-stlport_mssd_dir ./vc6-stlport/boost_regex_vc6-stlport_mssd.lib boost_regex_vc6-stlport_mdid_dir ./vc6-stlport/boost_regex_vc6-stlport_mdid.lib boost_regex_vc6-stlport_mdi_dir ./vc6-stlport/boost_regex_vc6-stlport_mdi.lib boost_regex_vc6-stlport_mds_dir ./vc6-stlport/boost_regex_vc6-stlport_mds.lib boost_regex_vc6-stlport_mdsd_dir ./vc6-stlport/boost_regex_vc6-stlport_mdsd.lib boost_regex_vc6-stlport_mdidd_dir ./vc6-stlport/boost_regex_vc6-stlport_mdidd.lib boost_regex_vc6-stlport_mssdd_dir ./vc6-stlport/boost_regex_vc6-stlport_mssdd.lib boost_regex_vc6-stlport_mdsdd_dir ./vc6-stlport/boost_regex_vc6-stlport_mdsdd.lib @@ -574,4 +574,3 @@ boost_regex_vc6-stlport_mdsdd_clean : ./vc6-stlport/boost_regex_vc6-stlport_mdsdd.lib : vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits_common.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cpp_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cregex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/fileiter.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/instances.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_debug.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_synch.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/w32_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/wide_posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/winstances.obj link -lib /nologo /out:vc6-stlport/boost_regex_vc6-stlport_mdsdd.lib $(XSFLAGS) vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits_common.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cpp_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cregex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/fileiter.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/instances.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_debug.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_synch.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/w32_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/wide_posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/winstances.obj - diff --git a/build/vc6.mak b/build/vc6.mak index 88749e69..97e09c8a 100644 --- a/build/vc6.mak +++ b/build/vc6.mak @@ -36,7 +36,7 @@ NULL=nul !ENDIF -ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp +ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/cregex.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_fwd.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp ../../../boost/regex/v3/regex_traits.hpp all : main_dir boost_regex_vc6_sss_dir ./vc6/boost_regex_vc6_sss.lib boost_regex_vc6_mss_dir ./vc6/boost_regex_vc6_mss.lib boost_regex_vc6_sssd_dir ./vc6/boost_regex_vc6_sssd.lib boost_regex_vc6_mssd_dir ./vc6/boost_regex_vc6_mssd.lib boost_regex_vc6_mdid_dir ./vc6/boost_regex_vc6_mdid.lib boost_regex_vc6_mdi_dir ./vc6/boost_regex_vc6_mdi.lib boost_regex_vc6_mds_dir ./vc6/boost_regex_vc6_mds.lib boost_regex_vc6_mdsd_dir ./vc6/boost_regex_vc6_mdsd.lib @@ -510,5 +510,3 @@ boost_regex_vc6_mdsd_clean : ./vc6/boost_regex_vc6_mdsd.lib : vc6/boost_regex_vc6_mdsd/c_regex_traits.obj vc6/boost_regex_vc6_mdsd/c_regex_traits_common.obj vc6/boost_regex_vc6_mdsd/cpp_regex_traits.obj vc6/boost_regex_vc6_mdsd/cregex.obj vc6/boost_regex_vc6_mdsd/fileiter.obj vc6/boost_regex_vc6_mdsd/instances.obj vc6/boost_regex_vc6_mdsd/posix_api.obj vc6/boost_regex_vc6_mdsd/regex.obj vc6/boost_regex_vc6_mdsd/regex_debug.obj vc6/boost_regex_vc6_mdsd/regex_synch.obj vc6/boost_regex_vc6_mdsd/w32_regex_traits.obj vc6/boost_regex_vc6_mdsd/wide_posix_api.obj vc6/boost_regex_vc6_mdsd/winstances.obj link -lib /nologo /out:vc6/boost_regex_vc6_mdsd.lib $(XSFLAGS) vc6/boost_regex_vc6_mdsd/c_regex_traits.obj vc6/boost_regex_vc6_mdsd/c_regex_traits_common.obj vc6/boost_regex_vc6_mdsd/cpp_regex_traits.obj vc6/boost_regex_vc6_mdsd/cregex.obj vc6/boost_regex_vc6_mdsd/fileiter.obj vc6/boost_regex_vc6_mdsd/instances.obj vc6/boost_regex_vc6_mdsd/posix_api.obj vc6/boost_regex_vc6_mdsd/regex.obj vc6/boost_regex_vc6_mdsd/regex_debug.obj vc6/boost_regex_vc6_mdsd/regex_synch.obj vc6/boost_regex_vc6_mdsd/w32_regex_traits.obj vc6/boost_regex_vc6_mdsd/wide_posix_api.obj vc6/boost_regex_vc6_mdsd/winstances.obj - - diff --git a/build/vc7-stlport.mak b/build/vc7-stlport.mak new file mode 100644 index 00000000..7a2339fb --- /dev/null +++ b/build/vc7-stlport.mak @@ -0,0 +1,576 @@ +# +# auto generated makefile for VC6+STLPort +# +# usage: +# make +# brings libraries up to date +# make install +# brings libraries up to date and copies binaries to your VC6 /lib and /bin directories (recomended) +# + +# +# Add additional compiler options here: +# +CXXFLAGS= +# +# Add additional include directories here: +# +INCLUDES= +# +# add additional linker flags here: +# +XLFLAGS= +# +# add additional static-library creation flags here: +# +XSFLAGS= + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(MSVCDIR)" == "" +!ERROR Variable MSVCDIR not set. +!ENDIF + +!IF "$(STLPORT_PATH)" == "" +!ERROR Variable STLPORT_PATH not set. +!ENDIF + + +ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/cregex.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_fwd.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp ../../../boost/regex/v3/regex_traits.hpp + +all : main_dir boost_regex_vc7-stlport_mss_dir ./vc7-stlport/boost_regex_vc7-stlport_mss.lib boost_regex_vc7-stlport_mssd_dir ./vc7-stlport/boost_regex_vc7-stlport_mssd.lib boost_regex_vc7-stlport_mdid_dir ./vc7-stlport/boost_regex_vc7-stlport_mdid.lib boost_regex_vc7-stlport_mdi_dir ./vc7-stlport/boost_regex_vc7-stlport_mdi.lib boost_regex_vc7-stlport_mds_dir ./vc7-stlport/boost_regex_vc7-stlport_mds.lib boost_regex_vc7-stlport_mdsd_dir ./vc7-stlport/boost_regex_vc7-stlport_mdsd.lib boost_regex_vc7-stlport_mdidd_dir ./vc7-stlport/boost_regex_vc7-stlport_mdidd.lib boost_regex_vc7-stlport_mssdd_dir ./vc7-stlport/boost_regex_vc7-stlport_mssdd.lib boost_regex_vc7-stlport_mdsdd_dir ./vc7-stlport/boost_regex_vc7-stlport_mdsdd.lib + +clean : boost_regex_vc7-stlport_mss_clean boost_regex_vc7-stlport_mssd_clean boost_regex_vc7-stlport_mdid_clean boost_regex_vc7-stlport_mdi_clean boost_regex_vc7-stlport_mds_clean boost_regex_vc7-stlport_mdsd_clean boost_regex_vc7-stlport_mdidd_clean boost_regex_vc7-stlport_mssdd_clean boost_regex_vc7-stlport_mdsdd_clean + +install : stlport_check all + copy vc7-stlport\boost_regex_vc7-stlport_mss.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mssd.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdid.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdid.dll "$(MSVCDIR)\bin" + copy vc7-stlport\boost_regex_vc7-stlport_mdi.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdi.dll "$(MSVCDIR)\bin" + copy vc7-stlport\boost_regex_vc7-stlport_mds.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdsd.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdidd.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdidd.dll "$(MSVCDIR)\bin" + copy vc7-stlport\boost_regex_vc7-stlport_mdidd.pdb "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mssdd.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mssdd.pdb "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdsdd.lib "$(MSVCDIR)\lib" + copy vc7-stlport\boost_regex_vc7-stlport_mdsdd.pdb "$(MSVCDIR)\lib" + +main_dir : + @if not exist "vc7-stlport\$(NULL)" mkdir vc7-stlport + +stlport_check : $(STLPORT_PATH)\stlport\string + echo + + +######################################################## +# +# section for boost_regex_vc7-stlport_mss.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mss/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mss/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mss/boost_regex_vc7-stlport_mss.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mss/ -Fdvc7-stlport/boost_regex_vc7-stlport_mss.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mss_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mss\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mss + +boost_regex_vc7-stlport_mss_clean : + del vc7-stlport\boost_regex_vc7-stlport_mss\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mss\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mss\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mss\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mss.lib : vc7-stlport/boost_regex_vc7-stlport_mss/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mss/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mss/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mss/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mss/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mss/instances.obj vc7-stlport/boost_regex_vc7-stlport_mss/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mss/regex.obj vc7-stlport/boost_regex_vc7-stlport_mss/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mss/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mss/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mss/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mss/winstances.obj + link -lib /nologo /out:vc7-stlport/boost_regex_vc7-stlport_mss.lib $(XSFLAGS) vc7-stlport/boost_regex_vc7-stlport_mss/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mss/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mss/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mss/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mss/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mss/instances.obj vc7-stlport/boost_regex_vc7-stlport_mss/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mss/regex.obj vc7-stlport/boost_regex_vc7-stlport_mss/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mss/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mss/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mss/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mss/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mssd.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mssd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssd/boost_regex_vc7-stlport_mssd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssd.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mssd_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mssd\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mssd + +boost_regex_vc7-stlport_mssd_clean : + del vc7-stlport\boost_regex_vc7-stlport_mssd\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mssd\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mssd\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mssd\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mssd.lib : vc7-stlport/boost_regex_vc7-stlport_mssd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mssd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mssd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mssd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mssd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mssd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mssd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mssd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssd/winstances.obj + link -lib /nologo /out:vc7-stlport/boost_regex_vc7-stlport_mssd.lib $(XSFLAGS) vc7-stlport/boost_regex_vc7-stlport_mssd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mssd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mssd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mssd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mssd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mssd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mssd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mssd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssd/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mdid.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mdid/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdid/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdid/boost_regex_vc7-stlport_mdid.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdid/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdid.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mdid_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mdid\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mdid + +boost_regex_vc7-stlport_mdid_clean : + del vc7-stlport\boost_regex_vc7-stlport_mdid\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mdid\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mdid\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mdid\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mdid.lib : vc7-stlport/boost_regex_vc7-stlport_mdid/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdid/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdid/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdid/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdid/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdid/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdid/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdid/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdid/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdid/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdid/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdid/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdid/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc7-stlport/boost_regex_vc7-stlport_mdid.pdb" /debug /machine:I386 /out:"vc7-stlport/boost_regex_vc7-stlport_mdid.dll" /implib:"vc7-stlport/boost_regex_vc7-stlport_mdid.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc7-stlport/boost_regex_vc7-stlport_mdid/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdid/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdid/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdid/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdid/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdid/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdid/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdid/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdid/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdid/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdid/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdid/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdid/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mdi.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mdi/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdi/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdi/boost_regex_vc7-stlport_mdi.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdi/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdi.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mdi_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mdi\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mdi + +boost_regex_vc7-stlport_mdi_clean : + del vc7-stlport\boost_regex_vc7-stlport_mdi\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mdi\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mdi\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mdi\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mdi.lib : vc7-stlport/boost_regex_vc7-stlport_mdi/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdi/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdi/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdi/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdi/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdi/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdi/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdi/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdi/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdi/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdi/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdi/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdi/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc7-stlport/boost_regex_vc7-stlport_mdi.pdb" /debug /machine:I386 /out:"vc7-stlport/boost_regex_vc7-stlport_mdi.dll" /implib:"vc7-stlport/boost_regex_vc7-stlport_mdi.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc7-stlport/boost_regex_vc7-stlport_mdi/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdi/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdi/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdi/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdi/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdi/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdi/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdi/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdi/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdi/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdi/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdi/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdi/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mds.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mds/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mds/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mds/boost_regex_vc7-stlport_mds.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mds/ -Fdvc7-stlport/boost_regex_vc7-stlport_mds.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mds_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mds\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mds + +boost_regex_vc7-stlport_mds_clean : + del vc7-stlport\boost_regex_vc7-stlport_mds\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mds\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mds\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mds\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mds.lib : vc7-stlport/boost_regex_vc7-stlport_mds/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mds/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mds/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mds/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mds/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mds/instances.obj vc7-stlport/boost_regex_vc7-stlport_mds/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mds/regex.obj vc7-stlport/boost_regex_vc7-stlport_mds/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mds/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mds/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mds/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mds/winstances.obj + link -lib /nologo /out:vc7-stlport/boost_regex_vc7-stlport_mds.lib $(XSFLAGS) vc7-stlport/boost_regex_vc7-stlport_mds/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mds/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mds/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mds/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mds/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mds/instances.obj vc7-stlport/boost_regex_vc7-stlport_mds/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mds/regex.obj vc7-stlport/boost_regex_vc7-stlport_mds/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mds/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mds/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mds/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mds/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mdsd.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mdsd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsd/boost_regex_vc7-stlport_mdsd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsd.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mdsd_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mdsd\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mdsd + +boost_regex_vc7-stlport_mdsd_clean : + del vc7-stlport\boost_regex_vc7-stlport_mdsd\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mdsd\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mdsd\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mdsd\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mdsd.lib : vc7-stlport/boost_regex_vc7-stlport_mdsd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/winstances.obj + link -lib /nologo /out:vc7-stlport/boost_regex_vc7-stlport_mdsd.lib $(XSFLAGS) vc7-stlport/boost_regex_vc7-stlport_mdsd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsd/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mdidd.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mdidd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdidd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdidd/boost_regex_vc7-stlport_mdidd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdidd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdidd.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mdidd_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mdidd\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mdidd + +boost_regex_vc7-stlport_mdidd_clean : + del vc7-stlport\boost_regex_vc7-stlport_mdidd\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mdidd\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mdidd\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mdidd\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mdidd.lib : vc7-stlport/boost_regex_vc7-stlport_mdidd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc7-stlport/boost_regex_vc7-stlport_mdidd.pdb" /debug /machine:I386 /out:"vc7-stlport/boost_regex_vc7-stlport_mdidd.dll" /implib:"vc7-stlport/boost_regex_vc7-stlport_mdidd.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc7-stlport/boost_regex_vc7-stlport_mdidd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdidd/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mssdd.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mssdd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mssdd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mssdd/boost_regex_vc7-stlport_mssdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mssdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mssdd.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mssdd_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mssdd\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mssdd + +boost_regex_vc7-stlport_mssdd_clean : + del vc7-stlport\boost_regex_vc7-stlport_mssdd\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mssdd\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mssdd\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mssdd\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mssdd.lib : vc7-stlport/boost_regex_vc7-stlport_mssdd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/winstances.obj + link -lib /nologo /out:vc7-stlport/boost_regex_vc7-stlport_mssdd.lib $(XSFLAGS) vc7-stlport/boost_regex_vc7-stlport_mssdd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mssdd/winstances.obj + +######################################################## +# +# section for boost_regex_vc7-stlport_mdsdd.lib +# +######################################################## +vc7-stlport/boost_regex_vc7-stlport_mdsdd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/c_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/c_regex_traits_common.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/cpp_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/cregex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/fileiter.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/instances.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/regex.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/regex_debug.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/regex_synch.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/w32_regex_traits.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/wide_posix_api.cpp + +vc7-stlport/boost_regex_vc7-stlport_mdsdd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc7-stlport/boost_regex_vc7-stlport_mdsdd/boost_regex_vc7-stlport_mdsdd.pch -Fo./vc7-stlport/boost_regex_vc7-stlport_mdsdd/ -Fdvc7-stlport/boost_regex_vc7-stlport_mdsdd.pdb ../src/winstances.cpp + +boost_regex_vc7-stlport_mdsdd_dir : + @if not exist "vc7-stlport\boost_regex_vc7-stlport_mdsdd\$(NULL)" mkdir vc7-stlport\boost_regex_vc7-stlport_mdsdd + +boost_regex_vc7-stlport_mdsdd_clean : + del vc7-stlport\boost_regex_vc7-stlport_mdsdd\*.obj + del vc7-stlport\boost_regex_vc7-stlport_mdsdd\*.idb + del vc7-stlport\boost_regex_vc7-stlport_mdsdd\*.exp + del vc7-stlport\boost_regex_vc7-stlport_mdsdd\*.pch + +./vc7-stlport/boost_regex_vc7-stlport_mdsdd.lib : vc7-stlport/boost_regex_vc7-stlport_mdsdd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/winstances.obj + link -lib /nologo /out:vc7-stlport/boost_regex_vc7-stlport_mdsdd.lib $(XSFLAGS) vc7-stlport/boost_regex_vc7-stlport_mdsdd/c_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/c_regex_traits_common.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/cpp_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/cregex.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/fileiter.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/instances.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex_debug.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/regex_synch.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/w32_regex_traits.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/wide_posix_api.obj vc7-stlport/boost_regex_vc7-stlport_mdsdd/winstances.obj + diff --git a/build/vc7.mak b/build/vc7.mak index beaa0421..af8641c1 100644 --- a/build/vc7.mak +++ b/build/vc7.mak @@ -36,7 +36,7 @@ NULL=nul !ENDIF -ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp +ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/cregex.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_fwd.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp ../../../boost/regex/v3/regex_traits.hpp all : main_dir boost_regex_vc7_sss_dir ./vc7/boost_regex_vc7_sss.lib boost_regex_vc7_mss_dir ./vc7/boost_regex_vc7_mss.lib boost_regex_vc7_sssd_dir ./vc7/boost_regex_vc7_sssd.lib boost_regex_vc7_mssd_dir ./vc7/boost_regex_vc7_mssd.lib boost_regex_vc7_mdid_dir ./vc7/boost_regex_vc7_mdid.lib boost_regex_vc7_mdi_dir ./vc7/boost_regex_vc7_mdi.lib boost_regex_vc7_mds_dir ./vc7/boost_regex_vc7_mds.lib boost_regex_vc7_mdsd_dir ./vc7/boost_regex_vc7_mdsd.lib @@ -510,4 +510,3 @@ boost_regex_vc7_mdsd_clean : ./vc7/boost_regex_vc7_mdsd.lib : vc7/boost_regex_vc7_mdsd/c_regex_traits.obj vc7/boost_regex_vc7_mdsd/c_regex_traits_common.obj vc7/boost_regex_vc7_mdsd/cpp_regex_traits.obj vc7/boost_regex_vc7_mdsd/cregex.obj vc7/boost_regex_vc7_mdsd/fileiter.obj vc7/boost_regex_vc7_mdsd/instances.obj vc7/boost_regex_vc7_mdsd/posix_api.obj vc7/boost_regex_vc7_mdsd/regex.obj vc7/boost_regex_vc7_mdsd/regex_debug.obj vc7/boost_regex_vc7_mdsd/regex_synch.obj vc7/boost_regex_vc7_mdsd/w32_regex_traits.obj vc7/boost_regex_vc7_mdsd/wide_posix_api.obj vc7/boost_regex_vc7_mdsd/winstances.obj link -lib /nologo /out:vc7/boost_regex_vc7_mdsd.lib $(XSFLAGS) vc7/boost_regex_vc7_mdsd/c_regex_traits.obj vc7/boost_regex_vc7_mdsd/c_regex_traits_common.obj vc7/boost_regex_vc7_mdsd/cpp_regex_traits.obj vc7/boost_regex_vc7_mdsd/cregex.obj vc7/boost_regex_vc7_mdsd/fileiter.obj vc7/boost_regex_vc7_mdsd/instances.obj vc7/boost_regex_vc7_mdsd/posix_api.obj vc7/boost_regex_vc7_mdsd/regex.obj vc7/boost_regex_vc7_mdsd/regex_debug.obj vc7/boost_regex_vc7_mdsd/regex_synch.obj vc7/boost_regex_vc7_mdsd/w32_regex_traits.obj vc7/boost_regex_vc7_mdsd/wide_posix_api.obj vc7/boost_regex_vc7_mdsd/winstances.obj - diff --git a/build/vc71-stlport.mak b/build/vc71-stlport.mak new file mode 100644 index 00000000..61411b74 --- /dev/null +++ b/build/vc71-stlport.mak @@ -0,0 +1,576 @@ +# +# auto generated makefile for VC6+STLPort +# +# usage: +# make +# brings libraries up to date +# make install +# brings libraries up to date and copies binaries to your VC6 /lib and /bin directories (recomended) +# + +# +# Add additional compiler options here: +# +CXXFLAGS= +# +# Add additional include directories here: +# +INCLUDES= +# +# add additional linker flags here: +# +XLFLAGS= +# +# add additional static-library creation flags here: +# +XSFLAGS= + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(MSVCDIR)" == "" +!ERROR Variable MSVCDIR not set. +!ENDIF + +!IF "$(STLPORT_PATH)" == "" +!ERROR Variable STLPORT_PATH not set. +!ENDIF + + +ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/cregex.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_fwd.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp ../../../boost/regex/v3/regex_traits.hpp + +all : main_dir boost_regex_vc71-stlport_mss_dir ./vc71-stlport/boost_regex_vc71-stlport_mss.lib boost_regex_vc71-stlport_mssd_dir ./vc71-stlport/boost_regex_vc71-stlport_mssd.lib boost_regex_vc71-stlport_mdid_dir ./vc71-stlport/boost_regex_vc71-stlport_mdid.lib boost_regex_vc71-stlport_mdi_dir ./vc71-stlport/boost_regex_vc71-stlport_mdi.lib boost_regex_vc71-stlport_mds_dir ./vc71-stlport/boost_regex_vc71-stlport_mds.lib boost_regex_vc71-stlport_mdsd_dir ./vc71-stlport/boost_regex_vc71-stlport_mdsd.lib boost_regex_vc71-stlport_mdidd_dir ./vc71-stlport/boost_regex_vc71-stlport_mdidd.lib boost_regex_vc71-stlport_mssdd_dir ./vc71-stlport/boost_regex_vc71-stlport_mssdd.lib boost_regex_vc71-stlport_mdsdd_dir ./vc71-stlport/boost_regex_vc71-stlport_mdsdd.lib + +clean : boost_regex_vc71-stlport_mss_clean boost_regex_vc71-stlport_mssd_clean boost_regex_vc71-stlport_mdid_clean boost_regex_vc71-stlport_mdi_clean boost_regex_vc71-stlport_mds_clean boost_regex_vc71-stlport_mdsd_clean boost_regex_vc71-stlport_mdidd_clean boost_regex_vc71-stlport_mssdd_clean boost_regex_vc71-stlport_mdsdd_clean + +install : stlport_check all + copy vc71-stlport\boost_regex_vc71-stlport_mss.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mssd.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdid.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdid.dll "$(MSVCDIR)\bin" + copy vc71-stlport\boost_regex_vc71-stlport_mdi.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdi.dll "$(MSVCDIR)\bin" + copy vc71-stlport\boost_regex_vc71-stlport_mds.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdsd.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdidd.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdidd.dll "$(MSVCDIR)\bin" + copy vc71-stlport\boost_regex_vc71-stlport_mdidd.pdb "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mssdd.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mssdd.pdb "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdsdd.lib "$(MSVCDIR)\lib" + copy vc71-stlport\boost_regex_vc71-stlport_mdsdd.pdb "$(MSVCDIR)\lib" + +main_dir : + @if not exist "vc71-stlport\$(NULL)" mkdir vc71-stlport + +stlport_check : $(STLPORT_PATH)\stlport\string + echo + + +######################################################## +# +# section for boost_regex_vc71-stlport_mss.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mss/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mss/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mss/boost_regex_vc71-stlport_mss.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mss/ -Fdvc71-stlport/boost_regex_vc71-stlport_mss.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mss_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mss\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mss + +boost_regex_vc71-stlport_mss_clean : + del vc71-stlport\boost_regex_vc71-stlport_mss\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mss\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mss\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mss\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mss.lib : vc71-stlport/boost_regex_vc71-stlport_mss/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mss/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mss/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mss/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mss/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mss/instances.obj vc71-stlport/boost_regex_vc71-stlport_mss/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mss/regex.obj vc71-stlport/boost_regex_vc71-stlport_mss/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mss/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mss/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mss/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mss/winstances.obj + link -lib /nologo /out:vc71-stlport/boost_regex_vc71-stlport_mss.lib $(XSFLAGS) vc71-stlport/boost_regex_vc71-stlport_mss/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mss/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mss/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mss/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mss/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mss/instances.obj vc71-stlport/boost_regex_vc71-stlport_mss/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mss/regex.obj vc71-stlport/boost_regex_vc71-stlport_mss/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mss/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mss/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mss/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mss/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mssd.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mssd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssd/boost_regex_vc71-stlport_mssd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssd.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mssd_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mssd\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mssd + +boost_regex_vc71-stlport_mssd_clean : + del vc71-stlport\boost_regex_vc71-stlport_mssd\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mssd\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mssd\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mssd\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mssd.lib : vc71-stlport/boost_regex_vc71-stlport_mssd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mssd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mssd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mssd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mssd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mssd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mssd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mssd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssd/winstances.obj + link -lib /nologo /out:vc71-stlport/boost_regex_vc71-stlport_mssd.lib $(XSFLAGS) vc71-stlport/boost_regex_vc71-stlport_mssd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mssd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mssd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mssd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mssd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mssd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mssd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mssd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssd/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mdid.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mdid/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdid/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdid/boost_regex_vc71-stlport_mdid.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdid/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdid.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mdid_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mdid\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mdid + +boost_regex_vc71-stlport_mdid_clean : + del vc71-stlport\boost_regex_vc71-stlport_mdid\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mdid\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mdid\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mdid\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mdid.lib : vc71-stlport/boost_regex_vc71-stlport_mdid/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdid/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdid/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdid/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdid/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdid/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdid/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdid/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdid/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdid/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdid/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdid/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdid/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc71-stlport/boost_regex_vc71-stlport_mdid.pdb" /debug /machine:I386 /out:"vc71-stlport/boost_regex_vc71-stlport_mdid.dll" /implib:"vc71-stlport/boost_regex_vc71-stlport_mdid.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc71-stlport/boost_regex_vc71-stlport_mdid/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdid/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdid/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdid/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdid/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdid/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdid/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdid/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdid/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdid/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdid/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdid/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdid/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mdi.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mdi/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdi/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /I$(STLPORT_PATH)\stlport /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdi/boost_regex_vc71-stlport_mdi.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdi/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdi.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mdi_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mdi\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mdi + +boost_regex_vc71-stlport_mdi_clean : + del vc71-stlport\boost_regex_vc71-stlport_mdi\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mdi\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mdi\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mdi\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mdi.lib : vc71-stlport/boost_regex_vc71-stlport_mdi/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdi/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdi/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdi/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdi/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdi/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdi/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdi/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdi/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdi/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdi/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdi/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdi/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc71-stlport/boost_regex_vc71-stlport_mdi.pdb" /debug /machine:I386 /out:"vc71-stlport/boost_regex_vc71-stlport_mdi.dll" /implib:"vc71-stlport/boost_regex_vc71-stlport_mdi.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc71-stlport/boost_regex_vc71-stlport_mdi/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdi/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdi/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdi/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdi/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdi/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdi/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdi/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdi/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdi/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdi/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdi/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdi/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mds.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mds/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mds/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mds/boost_regex_vc71-stlport_mds.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mds/ -Fdvc71-stlport/boost_regex_vc71-stlport_mds.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mds_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mds\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mds + +boost_regex_vc71-stlport_mds_clean : + del vc71-stlport\boost_regex_vc71-stlport_mds\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mds\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mds\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mds\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mds.lib : vc71-stlport/boost_regex_vc71-stlport_mds/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mds/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mds/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mds/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mds/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mds/instances.obj vc71-stlport/boost_regex_vc71-stlport_mds/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mds/regex.obj vc71-stlport/boost_regex_vc71-stlport_mds/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mds/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mds/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mds/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mds/winstances.obj + link -lib /nologo /out:vc71-stlport/boost_regex_vc71-stlport_mds.lib $(XSFLAGS) vc71-stlport/boost_regex_vc71-stlport_mds/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mds/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mds/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mds/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mds/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mds/instances.obj vc71-stlport/boost_regex_vc71-stlport_mds/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mds/regex.obj vc71-stlport/boost_regex_vc71-stlport_mds/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mds/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mds/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mds/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mds/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mdsd.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mdsd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsd/boost_regex_vc71-stlport_mdsd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsd.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mdsd_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mdsd\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mdsd + +boost_regex_vc71-stlport_mdsd_clean : + del vc71-stlport\boost_regex_vc71-stlport_mdsd\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mdsd\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mdsd\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mdsd\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mdsd.lib : vc71-stlport/boost_regex_vc71-stlport_mdsd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/winstances.obj + link -lib /nologo /out:vc71-stlport/boost_regex_vc71-stlport_mdsd.lib $(XSFLAGS) vc71-stlport/boost_regex_vc71-stlport_mdsd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsd/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mdidd.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mdidd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdidd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdidd/boost_regex_vc71-stlport_mdidd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdidd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdidd.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mdidd_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mdidd\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mdidd + +boost_regex_vc71-stlport_mdidd_clean : + del vc71-stlport\boost_regex_vc71-stlport_mdidd\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mdidd\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mdidd\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mdidd\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mdidd.lib : vc71-stlport/boost_regex_vc71-stlport_mdidd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc71-stlport/boost_regex_vc71-stlport_mdidd.pdb" /debug /machine:I386 /out:"vc71-stlport/boost_regex_vc71-stlport_mdidd.dll" /implib:"vc71-stlport/boost_regex_vc71-stlport_mdidd.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc71-stlport/boost_regex_vc71-stlport_mdidd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdidd/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mssdd.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mssdd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mssdd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mssdd/boost_regex_vc71-stlport_mssdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mssdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mssdd.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mssdd_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mssdd\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mssdd + +boost_regex_vc71-stlport_mssdd_clean : + del vc71-stlport\boost_regex_vc71-stlport_mssdd\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mssdd\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mssdd\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mssdd\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mssdd.lib : vc71-stlport/boost_regex_vc71-stlport_mssdd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/winstances.obj + link -lib /nologo /out:vc71-stlport/boost_regex_vc71-stlport_mssdd.lib $(XSFLAGS) vc71-stlport/boost_regex_vc71-stlport_mssdd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mssdd/winstances.obj + +######################################################## +# +# section for boost_regex_vc71-stlport_mdsdd.lib +# +######################################################## +vc71-stlport/boost_regex_vc71-stlport_mdsdd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/c_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/c_regex_traits_common.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/cpp_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/cregex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/fileiter.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/instances.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/regex.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/regex_debug.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/regex_synch.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/w32_regex_traits.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/wide_posix_api.cpp + +vc71-stlport/boost_regex_vc71-stlport_mdsdd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I$(STLPORT_PATH)\stlport /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD /GZ /c $(CXXFLAGS) -Fpvc71-stlport/boost_regex_vc71-stlport_mdsdd/boost_regex_vc71-stlport_mdsdd.pch -Fo./vc71-stlport/boost_regex_vc71-stlport_mdsdd/ -Fdvc71-stlport/boost_regex_vc71-stlport_mdsdd.pdb ../src/winstances.cpp + +boost_regex_vc71-stlport_mdsdd_dir : + @if not exist "vc71-stlport\boost_regex_vc71-stlport_mdsdd\$(NULL)" mkdir vc71-stlport\boost_regex_vc71-stlport_mdsdd + +boost_regex_vc71-stlport_mdsdd_clean : + del vc71-stlport\boost_regex_vc71-stlport_mdsdd\*.obj + del vc71-stlport\boost_regex_vc71-stlport_mdsdd\*.idb + del vc71-stlport\boost_regex_vc71-stlport_mdsdd\*.exp + del vc71-stlport\boost_regex_vc71-stlport_mdsdd\*.pch + +./vc71-stlport/boost_regex_vc71-stlport_mdsdd.lib : vc71-stlport/boost_regex_vc71-stlport_mdsdd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/winstances.obj + link -lib /nologo /out:vc71-stlport/boost_regex_vc71-stlport_mdsdd.lib $(XSFLAGS) vc71-stlport/boost_regex_vc71-stlport_mdsdd/c_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/c_regex_traits_common.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/cpp_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/cregex.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/fileiter.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/instances.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex_debug.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/regex_synch.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/w32_regex_traits.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/wide_posix_api.obj vc71-stlport/boost_regex_vc71-stlport_mdsdd/winstances.obj + diff --git a/build/vc71.mak b/build/vc71.mak new file mode 100644 index 00000000..557e820a --- /dev/null +++ b/build/vc71.mak @@ -0,0 +1,512 @@ +# +# auto generated makefile for VC6 compiler +# +# usage: +# make +# brings libraries up to date +# make install +# brings libraries up to date and copies binaries to your VC6 /lib and /bin directories (recomended) +# + +# +# Add additional compiler options here: +# +CXXFLAGS= +# +# Add additional include directories here: +# +INCLUDES= +# +# add additional linker flags here: +# +XLFLAGS= +# +# add additional static-library creation flags here: +# +XSFLAGS= + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(MSVCDIR)" == "" +!ERROR Variable MSVCDIR not set. +!ENDIF + + +ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/cregex.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_fwd.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp ../../../boost/regex/v3/regex_traits.hpp + +all : main_dir boost_regex_vc71_sss_dir ./vc71/boost_regex_vc71_sss.lib boost_regex_vc71_mss_dir ./vc71/boost_regex_vc71_mss.lib boost_regex_vc71_sssd_dir ./vc71/boost_regex_vc71_sssd.lib boost_regex_vc71_mssd_dir ./vc71/boost_regex_vc71_mssd.lib boost_regex_vc71_mdid_dir ./vc71/boost_regex_vc71_mdid.lib boost_regex_vc71_mdi_dir ./vc71/boost_regex_vc71_mdi.lib boost_regex_vc71_mds_dir ./vc71/boost_regex_vc71_mds.lib boost_regex_vc71_mdsd_dir ./vc71/boost_regex_vc71_mdsd.lib + +clean : boost_regex_vc71_sss_clean boost_regex_vc71_mss_clean boost_regex_vc71_sssd_clean boost_regex_vc71_mssd_clean boost_regex_vc71_mdid_clean boost_regex_vc71_mdi_clean boost_regex_vc71_mds_clean boost_regex_vc71_mdsd_clean + +install : all + copy vc71\boost_regex_vc71_sss.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mss.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_sssd.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_sssd.pdb "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mssd.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mssd.pdb "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mdid.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mdid.dll "$(MSVCDIR)\bin" + copy vc71\boost_regex_vc71_mdid.pdb "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mdi.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mdi.dll "$(MSVCDIR)\bin" + copy vc71\boost_regex_vc71_mds.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mdsd.lib "$(MSVCDIR)\lib" + copy vc71\boost_regex_vc71_mdsd.pdb "$(MSVCDIR)\lib" + +main_dir : + @if not exist "vc71\$(NULL)" mkdir vc71 + + +######################################################## +# +# section for boost_regex_vc71_sss.lib +# +######################################################## +vc71/boost_regex_vc71_sss/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_sss/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_sss/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_sss/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_sss/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_sss/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_sss/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_sss/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_sss/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_sss/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_sss/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_sss/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_sss/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /c /nologo /ML /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sss/boost_regex_vc71_sss.pch -Fo./vc71/boost_regex_vc71_sss/ -Fdvc71/boost_regex_vc71_sss.pdb ../src/winstances.cpp + +boost_regex_vc71_sss_dir : + @if not exist "vc71\boost_regex_vc71_sss\$(NULL)" mkdir vc71\boost_regex_vc71_sss + +boost_regex_vc71_sss_clean : + del vc71\boost_regex_vc71_sss\*.obj + del vc71\boost_regex_vc71_sss\*.idb + del vc71\boost_regex_vc71_sss\*.exp + del vc71\boost_regex_vc71_sss\*.pch + +./vc71/boost_regex_vc71_sss.lib : vc71/boost_regex_vc71_sss/c_regex_traits.obj vc71/boost_regex_vc71_sss/c_regex_traits_common.obj vc71/boost_regex_vc71_sss/cpp_regex_traits.obj vc71/boost_regex_vc71_sss/cregex.obj vc71/boost_regex_vc71_sss/fileiter.obj vc71/boost_regex_vc71_sss/instances.obj vc71/boost_regex_vc71_sss/posix_api.obj vc71/boost_regex_vc71_sss/regex.obj vc71/boost_regex_vc71_sss/regex_debug.obj vc71/boost_regex_vc71_sss/regex_synch.obj vc71/boost_regex_vc71_sss/w32_regex_traits.obj vc71/boost_regex_vc71_sss/wide_posix_api.obj vc71/boost_regex_vc71_sss/winstances.obj + link -lib /nologo /out:vc71/boost_regex_vc71_sss.lib $(XSFLAGS) vc71/boost_regex_vc71_sss/c_regex_traits.obj vc71/boost_regex_vc71_sss/c_regex_traits_common.obj vc71/boost_regex_vc71_sss/cpp_regex_traits.obj vc71/boost_regex_vc71_sss/cregex.obj vc71/boost_regex_vc71_sss/fileiter.obj vc71/boost_regex_vc71_sss/instances.obj vc71/boost_regex_vc71_sss/posix_api.obj vc71/boost_regex_vc71_sss/regex.obj vc71/boost_regex_vc71_sss/regex_debug.obj vc71/boost_regex_vc71_sss/regex_synch.obj vc71/boost_regex_vc71_sss/w32_regex_traits.obj vc71/boost_regex_vc71_sss/wide_posix_api.obj vc71/boost_regex_vc71_sss/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_mss.lib +# +######################################################## +vc71/boost_regex_vc71_mss/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_mss/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_mss/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_mss/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_mss/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_mss/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_mss/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_mss/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_mss/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_mss/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_mss/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_mss/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_mss/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MT /W3 /GX /O2 /GB /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mss/boost_regex_vc71_mss.pch -Fo./vc71/boost_regex_vc71_mss/ -Fdvc71/boost_regex_vc71_mss.pdb ../src/winstances.cpp + +boost_regex_vc71_mss_dir : + @if not exist "vc71\boost_regex_vc71_mss\$(NULL)" mkdir vc71\boost_regex_vc71_mss + +boost_regex_vc71_mss_clean : + del vc71\boost_regex_vc71_mss\*.obj + del vc71\boost_regex_vc71_mss\*.idb + del vc71\boost_regex_vc71_mss\*.exp + del vc71\boost_regex_vc71_mss\*.pch + +./vc71/boost_regex_vc71_mss.lib : vc71/boost_regex_vc71_mss/c_regex_traits.obj vc71/boost_regex_vc71_mss/c_regex_traits_common.obj vc71/boost_regex_vc71_mss/cpp_regex_traits.obj vc71/boost_regex_vc71_mss/cregex.obj vc71/boost_regex_vc71_mss/fileiter.obj vc71/boost_regex_vc71_mss/instances.obj vc71/boost_regex_vc71_mss/posix_api.obj vc71/boost_regex_vc71_mss/regex.obj vc71/boost_regex_vc71_mss/regex_debug.obj vc71/boost_regex_vc71_mss/regex_synch.obj vc71/boost_regex_vc71_mss/w32_regex_traits.obj vc71/boost_regex_vc71_mss/wide_posix_api.obj vc71/boost_regex_vc71_mss/winstances.obj + link -lib /nologo /out:vc71/boost_regex_vc71_mss.lib $(XSFLAGS) vc71/boost_regex_vc71_mss/c_regex_traits.obj vc71/boost_regex_vc71_mss/c_regex_traits_common.obj vc71/boost_regex_vc71_mss/cpp_regex_traits.obj vc71/boost_regex_vc71_mss/cregex.obj vc71/boost_regex_vc71_mss/fileiter.obj vc71/boost_regex_vc71_mss/instances.obj vc71/boost_regex_vc71_mss/posix_api.obj vc71/boost_regex_vc71_mss/regex.obj vc71/boost_regex_vc71_mss/regex_debug.obj vc71/boost_regex_vc71_mss/regex_synch.obj vc71/boost_regex_vc71_mss/w32_regex_traits.obj vc71/boost_regex_vc71_mss/wide_posix_api.obj vc71/boost_regex_vc71_mss/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_sssd.lib +# +######################################################## +vc71/boost_regex_vc71_sssd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_sssd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_sssd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_sssd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_sssd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_sssd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_sssd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_sssd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_sssd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_sssd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_sssd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_sssd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_sssd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MLd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_sssd/boost_regex_vc71_sssd.pch -Fo./vc71/boost_regex_vc71_sssd/ -Fdvc71/boost_regex_vc71_sssd.pdb ../src/winstances.cpp + +boost_regex_vc71_sssd_dir : + @if not exist "vc71\boost_regex_vc71_sssd\$(NULL)" mkdir vc71\boost_regex_vc71_sssd + +boost_regex_vc71_sssd_clean : + del vc71\boost_regex_vc71_sssd\*.obj + del vc71\boost_regex_vc71_sssd\*.idb + del vc71\boost_regex_vc71_sssd\*.exp + del vc71\boost_regex_vc71_sssd\*.pch + +./vc71/boost_regex_vc71_sssd.lib : vc71/boost_regex_vc71_sssd/c_regex_traits.obj vc71/boost_regex_vc71_sssd/c_regex_traits_common.obj vc71/boost_regex_vc71_sssd/cpp_regex_traits.obj vc71/boost_regex_vc71_sssd/cregex.obj vc71/boost_regex_vc71_sssd/fileiter.obj vc71/boost_regex_vc71_sssd/instances.obj vc71/boost_regex_vc71_sssd/posix_api.obj vc71/boost_regex_vc71_sssd/regex.obj vc71/boost_regex_vc71_sssd/regex_debug.obj vc71/boost_regex_vc71_sssd/regex_synch.obj vc71/boost_regex_vc71_sssd/w32_regex_traits.obj vc71/boost_regex_vc71_sssd/wide_posix_api.obj vc71/boost_regex_vc71_sssd/winstances.obj + link -lib /nologo /out:vc71/boost_regex_vc71_sssd.lib $(XSFLAGS) vc71/boost_regex_vc71_sssd/c_regex_traits.obj vc71/boost_regex_vc71_sssd/c_regex_traits_common.obj vc71/boost_regex_vc71_sssd/cpp_regex_traits.obj vc71/boost_regex_vc71_sssd/cregex.obj vc71/boost_regex_vc71_sssd/fileiter.obj vc71/boost_regex_vc71_sssd/instances.obj vc71/boost_regex_vc71_sssd/posix_api.obj vc71/boost_regex_vc71_sssd/regex.obj vc71/boost_regex_vc71_sssd/regex_debug.obj vc71/boost_regex_vc71_sssd/regex_synch.obj vc71/boost_regex_vc71_sssd/w32_regex_traits.obj vc71/boost_regex_vc71_sssd/wide_posix_api.obj vc71/boost_regex_vc71_sssd/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_mssd.lib +# +######################################################## +vc71/boost_regex_vc71_mssd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_mssd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_mssd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_mssd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_mssd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_mssd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_mssd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_mssd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_mssd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_mssd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_mssd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_mssd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_mssd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MTd /W3 /Gm /GX /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mssd/boost_regex_vc71_mssd.pch -Fo./vc71/boost_regex_vc71_mssd/ -Fdvc71/boost_regex_vc71_mssd.pdb ../src/winstances.cpp + +boost_regex_vc71_mssd_dir : + @if not exist "vc71\boost_regex_vc71_mssd\$(NULL)" mkdir vc71\boost_regex_vc71_mssd + +boost_regex_vc71_mssd_clean : + del vc71\boost_regex_vc71_mssd\*.obj + del vc71\boost_regex_vc71_mssd\*.idb + del vc71\boost_regex_vc71_mssd\*.exp + del vc71\boost_regex_vc71_mssd\*.pch + +./vc71/boost_regex_vc71_mssd.lib : vc71/boost_regex_vc71_mssd/c_regex_traits.obj vc71/boost_regex_vc71_mssd/c_regex_traits_common.obj vc71/boost_regex_vc71_mssd/cpp_regex_traits.obj vc71/boost_regex_vc71_mssd/cregex.obj vc71/boost_regex_vc71_mssd/fileiter.obj vc71/boost_regex_vc71_mssd/instances.obj vc71/boost_regex_vc71_mssd/posix_api.obj vc71/boost_regex_vc71_mssd/regex.obj vc71/boost_regex_vc71_mssd/regex_debug.obj vc71/boost_regex_vc71_mssd/regex_synch.obj vc71/boost_regex_vc71_mssd/w32_regex_traits.obj vc71/boost_regex_vc71_mssd/wide_posix_api.obj vc71/boost_regex_vc71_mssd/winstances.obj + link -lib /nologo /out:vc71/boost_regex_vc71_mssd.lib $(XSFLAGS) vc71/boost_regex_vc71_mssd/c_regex_traits.obj vc71/boost_regex_vc71_mssd/c_regex_traits_common.obj vc71/boost_regex_vc71_mssd/cpp_regex_traits.obj vc71/boost_regex_vc71_mssd/cregex.obj vc71/boost_regex_vc71_mssd/fileiter.obj vc71/boost_regex_vc71_mssd/instances.obj vc71/boost_regex_vc71_mssd/posix_api.obj vc71/boost_regex_vc71_mssd/regex.obj vc71/boost_regex_vc71_mssd/regex_debug.obj vc71/boost_regex_vc71_mssd/regex_synch.obj vc71/boost_regex_vc71_mssd/w32_regex_traits.obj vc71/boost_regex_vc71_mssd/wide_posix_api.obj vc71/boost_regex_vc71_mssd/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_mdid.lib +# +######################################################## +vc71/boost_regex_vc71_mdid/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_mdid/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_mdid/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_mdid/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_mdid/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_mdid/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_mdid/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_mdid/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_mdid/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_mdid/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_mdid/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_mdid/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_mdid/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdid/boost_regex_vc71_mdid.pch -Fo./vc71/boost_regex_vc71_mdid/ -Fdvc71/boost_regex_vc71_mdid.pdb ../src/winstances.cpp + +boost_regex_vc71_mdid_dir : + @if not exist "vc71\boost_regex_vc71_mdid\$(NULL)" mkdir vc71\boost_regex_vc71_mdid + +boost_regex_vc71_mdid_clean : + del vc71\boost_regex_vc71_mdid\*.obj + del vc71\boost_regex_vc71_mdid\*.idb + del vc71\boost_regex_vc71_mdid\*.exp + del vc71\boost_regex_vc71_mdid\*.pch + +./vc71/boost_regex_vc71_mdid.lib : vc71/boost_regex_vc71_mdid/c_regex_traits.obj vc71/boost_regex_vc71_mdid/c_regex_traits_common.obj vc71/boost_regex_vc71_mdid/cpp_regex_traits.obj vc71/boost_regex_vc71_mdid/cregex.obj vc71/boost_regex_vc71_mdid/fileiter.obj vc71/boost_regex_vc71_mdid/instances.obj vc71/boost_regex_vc71_mdid/posix_api.obj vc71/boost_regex_vc71_mdid/regex.obj vc71/boost_regex_vc71_mdid/regex_debug.obj vc71/boost_regex_vc71_mdid/regex_synch.obj vc71/boost_regex_vc71_mdid/w32_regex_traits.obj vc71/boost_regex_vc71_mdid/wide_posix_api.obj vc71/boost_regex_vc71_mdid/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc71/boost_regex_vc71_mdid.pdb" /debug /machine:I386 /out:"vc71/boost_regex_vc71_mdid.dll" /implib:"vc71/boost_regex_vc71_mdid.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc71/boost_regex_vc71_mdid/c_regex_traits.obj vc71/boost_regex_vc71_mdid/c_regex_traits_common.obj vc71/boost_regex_vc71_mdid/cpp_regex_traits.obj vc71/boost_regex_vc71_mdid/cregex.obj vc71/boost_regex_vc71_mdid/fileiter.obj vc71/boost_regex_vc71_mdid/instances.obj vc71/boost_regex_vc71_mdid/posix_api.obj vc71/boost_regex_vc71_mdid/regex.obj vc71/boost_regex_vc71_mdid/regex_debug.obj vc71/boost_regex_vc71_mdid/regex_synch.obj vc71/boost_regex_vc71_mdid/w32_regex_traits.obj vc71/boost_regex_vc71_mdid/wide_posix_api.obj vc71/boost_regex_vc71_mdid/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_mdi.lib +# +######################################################## +vc71/boost_regex_vc71_mdi/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_mdi/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_mdi/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_mdi/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_mdi/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_mdi/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_mdi/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_mdi/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_mdi/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_mdi/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_mdi/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_mdi/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_mdi/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdi/boost_regex_vc71_mdi.pch -Fo./vc71/boost_regex_vc71_mdi/ -Fdvc71/boost_regex_vc71_mdi.pdb ../src/winstances.cpp + +boost_regex_vc71_mdi_dir : + @if not exist "vc71\boost_regex_vc71_mdi\$(NULL)" mkdir vc71\boost_regex_vc71_mdi + +boost_regex_vc71_mdi_clean : + del vc71\boost_regex_vc71_mdi\*.obj + del vc71\boost_regex_vc71_mdi\*.idb + del vc71\boost_regex_vc71_mdi\*.exp + del vc71\boost_regex_vc71_mdi\*.pch + +./vc71/boost_regex_vc71_mdi.lib : vc71/boost_regex_vc71_mdi/c_regex_traits.obj vc71/boost_regex_vc71_mdi/c_regex_traits_common.obj vc71/boost_regex_vc71_mdi/cpp_regex_traits.obj vc71/boost_regex_vc71_mdi/cregex.obj vc71/boost_regex_vc71_mdi/fileiter.obj vc71/boost_regex_vc71_mdi/instances.obj vc71/boost_regex_vc71_mdi/posix_api.obj vc71/boost_regex_vc71_mdi/regex.obj vc71/boost_regex_vc71_mdi/regex_debug.obj vc71/boost_regex_vc71_mdi/regex_synch.obj vc71/boost_regex_vc71_mdi/w32_regex_traits.obj vc71/boost_regex_vc71_mdi/wide_posix_api.obj vc71/boost_regex_vc71_mdi/winstances.obj + link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"vc71/boost_regex_vc71_mdi.pdb" /debug /machine:I386 /out:"vc71/boost_regex_vc71_mdi.dll" /implib:"vc71/boost_regex_vc71_mdi.lib" /LIBPATH:$(STLPORT_PATH)\lib $(XLFLAGS) vc71/boost_regex_vc71_mdi/c_regex_traits.obj vc71/boost_regex_vc71_mdi/c_regex_traits_common.obj vc71/boost_regex_vc71_mdi/cpp_regex_traits.obj vc71/boost_regex_vc71_mdi/cregex.obj vc71/boost_regex_vc71_mdi/fileiter.obj vc71/boost_regex_vc71_mdi/instances.obj vc71/boost_regex_vc71_mdi/posix_api.obj vc71/boost_regex_vc71_mdi/regex.obj vc71/boost_regex_vc71_mdi/regex_debug.obj vc71/boost_regex_vc71_mdi/regex_synch.obj vc71/boost_regex_vc71_mdi/w32_regex_traits.obj vc71/boost_regex_vc71_mdi/wide_posix_api.obj vc71/boost_regex_vc71_mdi/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_mds.lib +# +######################################################## +vc71/boost_regex_vc71_mds/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_mds/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_mds/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_mds/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_mds/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_mds/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_mds/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_mds/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_mds/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_mds/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_mds/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_mds/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_mds/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MD /W3 /GX /O2 /GB /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /YX /FD /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mds/boost_regex_vc71_mds.pch -Fo./vc71/boost_regex_vc71_mds/ -Fdvc71/boost_regex_vc71_mds.pdb ../src/winstances.cpp + +boost_regex_vc71_mds_dir : + @if not exist "vc71\boost_regex_vc71_mds\$(NULL)" mkdir vc71\boost_regex_vc71_mds + +boost_regex_vc71_mds_clean : + del vc71\boost_regex_vc71_mds\*.obj + del vc71\boost_regex_vc71_mds\*.idb + del vc71\boost_regex_vc71_mds\*.exp + del vc71\boost_regex_vc71_mds\*.pch + +./vc71/boost_regex_vc71_mds.lib : vc71/boost_regex_vc71_mds/c_regex_traits.obj vc71/boost_regex_vc71_mds/c_regex_traits_common.obj vc71/boost_regex_vc71_mds/cpp_regex_traits.obj vc71/boost_regex_vc71_mds/cregex.obj vc71/boost_regex_vc71_mds/fileiter.obj vc71/boost_regex_vc71_mds/instances.obj vc71/boost_regex_vc71_mds/posix_api.obj vc71/boost_regex_vc71_mds/regex.obj vc71/boost_regex_vc71_mds/regex_debug.obj vc71/boost_regex_vc71_mds/regex_synch.obj vc71/boost_regex_vc71_mds/w32_regex_traits.obj vc71/boost_regex_vc71_mds/wide_posix_api.obj vc71/boost_regex_vc71_mds/winstances.obj + link -lib /nologo /out:vc71/boost_regex_vc71_mds.lib $(XSFLAGS) vc71/boost_regex_vc71_mds/c_regex_traits.obj vc71/boost_regex_vc71_mds/c_regex_traits_common.obj vc71/boost_regex_vc71_mds/cpp_regex_traits.obj vc71/boost_regex_vc71_mds/cregex.obj vc71/boost_regex_vc71_mds/fileiter.obj vc71/boost_regex_vc71_mds/instances.obj vc71/boost_regex_vc71_mds/posix_api.obj vc71/boost_regex_vc71_mds/regex.obj vc71/boost_regex_vc71_mds/regex_debug.obj vc71/boost_regex_vc71_mds/regex_synch.obj vc71/boost_regex_vc71_mds/w32_regex_traits.obj vc71/boost_regex_vc71_mds/wide_posix_api.obj vc71/boost_regex_vc71_mds/winstances.obj + +######################################################## +# +# section for boost_regex_vc71_mdsd.lib +# +######################################################## +vc71/boost_regex_vc71_mdsd/c_regex_traits.obj: ../src/c_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/c_regex_traits.cpp + +vc71/boost_regex_vc71_mdsd/c_regex_traits_common.obj: ../src/c_regex_traits_common.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/c_regex_traits_common.cpp + +vc71/boost_regex_vc71_mdsd/cpp_regex_traits.obj: ../src/cpp_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/cpp_regex_traits.cpp + +vc71/boost_regex_vc71_mdsd/cregex.obj: ../src/cregex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/cregex.cpp + +vc71/boost_regex_vc71_mdsd/fileiter.obj: ../src/fileiter.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/fileiter.cpp + +vc71/boost_regex_vc71_mdsd/instances.obj: ../src/instances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/instances.cpp + +vc71/boost_regex_vc71_mdsd/posix_api.obj: ../src/posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/posix_api.cpp + +vc71/boost_regex_vc71_mdsd/regex.obj: ../src/regex.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/regex.cpp + +vc71/boost_regex_vc71_mdsd/regex_debug.obj: ../src/regex_debug.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/regex_debug.cpp + +vc71/boost_regex_vc71_mdsd/regex_synch.obj: ../src/regex_synch.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/regex_synch.cpp + +vc71/boost_regex_vc71_mdsd/w32_regex_traits.obj: ../src/w32_regex_traits.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/w32_regex_traits.cpp + +vc71/boost_regex_vc71_mdsd/wide_posix_api.obj: ../src/wide_posix_api.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/wide_posix_api.cpp + +vc71/boost_regex_vc71_mdsd/winstances.obj: ../src/winstances.cpp $(ALL_HEADER) + cl $(INCLUDES) /nologo /MDd /W3 /Gm /GX /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /YX /FD /GZ /c $(CXXFLAGS) -Fpvc71/boost_regex_vc71_mdsd/boost_regex_vc71_mdsd.pch -Fo./vc71/boost_regex_vc71_mdsd/ -Fdvc71/boost_regex_vc71_mdsd.pdb ../src/winstances.cpp + +boost_regex_vc71_mdsd_dir : + @if not exist "vc71\boost_regex_vc71_mdsd\$(NULL)" mkdir vc71\boost_regex_vc71_mdsd + +boost_regex_vc71_mdsd_clean : + del vc71\boost_regex_vc71_mdsd\*.obj + del vc71\boost_regex_vc71_mdsd\*.idb + del vc71\boost_regex_vc71_mdsd\*.exp + del vc71\boost_regex_vc71_mdsd\*.pch + +./vc71/boost_regex_vc71_mdsd.lib : vc71/boost_regex_vc71_mdsd/c_regex_traits.obj vc71/boost_regex_vc71_mdsd/c_regex_traits_common.obj vc71/boost_regex_vc71_mdsd/cpp_regex_traits.obj vc71/boost_regex_vc71_mdsd/cregex.obj vc71/boost_regex_vc71_mdsd/fileiter.obj vc71/boost_regex_vc71_mdsd/instances.obj vc71/boost_regex_vc71_mdsd/posix_api.obj vc71/boost_regex_vc71_mdsd/regex.obj vc71/boost_regex_vc71_mdsd/regex_debug.obj vc71/boost_regex_vc71_mdsd/regex_synch.obj vc71/boost_regex_vc71_mdsd/w32_regex_traits.obj vc71/boost_regex_vc71_mdsd/wide_posix_api.obj vc71/boost_regex_vc71_mdsd/winstances.obj + link -lib /nologo /out:vc71/boost_regex_vc71_mdsd.lib $(XSFLAGS) vc71/boost_regex_vc71_mdsd/c_regex_traits.obj vc71/boost_regex_vc71_mdsd/c_regex_traits_common.obj vc71/boost_regex_vc71_mdsd/cpp_regex_traits.obj vc71/boost_regex_vc71_mdsd/cregex.obj vc71/boost_regex_vc71_mdsd/fileiter.obj vc71/boost_regex_vc71_mdsd/instances.obj vc71/boost_regex_vc71_mdsd/posix_api.obj vc71/boost_regex_vc71_mdsd/regex.obj vc71/boost_regex_vc71_mdsd/regex_debug.obj vc71/boost_regex_vc71_mdsd/regex_synch.obj vc71/boost_regex_vc71_mdsd/w32_regex_traits.obj vc71/boost_regex_vc71_mdsd/wide_posix_api.obj vc71/boost_regex_vc71_mdsd/winstances.obj + diff --git a/build/vc_gen.sh b/build/vc_gen.sh index c23eefe5..56057cad 100644 --- a/build/vc_gen.sh +++ b/build/vc_gen.sh @@ -362,6 +362,27 @@ out="vc7.mak" no_single="no" subdir="vc7" vc6_gen +# +# generate vc7-stlport makefile: +is_stlport="yes" +out="vc7-stlport.mak" +no_single="yes" +subdir="vc7-stlport" +vc6_stlp_gen +# +# generate vc71 makefile: +is_stlport="no" +out="vc71.mak" +no_single="no" +subdir="vc71" +vc6_gen +# +# generate vc71-stlport makefile: +is_stlport="yes" +out="vc71-stlport.mak" +no_single="yes" +subdir="vc71-stlport" +vc6_stlp_gen # @@ -372,3 +393,4 @@ rm -f $tout $iout + diff --git a/doc/Attic/bad_expression.html b/doc/Attic/bad_expression.html new file mode 100644 index 00000000..c6e6d41f --- /dev/null +++ b/doc/Attic/bad_expression.html @@ -0,0 +1,82 @@ + + + + Boost.Regex: bad_expression + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

class bad_expression

+
+

Boost.Regex Index

+
+
+
+
+

Synopsis

+

#include <boost/pattern_except.hpp>

+

The class bad_expression defines the type of objects thrown as + exceptions to report errors during the conversion from a string representing a + regular expression to a finite state machine.  

+
+namespace boost{
+
+class bad_pattern : public std::runtime_error
+{
+public:
+   explicit bad_pattern(const std::string& s) : std::runtime_error(s){};
+};
+
+class bad_expression : public bad_pattern
+{
+public:
+   bad_expression(const std::string& s) : bad_pattern(s) {}
+};
+
+
+} // namespace boost
+
+

Description

+
+bad_expression(const string& what_arg);
+
+

Effects: Constructs an object of class bad_expression.

+ +

Postcondition: strcmp(what(), what_arg.c_str()) == 0.

+

Footnotes: the class bad_pattern forms the base class for all + pattern-matching exceptions, of which bad_expression is one. The choice + of std::runtime_error as the base class for bad_pattern is moot; + depending upon how the library is used exceptions may be either logic errors + (programmer supplied expressions) or run time errors (user supplied + expressions).

+

+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/basic_regex.html b/doc/Attic/basic_regex.html new file mode 100644 index 00000000..a8edfca2 --- /dev/null +++ b/doc/Attic/basic_regex.html @@ -0,0 +1,1293 @@ + + + +Boost.Regex: basic_regex + + + + + + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

basic_regex

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Synopsis

+ +
+#include <boost/regex.hpp>
+
+ +

The template class basic_regex encapsulates regular +expression parsing and compilation. The class takes three template +parameters:

+ +

charT: determines the character type, i.e. either +char or wchar_t.

+ +

traits: determines the behavior of the character +type, for example which character class names are recognized. A +default traits class is provided: +regex_traits<charT>.

+ +

Allocator: the allocator class used to allocate +memory by the class.

+ +

For ease of use there are two typedefs that define the two +standard basic_regex instances, unless you want to use +custom traits classes or allocators, you won't need to use anything +other than these:

+ +
+namespace boost{
+template <class charT, class traits = regex_traits<charT>, class Allocator = std::allocator<charT>  >
+class basic_regex;
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+}
+
+ +

The definition of basic_regex follows: it is based very +closely on class basic_string, and fulfils the requirements for a +constant-container of charT.

+ +
+namespace boost{
+
+template <class charT,
+          class traits = regex_traits<charT>,
+          class Allocator = allocator<charT> >
+class basic_regex
+{
+public:
+   // types:
+   typedef          charT                                value_type;
+   typedef          implementation defined               const_iterator;
+   typedef          const_iterator                       iterator;
+   typedef typename Allocator::reference                 reference;
+   typedef typename Allocator::const_reference           const_reference;
+   typedef typename Allocator::difference_type           difference_type;
+   typedef typename Allocator::size_type                 size_type;
+   typedef          Allocator                            allocator_type;
+   typedef          regex_constants::syntax_option_type  flag_type;
+   typedef typename traits::locale_type                  locale_type;
+
+   // constants:
+   static const regex_constants::syntax_option_type normal = regex_constants::normal;
+   static const regex_constants::syntax_option_type icase = regex_constants::icase;
+   static const regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
+   static const regex_constants::syntax_option_type optimize = regex_constants::optimize;
+   static const regex_constants::syntax_option_type collate = regex_constants::collate;
+   static const regex_constants::syntax_option_type ECMAScript = normal;
+   static const regex_constants::syntax_option_type JavaScript = normal;
+   static const regex_constants::syntax_option_type JScript = normal;
+   // these flags are optional, if the functionality is supported
+   // then the flags shall take these names.
+   static const regex_constants::syntax_option_type basic = regex_constants::basic;
+   static const regex_constants::syntax_option_type extended = regex_constants::extended;
+   static const regex_constants::syntax_option_type awk = regex_constants::awk;
+   static const regex_constants::syntax_option_type grep = regex_constants::grep;
+   static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
+   static const regex_constants::syntax_option_type sed = basic = regex_constants::sed;
+   static const regex_constants::syntax_option_type perl = regex_constants::perl;
+
+   // construct/copy/destroy:
+   explicit basic_regex(const Allocator& a = Allocator());
+   explicit basic_regex(const charT* p, flag_type f = regex_constants::normal,
+                        const Allocator& a = Allocator());
+   basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal,
+               const Allocator& a = Allocator());
+   basic_regex(const charT* p, size_type len, flag_type f,
+               const Allocator& a = Allocator());
+   basic_regex(const basic_regex&);
+   template <class ST, class SA>
+   explicit basic_regex(const basic_string<charT, ST, SA>& p,
+                        flag_type f = regex_constants::normal,
+                        const Allocator& a = Allocator());
+   template <class InputIterator>
+   basic_regex(InputIterator first, inputIterator last,
+               flag_type f = regex_constants::normal,
+               const Allocator& a = Allocator());
+
+   ~basic_regex();
+   basic_regex& operator=(const basic_regex&);
+   basic_regex& operator=(const charT* ptr);
+   template <class ST, class SA>
+   basic_regex& operator=(const basic_string<charT, ST, SA>& p);
+
+   // iterators:
+   const_iterator begin() const;
+   const_iterator end() const;
+   // capacity:
+   size_type size() const;
+   size_type max_size() const;
+   bool empty() const;
+   unsigned mark_count() const;
+
+   //
+   // modifiers:
+   basic_regex& assign(const basic_regex& that);
+   basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal);
+   basic_regex& assign(const charT* first, const charT* last,
+                       flag_type f = regex_constants::normal);
+   template <class string_traits, class A>
+   basic_regex& assign(const basic_string<charT, string_traits, A>& s,
+                       flag_type f = regex_constants::normal);
+   template <class InputIterator>
+   basic_regex& assign(InputIterator first, InputIterator last,
+                       flag_type f = regex_constants::normal);
+
+   // const operations:
+   Allocator get_allocator() const;
+   flag_type getflags() const;
+   basic_string<charT> str() const;
+   int compare(basic_regex&) const;
+   // locale:
+   locale_type imbue(locale_type loc);
+   locale_type getloc() const;
+   // swap
+   void swap(basic_regex&) throw();
+};
+
+template <class charT, class traits, class Allocator>
+bool operator == (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator != (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator < (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator <= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator >= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator > (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+
+template <class charT, class io_traits, class re_traits, class Allocator>
+basic_ostream<charT, io_traits>&
+   operator << (basic_ostream<charT, io_traits>& os,
+                const basic_regex<charT, re_traits, Allocator>& e);
+
+template <class charT, class traits, class Allocator>
+void swap(basic_regex<charT, traits, Allocator>& e1,
+          basic_regex<charT, traits, Allocator>& e2);
+
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+
+} // namespace boost
+
+ +

Description

+ +

Class basic_regex has the following public member +functions:

+ +

basic_regex constants

+ +
+static const regex_constants::syntax_option_type normal = regex_constants::normal;
+static const regex_constants::syntax_option_type icase = regex_constants::icase;
+static const regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
+static const regex_constants::syntax_option_type optimize = regex_constants::optimize;
+static const regex_constants::syntax_option_type collate = regex_constants::collate;
+static const regex_constants::syntax_option_type ECMAScript = normal;
+static const regex_constants::syntax_option_type JavaScript = normal;
+static const regex_constants::syntax_option_type JScript = normal;
+static const regex_constants::syntax_option_type basic = regex_constants::basic;
+static const regex_constants::syntax_option_type extended = regex_constants::extended;
+static const regex_constants::syntax_option_type awk = regex_constants::awk;
+static const regex_constants::syntax_option_type grep = regex_constants::grep;
+static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
+static const regex_constants::syntax_option_type sed = basic = regex_constants::sed;
+static const regex_constants::syntax_option_type perl = regex_constants::perl;
+
+ +

The static constant members are provided as synonyms for the +constants declared in namespace +boost::regex_constants; for each constant of type +syntax_option_type declared in namespace +boost::regex_constants then a constant with the same name, +type and value is declared within the scope of +basic_regex.

+ +

basic_regex constructors

+ +

In all basic_regex constructors, a copy of the +Allocator argument is used for any memory allocation +performed by the constructor or member functions during the +lifetime of the object.

+ +
+basic_regex(const Allocator& a = Allocator());
+
+ + + +

Effects: Constructs an object of class +basic_regex. The postconditions of this function are +indicated in the table:

+ +

+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

true

+
+

size()

+
+

0

+
+

str()

+
+

basic_string<charT>()

+
+
+
+ +
+ 
+
+ +
+basic_regex(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Requires: p shall not be a null pointer.

+ + + +

Throws: bad_expression if p is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the +null-terminated string p, and interpreted according to the +option flags specified +in f. The postconditions of this function are indicated in +the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

char_traits<charT>::length(p)

+
+

str()

+
+

basic_string<charT>(p)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Requires: p1 and p2 are not null pointers, +p1 < p2.

+ + + +

Throws: bad_expression if [p1,p2) is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the sequence +of characters [p1,p2), and interpreted according the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

std::distance(p1,p2)

+
+

str()

+
+

basic_string<charT>(p1,p2)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+basic_regex(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator());
+
+ + + +

Requires: p shall not be a null pointer, len +< max_size().

+ + + +

Throws: bad_expression if p is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the sequence +of characters [p, p+len), and interpreted according the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

len

+
+

str()

+
+

basic_string<charT>(p, len)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+  
+
+ +
+basic_regex(const basic_regex& e);
+
+ + + +

Effects: Constructs an object of class +basic_regex as a copy of the object e. The +postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

e.empty()

+
+

size()

+
+

e.size()

+
+

str()

+
+

e.str()

+
+

getflags()

+
+

e.getflags()

+
+

mark_count()

+
+

e.mark_count()

+
+
+
+ +
+ 
+
+ +
+template <class ST, class SA>
+basic_regex(const basic_string<charT, ST, SA>& s,
+            flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Throws: bad_expression if s is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the string +s, and interpreted according to the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

s.size()

+
+

str()

+
+

s

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+template <class ForwardIterator>
+basic_regex(ForwardIterator first, ForwardIterator last,
+            flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Throws: bad_expression if the sequence +[first, last) is not a valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the sequence +of characters [first, last), and interpreted according to the option flags specified in +f. The postconditions of this function are indicated in the +table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

distance(first,last)

+
+

str()

+
+

basic_string<charT>(first,last)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+  
+
+ +
+basic_regex& operator=(const basic_regex& e);
+
+ + + +

Effects: Returns the result of assign(e.str(), +e.getflags()).

+ +
+basic_regex& operator=(const charT* ptr);
+
+ + + +

Requires: p shall not be a null pointer.

+ + + +

Effects: Returns the result of +assign(ptr).

+ +
+template <class ST, class SA>
+basic_regex& operator=(const basic_string<charT, ST, SA>& p);
+
+ + + +

Effects: Returns the result of +assign(p).

+ +

basic_regex iterators

+ +
+const_iterator begin() const;
+
+ + + +

Effects: Returns a starting iterator to a sequence of +characters representing the regular expression.

+ +
+const_iterator end() const;
+
+ + + +

Effects: Returns termination iterator to a sequence of +characters representing the regular expression.

+ +

basic_regex capacity

+ +
+size_type size() const;
+
+ + + +

Effects: Returns the length of the sequence of characters +representing the regular expression.

+ +
+size_type max_size() const;
+
+ + + +

Effects: Returns the maximum length of the sequence of +characters representing the regular expression.

+ +
+bool empty() const;
+
+ + + +

Effects: Returns true if the object does not +contain a valid regular expression, otherwise false.

+ +
+unsigned mark_count() const;
+
+ + + +

Effects: Returns the number of marked sub-expressions +within the regular expresion.

+ +

basic_regex assign

+ +
+basic_regex& assign(const basic_regex& that);
+
+ + + +

Effects: Returns assign(that.str(), +that.getflags()).

+ +
+basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal);
+
+ + + +

Effects: Returns assign(string_type(ptr), +f).

+ +
+basic_regex& assign(const charT* first, const charT* last,
+                    flag_type f = regex_constants::normal);
+
+ + + +

Effects: Returns assign(string_type(first, last), +f).

+ +
+template <class string_traits, class A>
+basic_regex& assign(const basic_string<charT, string_traits, A>& s,
+                    flag_type f = regex_constants::normal);
+
+ + + +

Throws: bad_expression if s is not a +valid regular expression.

+ + + +

Returns: *this.

+ + + +

Effects: Assigns the regular expression contained in the +string s, interpreted according the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

s.size()

+
+

str()

+
+

s

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+template <class InputIterator>
+basic_regex& assign(InputIterator first, InputIterator last,
+                    flag_type f = regex_constants::normal);
+
+ + + +

Requires: The type InputIterator corresponds to the Input +Iterator requirements (24.1.1).

+ + + +

Effects: Returns assign(string_type(first, last), +f).

+ +

basic_regex constant operations

+ +
+Allocator get_allocator() const;
+
+ + + +

Effects: Returns a copy of the Allocator that was passed +to the object's constructor.

+ +
+flag_type getflags() const;
+
+ + + +

Effects: Returns a copy of the regular expression syntax +flags that were passed to the object's constructor, or the last +call to assign.

+ +
+basic_string<charT> str() const;
+
+ + + +

Effects: Returns a copy of the character sequence passed +to the object's constructor, or the last call to +assign.

+ +
+int compare(basic_regex& e)const;
+
+ + + +

Effects: If getflags() == e.getflags() then +returns str().compare(e.str()), otherwise returns +getflags() - e.getflags().

+ +

basic_regex locale

+ +
+locale_type imbue(locale_type l);
+
+ + + +

Effects: Returns the result of +traits_inst.imbue(l) where traits_inst is a +(default initialized) instance of the template parameter +traits stored within the object. Calls to imbue invalidate +any currently contained regular expression.

+ + + +

Postcondition: empty() == true.

+ +
+locale_type getloc() const;
+
+ + + +

Effects: Returns the result of +traits_inst.getloc() where traits_inst is a +(default initialized) instance of the template parameter +traits stored within the object.

+ +

basic_regex swap

+ +
+void swap(basic_regex& e) throw();
+
+ + + +

Effects: Swaps the contents of the two regular +expressions.

+ + + +

Postcondition: *this contains the characters +that were in e, e contains the regular expression +that was in *this.

+ + + +

Complexity: constant time.

+ +

basic_regex non-member functions

+ +
basic_regex non-member comparison operators 
+ +
+template <class charT, class traits, class Allocator>
+bool operator == (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) == 0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator != (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) != 0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator < (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) < +0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator <= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) <= +0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator >= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) >= +0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator > (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) > +0.

+ +
basic_regex inserter.
+ +
+template <class charT, class io_traits, class re_traits, class Allocator>
+basic_ostream<charT, io_traits>&
+   operator << (basic_ostream<charT, io_traits>& os
+                const basic_regex<charT, re_traits, Allocator>& e);
+
+ + + +

Effects: Returns (os << e.str()).

+ +
basic_regex non-member swap
+ +
+template <class charT, class traits, class Allocator>
+void swap(basic_regex<charT, traits, Allocator>& lhs,
+          basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: calls lhs.swap(rhs).

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/configuration.html b/doc/Attic/configuration.html new file mode 100644 index 00000000..205a9a83 --- /dev/null +++ b/doc/Attic/configuration.html @@ -0,0 +1,232 @@ + + + +Boost.Regex: Configuration and setup + + + + + + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Configuration and setup

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Contents

+ +
+
Compiler setup
+ +
Locale and traits class selection
+ +
Linkage Options
+ +
Algorithm Selection
+ +
Algorithm Tuning
+
+ +

Compiler setup.

+ +

You shouldn't need to do anything special to configure +boost.regex for use with your compiler - the boost.config subsystem should already +take care of it, if you do have problems (or you are using a +particularly obscure compiler or platform) then boost.config has a configure script.

+ +

Locale and traits class selection.

+ +

The following macros (see user.hpp) control how +boost.regex interacts with the user's locale:

+ + + + + + + + + + + + + + + + +
BOOST_REGEX_USE_C_LOCALEForces boost.regex to use the global C locale in its traits +class support: this is the default behavior on non-windows +platforms, but MS Windows platforms normally use the Win32 API for +locale support.
BOOST_REGEX_USE_CPP_LOCALEForces boost.regex to use std::locale in it's default traits +class, regular expressions can then be imbued with an +instance specific locale.
BOOST_REGEX_NO_W32Tells boost.regex not to use any Win32 API's even when +available (implies BOOST_REGEX_USE_C_LOCALE unless +BOOST_REGEX_USE_CPP_LOCALE is set).
+ +
+
+ + +

Linkage Options

+ + + + + + + + + + + +
BOOST_REGEX_DYN_LINKFor Microsoft and Borland C++ builds, this tells boost.regex +that it should link to the dll build of the boost.regex.  By +default boost.regex will link to its static library build, even if +the dynamic C runtime library is in use.
BOOST_REGEX_NO_LIBFor Microsoft and Borland C++ builds, this tells boost.regex +that it should not automatically select the library to link +to.
+ +
+
+ + +

Algorithm Selection

+ + + + + + + + + + + + + + + + +
BOOST_REGEX_V3Tells boost.regex to use the boost-1.30.0 matching algorithm, +define only if you need maximum compatibility with previous +behavior.
BOOST_REGEX_RECURSIVETells boost.regex to use a stack-recursive matching +algorithm.  This is generally the fastest option (although +there is very little in it), but can cause stack overflow in +extreme cases, on Win32 this can be handled safely, but this is not +the case on other platforms.
BOOST_REGEX_NON_RECURSIVETells boost.regex to use a non-stack recursive matching +algorithm, this can be slightly slower than the alternative, but is +always safe no matter how pathological the regular +expression.  This is the default on non-Win32 platforms.
+ +
+
+ + +

Algorithm Tuning

+ +

The following option applies only if BOOST_REGEX_RECURSIVE is +set.

+ + + + + + +
BOOST_REGEX_HAS_MS_STACK_GUARDTells boost.regex that Microsoft style __try - __except blocks +are supported, and can be used to safely trap stack overflow.
+ +
+
+ + +

The following options apply only if BOOST_REGEX_NON_RECURSIVE is +set.

+ + + + + + + + + + + + + + + + +
BOOST_REGEX_BLOCKSIZEIn non-recursive mode, boost.regex uses largish blocks of +memory to act as a stack for the state machine, the larger the +block size then the fewer allocations that will take place.  +This defaults to 4096 bytes, which is large enough to match the +vast majority of regular expressions without further +allocations, however, you can choose smaller or larger values +depending upon your platforms characteristics.
BOOST_REGEX_MAX_BLOCKSTells boost.regex how many blocks of size BOOST_REGEX_BLOCKSIZE +it is permitted to use.  If this value is exceeded then +boost.regex will stop trying to find a match and throw a +std::runtime_error.  Defaults to 1024, don't forget to tweek +this value if you alter BOOST_REGEX_BLOCKSIZE by much.
BOOST_REGEX_MAX_CACHE_BLOCKSTells boost.regex how many memory blocks to store in it's +internal cache - memory blocks are taken from this cache rather +than by calling ::operator new.  Generally speeking this can +be an order of magnitude faster than calling ::opertator new each +time a memory block is required, but has the downside that +boost.regex can end up caching a large chunk of memory (by default +up to 16 blocks each of BOOST_REGEX_BLOCKSIZE size).  If +memory is tight then try defining this to 0 (disables all caching), +or if that is too slow, then a value of 1 or 2, may be +sufficient.  On the other hand, on large multi-processor, +multi-threaded systems, you may find that a higher value is in +order.
+ +
+
+ + +
+

Revised +17 May 2003 +

+ +

© Copyright John +Maddock 1998- +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/contacts.html b/doc/Attic/contacts.html new file mode 100644 index 00000000..f459d203 --- /dev/null +++ b/doc/Attic/contacts.html @@ -0,0 +1,110 @@ + + + +Boost.Regex: Contacts + + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Contacts and Acknowledgements

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

The author can be contacted at +john_maddock@compuserve.com, the home page for this library is +at +http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm, +and the official boost version can be obtained from www.boost.org/libraries.htm.

+ +

I am indebted to Robert Sedgewick's "Algorithms in C++" for +forcing me to think about algorithms and their performance, and to +the folks at boost for forcing me to think, period. The +following people have all contributed useful comments or fixes: +Dave Abrahams, Mike Allison, Edan Ayal, Jayashree Balasubramanian, +Jan Bölsche, Beman Dawes, Paul Baxter, David Bergman, David +Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, +Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick +Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan Hermelink, +Max Leung, Wei-hao Lin, Jens Maurer, Richard Peters, Heiko Schmidt, +Jason Shirk, Gerald Slacik, Scobie Smith, Mike Smyth, Alexander +Sokolovsky, Hervé Poirier, Michael Raykh, Marc Recht, Scott +VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, +Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to +the manuals supplied with the Henry Spencer, Perl and GNU regular +expression libraries - wherever possible I have tried to maintain +compatibility with these libraries and with the POSIX standard - +the code however is entirely my own, including any bugs! I can +absolutely guarantee that I will not fix any bugs I don't know +about, so if you have any comments or spot any bugs, please get in +touch.

+ +

Useful further information can be found at:

+ +

A short tutorial on regular expressions can be +found here.

+ +

The Open Unix +Specification contains a wealth of useful material, including +the regular expression syntax, and specifications for +<regex.h> and +<nl_types.h>.

+ +

The Pattern +Matching Pointers site is a "must visit" resource for anyone +interested in pattern matching.

+ +

Glimpse and Agrep, +use a simplified regular expression syntax to achieve faster search +times.

+ +

Udi Manber +and Ricardo +Baeza-Yates both have a selection of useful pattern matching +papers available from their respective web sites.

+ +

+ +
+

Revised +17 May 2003 +

+ +

© Copyright John +Maddock 1998- +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + diff --git a/doc/Attic/examples.html b/doc/Attic/examples.html new file mode 100644 index 00000000..eeb99819 --- /dev/null +++ b/doc/Attic/examples.html @@ -0,0 +1,99 @@ + + + + Boost.Regex: Examples + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Examples

+
+

Boost.Regex Index

+
+
+
+
+

There are three demo applications that ship with this library, they all come + with makefiles for Borland, Microsoft and gcc compilers, otherwise you will + have to create your own makefiles.

+
regress.exe:
+

A regression test application that gives the matching/searching algorithms a + full workout. The presence of this program is your guarantee that the library + will behave as claimed - at least as far as those items tested are concerned - + if anyone spots anything that isn't being tested I'd be glad to hear about it.

+

Files: parse.cpp, + regress.cpp, tests.cpp.

+
jgrep.exe
+

A simple grep implementation, run with no command line options to find out its + usage. Look at fileiter.cpp/fileiter.hpp and + the mapfile class to see an example of a "smart" bidirectional iterator that + can be used with boost.regex or any other STL algorithm.

+

Files: jgrep.cpp, + main.cpp.

+
timer.exe
+

A simple interactive expression matching application, the results of all + matches are timed, allowing the programmer to optimize their regular + expressions where performance is critical.

+

Files: regex_timer.cpp.

+
Code snippets
+

The snippets examples contain the code examples used in the documentation:

+

credit_card_example.cpp: + Credit card number formatting code.

+

partial_regex_grep.cpp: + Search example using partial matches.

+

partial_regex_match.cpp: + regex_match example using partial matches.

+

regex_grep_example_1.cpp: + regex_grep example 1: searches a cpp file for class definitions.

+

regex_grep_example_2.cpp: + regex_grep example 2: searches a cpp file for class definitions, using a global + callback function.

+

regex_grep_example_3.cpp: + regex_grep example 2: searches a cpp file for class definitions, using a bound + member function callback.

+

regex_grep_example_4.cpp: + regex_grep example 2: searches a cpp file for class definitions, using a C++ + Builder closure as a callback.

+

regex_match_example.cpp: + ftp based regex_match example.

+

regex_merge_example.cpp: + regex_merge example: converts a C++ file to syntax highlighted HTML.

+

regex_replace_example.cpp: + regex_replace example: converts a C++ file to syntax highlighted HTML

+

regex_search_example.cpp: + regex_search example: searches a cpp file for class definitions.

+

regex_split_example_1.cpp: + regex_split example: split a string into tokens.

+

regex_split_example_2.cpp + : regex_split example: spit out linked URL's.

+

+
+

Revised +17 May 2003 +

+ +

© Copyright John +Maddock 1998- +2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/faq.html b/doc/Attic/faq.html new file mode 100644 index 00000000..f398ad92 --- /dev/null +++ b/doc/Attic/faq.html @@ -0,0 +1,162 @@ + + + + +Boost.Regex: FAQ + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

FAQ

+
+

+"Boost.Regex

+
+ +
+
+ + +
+ +

 Q. Why can't I use the "convenience" versions of +regex_match / regex_search / regex_grep / regex_format / +regex_merge?

+ +

A. These versions may or may not be available depending upon the +capabilities of your compiler, the rules determining the format of +these functions are quite complex - and only the versions visible +to a standard compliant compiler are given in the help. To find out +what your compiler supports, run <boost/regex.hpp> through +your C++ pre-processor, and search the output file for the function +that you are interested in.

+ +

Q. I can't get +regex++ to work with escape characters, what's going +on?

+ +

A. If you embed regular expressions in C++ code, then remember +that escape characters are processed twice: once by the C++ +compiler, and once by the regex++ expression compiler, so to pass +the regular expression \d+ to regex++, you need to embed "\\d+" in +your code. Likewise to match a literal backslash you will need to +embed "\\\\" in your code.

+ +

Q. Why does using parenthesis in a POSIX +regular expression change the result of a match?

+ +

For POSIX (extended and basic) regular expressions, but not for +perl regexes, parentheses don't only mark; they determine what the +best match is as well. When the expression is compiled as a POSIX +basic or extended regex then Boost.regex follows the POSIX standard +leftmost longest rule for determining what matched. So if there is +more than one possible match after considering the whole +expression, it looks next at the first sub-expression and then the +second sub-expression and so on. So...

+ +
+"(0*)([0-9]*)" against "00123" would produce
+$1 = "00"
+$2 = "123"
+
+ +

where as

+ +
+"0*([0-9)*" against "00123" would produce
+$1 = "00123"
+
+ +

If you think about it, had $1 only matched the "123", this would +be "less good" than the match "00123" which is both further to the +left and longer. If you want $1 to match only the "123" part, then +you need to use something like:

+ +
+"0*([1-9][0-9]*)"
+
+ +

as the expression.

+ +

Q. Why don't character ranges work +properly (POSIX mode only)?
+ A. The POSIX standard specifies that character range expressions +are locale sensitive - so for example the expression [A-Z] will +match any collating element that collates between 'A' and 'Z'. That +means that for most locales other than "C" or "POSIX", [A-Z] would +match the single character 't' for example, which is not what most +people expect - or at least not what most people have come to +expect from regular expression engines. For this reason, the +default behaviour of boost.regex (perl mode) is to turn locale +sensitive collation off by not setting the regex_constants::collate +compile time flag. However if you set a non-default compile time +flag - for example regex_constants::extended or +regex_constants::basic, then locale dependent collation will be +enabled, this also applies to the POSIX API functions which use +either regex_constants::extended or regex_constants::basic +internally. [Note - when regex_constants::nocollate in effect, +the library behaves "as if" the LC_COLLATE locale category were +always "C", regardless of what its actually set to - end +note].

+ +

Q. Why are there no throw specifications +on any of the functions? What exceptions can the library +throw?

+ +

A. Not all compilers support (or honor) throw specifications, +others support them but with reduced efficiency. Throw +specifications may be added at a later date as compilers begin to +handle this better. The library should throw only three types of +exception: boost::bad_expression can be thrown by basic_regex when +compiling a regular expression, std::runtime_error can be thrown +when a call to basic_regex::imbue tries to open a message catalogue +that doesn't exist, or when a call to regex_search or regex_match +results in an "everlasting" search, or when a call to +RegEx::GrepFiles or RegEx::FindFiles tries to open a file that +cannot be opened, finally std::bad_alloc can be thrown by just +about any of the functions in this library.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/format_syntax.html b/doc/Attic/format_syntax.html new file mode 100644 index 00000000..c267528d --- /dev/null +++ b/doc/Attic/format_syntax.html @@ -0,0 +1,272 @@ + + + + +Boost.Regex: Format String Syntax + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Format String Syntax

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Format strings are used by the algorithm regex_merge and by match_results::format, and are used +to transform one string into another.

+ +

There are three kind of format string: sed, Perl and extended, +the extended syntax is a superset of the others so this is covered +first.

+ +

Extended format syntax

+ +

In format strings, all characters are treated as literals +except: ()$\?:

+ +

To use any of these as literals you must prefix them with the +escape character \

+ +

The following special sequences are recognized: 
+  
+ Grouping:

+ +

Use the parenthesis characters ( and ) to group sub-expressions +within the format string, use \( and \) to represent literal '(' +and ')'. 
+  
+ Sub-expression expansions:

+ +

The following Perl like expressions expand to a particular +matched sub-expression:
+  

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 $`Expands to all the text from the end +of the previous match to the start of the current match, if there +was no previous match in the current operation, then everything +from the start of the input string to the start of the match. 
 $'Expands to all the text from the end +of the match to the end of the input string. 
 $&Expands to all of the current +match. 
 $0Expands to all of the current +match. 
 $NExpands to the text that matched +sub-expression N. 
+ +
+
+ + +

Conditional expressions:

+ +

Conditional expressions allow two different format strings to be +selected dependent upon whether a sub-expression participated in +the match or not:

+ +

?Ntrue_expression:false_expression

+ +

Executes true_expression if sub-expression N participated +in the match, otherwise executes false_expression.

+ +

Example: suppose we search for "(while)|(for)" then the format +string "?1WHILE:FOR" would output what matched, but in upper +case. 
+  
+ Escape sequences:

+ +

The following escape sequences are also allowed:
+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 \aThe bell character. 
 \fThe form feed character. 
 \nThe newline character. 
 \rThe carriage return character. 
 \tThe tab character. 
 \vA vertical tab character. 
 \xA hexadecimal character - for example +\x0D. 
 \x{}A possible Unicode hexadecimal +character - for example \x{1A0} 
 \cxThe ASCII escape character x, for +example \c@ is equivalent to escape-@. 
 \eThe ASCII escape character. 
 \ddAn octal character constant, for +example \10. 
+ +
+
+ + +

Perl format strings

+ +

Perl format strings are the same as the default syntax except +that the characters ()?: have no special meaning.

+ +

Sed format strings

+ +

Sed format strings use only the characters \ and & as +special characters.

+ +

\n where n is a digit, is expanded to the nth +sub-expression.

+ +

& is expanded to the whole of the match (equivalent to +\0).

+ +

Other escape sequences are expanded as per the default +syntax.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/headers.html b/doc/Attic/headers.html new file mode 100644 index 00000000..d0b8283c --- /dev/null +++ b/doc/Attic/headers.html @@ -0,0 +1,52 @@ + + + + Boost.Regex: Headers + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Headers

+
+

Boost.Regex Index

+
+

+
+

+

There are two main headers used by this library: <boost/regex.hpp> + provides full access to the entire library, while <boost/cregex.hpp> + provides access to just the high level class RegEx, and the POSIX API + functions. +

+

There is also a header containing only forward declarations + <boost/regex_fwd.hpp> for use when an interface is dependent upon + boost::basic_regex, but otherwise does not need the full definitions.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/history.html b/doc/Attic/history.html new file mode 100644 index 00000000..17ca695c --- /dev/null +++ b/doc/Attic/history.html @@ -0,0 +1,58 @@ + + + + Boost.Regex: History + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

History

+
+

Boost.Regex Index

+
+

+
+

+

Boost 1.31.0.

+
    +
  • + Completely rewritten pattern matching code - it is now up to 10 times faster + than before.
  • +
  • + Reorganized documentation.
  • +
  • + Deprecated all interfaces that are not part of the + regular expression standardization proposal.
  • +
  • + Added regex_iterator and regex_token_iterator.
  • +
  • + Added support for Perl style independent sub-expressions.
+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/implementation.html b/doc/Attic/implementation.html new file mode 100644 index 00000000..dfb8811a --- /dev/null +++ b/doc/Attic/implementation.html @@ -0,0 +1,45 @@ + + + + Boost.Regex: Implementation + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Implementation

+
+

Boost.Regex Index

+
+

+
+

+

Todo.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/install.html b/doc/Attic/install.html new file mode 100644 index 00000000..f24fb744 --- /dev/null +++ b/doc/Attic/install.html @@ -0,0 +1,237 @@ + + + + Boost.Regex: Index + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Installation

+
+

Boost.Regex Index

+
+

+
+

+

[ Important: If you are upgrading from the + 2.x version of this library then you will find a number of changes to the + documented header names and library interfaces, existing code should still + compile unchanged however - see + Note for Upgraders. ]

+

When you extract the library from its zip file, you must preserve its internal + directory structure (for example by using the -d option when extracting). If + you didn't do that when extracting, then you'd better stop reading this, delete + the files you just extracted, and try again! +

+

This library should not need configuring before use; most popular + compilers/standard libraries/platforms are already supported "as is". If you do + experience configuration problems, or just want to test the configuration with + your compiler, then the process is the same as for all of boost; see the + configuration library documentation.

+

The library will encase all code inside namespace boost. +

+

Unlike some other template libraries, this library consists of a mixture of + template code (in the headers) and static code and data (in cpp files). + Consequently it is necessary to build the library's support code into a library + or archive file before you can use it, instructions for specific platforms are + as follows: +

+

Borland C++ Builder: +

+
    +
  • + Open up a console window and change to the <boost>\libs\regex\build + directory. +
  • + Select the appropriate makefile (bcb4.mak for C++ Builder 4, bcb5.mak for C++ + Builder 5, and bcb6.mak for C++ Builder 6). +
  • + Invoke the makefile (pass the full path to your version of make if you have + more than one version installed, the makefile relies on the path to make to + obtain your C++ Builder installation directory and tools) for example: +
  • +
+
make -fbcb5.mak
+

The build process will build a variety of .lib and .dll files (the exact number + depends upon the version of Borland's tools you are using) the .lib and dll + files will be in a sub-directory called bcb4 or bcb5 depending upon the + makefile used. To install the libraries into your development system use:

+

make -fbcb5.mak install

+

library files will be copied to <BCROOT>/lib and the dll's to + <BCROOT>/bin, where <BCROOT> corresponds to the install path of + your Borland C++ tools. +

+

You may also remove temporary files created during the build process (excluding + lib and dll files) by using:

+

make -fbcb5.mak clean

+

Finally when you use regex++ it is only necessary for you to add the + <boost> root director to your list of include directories for that + project. It is not necessary for you to manually add a .lib file to the + project; the headers will automatically select the correct .lib file for your + build mode and tell the linker to include it. There is one caveat however: the + library can not tell the difference between VCL and non-VCL enabled builds when + building a GUI application from the command line, if you build from the command + line with the 5.5 command line tools then you must define the pre-processor + symbol _NO_VCL in order to ensure that the correct link libraries are selected: + the C++ Builder IDE normally sets this automatically. Hint, users of the 5.5 + command line tools may want to add a -D_NO_VCL to bcc32.cfg in order to set + this option permanently. +

+

If you would prefer to do a static link to the regex libraries even when using + the dll runtime then define BOOST_REGEX_STATIC_LINK, and if you want to + suppress automatic linking altogether (and supply your own custom build of the + lib) then define BOOST_REGEX_NO_LIB.

+

If you are building with C++ Builder 6, you will find that + <boost/regex.hpp> can not be used in a pre-compiled header (the actual + problem is in <locale> which gets included by <boost/regex.hpp>), + if this causes problems for you, then try defining BOOST_NO_STD_LOCALE when + building, this will disable some features throughout boost, but may save you a + lot in compile times!

+

Microsoft Visual C++ 6 and 7

+

You need version 6 of MSVC to build this library. If you are using VC5 then you + may want to look at one of the previous releases of this + library +

+

Open up a command prompt, which has the necessary MSVC environment variables + defined (for example by using the batch file Vcvars32.bat installed by the + Visual Studio installation), and change to the <boost>\libs\regex\build + directory. +

+

Select the correct makefile - vc6.mak for "vanilla" Visual C++ 6 or + vc6-stlport.mak if you are using STLPort.

+

Invoke the makefile like this:

+

nmake -fvc6.mak

+

You will now have a collection of lib and dll files in a "vc6" subdirectory, to + install these into your development system use:

+

nmake -fvc6.mak install

+

The lib files will be copied to your <VC6>\lib directory and the dll + files to <VC6>\bin, where <VC6> is the root of your Visual C++ 6 + installation.

+

You can delete all the temporary files created during the build (excluding lib + and dll files) using:

+

nmake -fvc6.mak clean +

+

Finally when you use regex++ it is only necessary for you to add the + <boost> root directory to your list of include directories for that + project. It is not necessary for you to manually add a .lib file to the + project; the headers will automatically select the correct .lib file for your + build mode and tell the linker to include it. +

+

Note that if you want to statically link to the regex library when using the + dynamic C++ runtime, define BOOST_REGEX_STATIC_LINK when building your project + (this only has an effect for release builds). If you want to add the source + directly to your project then define BOOST_REGEX_NO_LIB to disable automatic + library selection.

+

Important: there have been some reports of + compiler-optimization bugs affecting this library, (particularly with VC6 + versions prior to service patch 5) the workaround is to build the library using + /Oityb1 rather than /O2. That is to use all optimization settings except /Oa. + This problem is reported to affect some standard library code as well (in fact + I'm not sure if the problem is with the regex code or the underlying standard + library), so it's probably worthwhile applying this workaround in normal + practice in any case.

+

Note: if you have replaced the C++ standard library that comes with VC6, then + when you build the library you must ensure that the environment variables + "INCLUDE" and "LIB" have been updated to reflect the include and library paths + for the new library - see vcvars32.bat (part of your Visual Studio + installation) for more details. Alternatively if STLPort is in c:/stlport then + you could use:

+

nmake INCLUDES="-Ic:/stlport/stlport" XLFLAGS="/LIBPATH:c:/stlport/lib" + -fvc6-stlport.mak

+

If you are building with the full STLPort v4.x, then use the vc6-stlport.mak + file provided and set the environment variable STLPORT_PATH to point to the + location of your STLport installation (Note that the full STLPort libraries + appear not to support single-thread static builds). +
+   +
+   +

+

GCC(2.95 and 3.x) +

+

There is a conservative makefile for the g++ compiler. From the command prompt + change to the <boost>/libs/regex/build directory and type: +

+

make -fgcc.mak +

+

At the end of the build process you should have a gcc sub-directory containing + release and debug versions of the library (libboost_regex.a and + libboost_regex_debug.a). When you build projects that use regex++, you will + need to add the boost install directory to your list of include paths and add + <boost>/libs/regex/build/gcc/libboost_regex.a to your list of library + files. +

+

There is also a makefile to build the library as a shared library:

+

make -fgcc-shared.mak

+

which will build libboost_regex.so and libboost_regex_debug.so.

+

Both of the these makefiles support the following environment variables:

+

CXXFLAGS: extra compiler options - note that this applies to both the debug and + release builds.

+

INCLUDES: additional include directories.

+

LDFLAGS: additional linker options.

+

LIBS: additional library files.

+

For the more adventurous there is a configure script in + <boost>/libs/config; see the config library + documentation.

+

Sun Workshop 6.1

+

There is a makefile for the sun (6.1) compiler (C++ version 3.12). From the + command prompt change to the <boost>/libs/regex/build directory and type: +

+

dmake -f sunpro.mak +

+

At the end of the build process you should have a sunpro sub-directory + containing single and multithread versions of the library (libboost_regex.a, + libboost_regex.so, libboost_regex_mt.a and libboost_regex_mt.so). When you + build projects that use regex++, you will need to add the boost install + directory to your list of include paths and add + <boost>/libs/regex/build/sunpro/ to your library search path. +

+

Both of the these makefiles support the following environment variables:

+

CXXFLAGS: extra compiler options - note that this applies to both the single + and multithreaded builds.

+

INCLUDES: additional include directories.

+

LDFLAGS: additional linker options.

+

LIBS: additional library files.

+

LIBSUFFIX: a suffix to mangle the library name with (defaults to nothing).

+

This makefile does not set any architecture specific options like -xarch=v9, + you can set these by defining the appropriate macros, for example:

+

dmake CXXFLAGS="-xarch=v9" LDFLAGS="-xarch=v9" LIBSUFFIX="_v9" -f sunpro.mak

+

will build v9 variants of the regex library named libboost_regex_v9.a etc.

+

Other compilers: +

+

There is a generic makefile (generic.mak) + provided in <boost-root>/libs/regex/build - see that makefile for details + of environment variables that need to be set before use. Alternatively you can + using the Jam based build system. If + you need to configure the library for your platform, then refer to the + config library documentation + . +

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/introduction.html b/doc/Attic/introduction.html new file mode 100644 index 00000000..cd00847a --- /dev/null +++ b/doc/Attic/introduction.html @@ -0,0 +1,176 @@ + + + + Boost.Regex: Introduction + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Introduction

+
+

Boost.Regex Index

+
+

+
+

+

Regular expressions are a form of pattern-matching that are often used in text + processing; many users will be familiar with the Unix utilities grep, sed + and awk, and the programming language Perl, each of which make + extensive use of regular expressions. Traditionally C++ users have been limited + to the POSIX C API's for manipulating regular expressions, and while regex++ + does provide these API's, they do not represent the best way to use the + library. For example regex++ can cope with wide character strings, or search + and replace operations (in a manner analogous to either sed or Perl), something + that traditional C libraries can not do.

+

The class boost::basic_regex is the key class in + this library; it represents a "machine readable" regular expression, and is + very closely modeled on std::basic_string, think of it as a string plus the + actual state-machine required by the regular expression algorithms. Like + std::basic_string there are two typedefs that are almost always the means by + which this class is referenced:

+
namespace boost{
+
+template <class charT, 
+          class traits = regex_traits<charT>, 
+          class Allocator = std::allocator<charT> >
+class basic_regex;
+
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+
+}
+

To see how this library can be used, imagine that we are writing a credit card + processing application. Credit card numbers generally come as a string of + 16-digits, separated into groups of 4-digits, and separated by either a space + or a hyphen. Before storing a credit card number in a database (not necessarily + something your customers will appreciate!), we may want to verify that the + number is in the correct format. To match any digit we could use the regular + expression [0-9], however ranges of characters like this are actually locale + dependent. Instead we should use the POSIX standard form [[:digit:]], or the + regex++ and Perl shorthand for this \d (note that many older libraries tended + to be hard-coded to the C-locale, consequently this was not an issue for them). + That leaves us with the following regular expression to validate credit card + number formats:

+

(\d{4}[- ]){3}\d{4}

+

Here the parenthesis act to group (and mark for future reference) + sub-expressions, and the {4} means "repeat exactly 4 times". This is an example + of the extended regular expression syntax used by Perl, awk and egrep. Regex++ + also supports the older "basic" syntax used by sed and grep, but this is + generally less useful, unless you already have some basic regular expressions + that you need to reuse.

+

Now let's take that expression and place it in some C++ code to validate the + format of a credit card number:

+
bool validate_card_format(const std::string s)
+{
+   static const boost::regex e("(\\d{4}[- ]){3}\\d{4}");
+   return regex_match(s, e);
+}
+

Note how we had to add some extra escapes to the expression: remember that the + escape is seen once by the C++ compiler, before it gets to be seen by the + regular expression engine, consequently escapes in regular expressions have to + be doubled up when embedding them in C/C++ code. Also note that all the + examples assume that your compiler supports Koenig lookup, if yours doesn't + (for example VC6), then you will have to add some boost:: prefixes to some of + the function calls in the examples.

+

Those of you who are familiar with credit card processing, will have realized + that while the format used above is suitable for human readable card numbers, + it does not represent the format required by online credit card systems; these + require the number as a string of 16 (or possibly 15) digits, without any + intervening spaces. What we need is a means to convert easily between the two + formats, and this is where search and replace comes in. Those who are familiar + with the utilities sed and Perl will already be ahead here; we + need two strings - one a regular expression - the other a "format + string" that provides a description of the text to replace the match + with. In regex++ this search and replace operation is performed with the + algorithm regex_replace, for our credit card example we can write two algorithms + like this to provide the format conversions:

+
// match any format with the regular expression:
+const boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z");
+const std::string machine_format("\\1\\2\\3\\4");
+const std::string human_format("\\1-\\2-\\3-\\4");
+
+std::string machine_readable_card_number(const std::string s)
+{
+   return regex_replace(s, e, machine_format, boost::match_default | boost::format_sed);
+}
+
+std::string human_readable_card_number(const std::string s)
+{
+   return regex_replace(s, e, human_format, boost::match_default | boost::format_sed);
+}
+

Here we've used marked sub-expressions in the regular expression to split out + the four parts of the card number as separate fields, the format string then + uses the sed-like syntax to replace the matched text with the reformatted + version.

+

In the examples above, we haven't directly manipulated the results of a regular + expression match, however in general the result of a match contains a number of + sub-expression matches in addition to the overall match. When the library needs + to report a regular expression match it does so using an instance of the class + match_results, as before there are typedefs of this class for the most + common cases: +

+
namespace boost{
+typedef match_results<const char*> cmatch;
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<std::string::const_iterator> smatch;
+typedef match_results<std::wstring::const_iterator> wsmatch; 
+}
+

The algorithms regex_search and + regex_grep (i.e. finding all matches in a string) make use of + match_results to report what matched.

+

Note that these algorithms are not restricted to searching regular C-strings, + any bidirectional iterator type can be searched, allowing for the possibility + of seamlessly searching almost any kind of data. +

+

For search and replace operations in addition to the algorithm + regex_replace that we have already seen, the algorithm + regex_format takes the result of a match and a format string, and + produces a new string by merging the two.

+

For those that dislike templates, there is a high level wrapper class RegEx + that is an encapsulation of the lower level template code - it provides a + simplified interface for those that don't need the full power of the library, + and supports only narrow characters, and the "extended" regular expression + syntax. +

+

The POSIX API functions: regcomp, regexec, regfree + and regerror, are available in both narrow character and Unicode versions, and + are provided for those who need compatibility with these API's. +

+

Finally, note that the library now has run-time localization + support, and recognizes the full POSIX regular expression syntax - including + advanced features like multi-character collating elements and equivalence + classes - as well as providing compatibility with other regular expression + libraries including GNU and BSD4 regex packages, and to a more limited extent + Perl 5. +

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998-2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + + + diff --git a/doc/Attic/localisation.html b/doc/Attic/localisation.html new file mode 100644 index 00000000..e4184fd8 --- /dev/null +++ b/doc/Attic/localisation.html @@ -0,0 +1,1032 @@ + + + + +Boost.Regex: Localisation + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Localisation

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Boost.regex provides extensive support for run-time +localization, the localization model used can be split into two +parts: front-end and back-end.

+ +

Front-end localization deals with everything which the user sees +- error messages, and the regular expression syntax itself. For +example a French application could change [[:word:]] to [[:mot:]] +and \w to \m. Modifying the front end locale requires active +support from the developer, by providing the library with a message +catalogue to load, containing the localized strings. Front-end +locale is affected by the LC_MESSAGES category only.

+ +

Back-end localization deals with everything that occurs after +the expression has been parsed - in other words everything that the +user does not see or interact with directly. It deals with case +conversion, collation, and character class membership. The back-end +locale does not require any intervention from the developer - the +library will acquire all the information it requires for the +current locale from the underlying operating system / run time +library. This means that if the program user does not interact with +regular expressions directly - for example if the expressions are +embedded in your C++ code - then no explicit localization is +required, as the library will take care of everything for you. For +example embedding the expression [[:word:]]+ in your code will +always match a whole word, if the program is run on a machine with, +for example, a Greek locale, then it will still match a whole word, +but in Greek characters rather than Latin ones. The back-end locale +is affected by the LC_TYPE and LC_COLLATE categories.

+ +

There are three separate localization mechanisms supported by +boost.regex:

+ +

Win32 localization model.

+ +

This is the default model when the library is compiled under +Win32, and is encapsulated by the traits class w32_regex_traits. +When this model is in effect there is a single global locale as +defined by the user's control panel settings, and returned by +GetUserDefaultLCID. All the settings used by boost.regex are +acquired directly from the operating system bypassing the C run +time library. Front-end localization requires a resource dll, +containing a string table with the user-defined strings. The traits +class exports the function:

+ +

static std::string set_message_catalogue(const std::string& +s);

+ +

which needs to be called with a string identifying the name of +the resource dll, before your code compiles any regular +expressions (but not necessarily before you construct any +basic_regex instances):

+ +

+boost::w32_regex_traits<char>::set_message_catalogue("mydll.dll");

+ +

Note that this API sets the dll name for both the narrow +and wide character specializations of w32_regex_traits.

+ +

This model does not currently support thread specific locales +(via SetThreadLocale under Windows NT), the library provides full +Unicode support under NT, under Windows 9x the library degrades +gracefully - characters 0 to 255 are supported, the remainder are +treated as "unknown" graphic characters.

+ +

C localization model.

+ +

This is the default model when the library is compiled under an +operating system other than Win32, and is encapsulated by the +traits class c_regex_traits, Win32 users can force this +model to take effect by defining the pre-processor symbol +BOOST_REGEX_USE_C_LOCALE. When this model is in effect there is a +single global locale, as set by setlocale. All settings are +acquired from your run time library, consequently Unicode support +is dependent upon your run time library implementation. Front end +localization requires a POSIX message catalogue. The traits class +exports the function:

+ +

static std::string set_message_catalogue(const std::string& +s);

+ +

which needs to be called with a string identifying the name of +the message catalogue, before your code compiles any regular +expressions (but not necessarily before you construct any +basic_regex instances):

+ +

+boost::c_regex_traits<char>::set_message_catalogue("mycatalogue");

+ +

Note that this API sets the dll name for both the narrow +and wide character specializations of c_regex_traits. If your run +time library does not support POSIX message catalogues, then you +can either provide your own implementation of <nl_types.h> or +define BOOST_RE_NO_CAT to disable front-end localization via +message catalogues.

+ +

Note that calling setlocale invalidates all compiled +regular expressions, calling setlocale(LC_ALL, "C") will +make this library behave equivalent to most traditional regular +expression libraries including version 1 of this library.

+ +

C++ localization model.

+ +

This model is only in effect if the library is built with the +pre-processor symbol BOOST_REGEX_USE_CPP_LOCALE defined. When this +model is in effect each instance of basic_regex<> has its own +instance of std::locale, class basic_regex<> also has a +member function imbue which allows the locale for the +expression to be set on a per-instance basis. Front end +localization requires a POSIX message catalogue, which will be +loaded via the std::messages facet of the expression's locale, the +traits class exports the symbol:

+ +

static std::string set_message_catalogue(const std::string& +s);

+ +

which needs to be called with a string identifying the name of +the message catalogue, before your code compiles any regular +expressions (but not necessarily before you construct any +basic_regex instances):

+ +

+boost::cpp_regex_traits<char>::set_message_catalogue("mycatalogue");

+ +

Note that calling basic_regex<>::imbue will invalidate any +expression currently compiled in that instance of +basic_regex<>. This model is the one which closest fits the +ethos of the C++ standard library, however it is the model which +will produce the slowest code, and which is the least well +supported by current standard library implementations, for example +I have yet to find an implementation of std::locale which supports +either message catalogues, or locales other than "C" or +"POSIX".

+ +

Finally note that if you build the library with a non-default +localization model, then the appropriate pre-processor symbol +(BOOST_REGEX_USE_C_LOCALE or BOOST_REGEX_USE_CPP_LOCALE) must be +defined both when you build the support library, and when you +include <boost/regex.hpp> or <boost/cregex.hpp> in your +code. The best way to ensure this is to add the #define to +<boost/regex/user.hpp>.

+ +

Providing a message catalogue:

+ +

In order to localize the front end of the library, you need to +provide the library with the appropriate message strings contained +either in a resource dll's string table (Win32 model), or a POSIX +message catalogue (C or C++ models). In the latter case the +messages must appear in message set zero of the catalogue. The +messages and their id's are as follows:
+  

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Message idMeaningDefault value 
 101The character used to start a +sub-expression."(" 
 102The character used to end a +sub-expression declaration.")" 
 103The character used to denote an end of +line assertion."$" 
 104The character used to denote the start +of line assertion."^" 
 105The character used to denote the +"match any character expression"."." 
 106The match zero or more times +repetition operator."*" 
 107The match one or more repetition +operator."+" 
 108The match zero or one repetition +operator."?" 
 109The character set opening +character."[" 
 110The character set closing +character."]" 
 111The alternation operator."|" 
 112The escape character."\\" 
 113The hash character (not currently +used)."#" 
 114The range operator."-" 
 115The repetition operator opening +character."{" 
 116The repetition operator closing +character."}" 
 117The digit characters."0123456789" 
 118The character which when preceded by +an escape character represents the word boundary assertion."b" 
 119The character which when preceded by +an escape character represents the non-word boundary +assertion."B" 
 120The character which when preceded by +an escape character represents the word-start boundary +assertion."<" 
 121The character which when preceded by +an escape character represents the word-end boundary +assertion.">" 
 122The character which when preceded by +an escape character represents any word character."w" 
 123The character which when preceded by +an escape character represents a non-word character."W" 
 124The character which when preceded by +an escape character represents a start of buffer assertion."`A" 
 125The character which when preceded by +an escape character represents an end of buffer assertion."'z" 
 126The newline character."\n" 
 127The comma separator."," 
 128The character which when preceded by +an escape character represents the bell character."a" 
 129The character which when preceded by +an escape character represents the form feed character."f" 
 130The character which when preceded by +an escape character represents the newline character."n" 
 131The character which when preceded by +an escape character represents the carriage return character."r" 
 132The character which when preceded by +an escape character represents the tab character."t" 
 133The character which when preceded by +an escape character represents the vertical tab character."v" 
 134The character which when preceded by +an escape character represents the start of a hexadecimal character +constant."x" 
 135The character which when preceded by +an escape character represents the start of an ASCII escape +character."c" 
 136The colon character.":" 
 137The equals character."=" 
 138The character which when preceded by +an escape character represents the ASCII escape character."e" 
 139The character which when preceded by +an escape character represents any lower case character."l" 
 140The character which when preceded by +an escape character represents any non-lower case character."L" 
 141The character which when preceded by +an escape character represents any upper case character."u" 
 142The character which when preceded by +an escape character represents any non-upper case character."U" 
 143The character which when preceded by +an escape character represents any space character."s" 
 144The character which when preceded by +an escape character represents any non-space character."S" 
 145The character which when preceded by +an escape character represents any digit character."d" 
 146The character which when preceded by +an escape character represents any non-digit character."D" 
 147The character which when preceded by +an escape character represents the end quote operator."E" 
 148The character which when preceded by +an escape character represents the start quote operator."Q" 
 149The character which when preceded by +an escape character represents a Unicode combining character +sequence."X" 
 150The character which when preceded by +an escape character represents any single character."C" 
 151The character which when preceded by +an escape character represents end of buffer operator."Z" 
 152The character which when preceded by +an escape character represents the continuation assertion."G" 
 153The character which when preceeded by (? indicates a zero width +negated forward lookahead assert.! 
+ +
+
+ + +

Custom error messages are loaded as follows: 

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Message IDError message IDDefault string 
 201REG_NOMATCH"No match" 
 202REG_BADPAT"Invalid regular expression" 
 203REG_ECOLLATE"Invalid collation character" 
 204REG_ECTYPE"Invalid character class name" 
 205REG_EESCAPE"Trailing backslash" 
 206REG_ESUBREG"Invalid back reference" 
 207REG_EBRACK"Unmatched [ or [^" 
 208REG_EPAREN"Unmatched ( or \\(" 
 209REG_EBRACE"Unmatched \\{" 
 210REG_BADBR"Invalid content of \\{\\}" 
 211REG_ERANGE"Invalid range end" 
 212REG_ESPACE"Memory exhausted" 
 213REG_BADRPT"Invalid preceding regular +expression" 
 214REG_EEND"Premature end of regular +expression" 
 215REG_ESIZE"Regular expression too big" 
 216REG_ERPAREN"Unmatched ) or \\)" 
 217REG_EMPTY"Empty expression" 
 218REG_E_UNKNOWN"Unknown error" 
+ +
+
+ + +

Custom character class names are loaded as followed: 

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Message IDDescriptionEquivalent default class name 
 300The character class name for +alphanumeric characters."alnum" 
 301The character class name for +alphabetic characters."alpha" 
 302The character class name for control +characters."cntrl" 
 303The character class name for digit +characters."digit" 
 304The character class name for graphics +characters."graph" 
 305The character class name for lower +case characters."lower" 
 306The character class name for printable +characters."print" 
 307The character class name for +punctuation characters."punct" 
 308The character class name for space +characters."space" 
 309The character class name for upper +case characters."upper" 
 310The character class name for +hexadecimal characters."xdigit" 
 311The character class name for blank +characters."blank" 
 312The character class name for word +characters."word" 
 313The character class name for Unicode +characters."unicode" 
+ +
+
+ + +

Finally, custom collating element names are loaded starting from +message id 400, and terminating when the first load thereafter +fails. Each message looks something like: "tagname string" where +tagname is the name used inside [[.tagname.]] and +string is the actual text of the collating element. Note that +the value of collating element [[.zero.]] is used for the +conversion of strings to numbers - if you replace this with another +value then that will be used for string parsing - for example use +the Unicode character 0x0660 for [[.zero.]] if you want to use +Unicode Arabic-Indic digits in your regular expressions in place of +Latin digits.

+ +

Note that the POSIX defined names for character classes and +collating elements are always available - even if custom names are +defined, in contrast, custom error messages, and custom syntax +messages replace the default ones.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/match_flag_type.html b/doc/Attic/match_flag_type.html new file mode 100644 index 00000000..0e89736a --- /dev/null +++ b/doc/Attic/match_flag_type.html @@ -0,0 +1,330 @@ + + + + +Boost.Regex: match_flag_type + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

match_flag_type

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Synopsis

+ +

The type match_flag_type is an implementation +defined bitmask type (17.3.2.1.2) that controls how a regular +expression is matched against a character sequence.

+ +
+namespace std{ namespace regex_constants{
+
+typedef bitmask_type match_flag_type;
+
+static const match_flag_type match_default = 0;
+static const match_flag_type match_not_bob;
+static const match_flag_type match_not_eob;
+static const match_flag_type match_not_bol;
+static const match_flag_type match_not_eol;
+static const match_flag_type match_not_bow;
+static const match_flag_type match_not_eow;
+static const match_flag_type match_any;
+static const match_flag_type match_not_null;
+static const match_flag_type match_continuous;
+static const match_flag_type match_partial;
+static const match_flag_type match_prev_avail;
+static const match_flag_type match_not_dot_newline;
+static const match_flag_type match_not_dot_null;
+
+static const match_flag_type format_default = 0;
+static const match_flag_type format_sed;
+static const match_flag_type format_perl;
+static const match_flag_type format_no_copy;
+static const match_flag_type format_first_only;
+static const match_flag_type format_all;
+
+} // namespace regex_constants
+} // namespace std
+
+ +

Description

+ +

The type match_flag_type is an implementation +defined bitmask type (17.3.2.1.2). When matching a regular +expression against a sequence of characters [first, last) then +setting its elements has the effects listed in the table below:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Effect if set

+
+

match_default

+
+

Specifies that matching of regular expressions proceeds without +any modification of the normal rules used in ECMA-262, ECMAScript +Language Specification, Chapter 15 part 10, RegExp (Regular +Expression) Objects (FWD.1)

+
match_not_bobSpecifies that the expression "\A" +should not match against the sub-sequence [first,first).
match_not_eobSpecifies that the expressions "\z" +and "\Z" should not match against the sub-sequence +[last,last).
+

match_not_bol

+
+

Specifies that the expression "^" should not be matched against +the sub-sequence [first,first).

+
+

match_not_eol

+
+

Specifies that the expression "$" should not be matched against +the sub-sequence [last,last).

+
+

match_not_bow

+
+

Specifies that the expression "\b" should not be matched against +the sub-sequence [first,first).

+
+

match_not_eow

+
+

Specifies that the expression "\b" should not be matched against +the sub-sequence [last,last).

+
+

match_any

+
+

Specifies that if more than one match is possible then any match +is an acceptable result.

+
+

match_not_null

+
+

Specifies that the expression can not be matched against an +empty sequence.

+
+

match_continuous

+
+

Specifies that the expression must match a sub-sequence that +begins at first.

+
+

match_partial

+
+

Specifies that if no match can be found, then it is acceptable +to return a match [from, last) where from!=last, if there exists +some sequence of characters [from,to) of which [from,last) is a +prefix, and which would result in a full match.

+
+

match_prev_avail

+
+

Specifies that --first is a valid iterator +position, when this flag is set then the flags +match_not_bol and match_not_bow are ignored by +the regular expression algorithms (RE.7) and iterators (RE.8).

+
match_not_dot_newlineSpecifies that the expression "." does +not match a newline character.
match_not_dot_nullSpecified that the expression "." does +not match a character null '\0'.
+

format_default

+
+

Specifies that when a regular expression match is to be replaced +by a new string, that the new string is constructed using the rules +used by the ECMAScript replace function in ECMA-262, ECMAScript +Language Specification, Chapter 15 part 5.4.11 +String.prototype.replace. (FWD.1). In addition during search and +replace operations then all non-overlapping occurrences of the +regular expression are located and replaced, and sections of the +input that did not match the expression, are copied unchanged to +the output string.

+
+

format_sed

+
+

Specifies that when a regular expression match is to be replaced +by a new string, that the new string is constructed using the rules +used by the Unix sed utility in IEEE Std 1003.1-2001, Portable +Operating SystemInterface (POSIX ), Shells and Utilities..

+
+

format_perl

+
+

Specifies that when a regular expression match is to be replaced +by a new string, that the new string is constructed using an +implementation defined superset of the rules used by the ECMAScript +replace function in ECMA-262, ECMAScript Language Specification, +Chapter 15 part 5.4.11 String.prototype.replace (FWD.1).

+
format_allSpecifies that all syntax +extensions are enabled, including conditional +(?ddexpression1:expression2) replacements.
+

format_no_copy

+
+

When specified during a search and replace operation, then +sections of the character container sequence being searched that do +match the regular expression, are not copied to the output +string.

+
+

format_first_only

+
+

When specified during a search and replace operation, then only +the first occurrence of the regular expression is replaced.

+
+ +
+
+ + +

+ +
+
+
+ + +

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/match_results.html b/doc/Attic/match_results.html new file mode 100644 index 00000000..9acc3afc --- /dev/null +++ b/doc/Attic/match_results.html @@ -0,0 +1,511 @@ + + + + +Boost.Regex: class match_results + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

class match_results

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Contents

+ +
+
Synopsis
+ +
Description
+
+ +

Synopsis

+ +

#include <boost/regex.hpp>

+ +

Regular expressions are different from many simple +pattern-matching algorithms in that as well as finding an overall +match they can also produce sub-expression matches: each +sub-expression being delimited in the pattern by a pair of +parenthesis (...). There has to be some method for reporting +sub-expression matches back to the user: this is achieved this by +defining a class match_results that acts as an indexed +collection of sub-expression matches, each sub-expression match +being contained in an object of type +sub_match .

+ +

Template class match_results denotes a collection of character +sequences representing the result of a regular expression match. +Objects of type match_results are passed to the algorithms regex_match and +regex_search, and are returned by the iterator regex_iterator .  Storage for the +collection is allocated and freed as necessary by the member +functions of class match_results.

+ +

The template class match_results conforms to the requirements of +a Sequence, as specified in (lib.sequence.reqmts), except that only +operations defined for const-qualified Sequences are supported.

+ +

Class template match_results is most commonly used as one of the +typedefs cmatch, wcmatch, smatch, or wsmatch:

+ +
+template <class BidirectionalIterator,
+          class Allocator = allocator<sub_match<BidirectionalIterator> >
+class match_results;
+
+typedef match_results<const char*> cmatch;
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<string::const_iterator> smatch;
+typedef match_results<wstring::const_iterator> wsmatch;
+
+template <class BidirectionalIterator,
+          class Allocator = allocator<sub_match<BidirectionalIterator> >
+class match_results
+{ 
+public: 
+   typedef          sub_match<BidirectionalIterator>                        value_type;
+   typedef          const value_type&                                       const_reference;
+   typedef          const_reference                                         reference;
+   typedef          implementation defined                                  const_iterator;
+   typedef          const_iterator                                          iterator;
+   typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+   typedef typename Allocator::size_type                                    size_type;
+   typedef          Allocator                                               allocator_type;
+   typedef typename iterator_traits<BidirectionalIterator>::value_type      char_type;
+   typedef          basic_string<char_type>                                 string_type;
+
+   // construct/copy/destroy:
+   explicit match_results(const Allocator& a = Allocator());
+   match_results(const match_results& m);
+   match_results& operator=(const match_results& m); 
+   ~match_results();
+
+   // size:
+   size_type size() const;
+   size_type max_size() const;
+   bool empty() const;
+   // element access:
+   difference_type length(int sub = 0) const;
+   difference_type position(unsigned int sub = 0) const;
+   string_type str(int sub = 0) const;
+   const_reference operator[](int n) const;
+
+   const_reference prefix() const;
+
+   const_reference suffix() const;
+   const_iterator begin() const;
+   const_iterator end() const;
+   // format:
+   template <class OutputIterator>
+   OutputIterator format(OutputIterator out,
+                         const string_type& fmt,
+                         match_flag_type flags = format_default) const;
+   string_type format(const string_type& fmt,
+                      match_flag_type flags = format_default) const;
+
+   allocator_type get_allocator() const;
+   void swap(match_results& that);
+};
+
+template <class BidirectionalIterator, class Allocator>
+bool operator == (const match_results<BidirectionalIterator, Allocator>& m1,
+                  const match_results<BidirectionalIterator, Allocator>& m2);
+template <class BidirectionalIterator, class Allocator>
+bool operator != (const match_results<BidirectionalIterator, Allocator>& m1,
+                  const match_results<BidirectionalIterator, Allocator>& m2);
+
+template <class charT, class traits, class BidirectionalIterator, class Allocator>
+basic_ostream<charT, traits>&
+   operator << (basic_ostream<charT, traits>& os,
+                const match_results<BidirectionalIterator, Allocator>& m);
+
+template <class BidirectionalIterator, class Allocator>
+void swap(match_results<BidirectionalIterator, Allocator>& m1,
+          match_results<BidirectionalIterator, Allocator>& m2);
+
+ +

Description

+ +

match_results constructors

+ +

In all match_results constructors, a copy of the +Allocator argument is used for any memory allocation performed by +the constructor or member functions during the lifetime of the +object.

+ +
+match_results(const Allocator& a = Allocator());
+
+ + +

Effects: Constructs an object of class match_results. The +postconditions of this function are indicated in the table:

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value

+
+

empty()

+
+

true

+
+

size()

+
+

0

+
+

str()

+
+

basic_string<charT>()

+
+
+ +

 

+ +
+match_results(const match_results& m);
+
+ + +

Effects: Constructs an object of class match_results, as +a copy of m.

+ +
+match_results& operator=(const match_results& m);
+
+ + +

Effects: Assigns m to *this. The postconditions of this +function are indicated in the table:

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value

+
+

empty()

+
+

m.empty().

+
+

size()

+
+

m.size().

+
+

str(n)

+
+

m.str(n) for all integers n < m.size().

+
+

prefix()

+
+

m.prefix().

+
+

suffix()

+
+

m.suffix().

+
+

(*this)[n]

+
+

m[n] for all integers n < m.size().

+
+

length(n)

+
+

m.length(n) for all integers n < m.size().

+
+

position(n)

+
+

m.position(n) for all integers n < m.size().

+
+
+ +

match_results size

+ +
+size_type size()const;
+
+ + +

Effects: Returns the number of sub_match elements stored +in *this.

+ +
+size_type max_size()const;
+
+ + +

Effects: Returns the maximum number of sub_match elements +that can be stored in *this.

+ +
+bool empty()const;
+
+ + +

Effects: Returns size() == 0.

+ +

match_results element access

+ +
+difference_type length(int sub = 0)const;
+
+ + +

Effects: Returns (*this)[sub].length().

+ +
+difference_type position(unsigned int sub = 0)const;
+
+ + +

Effects: Returns std::distance(prefix().first, +(*this)[sub].first).

+ +
+string_type str(int sub = 0)const;
+
+ + +

Effects: Returns +string_type((*this)[sub]).

+ +
+const_reference operator[](int n) const;
+
+ + +

Effects: Returns a reference to the +sub_match object representing the character sequence that +matched marked sub-expression n. If n == 0 then +returns a reference to a sub_match object representing +the character sequence that matched the whole regular +expression.

+ +
+const_reference prefix()const;
+
+ + +

Effects: Returns a reference to the +sub_match object representing the character sequence from +the start of the string being matched/searched, to the start of the +match found.

+ +
+const_reference suffix()const;
+
+ + +

Effects: Returns a reference to the +sub_match object representing the character sequence from +the end of the match found to the end of the string being +matched/searched.

+ +
+const_iterator begin()const;
+
+ + +

Effects: Returns a starting iterator that enumerates over +all the marked sub-expression matches stored in *this.

+ +
+const_iterator end()const;
+
+ + +

Effects: Returns a terminating iterator that enumerates +over all the marked sub-expression matches stored in *this.

+ +

match_results reformatting

+ +
+template <class OutputIterator>
+OutputIterator format(OutputIterator out,
+                      const string_type& fmt,
+                      match_flag_type flags = format_default);
+
+ + +

Requires: The type OutputIterator conforms to the Output +Iterator requirements (24.1.2).

+ + +

Effects: Copies the character sequence [fmt.begin(), +fmt.end()) to OutputIterator out. For each format +specifier or escape sequence in fmt, replace that sequence +with either the character(s) it represents, or the sequence of +characters within *this to which it refers. The bitmasks specified +in flags determines what +format specifiers or escape sequences +are recognized, by default this is the format used by ECMA-262, +ECMAScript Language Specification, Chapter 15 part 5.4.11 +String.prototype.replace.

+ + +

Returns: out.

+ +
+string_type format(const string_type& fmt,
+                   match_flag_type flags = format_default);
+
+ + +

Effects: Returns a copy of the string fmt. For +each format specifier or escape sequence in fmt, replace +that sequence with either the character(s) it represents, or the +sequence of characters within *this to which it refers. The +bitmasks specified in +flags determines what format +specifiers or escape sequences are recognized, by default this +is the format used by ECMA-262, ECMAScript Language Specification, +Chapter 15 part 5.4.11 String.prototype.replace.

+ +
+allocator_type get_allocator()const;
+
+ + +

Effects: Returns a copy of the Allocator that was passed +to the object's constructor.

+ +
+void swap(match_results& that);
+
+ + +

Effects: Swaps the contents of the two sequences.

+ + +

Postcondition: *this contains the sequence +of matched sub-expressions that were in that, +that contains the sequence of matched sub-expressions that +were in *this.

+ + +

Complexity: constant time.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/partial_matches.html b/doc/Attic/partial_matches.html new file mode 100644 index 00000000..3f4d2a53 --- /dev/null +++ b/doc/Attic/partial_matches.html @@ -0,0 +1,185 @@ + + + + Boost.Regex: Partial Matches + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Partial Matches

+
+

Boost.Regex Index

+
+

+
+

+

The match-flag match_partial can + be passed to the following algorithms: regex_match, + regex_search, and regex_grep. + When used it indicates that partial as well as full matches should be found. A + partial match is one that matched one or more characters at the end of the text + input, but did not match all of the regular expression (although it may have + done so had more input been available). Partial matches are typically used when + either validating data input (checking each character as it is entered on the + keyboard), or when searching texts that are either too long to load into memory + (or even into a memory mapped file), or are of indeterminate length (for + example the source may be a socket or similar). Partial and full matches can be + differentiated as shown in the following table (the variable M represents an + instance of match_results<> as filled in + by regex_match, regex_search or regex_grep):
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 ResultM[0].matchedM[0].firstM[0].second
No matchFalseUndefinedUndefinedUndefined
Partial matchTrueFalseStart of partial match.End of partial match (end of text).
Full matchTrueTrueStart of full match.End of full match.
+

+

The following example + tests to see whether the text could be a valid credit card number, as the user + presses a key, the character entered would be added to the string being built + up, and passed to is_possible_card_number. If this returns true + then the text could be a valid card number, so the user interface's OK button + would be enabled. If it returns false, then this is not yet a valid card + number, but could be with more input, so the user interface would disable the + OK button. Finally, if the procedure throws an exception the input could never + become a valid number, and the inputted character must be discarded, and a + suitable error indication displayed to the user.

+
#include <string>
+#include <iostream>
+#include <boost/regex.hpp>
+
+boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})");
+
+bool is_possible_card_number(const std::string& input)
+{
+   //
+   // return false for partial match, true for full match, or throw for
+   // impossible match based on what we have so far...
+   boost::match_results<std::string::const_iterator> what;
+   if(0 == boost::regex_match(input, what, e, boost::match_default | boost::match_partial))
+   {
+      // the input so far could not possibly be valid so reject it:
+      throw std::runtime_error("Invalid data entered - this could not possibly be a valid card number");
+   }
+   // OK so far so good, but have we finished?
+   if(what[0].matched)
+   {
+      // excellent, we have a result:
+      return true;
+   }
+   // what we have so far is only a partial match...
+   return false;
+}
+

In the following example, + text input is taken from a stream containing an unknown amount of text; this + example simply counts the number of html tags encountered in the stream. The + text is loaded into a buffer and searched a part at a time, if a partial match + was encountered, then the partial match gets searched a second time as the + start of the next batch of text:

+
#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <boost/regex.hpp>
+
+// match some kind of html tag:
+boost::regex e("<[^>]*>");
+// count how many:
+unsigned int tags = 0;
+// saved position of partial match:
+char* next_pos = 0;
+
+bool grep_callback(const boost::match_results<char*>& m)
+{
+   if(m[0].matched == false)
+   {
+      // save position and return:
+      next_pos = m[0].first;
+   }
+   else
+      ++tags;
+   return true;
+}
+
+void search(std::istream& is)
+{
+   char buf[4096];
+   next_pos = buf + sizeof(buf);
+   bool have_more = true;
+   while(have_more)
+   {
+      // how much do we copy forward from last try:
+      unsigned leftover = (buf + sizeof(buf)) - next_pos;
+      // and how much is left to fill:
+      unsigned size = next_pos - buf;
+      // copy forward whatever we have left:
+      memcpy(buf, next_pos, leftover);
+      // fill the rest from the stream:
+      unsigned read = is.readsome(buf + leftover, size);
+      // check to see if we've run out of text:
+      have_more = read == size;
+      // reset next_pos:
+      next_pos = buf + sizeof(buf);
+      // and then grep:
+      boost::regex_grep(grep_callback,
+                        buf,
+                        buf + read + leftover,
+                        e,
+                        boost::match_default | boost::match_partial);
+   }
+}
+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/performance.html b/doc/Attic/performance.html new file mode 100644 index 00000000..826dd83a --- /dev/null +++ b/doc/Attic/performance.html @@ -0,0 +1,54 @@ + + + + Boost.Regex: Performance + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Performance

+
+

Boost.Regex Index

+
+

+
+

+

The performance of Boost.regex in both recursive and non-recursive modes should + be broadly comparable to other regular expression libraries: recursive mode is + slightly faster (especially where memory allocation requires thread + synchronisation), but not by much.  The following pages compare + Boost.regex with various other regular expression libraries for the following + compilers:

+

Visual Studio.Net 2003 (recursive Boost.regex + implementation).

+

Gcc 3.2 (cygwin) (non-recursive Boost.regex + implementation).

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/posix_api.html b/doc/Attic/posix_api.html new file mode 100644 index 00000000..fdc3bba3 --- /dev/null +++ b/doc/Attic/posix_api.html @@ -0,0 +1,288 @@ + + + + Boost.Regex: POSIX API Compatibility Functions + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

POSIX API Compatibility Functions

+
+

Boost.Regex Index

+
+

+
+

+
#include <boost/cregex.hpp>
+or:
+#include <boost/regex.h>
+

The following functions are available for users who need a POSIX compatible C + library, they are available in both Unicode and narrow character versions, the + standard POSIX API names are macros that expand to one version or the other + depending upon whether UNICODE is defined or not. +

+

Important: Note that all the symbols defined here are enclosed inside + namespace boost when used in C++ programs, unless you use #include + <boost/regex.h> instead - in which case the symbols are still defined in + namespace boost, but are made available in the global namespace as well.

+

The functions are defined as: +

+
extern "C" {
+int regcompA(regex_tA*, const char*, int);
+unsigned int regerrorA(int, const regex_tA*, char*, unsigned int);
+int regexecA(const regex_tA*, const char*, unsigned int, regmatch_t*, int);
+void regfreeA(regex_tA*);
+
+int regcompW(regex_tW*, const wchar_t*, int);
+unsigned int regerrorW(int, const regex_tW*, wchar_t*, unsigned int);
+int regexecW(const regex_tW*, const wchar_t*, unsigned int, regmatch_t*, int);
+void regfreeW(regex_tW*);
+
+#ifdef UNICODE
+#define regcomp regcompW
+#define regerror regerrorW
+#define regexec regexecW
+#define regfree regfreeW
+#define regex_t regex_tW
+#else
+#define regcomp regcompA
+#define regerror regerrorA
+#define regexec regexecA
+#define regfree regfreeA
+#define regex_t regex_tA
+#endif
+}
+

All the functions operate on structure regex_t, which exposes two public + members: +

+

unsigned int re_nsub this is filled in by regcomp and indicates + the number of sub-expressions contained in the regular expression. +

+

const TCHAR* re_endp points to the end of the expression to compile when + the flag REG_PEND is set. +

+

Footnote: regex_t is actually a #define - it is either regex_tA or regex_tW + depending upon whether UNICODE is defined or not, TCHAR is either char or + wchar_t again depending upon the macro UNICODE. +

+

regcomp

+

regcomp takes a pointer to a regex_t, a pointer to the expression + to compile and a flags parameter which can be a combination of: +
+   +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 REG_EXTENDEDCompiles modern regular expressions. Equivalent to + regbase::char_classes | regbase::intervals | regbase::bk_refs. 
 REG_BASICCompiles basic (obsolete) regular expression syntax. + Equivalent to regbase::char_classes | regbase::intervals | regbase::limited_ops + | regbase::bk_braces | regbase::bk_parens | regbase::bk_refs. 
 REG_NOSPECAll characters are ordinary, the expression is a + literal string. 
 REG_ICASECompiles for matching that ignores character case. 
 REG_NOSUBHas no effect in this library. 
 REG_NEWLINEWhen this flag is set a dot does not match the + newline character. 
 REG_PENDWhen this flag is set the re_endp parameter of the + regex_t structure must point to the end of the regular expression to compile. 
 REG_NOCOLLATEWhen this flag is set then locale dependent collation + for character ranges is turned off. 
 REG_ESCAPE_IN_LISTS
+ , , , +
When this flag is set, then escape sequences are + permitted in bracket expressions (character sets). 
 REG_NEWLINE_ALT When this flag is set then the newline character is + equivalent to the alternation operator |. 
 REG_PERL Compiles Perl like regular expressions. 
 REG_AWKA shortcut for awk-like behavior: REG_EXTENDED | + REG_ESCAPE_IN_LISTS 
 REG_GREPA shortcut for grep like behavior: REG_BASIC | + REG_NEWLINE_ALT 
 REG_EGREP A shortcut for egrep like behavior: + REG_EXTENDED | REG_NEWLINE_ALT 
+

+

regerror

+

regerror takes the following parameters, it maps an error code to a human + readable string: +
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
 int codeThe error code. 
 const regex_t* eThe regular expression (can be null). 
 char* bufThe buffer to fill in with the error message. 
 unsigned int buf_sizeThe length of buf. 
+

+

If the error code is OR'ed with REG_ITOA then the message that results is the + printable name of the code rather than a message, for example "REG_BADPAT". If + the code is REG_ATIO then e must not be null and e->re_pend must + point to the printable name of an error code, the return value is then the + value of the error code. For any other value of code, the return value + is the number of characters in the error message, if the return value is + greater than or equal to buf_size then regerror will have to be + called again with a larger buffer.

+

regexec

+

regexec finds the first occurrence of expression e within string buf. + If len is non-zero then *m is filled in with what matched the + regular expression, m[0] contains what matched the whole string, m[1] + the first sub-expression etc, see regmatch_t in the header file + declaration for more details. The eflags parameter can be a combination + of: +
+   +

+

+ + + + + + + + + + + + + + + + + + + +
 REG_NOTBOLParameter buf does not represent the start of + a line. 
 REG_NOTEOLParameter buf does not terminate at the end of + a line. 
 REG_STARTENDThe string searched starts at buf + pmatch[0].rm_so + and ends at buf + pmatch[0].rm_eo. 
+

+

regfree

+

Finally regfree frees all the memory that was allocated by regcomp. +

+

Footnote: this is an abridged reference to the POSIX API functions, it is + provided for compatibility with other libraries, rather than an API to be used + in new code (unless you need access from a language other than C++). This + version of these functions should also happily coexist with other versions, as + the names used are macros that expand to the actual function names. +

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/redistributables.html b/doc/Attic/redistributables.html new file mode 100644 index 00000000..884fca7a --- /dev/null +++ b/doc/Attic/redistributables.html @@ -0,0 +1,84 @@ + + + + Boost.Regex: Redistributables and Library Names + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Redistributables and Library Names

+
+

Boost.Regex Index

+
+

+
+

+

If you are using Microsoft or Borland C++ and link to a dll version of the run + time library, then you will also link to one of the dll versions of boost.regex. + While these dll's are redistributable, there are no "standard" versions, so + when installing on the users PC, you should place these in a directory private + to your application, and not in the PC's directory path. Note that if you link + to a static version of your run time library, then you will also link to a + static version of boost.regex and no dll's will need to be distributed. The + possible boost.regex dll and library names are computed according to the following + formula:
+

+

+

"boost_regex_"
+ + BOOST_LIB_TOOLSET
+ + "_"
+ + BOOST_LIB_THREAD_OPT
+ + BOOST_LIB_RT_OPT
+ + BOOST_LIB_LINK_OPT
+ + BOOST_LIB_DEBUG_OPT
+
+ These are defined as:
+
+ BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
+
+ BOOST_LIB_THREAD_OPT: "s" for single thread builds,
+ "m" for multithread builds.
+
+ BOOST_LIB_RT_OPT: "s" for static runtime,
+ "d" for dynamic runtime.
+
+ BOOST_LIB_LINK_OPT: "s" for static link,
+ "i" for dynamic link.
+
+ BOOST_LIB_DEBUG_OPT: nothing for release builds,
+ "d" for debug builds,
+ "dd" for debug-diagnostic builds (_STLP_DEBUG).

+

+ Note: you can disable automatic library selection by defining the symbol + BOOST_REGEX_NO_LIB when compiling, this is useful if you want to statically + link even though you're using the dll version of your run time library, or if + you need to debug boost.regex. +

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/reg_expression.html b/doc/Attic/reg_expression.html new file mode 100644 index 00000000..a1fd6b56 --- /dev/null +++ b/doc/Attic/reg_expression.html @@ -0,0 +1,46 @@ + + + + Boost.Regex: Class reg_expression (deprecated) + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Class reg_expression (deprecated)

+
+

Boost.Regex Index

+
+

+
+

+

The use of class template reg_expression is deprecated: use + basic_regex instead.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/regbase.html b/doc/Attic/regbase.html new file mode 100644 index 00000000..f36ce38a --- /dev/null +++ b/doc/Attic/regbase.html @@ -0,0 +1,91 @@ + + + + +Boost.Regex: regbase + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

regbase

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Use of the type boost::regbase is now deprecated, +and the type does not form a part of the +regular expression standardization proposal.  This type +still exists as a base class of boost::basic_regex, +and you can still refer to +boost::regbase::constant_name in your code, however for +maximum portability to other std regex implementations you should +instead use either:

+ +
+boost::regex_constants::constant_name
+
+ +

or

+ +
+boost::regex::constant_name
+
+ +

or

+ +
+boost::wregex::constant_name
+
+ +

+ +
+
+
+ + +

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/regex.html b/doc/Attic/regex.html new file mode 100644 index 00000000..785caf87 --- /dev/null +++ b/doc/Attic/regex.html @@ -0,0 +1,620 @@ + + + + +Boost.Regex: class RegEx (deprecated) + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

class RegEx (deprecated)

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

The high level wrapper class RegEx is now deprecated and does +not form a part of the +regular expression standardization proposal.  This type +still exists, and existing code will continue to compile, however +the following documentation is unlikely to be further updated.

+ +
+#include <boost/cregex.hpp>
+
+ +

The class RegEx provides a high level simplified interface to +the regular expression library, this class only handles narrow +character strings, and regular expressions always follow the +"normal" syntax - that is the same as the perl / ECMAScript +synatx.

+ +
+typedef bool (*GrepCallback)(const RegEx& expression);
+typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
+typedef bool (*FindFilesCallback)(const char* file);
+
+class  RegEx
+{
+public:
+   RegEx();
+   RegEx(const RegEx& o);
+   ~RegEx();
+   RegEx(const char* c, bool icase = false);
+   explicit RegEx(const std::string& s, bool icase = false);
+   RegEx& operator=(const RegEx& o);
+   RegEx& operator=(const char* p);
+   RegEx& operator=(const std::string& s);
+   unsigned int SetExpression(const char* p, bool icase = false);
+   unsigned int SetExpression(const std::string& s, bool icase = false);
+   std::string Expression()const;
+   //
+   // now matching operators: 
+   // 
+   bool Match(const char* p, unsigned int flags = match_default);
+   bool Match(const std::string& s, unsigned int flags = match_default); 
+   bool Search(const char* p, unsigned int flags = match_default); 
+   bool Search(const std::string& s, unsigned int flags = match_default); 
+   unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default); 
+   unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<std::string>& v, const char* p, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<std::string>& v, const std::string& s, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<unsigned int>& v, const char* p, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<unsigned int>& v, const std::string& s, unsigned int flags = match_default); 
+   unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default); 
+   unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default); 
+   unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default); 
+   unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default); 
+   std::string Merge(const std::string& in, const std::string& fmt, bool copy = true, unsigned int flags = match_default); 
+   std::string Merge(const char* in, const char* fmt, bool copy = true, unsigned int flags = match_default); 
+   unsigned Split(std::vector<std::string>& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0); 
+   // 
+   // now operators for returning what matched in more detail: 
+   // 
+   unsigned int Position(int i = 0)const; 
+   unsigned int Length(int i = 0)const; 
+   bool Matched(int i = 0)const;
+   unsigned int Line()const; 
+   unsigned int Marks() const; 
+   std::string What(int i)const; 
+   std::string operator[](int i)const ; 
+
+   static const unsigned int npos;
+};    
+
+ +

Member functions for class RegEx are defined as follows:
+  

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 RegEx();Default constructor, constructs an +instance of RegEx without any valid expression. 
 RegEx(const RegEx& o);Copy constructor, all the properties +of parameter o are copied. 
 RegEx(const char* c, +bool icase = false);Constructs an instance of RegEx, +setting the expression to c, if icase is true +then matching is insensitive to case, otherwise it is sensitive to +case. Throws bad_expression on failure. 
 RegEx(const std::string& s, +bool icase = false);Constructs an instance of RegEx, +setting the expression to s, if icase is true +then matching is insensitive to case, otherwise it is sensitive to +case. Throws bad_expression on failure. 
 RegEx& +operator=(const RegEx& o);Default assignment operator. 
 RegEx& +operator=(const char* p);Assignment operator, equivalent to +calling SetExpression(p, false). Throws +bad_expression on failure. 
 RegEx& +operator=(const std::string& s);Assignment operator, equivalent to +calling SetExpression(s, false). Throws +bad_expression on failure. 
 unsigned int +SetExpression(constchar* p, bool icase = +false);Sets the current expression to +p, if icase is true then matching is insensitive +to case, otherwise it is sensitive to case. Throws +bad_expression on failure. 
 unsigned int +SetExpression(const std::string& s, bool icase = +false);Sets the current expression to +s, if icase is true then matching is insensitive +to case, otherwise it is sensitive to case. Throws +bad_expression on failure. 
 std::string +Expression()const;Returns a copy of the current regular +expression. 
 bool Match(const +char* p, unsigned int flags = +match_default);Attempts to match the current +expression against the text p using the match flags +flags - see match flags. +Returns true if the expression matches the whole of the +input string. 
 bool Match(const +std::string& s, unsigned int flags = +match_default) ;Attempts to match the current +expression against the text s using the match flags +flags - see match flags. +Returns true if the expression matches the whole of the +input string. 
 bool Search(const +char* p, unsigned int flags = +match_default);Attempts to find a match for the +current expression somewhere in the text p using the match +flags flags - see match +flags. Returns true if the match succeeds. 
 bool Search(const +std::string& s, unsigned int flags = +match_default) ;Attempts to find a match for the +current expression somewhere in the text s using the match +flags flags - see match +flags. Returns true if the match succeeds. 
 unsigned int +Grep(GrepCallback cb, const char* p, unsigned +int flags = match_default);Finds all matches of the current +expression in the text p using the match flags flags +- see match flags. For each +match found calls the call-back function cb as: cb(*this); + +

If at any stage the call-back function returns false then the +grep operation terminates, otherwise continues until no further +matches are found. Returns the number of matches found.

+
 
 unsigned int +Grep(GrepCallback cb, const std::string& s, +unsigned int flags = match_default);Finds all matches of the current +expression in the text s using the match flags flags +- see match flags. For each +match found calls the call-back function cb as: cb(*this); + +

If at any stage the call-back function returns false then the +grep operation terminates, otherwise continues until no further +matches are found. Returns the number of matches found.

+
 
 unsigned int +Grep(std::vector<std::string>& v, const +char* p, unsigned int flags = +match_default);Finds all matches of the current +expression in the text p using the match flags flags +- see match flags. For each +match pushes a copy of what matched onto v. Returns the +number of matches found. 
 unsigned int +Grep(std::vector<std::string>& v, const +std::string& s, unsigned int flags = +match_default);Finds all matches of the current +expression in the text s using the match flags flags +- see match flags. For each +match pushes a copy of what matched onto v. Returns the +number of matches found. 
 unsigned int +Grep(std::vector<unsigned int>& v, const +char* p, unsigned int flags = +match_default);Finds all matches of the current +expression in the text p using the match flags flags +- see match flags. For each +match pushes the starting index of what matched onto v. +Returns the number of matches found. 
 unsigned int +Grep(std::vector<unsigned int>& v, const +std::string& s, unsigned int flags = +match_default);Finds all matches of the current +expression in the text s using the match flags flags +- see match flags. For each +match pushes the starting index of what matched onto v. +Returns the number of matches found. 
 unsigned int +GrepFiles(GrepFileCallback cb, const char* files, +bool recurse = false, unsigned int flags = +match_default);Finds all matches of the current +expression in the files files using the match flags +flags - see match flags. For +each match calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering further matches in the current file, or any +further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of matches found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 unsigned int +GrepFiles(GrepFileCallback cb, const std::string& files, +bool recurse = false, unsigned int +flags = match_default);Finds all matches of the current +expression in the files files using the match flags +flags - see match flags. For +each match calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering further matches in the current file, or any +further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of matches found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 unsigned int +FindFiles(FindFilesCallback cb, const char* files, +bool recurse = false, unsigned int +flags = match_default);Searches files to find all +those which contain at least one match of the current expression +using the match flags flags - see match flags. For each matching file +calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering any further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of files found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 unsigned int +FindFiles(FindFilesCallback cb, const std::string& +files, bool recurse = false, unsigned +int flags = match_default);Searches files to find all +those which contain at least one match of the current expression +using the match flags flags - see match flags. For each matching file +calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering any further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of files found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 std::string Merge(const +std::string& in, const std::string& fmt, bool +copy = true, unsigned int flags = +match_default);Performs a search and replace +operation: searches through the string in for all +occurrences of the current expression, for each occurrence replaces +the match with the format string fmt. Uses flags to +determine what gets matched, and how the format string should be +treated. If copy is true then all unmatched sections of +input are copied unchanged to output, if the flag +format_first_only is set then only the first occurance of the +pattern found is replaced. Returns the new string. See also format string syntax, match flags and format flags. 
 std::string Merge(const char* +in, const char* fmt, bool copy = true, +unsigned int flags = match_default);Performs a search and replace +operation: searches through the string in for all +occurrences of the current expression, for each occurrence replaces +the match with the format string fmt. Uses flags to +determine what gets matched, and how the format string should be +treated. If copy is true then all unmatched sections of +input are copied unchanged to output, if the flag +format_first_only is set then only the first occurance of the +pattern found is replaced. Returns the new string. See also format string syntax, match flags and format flags. 
 unsigned +Split(std::vector<std::string>& v, std::string& s, +unsigned flags = match_default, unsigned max_count = +~0);Splits the input string and pushes each one onto +the vector. If the expression contains no marked sub-expressions, +then one string is outputted for each section of the input that +does not match the expression. If the expression does contain +marked sub-expressions, then outputs one string for each marked +sub-expression each time a match occurs. Outputs no more than +max_count strings. Before returning, deletes from the input +string s all of the input that has been processed (all of +the string if max_count was not reached). Returns the number +of strings pushed onto the vector. 
 unsigned int +Position(int i = 0)const;Returns the position of what matched +sub-expression i. If i = 0 then returns the position +of the whole match. Returns RegEx::npos if the supplied index is +invalid, or if the specified sub-expression did not participate in +the match. 
 unsigned int +Length(int i = 0)const;Returns the length of what matched +sub-expression i. If i = 0 then returns the length of +the whole match. Returns RegEx::npos if the supplied index is +invalid, or if the specified sub-expression did not participate in +the match. 
 bool Matched(int i = +0)const;Returns true if sub-expression i was matched, false +otherwise. 
 unsigned int +Line()const;Returns the line on which the match +occurred, indexes start from 1 not zero, if no match occurred then +returns RegEx::npos. 
 unsigned int Marks() +const;Returns the number of marked +sub-expressions contained in the expression. Note that this +includes the whole match (sub-expression zero), so the value +returned is always >= 1. 
 std::string What(int +i)const;Returns a copy of what matched +sub-expression i. If i = 0 then returns a copy of the +whole match. Returns a null string if the index is invalid or if +the specified sub-expression did not participate in a match. 
 std::string +operator[](int i)const ;Returns what(i); + +

Can be used to simplify access to sub-expression matches, and +make usage more perl-like.

+
 
+ +
+
+ + +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/regex_format.html b/doc/Attic/regex_format.html new file mode 100644 index 00000000..786353e8 --- /dev/null +++ b/doc/Attic/regex_format.html @@ -0,0 +1,213 @@ + + + + +Boost.Regex: Algorithm regex_format (deprecated) + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Algorithm regex_format (deprecated)

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

The algorithm regex_format is deprecated; new code should use +match_results::format instead.  Existing code will continue to +compile, the following documentation is taken from the previous +version of boost.regex and will not be further updated:

+ +

Algorithm regex_format

+ +
+#include <boost/regex.hpp>
+
+ +

The algorithm regex_format takes the results of a match and +creates a new string based upon a +format string, regex_format can be used for search and replace +operations:

+ +
+template <class OutputIterator, class iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+                            const match_results<iterator, Allocator>& m,
+                            const charT* fmt,
+                            match_flag_type flags = 0);
+template <class OutputIterator, class iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+                            const match_results<iterator, Allocator>& m,
+                            const std::basic_string<charT>& fmt,
+                            match_flag_type flags = 0);
+
+ +

The library also defines the following convenience variation of +regex_format, which returns the result directly as a string, rather +than outputting to an iterator [note - this version may not be +available, or may be available in a more limited form, depending +upon your compilers capabilities]:

+ +
+template <class iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format
+                                 (const match_results<iterator, Allocator>& m, 
+                                  const charT* fmt,
+                                  match_flag_type flags = 0);
+
+template <class iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format
+                                 (const match_results<iterator, Allocator>& m, 
+                                  const std::basic_string<charT>& fmt,
+                                  match_flag_type flags = 0);
+
+ +

Parameters to the main version of the function are passed as +follows:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 OutputIterator outAn output iterator type, the output +string is sent to this iterator. Typically this would be a +std::ostream_iterator. 
 const +match_results<iterator, Allocator>& mAn instance of match_results<> +obtained from one of the matching algorithms above, and denoting +what matched. 
 const charT* fmtA format string that determines how +the match is transformed into the new string. 
 unsigned flagsOptional flags which describe how the +format string is to be interpreted. 
+ +
+
+ + +

Format flags are defined as +follows:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 format_allEnables all syntax options (perl-like +plus extentions). 
 format_sedAllows only a sed-like syntax. 
 format_perlAllows only a perl-like syntax. 
 format_no_copyDisables copying of unmatched sections +to the output string during +regex_merge operations. 
 format_first_onlyWhen this flag is set only the first occurance will be replaced +(applies to regex_merge only). 
+ +
+
+ + +

The format string syntax (and available options) is described +more fully under format strings +.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/Attic/regex_grep.html b/doc/Attic/regex_grep.html new file mode 100644 index 00000000..0c6f1218 --- /dev/null +++ b/doc/Attic/regex_grep.html @@ -0,0 +1,386 @@ + + + + Boost.Regex: Algorithm regex_grep (deprecated) + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_grep (deprecated)

+
+

Boost.Regex Index

+
+
+
+
+

The algorithm regex_grep is deprecated in favor of regex_iterator + which provides a more convenient and standard library friendly interface.

+

The following documentation is taken unchanged from the previous boost release, + and will not be updated in future.

+
+
+#include <boost/regex.hpp>
+
+

regex_grep allows you to search through a bidirectional-iterator range and + locate all the (non-overlapping) matches with a given regular expression. The + function is declared as:

+
+template <class Predicate, class iterator, class charT, class traits, class Allocator>
+unsigned int regex_grep(Predicate foo,
+                         iterator first,
+                         iterator last,
+                         const basic_regex<charT, traits, Allocator>& e,
+                         unsigned flags = match_default)
+
+

The library also defines the following convenience versions, which take either + a const charT*, or a const std::basic_string<>& in place of a pair of + iterators [note - these versions may not be available, or may be available in a + more limited form, depending upon your compilers capabilities]:

+
+template <class Predicate, class charT, class Allocator, class traits>
+unsigned int regex_grep(Predicate foo, 
+              const charT* str, 
+              const basic_regex<charT, traits, Allocator>& e, 
+              unsigned flags = match_default);
+
+template <class Predicate, class ST, class SA, class Allocator, class charT, class traits>
+unsigned int regex_grep(Predicate foo, 
+              const std::basic_string<charT, ST, SA>& s, 
+              const basic_regex<charT, traits, Allocator>& e, 
+              unsigned flags = match_default);
+
+

The parameters for the primary version of regex_grep have the following + meanings: 

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 fooA predicate function object or function pointer, see + below for more information. 
 firstThe start of the range to search. 
 lastThe end of the range to search. 
 eThe regular expression to search for. 
 flagsThe flags that determine how matching is carried out, + one of the match_flags enumerators. 
+
+
+

The algorithm finds all of the non-overlapping matches of the expression e, for + each match it fills a match_results<iterator, + Allocator> structure, which contains information on what matched, and calls + the predicate foo, passing the match_results<iterator, Allocator> as a + single argument. If the predicate returns true, then the grep operation + continues, otherwise it terminates without searching for further matches. The + function returns the number of matches found.

+

The general form of the predicate is:

+
+struct grep_predicate
+{
+   bool operator()(const match_results<iterator_type, typename expression_type::alloc_type::template rebind<sub_match<BidirectionalIterator> >::other>& m);
+};
+
+

Note that in almost every case the allocator parameter can be omitted, when + specifying the match_results type, + alternatively one of the typedefs cmatch, wcmatch, smatch or wsmatch can be + used.

+

For example the regular expression "a*b" would find one match in the string + "aaaaab" and two in the string "aaabb".

+

Remember this algorithm can be used for a lot more than implementing a version + of grep, the predicate can be and do anything that you want, grep utilities + would output the results to the screen, another program could index a file + based on a regular expression and store a set of bookmarks in a list, or a text + file conversion utility would output to file. The results of one regex_grep can + even be chained into another regex_grep to create recursive parsers.

+

The algorithm may throw std::runtime_error if the complexity + of matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Example: convert + the example from regex_search to use regex_grep instead:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+
+// IndexClasses: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+
+const char* re = 
+   // possibly leading whitespace:   
+   "^[[:space:]]*" 
+   // possible template declaration:
+   "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
+   // class or struct:
+   "(class|struct)[[:space:]]*" 
+   // leading declspec macros etc:
+   "("
+      "\\<\\w+\\>"
+      "("
+         "[[:blank:]]*\\([^)]*\\)"
+      ")?"
+      "[[:space:]]*"
+   ")*" 
+   // the class name
+   "(\\<\\w*\\>)[[:space:]]*" 
+   // template specialisation parameters
+   "(<[^;:{]+>)?[[:space:]]*"
+   // terminate in { or :
+   "(\\{|:[^;\\{()]*\\{)";
+
+boost::regex expression(re); 
+class IndexClassesPred 
+{ 
+   map_type& m; 
+   std::string::const_iterator base; 
+public: 
+   IndexClassesPred(map_type& a, std::string::const_iterator b) : m(a), base(b) {} 
+   bool operator()(const  smatch& what) 
+   { 
+      // what[0] contains the whole string 
+      // what[5] contains the class name. 
+      // what[6] contains the template specialisation if any. 
+      // add class name and position to map: 
+      m[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+                what[5].first - base; 
+      return true; 
+   } 
+}; 
+void IndexClasses(map_type& m, const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   regex_grep(IndexClassesPred(m, start), start, end, expression); 
+}
+
+

Example: Use + regex_grep to call a global callback function:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+
+const char* re = 
+   // possibly leading whitespace:   
+   "^[[:space:]]*" 
+   // possible template declaration:
+   "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
+   // class or struct:
+   "(class|struct)[[:space:]]*" 
+   // leading declspec macros etc:
+   "("
+      "\\<\\w+\\>"
+      "("
+         "[[:blank:]]*\\([^)]*\\)"
+      ")?"
+      "[[:space:]]*"
+   ")*" 
+   // the class name
+   "(\\<\\w*\\>)[[:space:]]*" 
+   // template specialisation parameters
+   "(<[^;:{]+>)?[[:space:]]*"
+   // terminate in { or :
+   "(\\{|:[^;\\{()]*\\{)";
+
+boost::regex expression(re);
+map_type class_index; 
+std::string::const_iterator base; 
+
+bool grep_callback(const  boost::smatch& what) 
+{ 
+   // what[0] contains the whole string 
+   // what[5] contains the class name. 
+   // what[6] contains the template specialisation if any. 
+   // add class name and position to map: 
+   class_index[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+                what[5].first - base; 
+   return true; 
+} 
+void IndexClasses(const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   base = start; 
+   regex_grep(grep_callback, start, end, expression, match_default); 
+}
+ 
+
+

Example: use + regex_grep to call a class member function, use the standard library adapters std::mem_fun + and std::bind1st to convert the member function into a predicate:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+#include <functional> 
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+class class_index 
+{ 
+   boost::regex expression; 
+   map_type index; 
+   std::string::const_iterator base; 
+   bool  grep_callback(boost::smatch what); 
+public: 
+   void IndexClasses(const std::string& file); 
+   class_index() 
+      : index(), 
+        expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?" 
+                   "(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?" 
+                   "[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?" 
+                   "(\\{|:[^;\\{()]*\\{)" 
+                   ){} 
+}; 
+bool  class_index::grep_callback(boost::smatch what) 
+{ 
+   // what[0] contains the whole string 
+   // what[5] contains the class name. 
+   // what[6] contains the template specialisation if any. 
+   // add class name and position to map: 
+   index[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+               what[5].first - base; 
+   return true; 
+} 
+
+void class_index::IndexClasses(const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   base = start; 
+   regex_grep(std::bind1st(std::mem_fun(&class_index::grep_callback), this), 
+              start, 
+              end, 
+              expression); 
+} 
+ 
+
+

Finally, C++ + Builder users can use C++ Builder's closure type as a callback argument:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+#include <functional> 
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+class class_index 
+{ 
+   boost::regex expression; 
+   map_type index; 
+   std::string::const_iterator base; 
+   typedef  boost::smatch arg_type; 
+   bool grep_callback(const arg_type& what); 
+public: 
+   typedef bool (__closure* grep_callback_type)(const arg_type&); 
+   void IndexClasses(const std::string& file); 
+   class_index() 
+      : index(), 
+        expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?" 
+                   "(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?" 
+                   "[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?" 
+                   "(\\{|:[^;\\{()]*\\{)" 
+                   ){} 
+}; 
+
+bool class_index::grep_callback(const arg_type& what) 
+{ 
+   // what[0] contains the whole string    
+// what[5] contains the class name.    
+// what[6] contains the template specialisation if any.    
+// add class name and position to map:    
+index[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+               what[5].first - base; 
+   return true; 
+} 
+
+void class_index::IndexClasses(const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   base = start; 
+   class_index::grep_callback_type cl = &(this->grep_callback); 
+   regex_grep(cl, 
+            start, 
+            end, 
+            expression); 
+}
+
+

+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_iterator.html b/doc/Attic/regex_iterator.html new file mode 100644 index 00000000..4a24769b --- /dev/null +++ b/doc/Attic/regex_iterator.html @@ -0,0 +1,427 @@ + + + + Boost.Regex: regex_iterator + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

regex_iterator

+
+

Boost.Regex Index

+
+
+
+
+

Contents

+
+
Synopsis
Description
+ Examples
+
+

Synopsis

+

The iterator type regex_iterator will enumerate all of the regular expression + matches found in some sequence: dereferencing a regex_iterator yields a + reference to a match_results object.

+
+template <class BidirectionalIterator, 
+          class charT = iterator_traits<BidirectionalIterator>::value_type,
+          class traits = regex_traits<charT>,
+          class Allocator = allocator<charT> >
+class regex_iterator 
+{
+public:
+   typedef          basic_regex<charT, traits, Allocator>                   regex_type;
+   typedef          match_results<BidirectionalIterator>                    value_type;
+   typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+   typedef          const value_type*                                       pointer;
+   typedef          const value_type&                                       reference;
+   typedef          std::forward_iterator_tag                               iterator_category;
+   
+   regex_iterator();
+   regex_iterator(BidirectionalIterator a, BidirectionalIterator b, 
+                  const regex_type& re, 
+                  match_flag_type m = match_default);
+   regex_iterator(const regex_iterator&);
+   regex_iterator& operator=(const regex_iterator&);
+   bool operator==(const regex_iterator&);
+   bool operator!=(const regex_iterator&);
+   const value_type& operator*();
+   const value_type* operator->();
+   regex_iterator& operator++();
+   regex_iterator operator++(int);
+};
+
+
+

Description

+

A regex_iterator is constructed from a pair of iterators, and enumerates all + occurrences of a regular expression within that iterator range.

+
+regex_iterator();
+
+ +

Effects: constructs an end of sequence regex_iterator.

+
+regex_iterator(BidirectionalIterator a, BidirectionalIterator b, 
+               const regex_type& re, 
+               match_flag_type m = match_default);
+
+ +

Effects: constructs a regex_iterator that will enumerate all occurrences + of the expression re, within the sequence [a,b), and found + using match flags m.  The object re must exist for the + lifetime of the regex_iterator.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
+regex_iterator(const regex_iterator& that);
+
+ +

Effects: constructs a copy of that.

+ +

Postconditions: *this == that.

+
+regex_iterator& operator=(const regex_iterator&);
+
+ +

Effects: sets *this equal to those in that.

+ +

Postconditions: *this == that.

+
+bool operator==(const regex_iterator& that);
+
+ +

Effects: returns true if *this is equal to that.

+
+bool operator!=(const regex_iterator&);
+
+ +

Effects: returns !(*this == that).

+
+const value_type& operator*();
+
+

Effects: dereferencing a regex_iterator object it yields a + const reference to a match_results object, + whose members are set as follows:

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value

+
+

(*it).size()

+
+

re.mark_count()

+
+

(*it).empty()

+
+

false

+
+

(*it).prefix().first

+
+

The end of the last match found, or the start of the underlying sequence if + this is the first match enumerated

+
+

(*it).prefix().last

+
+

(*it)[0].first

+
+

(*it).prefix().matched

+
+

(*it).prefix().first != (*it).prefix().second

+
+

(*it).suffix().first

+
+

(*it)[0].second

+
+

(*it).suffix().last

+
+

The end of the underlying sequence.

+
+

(*it).suffix().matched

+
+

(*it).suffix().first != (*it).suffix().second

+
+

(*it)[0].first

+
+

The start of the sequence of characters that matched the regular expression

+
+

(*it)[0].second

+
+

The end of the sequence of characters that matched the regular expression

+
+

(*it)[0].matched

+
+

true if a full match was found, and false if it was a + partial match (found as a result of the match_partial flag being + set).

+
+

(*it)[n].first

+
+

For all integers n < (*it).size(), the start of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

(*it)[n].second

+
+

For all integers n < (*it).size(), the end of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

(*it)[n].matched

+
+

For all integers n < (*it).size(), true if sub-expression n participated + in the match, false otherwise.

+
(*it).position(n)For all integers n < (*it).size(), then the + distance from the start of the underlying sequence to the start of + sub-expression match n.
+
+
+
+const value_type* operator->();
+
+ +

Effects: returns &(*this).

+
+regex_iterator& operator++();
+
+

Effects: moves the iterator to the next match in the + underlying sequence, or the end of sequence iterator if none if found. +  When the last match found matched a zero length string, then the + regex_iterator will find the next match as follows: if there exists a non-zero + length match that starts at the same location as the last one, then returns it, + otherwise starts looking for the next (possibly zero length) match from one + position to the right of the last match.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+ +

Returns: *this.

+
+regex_iterator operator++(int);
+
+ +

Effects: constructs a copy result of *this, + then calls ++(*this).

+ +

Returns: result.

+

Examples

+

The following example + takes a C++ source file and builds up an index of class names, and the location + of that class in the file.

+
+#include <string>
+#include <map>
+#include <fstream>
+#include <iostream>
+#include <boost/regex.hpp>
+
+using namespace std;
+
+// purpose:
+// takes the contents of a file in the form of a string
+// and searches for all the C++ class definitions, storing
+// their locations in a map of strings/int's
+
+typedef std::map<std::string, std::string::difference_type, std::less<std::string> > map_type;
+
+const char* re = 
+   // possibly leading whitespace:   
+   "^[[:space:]]*" 
+   // possible template declaration:
+   "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
+   // class or struct:
+   "(class|struct)[[:space:]]*" 
+   // leading declspec macros etc:
+   "("
+      "\\<\\w+\\>"
+      "("
+         "[[:blank:]]*\\([^)]*\\)"
+      ")?"
+      "[[:space:]]*"
+   ")*" 
+   // the class name
+   "(\\<\\w*\\>)[[:space:]]*" 
+   // template specialisation parameters
+   "(<[^;:{]+>)?[[:space:]]*"
+   // terminate in { or :
+   "(\\{|:[^;\\{()]*\\{)";
+
+
+boost::regex expression(re);
+map_type class_index;
+
+bool regex_callback(const boost::match_results<std::string::const_iterator>& what)
+{
+   // what[0] contains the whole string
+   // what[5] contains the class name.
+   // what[6] contains the template specialisation if any.
+   // add class name and position to map:
+   class_index[what[5].str() + what[6].str()] = what.position(5);
+   return true;
+}
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   s.reserve(is.rdbuf()->in_avail());
+   char c;
+   while(is.get(c))
+   {
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+int main(int argc, const char** argv)
+{
+   std::string text;
+   for(int i = 1; i < argc; ++i)
+   {
+      cout << "Processing file " << argv[i] << endl;
+      std::ifstream fs(argv[i]);
+      load_file(text, fs);
+      // construct our iterators:
+      boost::regex_iterator<std::string::const_iterator> m1(text.begin(), text.end(), expression);
+      boost::regex_iterator<std::string::const_iterator> m2;
+      std::for_each(m1, m2, ®ex_callback);
+      // copy results:
+      cout << class_index.size() << " matches found" << endl;
+      map_type::iterator c, d;
+      c = class_index.begin();
+      d = class_index.end();
+      while(c != d)
+      {
+         cout << "class \"" << (*c).first << "\" found at index: " << (*c).second << endl;
+         ++c;
+      }
+      class_index.erase(class_index.begin(), class_index.end());
+   }
+   return 0;
+}
+
+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_match.html b/doc/Attic/regex_match.html new file mode 100644 index 00000000..1345180b --- /dev/null +++ b/doc/Attic/regex_match.html @@ -0,0 +1,317 @@ + + + + Boost.Regex: Algorithm regex_match + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_match

+
+

Boost.Regex Index

+
+

+
+

+

Contents

+
+
Synopsis
Description
+ Examples
+
+

Synopsis

+
#include <boost/regex.hpp> 
+

The algorithm regex _match determines whether a given regular expression + matches a given sequence denoted by a pair of bidirectional-iterators, the + algorithm is defined as follows, note that the result is true only if the + expression matches the whole of the input sequence, the main use of + this function is data input validation. +

template <class BidirectionalIterator, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 match_results<BidirectionalIterator, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class BidirectionalIterator, class charT, class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class charT, class Allocator, class traits, class Allocator2>
+bool regex_match(const charT* str, match_results<const charT*, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class ST, class SA, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
+                 const basic_regex<charT, traits, Allocator2>& e, 
+                 match_flag_type flags = match_default);
+                 
+template <class charT, class traits, class Allocator2>
+bool regex_match(const charT* str,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class ST, class SA, class charT, class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+
+

Description

+
template <class BidirectionalIterator, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 match_results<BidirectionalIterator, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Requires: Type BidirectionalIterator meets the requirements of a + Bidirectional Iterator (24.1.4).

+

Effects: Determines whether there is an exact match between the regular + expression e, and all of the character sequence [first, last), parameter + flags is used to control how the expression + is matched against the character sequence. Returns true if such a match + exists, false otherwise.

+

Throws: std::runtime_error if the complexity of matching the + expression against an N character string begins to exceed O(N2), or + if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Postconditions: If the function returns false, then the effect on + parameter m is undefined, otherwise the effects on parameter m are + given in the table:

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element +

+
+

Value +

+
+

m.size()

+
+

e.mark_count()

+
+

m.empty()

+
+

false

+
+

m.prefix().first

+
+

first

+
+

m.prefix().last

+
+

first

+
+

m.prefix().matched

+
+

false

+
+

m.suffix().first

+
+

last

+
+

m.suffix().last

+
+

last

+
+

m.suffix().matched

+
+

false

+
+

m[0].first

+
+

first

+
+

m[0].second

+
+

last

+
+

m[0].matched

+
+

true if a full match was found, and false if it was + a partial match (found as a result of the match_partial flag being + set).

+
+

m[n].first

+
+

For all integers n < m.size(), the start of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].second

+
+

For all integers n < m.size(), the end of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].matched

+
+

For all integers n < m.size(), true if sub-expression n participated + in the match, false otherwise.

+
+
+

+
+
 
+
template <class BidirectionalIterator, class charT, class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Behaves "as if" by constructing an instance of + match_results<BidirectionalIterator> what, + and then returning the result of regex_match(first, last, what, e, flags).

+
template <class charT, class Allocator, class traits, class Allocator2>
+bool regex_match(const charT* str, match_results<const charT*, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(str, str + + char_traits<charT>::length(str), m, e, flags).

+
template <class ST, class SA, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
+                 const basic_regex<charT, traits, Allocator2>& e, 
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(s.begin(), s.end(), m, e, + flags).

+
template <class charT, class traits, class Allocator2>
+bool regex_match(const charT* str,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(str, str + + char_traits<charT>::length(str), e, flags).

+
template <class ST, class SA, class charT, class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(s.begin(), s.end(), e, + flags). +

Examples

+

The following example + processes an ftp response: +

+
#include <stdlib.h> 
+#include <boost/regex.hpp> 
+#include <string> 
+#include <iostream> 
+
+using namespace boost; 
+
+regex expression("([0-9]+)(\\-| |$)(.*)"); 
+
+// process_ftp: 
+// on success returns the ftp response code, and fills 
+// msg with the ftp response message. 
+int process_ftp(const char* response, std::string* msg) 
+{ 
+   cmatch what; 
+   if(regex_match(response, what, expression)) 
+   { 
+      // what[0] contains the whole string 
+      // what[1] contains the response code 
+      // what[2] contains the separator character 
+      // what[3] contains the text message. 
+      if(msg) 
+         msg->assign(what[3].first, what[3].second); 
+      return std::atoi(what[1].first); 
+   } 
+   // failure did not match 
+   if(msg) 
+      msg->erase(); 
+   return -1; 
+}
+      

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_merge.html b/doc/Attic/regex_merge.html new file mode 100644 index 00000000..00c35d76 --- /dev/null +++ b/doc/Attic/regex_merge.html @@ -0,0 +1,47 @@ + + + + Boost.Regex: Algorithm regex_merge (deprecated) + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_merge (deprecated)

+
+

Boost.Regex Index

+
+

+
+

+

Algorithm regex_merge has been renamed regex_replace, + existing code will continue to compile, but new code should use + regex_replace instead.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/Attic/regex_replace.html b/doc/Attic/regex_replace.html new file mode 100644 index 00000000..1e13b553 --- /dev/null +++ b/doc/Attic/regex_replace.html @@ -0,0 +1,213 @@ + + + + Boost.Regex: Algorithm regex_replace + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_replace

+
+

Boost.Regex Index

+
+

+
+

Contents

+
+
Synopsis
Description
+ Examples
+

Synopsis

+
#include <boost/regex.hpp> 
+

The algorithm regex_replace searches through a string finding + all the matches to the regular expression: for each match it then calls + match_results::format to format the string and sends the result to the + output iterator. Sections of text that do not match are copied to the output + unchanged only if the flags parameter does not have the flag + format_no_copy set. If the flag format_first_only + is set then only the first occurrence is replaced rather than all + occurrences. 

template <class OutputIterator, class BidirectionalIterator, class traits,
+          class Allocator, class charT>
+OutputIterator regex_replace(OutputIterator out,
+                           BidirectionalIterator first,
+                           BidirectionalIterator last,
+                           const basic_regex<charT, traits, Allocator>& e,
+                           const basic_string<charT>& fmt,
+                           match_flag_type flags = match_default);
+
+template <class traits, class Allocator, class charT>
+basic_string<charT> regex_replace(const basic_string<charT>& s,
+                            const basic_regex<charT, traits, Allocator>& e,
+                            const basic_string<charT>& fmt,
+                            match_flag_type flags = match_default);
+
+
+

Description

+
template <class OutputIterator, class BidirectionalIterator, class traits,
+          class Allocator, class charT>
+OutputIterator regex_replace(OutputIterator out,
+                           BidirectionalIterator first,
+                           BidirectionalIterator last,
+                           const basic_regex<charT, traits, Allocator>& e,
+                           const basic_string<charT>& fmt,
+                           match_flag_type flags = match_default);
+

Effects: Finds all the non-overlapping matches m of type match_results<BidirectionalIterator> + that occur within the sequence [first, last). If no such matches are + found and !(flags & format_no_copy) then calls std::copy(first, + last, out). Otherwise, for each match found, if !(flags & + format_no_copy) calls std::copy(m.prefix().first, m.prefix().last, + out), and then calls m.format(out, fmt, flags). Finally + if !(flags & format_no_copy) calls std::copy(last_m.suffix().first, + last_m,suffix().last, out) where last_m is a copy of the + last match found. If flags & format_first_only is non-zero + then only the first match found is replaced.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Returns: out. +

+
template <class traits, class Allocator, class charT>
+basic_string<charT> regex_replace(const basic_string<charT>& s,
+                            const basic_regex<charT, traits, Allocator>& e,
+                            const basic_string<charT>& fmt,
+                            match_flag_type flags = match_default);
+

Effects: Constructs an object basic_string<charT> result, + calls regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt, + flags), and then returns result. +

Examples

+

The following example + takes C/C++ source code as input, and outputs syntax highlighted HTML code.

+

+
#include <fstream>
+#include <sstream>
+#include <string>
+#include <iterator>
+#include <boost/regex.hpp>
+#include <fstream>
+#include <iostream>
+
+// purpose:
+// takes the contents of a file and transform to
+// syntax highlighted code in html format
+
+boost::regex e1, e2;
+extern const char* expression_text;
+extern const char* format_string;
+extern const char* pre_expression;
+extern const char* pre_format;
+extern const char* header_text;
+extern const char* footer_text;
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   s.reserve(is.rdbuf()->in_avail());
+   char c;
+   while(is.get(c))
+   {
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+int main(int argc, const char** argv)
+{
+   try{
+   e1.assign(expression_text);
+   e2.assign(pre_expression);
+   for(int i = 1; i < argc; ++i)
+   {
+      std::cout << "Processing file " << argv[i] << std::endl;
+      std::ifstream fs(argv[i]);
+      std::string in;
+      load_file(in, fs);
+      std::string out_name(std::string(argv[i]) + std::string(".htm"));
+      std::ofstream os(out_name.c_str());
+      os << header_text;
+      // strip '<' and '>' first by outputting to a
+      // temporary string stream
+      std::ostringstream t(std::ios::out | std::ios::binary);
+      std::ostream_iterator<char, char> oi(t);
+      boost::regex_replace(oi, in.begin(), in.end(),
+      e2, pre_format, boost::match_default | boost::format_all);
+      // then output to final output stream
+      // adding syntax highlighting:
+      std::string s(t.str());
+      std::ostream_iterator<char, char> out(os);
+      boost::regex_replace(out, s.begin(), s.end(),
+      e1, format_string, boost::match_default | boost::format_all);
+      os << footer_text;
+   }
+   }
+   catch(...)
+   { return -1; }
+   return 0;
+}
+
+extern const char* pre_expression = "(<)|(>)|\\r";
+extern const char* pre_format = "(?1<)(?2>)";
+
+
+const char* expression_text = // preprocessor directives: index 1
+                              "(^[[:blank:]]*#(?:[^\\\\\\n]|\\\\[^\\n[:punct:][:word:]]*[\\n[:punct:][:word:]])*)|"
+                              // comment: index 2
+                              "(//[^\\n]*|/\\*.*?\\*/)|"
+                              // literals: index 3
+                              "\\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\\>|"
+                              // string literals: index 4
+                              "('(?:[^\\\\']|\\\\.)*'|\"(?:[^\\\\\"]|\\\\.)*\")|"
+                              // keywords: index 5
+                              "\\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import"
+                              "|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall"
+                              "|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool"
+                              "|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete"
+                              "|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto"
+                              "|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected"
+                              "|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast"
+                              "|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned"
+                              "|using|virtual|void|volatile|wchar_t|while)\\>"
+                              ;
+
+const char* format_string = "(?1<font color=\"#008040\">$&</font>)"
+                            "(?2<I><font color=\"#000080\">$&</font></I>)"
+                            "(?3<font color=\"#0000A0\">$&</font>)"
+                            "(?4<font color=\"#0000FF\">$&</font>)"
+                            "(?5<B>$&</B>)";
+
+const char* header_text = "<HTML>\n<HEAD>\n"
+                          "<TITLE>Auto-generated html formated source</TITLE>\n"
+                          "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=windows-1252\">\n"
+                          "</HEAD>\n"
+                          "<BODY LINK=\"#0000ff\" VLINK=\"#800080\" BGCOLOR=\"#ffffff\">\n"
+                          "<P> </P>\n<PRE>";
+
+const char* footer_text = "</PRE>\n</BODY>\n\n";
+      
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_search.html b/doc/Attic/regex_search.html new file mode 100644 index 00000000..a7fcd9b8 --- /dev/null +++ b/doc/Attic/regex_search.html @@ -0,0 +1,328 @@ + + + + Boost.Regex: Algorithm regex_search + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_search

+
+

Boost.Regex Index

+
+

+
+

Contents

+
+
Synopsis
Description
+ Examples
+

Synopsis

+
#include <boost/regex.hpp> 
+

+

The algorithm regex_search will search a range denoted by a pair of + bidirectional-iterators for a given regular expression. The algorithm uses + various heuristics to reduce the search time by only checking for a match if a + match could conceivably start at that position. The algorithm is defined as + follows: +

template <class BidirectionalIterator, 
+          class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
+                  match_results<BidirectionalIterator, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+                  
+template <class ST, class SA, 
+          class Allocator, class charT,
+          class traits, class Allocator2> 
+bool regex_search(const basic_string<charT, ST, SA>& s, 
+                  match_results<
+                      typename basic_string<charT, ST,SA>::const_iterator, 
+                      Allocator>& m, 
+                  const basic_regex<charT, traits, Allocator2>& e, 
+                  match_flag_type flags = match_default); 
+          
+template<class charT, class Allocator, class traits, 
+         class Allocator2> 
+bool regex_search(const charT* str, 
+                  match_results<const charT*, Allocator>& m, 
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+                  
+template <class BidirectionalIterator, class Allocator,
+          class charT, class traits>                
+bool regex_search(BidirectionalIterator first, BidirectionalIterator last, 
+                  const basic_regex<charT, traits, Allocator>& e, 
+                  match_flag_type flags = match_default); 
+                  
+template <class charT, class Allocator, 
+          class traits> 
+bool regex_search(const charT* str, 
+                  const basic_regex<charT, traits, Allocator>& e, 
+                  match_flag_type flags = match_default); 
+                  
+template<class ST, class SA,
+         class Allocator, class charT, 
+         class traits>
+bool regex_search(const basic_string<charT, ST, SA>& s,
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+
+

Description

+
template <class BidirectionalIterator, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
+                  match_results<BidirectionalIterator, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+

Requires: Type BidirectionalIterator meets the requirements of a + Bidirectional Iterator (24.1.4).

+

Effects: Determines whether there is some sub-sequence within + [first,last) that matches the regular expression e, parameter flags + is used to control how the expression is matched against the character + sequence. Returns true if such a sequence exists, false otherwise.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Postconditions: If the function returns false, then the effect on + parameter m is undefined, otherwise the effects on parameter m are + given in the table:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value +

+
+

m.size()

+
+

e.mark_count()

+
+

m.empty()

+
+

false

+
+

m.prefix().first

+
+

first

+
+

m.prefix().last

+
+

m[0].first

+
+

m.prefix().matched

+
+

m.prefix().first != m.prefix().second

+
+

m.suffix().first

+
+

m[0].second

+
+

m.suffix().last

+
+

last

+
+

m.suffix().matched

+
+

m.suffix().first != m.suffix().second

+
+

m[0].first

+
+

The start of the sequence of characters that matched the regular expression

+
+

m[0].second

+
+

The end of the sequence of characters that matched the regular expression

+
+

m[0].matched

+
+

true if a full match was found, and false if it was + a partial match (found as a result of the match_partial flag being + set).

+
+

m[n].first

+
+

For all integers n < m.size(), the start of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].second

+
+

For all integers n < m.size(), the end of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].matched

+
+

For all integers n < m.size(), true if sub-expression n participated + in the match, false otherwise.

+
+
+
+
template <class charT, class Allocator, class traits, class Allocator2>
+bool regex_search(const charT* str, match_results<const charT*, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(str, str + + char_traits<charT>::length(str), m, e, flags).

+
template <class ST, class SA, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_search(const basic_string<charT, ST, SA>& s,
+                  match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(s.begin(), s.end(), m, + e, flags).

+
template <class iterator, class Allocator, class charT,
+          class traits>
+bool regex_search(iterator first, iterator last,
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+

Effects: Behaves "as if" by constructing an instance of + match_results<BidirectionalIterator> what, + and then returning the result of regex_search(first, last, what, e, flags).

+
template <class charT, class Allocator, class traits>
+bool regex_search(const charT* str
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(str, str + + char_traits<charT>::length(str), e, flags).

+
template <class ST, class SA, class Allocator, class charT,
+          class traits>
+bool regex_search(const basic_string<charT, ST, SA>& s,
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(s.begin(), s.end(), e, + flags). +

Examples

+

The following example, + takes the contents of a file in the form of a string, and searches for all the + C++ class declarations in the file. The code will work regardless of the way + that std::string is implemented, for example it could easily be modified to + work with the SGI rope class, which uses a non-contiguous storage strategy.

+

+
#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+
+boost::regex expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?(\\{|:[^;\\{()]*\\{)"); 
+
+void IndexClasses(map_type& m, const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+      boost::match_results<std::string::const_iterator> what; 
+   unsigned int flags = boost::match_default; 
+   while(regex_search(start, end, what, expression, flags)) 
+   { 
+      // what[0] contains the whole string 
+      // what[5] contains the class name. 
+      // what[6] contains the template specialisation if any. 
+      // add class name and position to map: 
+      m[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+                what[5].first - file.begin(); 
+      // update search position: 
+      start = what[0].second; 
+      // update flags: 
+      flags |= boost::match_prev_avail; 
+      flags |= boost::match_not_bob; 
+   } 
+}
+     
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_split.html b/doc/Attic/regex_split.html new file mode 100644 index 00000000..e1eba954 --- /dev/null +++ b/doc/Attic/regex_split.html @@ -0,0 +1,148 @@ + + + + Boost.Regex: Algorithm regex_split (deprecated) + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_split (deprecated)

+
+

Boost.Regex Index

+
+

+
+

+

The algorithm regex_split has been deprecated in favor of the iterator + regex_token_iterator which has a more flexible and powerful interface, + as well as following the more usual standard library "pull" rather than "push" + semantics.

+

Code which uses regex_split will continue to compile, the following + documentation is taken from the previous boost.regex version:

+

Algorithm regex_split

+
#include <boost/regex.hpp> 
+

Algorithm regex_split performs a similar operation to the perl split operation, + and comes in three overloaded forms: +

+
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+std::size_t regex_split(OutputIterator out, 
+                        std::basic_string<charT, Traits1, Alloc1>& s, 
+                        const basic_regex<charT, Traits2, Alloc2>& e,
+                        unsigned flags,
+                        std::size_t max_split);
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+std::size_t regex_split(OutputIterator out, 
+                        std::basic_string<charT, Traits1, Alloc1>& s, 
+                        const basic_regex<charT, Traits2, Alloc2>& e,
+                        unsigned flags = match_default);
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1>
+std::size_t regex_split(OutputIterator out, 
+                        std::basic_string<charT, Traits1, Alloc1>& s);
+

Effects: Each version of the algorithm takes an + output-iterator for output, and a string for input. If the expression contains + no marked sub-expressions, then the algorithm writes one string onto the + output-iterator for each section of input that does not match the expression. + If the expression does contain marked sub-expressions, then each time a match + is found, one string for each marked sub-expression will be written to the + output-iterator. No more than max_split strings will be written to the + output-iterator. Before returning, all the input processed will be deleted from + the string s (if max_split is not reached then all of s will + be deleted). Returns the number of strings written to the output-iterator. If + the parameter max_split is not specified then it defaults to UINT_MAX. + If no expression is specified, then it defaults to "\s+", and splitting occurs + on whitespace. +

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Example: the + following function will split the input string into a series of tokens, and + remove each token from the string s: +

+
unsigned tokenise(std::list<std::string>& l, std::string& s)
+{
+   return boost::regex_split(std::back_inserter(l), s);
+}
+

Example: the + following short program will extract all of the URL's from a html file, and + print them out to cout: +

+
#include <list>
+#include <fstream>
+#include <iostream>
+#include <boost/regex.hpp>
+
+boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
+               boost::regbase::normal | boost::regbase::icase);
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   //
+   // attempt to grow string buffer to match file size,
+   // this doesn't always work...
+   s.reserve(is.rdbuf()-&gtin_avail());
+   char c;
+   while(is.get(c))
+   {
+      // use logarithmic growth stategy, in case
+      // in_avail (above) returned zero:
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+
+int main(int argc, char** argv)
+{
+   std::string s;
+   std::list<std::string> l;
+
+   for(int i = 1; i < argc; ++i)
+   {
+      std::cout << "Findings URL's in " << argv[i] << ":" << std::endl;
+      s.erase();
+      std::ifstream is(argv[i]);
+      load_file(s, is);
+      boost::regex_split(std::back_inserter(l), s, e);
+      while(l.size())
+      {
+         s = *(l.begin());
+         l.pop_front();
+         std::cout << s << std::endl;
+      }
+   }
+   return 0;
+}
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_token_iterator.html b/doc/Attic/regex_token_iterator.html new file mode 100644 index 00000000..03e2e64e --- /dev/null +++ b/doc/Attic/regex_token_iterator.html @@ -0,0 +1,286 @@ + + + + Boost.Regex: regex_token_iterator + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

regex_token_iterator

+
+

Boost.Regex Index

+
+

+
+

Contents

+
+
Synopsis
Description
+ Examples
+

Synopsis

+

The template class regex_token_iterator is an iterator adapter; + that is to say it represents a new view of an existing iterator sequence, by + enumerating all the occurrences of a regular expression within that sequence, + and presenting one or more new strings for each match found. Each position + enumerated by the iterator is a string that represents what matched a + particular sub-expression within the regular expression. When class regex_token_iterator + is used to enumerate a single sub-expression with index -1, then the iterator + performs field splitting: that is to say it enumerates one string for each + section of the character container sequence that does not match the regular + expression specified.

+
+template <class BidirectionalIterator, 
+          class charT = iterator_traits<BidirectionalIterator>::value_type,
+          class traits = regex_traits<charT>,
+          class Allocator = allocator<charT> >
+class regex_token_iterator 
+{
+public:
+   typedef          basic_regex<charT, traits, Allocator>                   regex_type;
+   typedef          basic_string<charT>                                     value_type;
+   typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+   typedef          const value_type*                                       pointer;
+   typedef          const value_type&                                       reference;
+   typedef          std::forward_iterator_tag                               iterator_category;
+   
+   regex_token_iterator();
+   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                        int submatch = 0, match_flag_type m = match_default);
+   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                        const std::vector<int>& submatches, match_flag_type m = match_default);
+   template <std::size_t N>
+   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                        const int (&submatches)[N], match_flag_type m = match_default);
+   regex_token_iterator(const regex_token_iterator&);
+   regex_token_iterator& operator=(const regex_token_iterator&);
+   bool operator==(const regex_token_iterator&);
+   bool operator!=(const regex_token_iterator&);
+   const value_type& operator*();
+   const value_type* operator->();
+   regex_token_iterator& operator++();
+   regex_token_iterator operator++(int);
+};
+
+

Description

+
regex_token_iterator();
+

Effects: constructs an end of sequence iterator.

+
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                     int submatch = 0, match_flag_type m = match_default);
+

Preconditions: !re.empty().

+

Effects: constructs a regex_token_iterator that will enumerate one + string for each regular expression match of the expression re found + within the sequence [a,b), using match flags m.  The + string enumerated is the sub-expression submatch for each match + found; if submatch is -1, then enumerates all the text sequences that + did not match the expression re (that is to performs field splitting).

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                     const std::vector<int>& submatches, match_flag_type m = match_default);
+

Preconditions: submatches.size() && !re.empty().

+

Effects: constructs a regex_token_iterator that will enumerate submatches.size() + strings for each regular expression match of the expression re found + within the sequence [a,b), using match flags m.  For + each match found one string will be enumerated for each sub-expression + index contained within submatches vector; if submatches[0] + is -1, then the first string enumerated for each match will be all of the text + from end of the last match to the start of the current match, in addition there + will be one extra string enumerated when no more matches can be found: from the + end of the last match found, to the end of the underlying sequence.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
template <std::size_t N>
+regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                     const int (&submatches)[R], match_flag_type m = match_default);
+

Preconditions: !re.empty().

+

Effects: constructs a regex_token_iterator that will + enumerate R strings for each regular expression match of the + expression re found within the sequence [a,b), using match + flags m.  For each match found one string will be + enumerated for each sub-expression index contained within the submatches + array; if submatches[0] is -1, then the first string enumerated + for each match will be all of the text from end of the last match to the start + of the current match, in addition there will be one extra string enumerated + when no more matches can be found: from the end of the last match found, to the + end of the underlying sequence.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
regex_token_iterator(const regex_token_iterator& that);
+

Effects: constructs a copy of that.

+

Postconditions: *this == that.

+
regex_token_iterator& operator=(const regex_token_iterator& that);
+

Effects: sets *this to be equal to that.

+

Postconditions: *this == that.

+
bool operator==(const regex_token_iterator&);
+

+ Effects: returns true if *this is the same position as that.

+
bool operator!=(const regex_token_iterator&);
+

+ Effects: returns !(*this == that).

+
const value_type& operator*();
+

+ Effects: returns the current string being enumerated.

+
const value_type* operator->();
+

+ Effects: returns &(*this).

+
regex_token_iterator& operator++();
+

+ Effects: Moves on to the next string to be enumerated.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+ +

+ Returns: *this.

regex_token_iterator& operator++(int);
+

Effects: constructs a copy result of *this, + then calls ++(*this).

+

Returns: result. +

Examples

+

The following example + takes a string and splits it into a series of tokens:

+
+#include <iostream>
+#include <boost/regex.hpp>
+
+using namespace std;
+
+int main(int argc)
+{
+   string s;
+   do{
+      if(argc == 1)
+      {
+         cout << "Enter text to split (or \"quit\" to exit): ";
+         getline(cin, s);
+         if(s == "quit") break;
+      }
+      else
+         s = "This is a string of tokens";
+
+      boost::regex re("\\s+");
+      boost::regex_token_iterator<std::string::const_iterator> i(s.begin(), s.end(), re, -1);
+      boost::regex_token_iterator<std::string::const_iterator> j;
+
+      unsigned count = 0;
+      while(i != j)
+      {
+         cout << *i++ << endl;
+         count++;
+      }
+      cout << "There were " << count << " tokens found." << endl;
+
+   }while(argc == 1);
+   return 0;
+}
+
+
+

The following example + takes a html file and outputs a list of all the linked files:

+
+#include <fstream>
+#include <iostream>
+#include <iterator>
+#include <boost/regex.hpp>
+
+boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
+               boost::regex::normal | boost::regbase::icase);
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   //
+   // attempt to grow string buffer to match file size,
+   // this doesn't always work...
+   s.reserve(is.rdbuf()->in_avail());
+   char c;
+   while(is.get(c))
+   {
+      // use logarithmic growth stategy, in case
+      // in_avail (above) returned zero:
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   std::string s;
+   int i;
+   for(i = 1; i < argc; ++i)
+   {
+      std::cout << "Findings URL's in " << argv[i] << ":" << std::endl;
+      s.erase();
+      std::ifstream is(argv[i]);
+      load_file(s, is);
+      boost::regex_token_iterator<std::string::const_iterator>
+         i(s.begin(), s.end(), e, 1);
+      boost::regex_token_iterator<std::string::const_iterator> j;
+      while(i != j)
+      {
+         std::cout << *i++ << std::endl;
+      }
+   }
+   //
+   // alternative method:
+   // test the array-literal constructor, and split out the whole
+   // match as well as $1....
+   //
+   for(i = 1; i < argc; ++i)
+   {
+      std::cout << "Findings URL's in " << argv[i] << ":" << std::endl;
+      s.erase();
+      std::ifstream is(argv[i]);
+      load_file(s, is);
+      const int subs[] = {1, 0,};
+      boost::regex_token_iterator<std::string::const_iterator>
+         i(s.begin(), s.end(), e, subs);
+      boost::regex_token_iterator<std::string::const_iterator> j;
+      while(i != j)
+      {
+         std::cout << *i++ << std::endl;
+      }
+   }
+
+   return 0;
+}
+
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/Attic/regex_traits.html b/doc/Attic/regex_traits.html new file mode 100644 index 00000000..a359e2e9 --- /dev/null +++ b/doc/Attic/regex_traits.html @@ -0,0 +1,48 @@ + + + + Boost.Regex: class regex_traits + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

class regex_traits

+
+

Boost.Regex Index

+
+

+
+

+

Under construction.

+

The current boost.regex traits class design will be migrated to that specified + in the regular + expression standardization proposal

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/bad_expression.html b/doc/bad_expression.html new file mode 100644 index 00000000..c6e6d41f --- /dev/null +++ b/doc/bad_expression.html @@ -0,0 +1,82 @@ + + + + Boost.Regex: bad_expression + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

class bad_expression

+
+

Boost.Regex Index

+
+
+
+
+

Synopsis

+

#include <boost/pattern_except.hpp>

+

The class bad_expression defines the type of objects thrown as + exceptions to report errors during the conversion from a string representing a + regular expression to a finite state machine.  

+
+namespace boost{
+
+class bad_pattern : public std::runtime_error
+{
+public:
+   explicit bad_pattern(const std::string& s) : std::runtime_error(s){};
+};
+
+class bad_expression : public bad_pattern
+{
+public:
+   bad_expression(const std::string& s) : bad_pattern(s) {}
+};
+
+
+} // namespace boost
+
+

Description

+
+bad_expression(const string& what_arg);
+
+

Effects: Constructs an object of class bad_expression.

+ +

Postcondition: strcmp(what(), what_arg.c_str()) == 0.

+

Footnotes: the class bad_pattern forms the base class for all + pattern-matching exceptions, of which bad_expression is one. The choice + of std::runtime_error as the base class for bad_pattern is moot; + depending upon how the library is used exceptions may be either logic errors + (programmer supplied expressions) or run time errors (user supplied + expressions).

+

+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/basic_regex.html b/doc/basic_regex.html new file mode 100644 index 00000000..a8edfca2 --- /dev/null +++ b/doc/basic_regex.html @@ -0,0 +1,1293 @@ + + + +Boost.Regex: basic_regex + + + + + + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

basic_regex

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Synopsis

+ +
+#include <boost/regex.hpp>
+
+ +

The template class basic_regex encapsulates regular +expression parsing and compilation. The class takes three template +parameters:

+ +

charT: determines the character type, i.e. either +char or wchar_t.

+ +

traits: determines the behavior of the character +type, for example which character class names are recognized. A +default traits class is provided: +regex_traits<charT>.

+ +

Allocator: the allocator class used to allocate +memory by the class.

+ +

For ease of use there are two typedefs that define the two +standard basic_regex instances, unless you want to use +custom traits classes or allocators, you won't need to use anything +other than these:

+ +
+namespace boost{
+template <class charT, class traits = regex_traits<charT>, class Allocator = std::allocator<charT>  >
+class basic_regex;
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+}
+
+ +

The definition of basic_regex follows: it is based very +closely on class basic_string, and fulfils the requirements for a +constant-container of charT.

+ +
+namespace boost{
+
+template <class charT,
+          class traits = regex_traits<charT>,
+          class Allocator = allocator<charT> >
+class basic_regex
+{
+public:
+   // types:
+   typedef          charT                                value_type;
+   typedef          implementation defined               const_iterator;
+   typedef          const_iterator                       iterator;
+   typedef typename Allocator::reference                 reference;
+   typedef typename Allocator::const_reference           const_reference;
+   typedef typename Allocator::difference_type           difference_type;
+   typedef typename Allocator::size_type                 size_type;
+   typedef          Allocator                            allocator_type;
+   typedef          regex_constants::syntax_option_type  flag_type;
+   typedef typename traits::locale_type                  locale_type;
+
+   // constants:
+   static const regex_constants::syntax_option_type normal = regex_constants::normal;
+   static const regex_constants::syntax_option_type icase = regex_constants::icase;
+   static const regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
+   static const regex_constants::syntax_option_type optimize = regex_constants::optimize;
+   static const regex_constants::syntax_option_type collate = regex_constants::collate;
+   static const regex_constants::syntax_option_type ECMAScript = normal;
+   static const regex_constants::syntax_option_type JavaScript = normal;
+   static const regex_constants::syntax_option_type JScript = normal;
+   // these flags are optional, if the functionality is supported
+   // then the flags shall take these names.
+   static const regex_constants::syntax_option_type basic = regex_constants::basic;
+   static const regex_constants::syntax_option_type extended = regex_constants::extended;
+   static const regex_constants::syntax_option_type awk = regex_constants::awk;
+   static const regex_constants::syntax_option_type grep = regex_constants::grep;
+   static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
+   static const regex_constants::syntax_option_type sed = basic = regex_constants::sed;
+   static const regex_constants::syntax_option_type perl = regex_constants::perl;
+
+   // construct/copy/destroy:
+   explicit basic_regex(const Allocator& a = Allocator());
+   explicit basic_regex(const charT* p, flag_type f = regex_constants::normal,
+                        const Allocator& a = Allocator());
+   basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal,
+               const Allocator& a = Allocator());
+   basic_regex(const charT* p, size_type len, flag_type f,
+               const Allocator& a = Allocator());
+   basic_regex(const basic_regex&);
+   template <class ST, class SA>
+   explicit basic_regex(const basic_string<charT, ST, SA>& p,
+                        flag_type f = regex_constants::normal,
+                        const Allocator& a = Allocator());
+   template <class InputIterator>
+   basic_regex(InputIterator first, inputIterator last,
+               flag_type f = regex_constants::normal,
+               const Allocator& a = Allocator());
+
+   ~basic_regex();
+   basic_regex& operator=(const basic_regex&);
+   basic_regex& operator=(const charT* ptr);
+   template <class ST, class SA>
+   basic_regex& operator=(const basic_string<charT, ST, SA>& p);
+
+   // iterators:
+   const_iterator begin() const;
+   const_iterator end() const;
+   // capacity:
+   size_type size() const;
+   size_type max_size() const;
+   bool empty() const;
+   unsigned mark_count() const;
+
+   //
+   // modifiers:
+   basic_regex& assign(const basic_regex& that);
+   basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal);
+   basic_regex& assign(const charT* first, const charT* last,
+                       flag_type f = regex_constants::normal);
+   template <class string_traits, class A>
+   basic_regex& assign(const basic_string<charT, string_traits, A>& s,
+                       flag_type f = regex_constants::normal);
+   template <class InputIterator>
+   basic_regex& assign(InputIterator first, InputIterator last,
+                       flag_type f = regex_constants::normal);
+
+   // const operations:
+   Allocator get_allocator() const;
+   flag_type getflags() const;
+   basic_string<charT> str() const;
+   int compare(basic_regex&) const;
+   // locale:
+   locale_type imbue(locale_type loc);
+   locale_type getloc() const;
+   // swap
+   void swap(basic_regex&) throw();
+};
+
+template <class charT, class traits, class Allocator>
+bool operator == (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator != (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator < (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator <= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator >= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+template <class charT, class traits, class Allocator>
+bool operator > (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+
+template <class charT, class io_traits, class re_traits, class Allocator>
+basic_ostream<charT, io_traits>&
+   operator << (basic_ostream<charT, io_traits>& os,
+                const basic_regex<charT, re_traits, Allocator>& e);
+
+template <class charT, class traits, class Allocator>
+void swap(basic_regex<charT, traits, Allocator>& e1,
+          basic_regex<charT, traits, Allocator>& e2);
+
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+
+} // namespace boost
+
+ +

Description

+ +

Class basic_regex has the following public member +functions:

+ +

basic_regex constants

+ +
+static const regex_constants::syntax_option_type normal = regex_constants::normal;
+static const regex_constants::syntax_option_type icase = regex_constants::icase;
+static const regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
+static const regex_constants::syntax_option_type optimize = regex_constants::optimize;
+static const regex_constants::syntax_option_type collate = regex_constants::collate;
+static const regex_constants::syntax_option_type ECMAScript = normal;
+static const regex_constants::syntax_option_type JavaScript = normal;
+static const regex_constants::syntax_option_type JScript = normal;
+static const regex_constants::syntax_option_type basic = regex_constants::basic;
+static const regex_constants::syntax_option_type extended = regex_constants::extended;
+static const regex_constants::syntax_option_type awk = regex_constants::awk;
+static const regex_constants::syntax_option_type grep = regex_constants::grep;
+static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
+static const regex_constants::syntax_option_type sed = basic = regex_constants::sed;
+static const regex_constants::syntax_option_type perl = regex_constants::perl;
+
+ +

The static constant members are provided as synonyms for the +constants declared in namespace +boost::regex_constants; for each constant of type +syntax_option_type declared in namespace +boost::regex_constants then a constant with the same name, +type and value is declared within the scope of +basic_regex.

+ +

basic_regex constructors

+ +

In all basic_regex constructors, a copy of the +Allocator argument is used for any memory allocation +performed by the constructor or member functions during the +lifetime of the object.

+ +
+basic_regex(const Allocator& a = Allocator());
+
+ + + +

Effects: Constructs an object of class +basic_regex. The postconditions of this function are +indicated in the table:

+ +

+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

true

+
+

size()

+
+

0

+
+

str()

+
+

basic_string<charT>()

+
+
+
+ +
+ 
+
+ +
+basic_regex(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Requires: p shall not be a null pointer.

+ + + +

Throws: bad_expression if p is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the +null-terminated string p, and interpreted according to the +option flags specified +in f. The postconditions of this function are indicated in +the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

char_traits<charT>::length(p)

+
+

str()

+
+

basic_string<charT>(p)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Requires: p1 and p2 are not null pointers, +p1 < p2.

+ + + +

Throws: bad_expression if [p1,p2) is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the sequence +of characters [p1,p2), and interpreted according the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

std::distance(p1,p2)

+
+

str()

+
+

basic_string<charT>(p1,p2)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+basic_regex(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator());
+
+ + + +

Requires: p shall not be a null pointer, len +< max_size().

+ + + +

Throws: bad_expression if p is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the sequence +of characters [p, p+len), and interpreted according the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

len

+
+

str()

+
+

basic_string<charT>(p, len)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+  
+
+ +
+basic_regex(const basic_regex& e);
+
+ + + +

Effects: Constructs an object of class +basic_regex as a copy of the object e. The +postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

e.empty()

+
+

size()

+
+

e.size()

+
+

str()

+
+

e.str()

+
+

getflags()

+
+

e.getflags()

+
+

mark_count()

+
+

e.mark_count()

+
+
+
+ +
+ 
+
+ +
+template <class ST, class SA>
+basic_regex(const basic_string<charT, ST, SA>& s,
+            flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Throws: bad_expression if s is not a +valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the string +s, and interpreted according to the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

s.size()

+
+

str()

+
+

s

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+template <class ForwardIterator>
+basic_regex(ForwardIterator first, ForwardIterator last,
+            flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+
+ + + +

Throws: bad_expression if the sequence +[first, last) is not a valid regular expression.

+ + + +

Effects: Constructs an object of class +basic_regex; the object's internal finite state machine is +constructed from the regular expression contained in the sequence +of characters [first, last), and interpreted according to the option flags specified in +f. The postconditions of this function are indicated in the +table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

distance(first,last)

+
+

str()

+
+

basic_string<charT>(first,last)

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+  
+
+ +
+basic_regex& operator=(const basic_regex& e);
+
+ + + +

Effects: Returns the result of assign(e.str(), +e.getflags()).

+ +
+basic_regex& operator=(const charT* ptr);
+
+ + + +

Requires: p shall not be a null pointer.

+ + + +

Effects: Returns the result of +assign(ptr).

+ +
+template <class ST, class SA>
+basic_regex& operator=(const basic_string<charT, ST, SA>& p);
+
+ + + +

Effects: Returns the result of +assign(p).

+ +

basic_regex iterators

+ +
+const_iterator begin() const;
+
+ + + +

Effects: Returns a starting iterator to a sequence of +characters representing the regular expression.

+ +
+const_iterator end() const;
+
+ + + +

Effects: Returns termination iterator to a sequence of +characters representing the regular expression.

+ +

basic_regex capacity

+ +
+size_type size() const;
+
+ + + +

Effects: Returns the length of the sequence of characters +representing the regular expression.

+ +
+size_type max_size() const;
+
+ + + +

Effects: Returns the maximum length of the sequence of +characters representing the regular expression.

+ +
+bool empty() const;
+
+ + + +

Effects: Returns true if the object does not +contain a valid regular expression, otherwise false.

+ +
+unsigned mark_count() const;
+
+ + + +

Effects: Returns the number of marked sub-expressions +within the regular expresion.

+ +

basic_regex assign

+ +
+basic_regex& assign(const basic_regex& that);
+
+ + + +

Effects: Returns assign(that.str(), +that.getflags()).

+ +
+basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal);
+
+ + + +

Effects: Returns assign(string_type(ptr), +f).

+ +
+basic_regex& assign(const charT* first, const charT* last,
+                    flag_type f = regex_constants::normal);
+
+ + + +

Effects: Returns assign(string_type(first, last), +f).

+ +
+template <class string_traits, class A>
+basic_regex& assign(const basic_string<charT, string_traits, A>& s,
+                    flag_type f = regex_constants::normal);
+
+ + + +

Throws: bad_expression if s is not a +valid regular expression.

+ + + +

Returns: *this.

+ + + +

Effects: Assigns the regular expression contained in the +string s, interpreted according the option flags specified in f. +The postconditions of this function are indicated in the table:

+ + + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Element

+
+ +

Value

+
+

empty()

+
+

false

+
+

size()

+
+

s.size()

+
+

str()

+
+

s

+
+

getflags()

+
+

f

+
+

mark_count()

+
+

The number of marked sub-expressions within the expression.

+
+
+
+ +
+ 
+
+ +
+template <class InputIterator>
+basic_regex& assign(InputIterator first, InputIterator last,
+                    flag_type f = regex_constants::normal);
+
+ + + +

Requires: The type InputIterator corresponds to the Input +Iterator requirements (24.1.1).

+ + + +

Effects: Returns assign(string_type(first, last), +f).

+ +

basic_regex constant operations

+ +
+Allocator get_allocator() const;
+
+ + + +

Effects: Returns a copy of the Allocator that was passed +to the object's constructor.

+ +
+flag_type getflags() const;
+
+ + + +

Effects: Returns a copy of the regular expression syntax +flags that were passed to the object's constructor, or the last +call to assign.

+ +
+basic_string<charT> str() const;
+
+ + + +

Effects: Returns a copy of the character sequence passed +to the object's constructor, or the last call to +assign.

+ +
+int compare(basic_regex& e)const;
+
+ + + +

Effects: If getflags() == e.getflags() then +returns str().compare(e.str()), otherwise returns +getflags() - e.getflags().

+ +

basic_regex locale

+ +
+locale_type imbue(locale_type l);
+
+ + + +

Effects: Returns the result of +traits_inst.imbue(l) where traits_inst is a +(default initialized) instance of the template parameter +traits stored within the object. Calls to imbue invalidate +any currently contained regular expression.

+ + + +

Postcondition: empty() == true.

+ +
+locale_type getloc() const;
+
+ + + +

Effects: Returns the result of +traits_inst.getloc() where traits_inst is a +(default initialized) instance of the template parameter +traits stored within the object.

+ +

basic_regex swap

+ +
+void swap(basic_regex& e) throw();
+
+ + + +

Effects: Swaps the contents of the two regular +expressions.

+ + + +

Postcondition: *this contains the characters +that were in e, e contains the regular expression +that was in *this.

+ + + +

Complexity: constant time.

+ +

basic_regex non-member functions

+ +
basic_regex non-member comparison operators 
+ +
+template <class charT, class traits, class Allocator>
+bool operator == (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) == 0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator != (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) != 0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator < (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) < +0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator <= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) <= +0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator >= (const basic_regex<charT, traits, Allocator>& lhs,
+                  const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) >= +0.

+ +
+template <class charT, class traits, class Allocator>
+bool operator > (const basic_regex<charT, traits, Allocator>& lhs,
+                 const basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: Returns lhs.compare(rhs) > +0.

+ +
basic_regex inserter.
+ +
+template <class charT, class io_traits, class re_traits, class Allocator>
+basic_ostream<charT, io_traits>&
+   operator << (basic_ostream<charT, io_traits>& os
+                const basic_regex<charT, re_traits, Allocator>& e);
+
+ + + +

Effects: Returns (os << e.str()).

+ +
basic_regex non-member swap
+ +
+template <class charT, class traits, class Allocator>
+void swap(basic_regex<charT, traits, Allocator>& lhs,
+          basic_regex<charT, traits, Allocator>& rhs);
+
+ + + +

Effects: calls lhs.swap(rhs).

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/configuration.html b/doc/configuration.html new file mode 100644 index 00000000..205a9a83 --- /dev/null +++ b/doc/configuration.html @@ -0,0 +1,232 @@ + + + +Boost.Regex: Configuration and setup + + + + + + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Configuration and setup

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Contents

+ +
+
Compiler setup
+ +
Locale and traits class selection
+ +
Linkage Options
+ +
Algorithm Selection
+ +
Algorithm Tuning
+
+ +

Compiler setup.

+ +

You shouldn't need to do anything special to configure +boost.regex for use with your compiler - the boost.config subsystem should already +take care of it, if you do have problems (or you are using a +particularly obscure compiler or platform) then boost.config has a configure script.

+ +

Locale and traits class selection.

+ +

The following macros (see user.hpp) control how +boost.regex interacts with the user's locale:

+ + + + + + + + + + + + + + + + +
BOOST_REGEX_USE_C_LOCALEForces boost.regex to use the global C locale in its traits +class support: this is the default behavior on non-windows +platforms, but MS Windows platforms normally use the Win32 API for +locale support.
BOOST_REGEX_USE_CPP_LOCALEForces boost.regex to use std::locale in it's default traits +class, regular expressions can then be imbued with an +instance specific locale.
BOOST_REGEX_NO_W32Tells boost.regex not to use any Win32 API's even when +available (implies BOOST_REGEX_USE_C_LOCALE unless +BOOST_REGEX_USE_CPP_LOCALE is set).
+ +
+
+ + +

Linkage Options

+ + + + + + + + + + + +
BOOST_REGEX_DYN_LINKFor Microsoft and Borland C++ builds, this tells boost.regex +that it should link to the dll build of the boost.regex.  By +default boost.regex will link to its static library build, even if +the dynamic C runtime library is in use.
BOOST_REGEX_NO_LIBFor Microsoft and Borland C++ builds, this tells boost.regex +that it should not automatically select the library to link +to.
+ +
+
+ + +

Algorithm Selection

+ + + + + + + + + + + + + + + + +
BOOST_REGEX_V3Tells boost.regex to use the boost-1.30.0 matching algorithm, +define only if you need maximum compatibility with previous +behavior.
BOOST_REGEX_RECURSIVETells boost.regex to use a stack-recursive matching +algorithm.  This is generally the fastest option (although +there is very little in it), but can cause stack overflow in +extreme cases, on Win32 this can be handled safely, but this is not +the case on other platforms.
BOOST_REGEX_NON_RECURSIVETells boost.regex to use a non-stack recursive matching +algorithm, this can be slightly slower than the alternative, but is +always safe no matter how pathological the regular +expression.  This is the default on non-Win32 platforms.
+ +
+
+ + +

Algorithm Tuning

+ +

The following option applies only if BOOST_REGEX_RECURSIVE is +set.

+ + + + + + +
BOOST_REGEX_HAS_MS_STACK_GUARDTells boost.regex that Microsoft style __try - __except blocks +are supported, and can be used to safely trap stack overflow.
+ +
+
+ + +

The following options apply only if BOOST_REGEX_NON_RECURSIVE is +set.

+ + + + + + + + + + + + + + + + +
BOOST_REGEX_BLOCKSIZEIn non-recursive mode, boost.regex uses largish blocks of +memory to act as a stack for the state machine, the larger the +block size then the fewer allocations that will take place.  +This defaults to 4096 bytes, which is large enough to match the +vast majority of regular expressions without further +allocations, however, you can choose smaller or larger values +depending upon your platforms characteristics.
BOOST_REGEX_MAX_BLOCKSTells boost.regex how many blocks of size BOOST_REGEX_BLOCKSIZE +it is permitted to use.  If this value is exceeded then +boost.regex will stop trying to find a match and throw a +std::runtime_error.  Defaults to 1024, don't forget to tweek +this value if you alter BOOST_REGEX_BLOCKSIZE by much.
BOOST_REGEX_MAX_CACHE_BLOCKSTells boost.regex how many memory blocks to store in it's +internal cache - memory blocks are taken from this cache rather +than by calling ::operator new.  Generally speeking this can +be an order of magnitude faster than calling ::opertator new each +time a memory block is required, but has the downside that +boost.regex can end up caching a large chunk of memory (by default +up to 16 blocks each of BOOST_REGEX_BLOCKSIZE size).  If +memory is tight then try defining this to 0 (disables all caching), +or if that is too slow, then a value of 1 or 2, may be +sufficient.  On the other hand, on large multi-processor, +multi-threaded systems, you may find that a higher value is in +order.
+ +
+
+ + +
+

Revised +17 May 2003 +

+ +

© Copyright John +Maddock 1998- +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/contacts.html b/doc/contacts.html new file mode 100644 index 00000000..f459d203 --- /dev/null +++ b/doc/contacts.html @@ -0,0 +1,110 @@ + + + +Boost.Regex: Contacts + + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Contacts and Acknowledgements

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

The author can be contacted at +john_maddock@compuserve.com, the home page for this library is +at +http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm, +and the official boost version can be obtained from www.boost.org/libraries.htm.

+ +

I am indebted to Robert Sedgewick's "Algorithms in C++" for +forcing me to think about algorithms and their performance, and to +the folks at boost for forcing me to think, period. The +following people have all contributed useful comments or fixes: +Dave Abrahams, Mike Allison, Edan Ayal, Jayashree Balasubramanian, +Jan Bölsche, Beman Dawes, Paul Baxter, David Bergman, David +Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, +Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick +Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan Hermelink, +Max Leung, Wei-hao Lin, Jens Maurer, Richard Peters, Heiko Schmidt, +Jason Shirk, Gerald Slacik, Scobie Smith, Mike Smyth, Alexander +Sokolovsky, Hervé Poirier, Michael Raykh, Marc Recht, Scott +VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, +Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to +the manuals supplied with the Henry Spencer, Perl and GNU regular +expression libraries - wherever possible I have tried to maintain +compatibility with these libraries and with the POSIX standard - +the code however is entirely my own, including any bugs! I can +absolutely guarantee that I will not fix any bugs I don't know +about, so if you have any comments or spot any bugs, please get in +touch.

+ +

Useful further information can be found at:

+ +

A short tutorial on regular expressions can be +found here.

+ +

The Open Unix +Specification contains a wealth of useful material, including +the regular expression syntax, and specifications for +<regex.h> and +<nl_types.h>.

+ +

The Pattern +Matching Pointers site is a "must visit" resource for anyone +interested in pattern matching.

+ +

Glimpse and Agrep, +use a simplified regular expression syntax to achieve faster search +times.

+ +

Udi Manber +and Ricardo +Baeza-Yates both have a selection of useful pattern matching +papers available from their respective web sites.

+ +

+ +
+

Revised +17 May 2003 +

+ +

© Copyright John +Maddock 1998- +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + diff --git a/doc/examples.html b/doc/examples.html new file mode 100644 index 00000000..eeb99819 --- /dev/null +++ b/doc/examples.html @@ -0,0 +1,99 @@ + + + + Boost.Regex: Examples + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Examples

+
+

Boost.Regex Index

+
+
+
+
+

There are three demo applications that ship with this library, they all come + with makefiles for Borland, Microsoft and gcc compilers, otherwise you will + have to create your own makefiles.

+
regress.exe:
+

A regression test application that gives the matching/searching algorithms a + full workout. The presence of this program is your guarantee that the library + will behave as claimed - at least as far as those items tested are concerned - + if anyone spots anything that isn't being tested I'd be glad to hear about it.

+

Files: parse.cpp, + regress.cpp, tests.cpp.

+
jgrep.exe
+

A simple grep implementation, run with no command line options to find out its + usage. Look at fileiter.cpp/fileiter.hpp and + the mapfile class to see an example of a "smart" bidirectional iterator that + can be used with boost.regex or any other STL algorithm.

+

Files: jgrep.cpp, + main.cpp.

+
timer.exe
+

A simple interactive expression matching application, the results of all + matches are timed, allowing the programmer to optimize their regular + expressions where performance is critical.

+

Files: regex_timer.cpp.

+
Code snippets
+

The snippets examples contain the code examples used in the documentation:

+

credit_card_example.cpp: + Credit card number formatting code.

+

partial_regex_grep.cpp: + Search example using partial matches.

+

partial_regex_match.cpp: + regex_match example using partial matches.

+

regex_grep_example_1.cpp: + regex_grep example 1: searches a cpp file for class definitions.

+

regex_grep_example_2.cpp: + regex_grep example 2: searches a cpp file for class definitions, using a global + callback function.

+

regex_grep_example_3.cpp: + regex_grep example 2: searches a cpp file for class definitions, using a bound + member function callback.

+

regex_grep_example_4.cpp: + regex_grep example 2: searches a cpp file for class definitions, using a C++ + Builder closure as a callback.

+

regex_match_example.cpp: + ftp based regex_match example.

+

regex_merge_example.cpp: + regex_merge example: converts a C++ file to syntax highlighted HTML.

+

regex_replace_example.cpp: + regex_replace example: converts a C++ file to syntax highlighted HTML

+

regex_search_example.cpp: + regex_search example: searches a cpp file for class definitions.

+

regex_split_example_1.cpp: + regex_split example: split a string into tokens.

+

regex_split_example_2.cpp + : regex_split example: spit out linked URL's.

+

+
+

Revised +17 May 2003 +

+ +

© Copyright John +Maddock 1998- +2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/faq.html b/doc/faq.html new file mode 100644 index 00000000..f398ad92 --- /dev/null +++ b/doc/faq.html @@ -0,0 +1,162 @@ + + + + +Boost.Regex: FAQ + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

FAQ

+
+

+"Boost.Regex

+
+ +
+
+ + +
+ +

 Q. Why can't I use the "convenience" versions of +regex_match / regex_search / regex_grep / regex_format / +regex_merge?

+ +

A. These versions may or may not be available depending upon the +capabilities of your compiler, the rules determining the format of +these functions are quite complex - and only the versions visible +to a standard compliant compiler are given in the help. To find out +what your compiler supports, run <boost/regex.hpp> through +your C++ pre-processor, and search the output file for the function +that you are interested in.

+ +

Q. I can't get +regex++ to work with escape characters, what's going +on?

+ +

A. If you embed regular expressions in C++ code, then remember +that escape characters are processed twice: once by the C++ +compiler, and once by the regex++ expression compiler, so to pass +the regular expression \d+ to regex++, you need to embed "\\d+" in +your code. Likewise to match a literal backslash you will need to +embed "\\\\" in your code.

+ +

Q. Why does using parenthesis in a POSIX +regular expression change the result of a match?

+ +

For POSIX (extended and basic) regular expressions, but not for +perl regexes, parentheses don't only mark; they determine what the +best match is as well. When the expression is compiled as a POSIX +basic or extended regex then Boost.regex follows the POSIX standard +leftmost longest rule for determining what matched. So if there is +more than one possible match after considering the whole +expression, it looks next at the first sub-expression and then the +second sub-expression and so on. So...

+ +
+"(0*)([0-9]*)" against "00123" would produce
+$1 = "00"
+$2 = "123"
+
+ +

where as

+ +
+"0*([0-9)*" against "00123" would produce
+$1 = "00123"
+
+ +

If you think about it, had $1 only matched the "123", this would +be "less good" than the match "00123" which is both further to the +left and longer. If you want $1 to match only the "123" part, then +you need to use something like:

+ +
+"0*([1-9][0-9]*)"
+
+ +

as the expression.

+ +

Q. Why don't character ranges work +properly (POSIX mode only)?
+ A. The POSIX standard specifies that character range expressions +are locale sensitive - so for example the expression [A-Z] will +match any collating element that collates between 'A' and 'Z'. That +means that for most locales other than "C" or "POSIX", [A-Z] would +match the single character 't' for example, which is not what most +people expect - or at least not what most people have come to +expect from regular expression engines. For this reason, the +default behaviour of boost.regex (perl mode) is to turn locale +sensitive collation off by not setting the regex_constants::collate +compile time flag. However if you set a non-default compile time +flag - for example regex_constants::extended or +regex_constants::basic, then locale dependent collation will be +enabled, this also applies to the POSIX API functions which use +either regex_constants::extended or regex_constants::basic +internally. [Note - when regex_constants::nocollate in effect, +the library behaves "as if" the LC_COLLATE locale category were +always "C", regardless of what its actually set to - end +note].

+ +

Q. Why are there no throw specifications +on any of the functions? What exceptions can the library +throw?

+ +

A. Not all compilers support (or honor) throw specifications, +others support them but with reduced efficiency. Throw +specifications may be added at a later date as compilers begin to +handle this better. The library should throw only three types of +exception: boost::bad_expression can be thrown by basic_regex when +compiling a regular expression, std::runtime_error can be thrown +when a call to basic_regex::imbue tries to open a message catalogue +that doesn't exist, or when a call to regex_search or regex_match +results in an "everlasting" search, or when a call to +RegEx::GrepFiles or RegEx::FindFiles tries to open a file that +cannot be opened, finally std::bad_alloc can be thrown by just +about any of the functions in this library.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/format_syntax.html b/doc/format_syntax.html new file mode 100644 index 00000000..c267528d --- /dev/null +++ b/doc/format_syntax.html @@ -0,0 +1,272 @@ + + + + +Boost.Regex: Format String Syntax + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Format String Syntax

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Format strings are used by the algorithm regex_merge and by match_results::format, and are used +to transform one string into another.

+ +

There are three kind of format string: sed, Perl and extended, +the extended syntax is a superset of the others so this is covered +first.

+ +

Extended format syntax

+ +

In format strings, all characters are treated as literals +except: ()$\?:

+ +

To use any of these as literals you must prefix them with the +escape character \

+ +

The following special sequences are recognized: 
+  
+ Grouping:

+ +

Use the parenthesis characters ( and ) to group sub-expressions +within the format string, use \( and \) to represent literal '(' +and ')'. 
+  
+ Sub-expression expansions:

+ +

The following Perl like expressions expand to a particular +matched sub-expression:
+  

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 $`Expands to all the text from the end +of the previous match to the start of the current match, if there +was no previous match in the current operation, then everything +from the start of the input string to the start of the match. 
 $'Expands to all the text from the end +of the match to the end of the input string. 
 $&Expands to all of the current +match. 
 $0Expands to all of the current +match. 
 $NExpands to the text that matched +sub-expression N. 
+ +
+
+ + +

Conditional expressions:

+ +

Conditional expressions allow two different format strings to be +selected dependent upon whether a sub-expression participated in +the match or not:

+ +

?Ntrue_expression:false_expression

+ +

Executes true_expression if sub-expression N participated +in the match, otherwise executes false_expression.

+ +

Example: suppose we search for "(while)|(for)" then the format +string "?1WHILE:FOR" would output what matched, but in upper +case. 
+  
+ Escape sequences:

+ +

The following escape sequences are also allowed:
+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 \aThe bell character. 
 \fThe form feed character. 
 \nThe newline character. 
 \rThe carriage return character. 
 \tThe tab character. 
 \vA vertical tab character. 
 \xA hexadecimal character - for example +\x0D. 
 \x{}A possible Unicode hexadecimal +character - for example \x{1A0} 
 \cxThe ASCII escape character x, for +example \c@ is equivalent to escape-@. 
 \eThe ASCII escape character. 
 \ddAn octal character constant, for +example \10. 
+ +
+
+ + +

Perl format strings

+ +

Perl format strings are the same as the default syntax except +that the characters ()?: have no special meaning.

+ +

Sed format strings

+ +

Sed format strings use only the characters \ and & as +special characters.

+ +

\n where n is a digit, is expanded to the nth +sub-expression.

+ +

& is expanded to the whole of the match (equivalent to +\0).

+ +

Other escape sequences are expanded as per the default +syntax.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/gcc-performance.html b/doc/gcc-performance.html new file mode 100644 index 00000000..dc0adb53 --- /dev/null +++ b/doc/gcc-performance.html @@ -0,0 +1,539 @@ + + + + Regular Expression Performance Comparison (gcc 3.2) + + + + + + + +

Regular Expression Performance Comparison

+

The following tables provide comparisons between the following regular + expression libraries:

+

The Boost regex library.

+

The GNU regular expression library.

+

Philip Hazel's PCRE library.

+

Details

+

Machine: Intel Pentium 4 2.8GHz PC.

+

Compiler: GNU C++ version 3.2 20020927 (prerelease).

+

C++ Standard Library: GNU libstdc++ version 20020927.

+

OS: Cygwin.

+

Boost version: 1.31.0.

+

PCRE version: 4.1.

+

As ever care should be taken in interpreting the results, only sensible regular + expressions (rather than pathological cases) are given, most are taken from the + Boost regex examples, or from the Library of + Regular Expressions. In addition, some variation in the relative + performance of these libraries can be expected on other machines - as memory + access and processor caching effects can be quite large for most finite state + machine algorithms. In each case the first figure given is the relative time + taken (so a value of 1.0 is as good as it gets), while the second figure is the + actual time taken.

+

Averages

+

The following are the average relative scores for all the tests: the perfect + regular expression library would score 1, in practice anything less than 2 + is pretty good.

+ + + + + + + + + + + + + +
BoostBoost + C++ localePOSIXPCRE
1.45031.49124108.3721.56255
+
+
+

Comparison 1: Long Search

+

For each of the following regular expressions the time taken to find all + occurrences of the expression within a long English language text was measured + (mtent12.txt + from Project Gutenberg, 19Mb). 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionBoostBoost + C++ localePOSIXPCRE
Twain3.49
+ (0.205s)
4.09
+ (0.24s)
65.2
+ (3.83s)
1
+ (0.0588s)
Huck[[:alpha:]]+3.86
+ (0.203s)
4.52
+ (0.238s)
100
+ (5.26s)
1
+ (0.0526s)
[[:alpha:]]+ing1.01
+ (1.23s)
1
+ (1.22s)
4.95
+ (6.04s)
4.67
+ (5.71s)
^[^ ]*?Twain1
+ (0.31s)
1.05
+ (0.326s)
NA3.32
+ (1.03s)
Tom|Sawyer|Huckleberry|Finn1.02
+ (0.125s)
1
+ (0.123s)
165
+ (20.3s)
1.08
+ (0.133s)
(Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)1
+ (0.345s)
1.03
+ (0.355s)
NA1.71
+ (0.59s)
+
+
+

Comparison 2: Medium Sized Search

+

For each of the following regular expressions the time taken to find all + occurrences of the expression within a medium sized English language text was + measured (the first 50K from mtent12.txt). 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionBoostBoost + C++ localePOSIXPCRE
Twain1.8
+ (0.000519s)
2.14
+ (0.000616s)
9.08
+ (0.00262s)
1
+ (0.000289s)
Huck[[:alpha:]]+3.65
+ (0.000499s)
4.36
+ (0.000597s)
1
+ (0.000137s)
1.43
+ (0.000196s)
[[:alpha:]]+ing1
+ (0.00258s)
1
+ (0.00258s)
5.28
+ (0.0136s)
5.63
+ (0.0145s)
^[^ ]*?Twain1
+ (0.000929s)
1.03
+ (0.000957s)
NA2.82
+ (0.00262s)
Tom|Sawyer|Huckleberry|Finn1
+ (0.000812s)
1
+ (0.000812s)
60.1
+ (0.0488s)
1.28
+ (0.00104s)
(Tom|Sawyer|Huckleberry|Finn).{0,30}river|river.{0,30}(Tom|Sawyer|Huckleberry|Finn)1.02
+ (0.00178s)
1
+ (0.00174s)
242
+ (0.421s)
1.3
+ (0.00227s)
+
+
+

Comparison 3: C++ Code Search

+

For each of the following regular expressions the time taken to find all + occurrences of the expression within the C++ source file + boost/crc.hpp was measured. 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionBoostBoost + C++ localePOSIXPCRE
^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\<\w+\>([ + ]*\([^)]*\))?[[:space:]]*)*(\<\w*\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?(\{|:[^;\{()]*\{)1.04
+ (0.000144s)
1
+ (0.000139s)
862
+ (0.12s)
4.56
+ (0.000636s)
(^[ + ]*#(?:[^\\\n]|\\[^\n_[:punct:][:alnum:]]*[\n[:punct:][:word:]])*)|(//[^\n]*|/\*.*?\*/)|\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\>|('(?:[^\\']|\\.)*'|"(?:[^\\"]|\\.)*")|\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\>1
+ (0.0139s)
1.01
+ (0.0141s)
NA1.55
+ (0.0216s)
^[ ]*#[ ]*include[ ]+("[^"]+"|<[^>]+>)1.04
+ (0.000332s)
1
+ (0.000318s)
130
+ (0.0413s)
1.72
+ (0.000547s)
^[ ]*#[ ]*include[ ]+("boost/[^"]+"|<boost/[^>]+>)1.02
+ (0.000323s)
1
+ (0.000318s)
150
+ (0.0476s)
1.72
+ (0.000547s)
+
+

+

Comparison 4: HTML Document Search +

+

For each of the following regular expressions the time taken to find all + occurrences of the expression within the html file libs/libraries.htm + was measured. 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionBoostBoost + C++ localePOSIXPCRE
beman|john|dave1.03
+ (0.000367s)
1
+ (0.000357s)
47.4
+ (0.0169s)
1.16
+ (0.000416s)
<p>.*?</p>1.25
+ (0.000459s)
1
+ (0.000367s)
NA1.03
+ (0.000376s)
<a[^>]+href=("[^"]*"|[^[:space:]]+)[^>]*>1
+ (0.000509s)
1.02
+ (0.000518s)
305
+ (0.155s)
1.1
+ (0.000558s)
<h[12345678][^>]*>.*?</h[12345678]>1.04
+ (0.00025s)
1
+ (0.00024s)
NA1.16
+ (0.000279s)
<img[^>]+src=("[^"]*"|[^[:space:]]+)[^>]*>2.22
+ (0.000489s)
1.69
+ (0.000372s)
148
+ (0.0326s)
1
+ (0.00022s)
<font[^>]+face=("[^"]*"|[^[:space:]]+)[^>]*>.*?</font>1.71
+ (0.000371s)
1.75
+ (0.000381s)
NA1
+ (0.000218s)
+
+
+

Comparison 3: Simple Matches

+

For each of the following regular expressions the time taken to match against + the text indicated was measured. 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionTextBoostBoost + C++ localePOSIXPCRE
abcabc1.36
+ (2.15e-07s)
1.36
+ (2.15e-07s)
2.76
+ (4.34e-07s)
1
+ (1.58e-07s)
^([0-9]+)(\-| |$)(.*)$100- this is a line of ftp response which contains a message string1.55
+ (7.26e-07s)
1.51
+ (7.07e-07s)
319
+ (0.000149s)
1
+ (4.67e-07s)
([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}1234-5678-1234-4561.96
+ (9.54e-07s)
1.96
+ (9.54e-07s)
44.5
+ (2.17e-05s)
1
+ (4.87e-07s)
^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$john_maddock@compuserve.com1.22
+ (1.51e-06s)
1.23
+ (1.53e-06s)
162
+ (0.000201s)
1
+ (1.24e-06s)
^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$foo12@foo.edu1.28
+ (1.47e-06s)
1.3
+ (1.49e-06s)
104
+ (0.00012s)
1
+ (1.15e-06s)
^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$bob.smith@foo.tv1.28
+ (1.47e-06s)
1.3
+ (1.49e-06s)
113
+ (0.00013s)
1
+ (1.15e-06s)
^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$EH10 2QQ1.38
+ (4.68e-07s)
1.41
+ (4.77e-07s)
13.5
+ (4.59e-06s)
1
+ (3.39e-07s)
^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$G1 1AA1.28
+ (4.35e-07s)
1.25
+ (4.25e-07s)
11.7
+ (3.97e-06s)
1
+ (3.39e-07s)
^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$SW1 1ZZ1.32
+ (4.53e-07s)
1.31
+ (4.49e-07s)
12.2
+ (4.2e-06s)
1
+ (3.44e-07s)
^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$4/1/20011.16
+ (3.82e-07s)
1.2
+ (3.96e-07s)
13.9
+ (4.59e-06s)
1
+ (3.29e-07s)
^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$12/12/20011.38
+ (4.49e-07s)
1.38
+ (4.49e-07s)
16
+ (5.2e-06s)
1
+ (3.25e-07s)
^[-+]?[[:digit:]]*\.?[[:digit:]]*$1231.19
+ (7.64e-07s)
1.16
+ (7.45e-07s)
7.51
+ (4.81e-06s)
1
+ (6.4e-07s)
^[-+]?[[:digit:]]*\.?[[:digit:]]*$+3.141591.32
+ (8.97e-07s)
1.31
+ (8.88e-07s)
14
+ (9.48e-06s)
1
+ (6.78e-07s)
^[-+]?[[:digit:]]*\.?[[:digit:]]*$-3.141591.32
+ (8.97e-07s)
1.31
+ (8.88e-07s)
14
+ (9.48e-06s)
1
+ (6.78e-07s)
+
+
+
+

Copyright John Maddock April 2003, all rights reserved.

+ + diff --git a/doc/headers.html b/doc/headers.html new file mode 100644 index 00000000..d0b8283c --- /dev/null +++ b/doc/headers.html @@ -0,0 +1,52 @@ + + + + Boost.Regex: Headers + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Headers

+
+

Boost.Regex Index

+
+

+
+

+

There are two main headers used by this library: <boost/regex.hpp> + provides full access to the entire library, while <boost/cregex.hpp> + provides access to just the high level class RegEx, and the POSIX API + functions. +

+

There is also a header containing only forward declarations + <boost/regex_fwd.hpp> for use when an interface is dependent upon + boost::basic_regex, but otherwise does not need the full definitions.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/history.html b/doc/history.html new file mode 100644 index 00000000..17ca695c --- /dev/null +++ b/doc/history.html @@ -0,0 +1,58 @@ + + + + Boost.Regex: History + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

History

+
+

Boost.Regex Index

+
+

+
+

+

Boost 1.31.0.

+
    +
  • + Completely rewritten pattern matching code - it is now up to 10 times faster + than before.
  • +
  • + Reorganized documentation.
  • +
  • + Deprecated all interfaces that are not part of the + regular expression standardization proposal.
  • +
  • + Added regex_iterator and regex_token_iterator.
  • +
  • + Added support for Perl style independent sub-expressions.
+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/implementation.html b/doc/implementation.html new file mode 100644 index 00000000..dfb8811a --- /dev/null +++ b/doc/implementation.html @@ -0,0 +1,45 @@ + + + + Boost.Regex: Implementation + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Implementation

+
+

Boost.Regex Index

+
+

+
+

+

Todo.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..88196f29 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,127 @@ + + + + + Boost.Regex: Index + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Index

+
+

Boost Libraries Index

+
+
+
+
+

Contents

+
+
Overview
+
Configuration and setup
+
Installation
+
+
+
Borland C++ Builder
+ Microsoft Visual C++
GNU G++
+
Sun Forte Compiler
+ Other compilers (building with bjam)
+
+
+
Reference
+
+
+
Types
+
+
+
syntax_option_type
+ match_flag_type
class bad_expression
+
class regex_traits
+ class template basic_regex
class template + sub_match
class template + match_results
+
+
+
Algorithms
+
+
+
regex_match
regex_search
+
regex_replace
+
+
+
Iterators
+
+
+
regex_iterator
+
regex_token_iterator
+
+
+
Misc.
+
+
+
POSIX API Compatibility Functions
+
Partial matches
+
Regular Expression Syntax
+
Format String Syntax
+
+
+
Deprecated interfaces
+
+
+
class regbase
class + template reg_expression
Algorithm + regex_grep
Algorithm regex_format
+
Algorithm regex_merge
+ Algorithm regex_split
+
class RegEx
+
+
+
+
+
FAQ
+
Appendix
+
+
+
Implementation
+
Thread Safety
+
Localisation
+
Examples
+
Headers
+
Redistributables and Library Names
+
Standards Conformance
+
History
+
Performance
+
Contacts and Acknowledgements
+
+
+
+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + + + diff --git a/doc/install.html b/doc/install.html new file mode 100644 index 00000000..f24fb744 --- /dev/null +++ b/doc/install.html @@ -0,0 +1,237 @@ + + + + Boost.Regex: Index + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Installation

+
+

Boost.Regex Index

+
+

+
+

+

[ Important: If you are upgrading from the + 2.x version of this library then you will find a number of changes to the + documented header names and library interfaces, existing code should still + compile unchanged however - see + Note for Upgraders. ]

+

When you extract the library from its zip file, you must preserve its internal + directory structure (for example by using the -d option when extracting). If + you didn't do that when extracting, then you'd better stop reading this, delete + the files you just extracted, and try again! +

+

This library should not need configuring before use; most popular + compilers/standard libraries/platforms are already supported "as is". If you do + experience configuration problems, or just want to test the configuration with + your compiler, then the process is the same as for all of boost; see the + configuration library documentation.

+

The library will encase all code inside namespace boost. +

+

Unlike some other template libraries, this library consists of a mixture of + template code (in the headers) and static code and data (in cpp files). + Consequently it is necessary to build the library's support code into a library + or archive file before you can use it, instructions for specific platforms are + as follows: +

+

Borland C++ Builder: +

+
    +
  • + Open up a console window and change to the <boost>\libs\regex\build + directory. +
  • + Select the appropriate makefile (bcb4.mak for C++ Builder 4, bcb5.mak for C++ + Builder 5, and bcb6.mak for C++ Builder 6). +
  • + Invoke the makefile (pass the full path to your version of make if you have + more than one version installed, the makefile relies on the path to make to + obtain your C++ Builder installation directory and tools) for example: +
  • +
+
make -fbcb5.mak
+

The build process will build a variety of .lib and .dll files (the exact number + depends upon the version of Borland's tools you are using) the .lib and dll + files will be in a sub-directory called bcb4 or bcb5 depending upon the + makefile used. To install the libraries into your development system use:

+

make -fbcb5.mak install

+

library files will be copied to <BCROOT>/lib and the dll's to + <BCROOT>/bin, where <BCROOT> corresponds to the install path of + your Borland C++ tools. +

+

You may also remove temporary files created during the build process (excluding + lib and dll files) by using:

+

make -fbcb5.mak clean

+

Finally when you use regex++ it is only necessary for you to add the + <boost> root director to your list of include directories for that + project. It is not necessary for you to manually add a .lib file to the + project; the headers will automatically select the correct .lib file for your + build mode and tell the linker to include it. There is one caveat however: the + library can not tell the difference between VCL and non-VCL enabled builds when + building a GUI application from the command line, if you build from the command + line with the 5.5 command line tools then you must define the pre-processor + symbol _NO_VCL in order to ensure that the correct link libraries are selected: + the C++ Builder IDE normally sets this automatically. Hint, users of the 5.5 + command line tools may want to add a -D_NO_VCL to bcc32.cfg in order to set + this option permanently. +

+

If you would prefer to do a static link to the regex libraries even when using + the dll runtime then define BOOST_REGEX_STATIC_LINK, and if you want to + suppress automatic linking altogether (and supply your own custom build of the + lib) then define BOOST_REGEX_NO_LIB.

+

If you are building with C++ Builder 6, you will find that + <boost/regex.hpp> can not be used in a pre-compiled header (the actual + problem is in <locale> which gets included by <boost/regex.hpp>), + if this causes problems for you, then try defining BOOST_NO_STD_LOCALE when + building, this will disable some features throughout boost, but may save you a + lot in compile times!

+

Microsoft Visual C++ 6 and 7

+

You need version 6 of MSVC to build this library. If you are using VC5 then you + may want to look at one of the previous releases of this + library +

+

Open up a command prompt, which has the necessary MSVC environment variables + defined (for example by using the batch file Vcvars32.bat installed by the + Visual Studio installation), and change to the <boost>\libs\regex\build + directory. +

+

Select the correct makefile - vc6.mak for "vanilla" Visual C++ 6 or + vc6-stlport.mak if you are using STLPort.

+

Invoke the makefile like this:

+

nmake -fvc6.mak

+

You will now have a collection of lib and dll files in a "vc6" subdirectory, to + install these into your development system use:

+

nmake -fvc6.mak install

+

The lib files will be copied to your <VC6>\lib directory and the dll + files to <VC6>\bin, where <VC6> is the root of your Visual C++ 6 + installation.

+

You can delete all the temporary files created during the build (excluding lib + and dll files) using:

+

nmake -fvc6.mak clean +

+

Finally when you use regex++ it is only necessary for you to add the + <boost> root directory to your list of include directories for that + project. It is not necessary for you to manually add a .lib file to the + project; the headers will automatically select the correct .lib file for your + build mode and tell the linker to include it. +

+

Note that if you want to statically link to the regex library when using the + dynamic C++ runtime, define BOOST_REGEX_STATIC_LINK when building your project + (this only has an effect for release builds). If you want to add the source + directly to your project then define BOOST_REGEX_NO_LIB to disable automatic + library selection.

+

Important: there have been some reports of + compiler-optimization bugs affecting this library, (particularly with VC6 + versions prior to service patch 5) the workaround is to build the library using + /Oityb1 rather than /O2. That is to use all optimization settings except /Oa. + This problem is reported to affect some standard library code as well (in fact + I'm not sure if the problem is with the regex code or the underlying standard + library), so it's probably worthwhile applying this workaround in normal + practice in any case.

+

Note: if you have replaced the C++ standard library that comes with VC6, then + when you build the library you must ensure that the environment variables + "INCLUDE" and "LIB" have been updated to reflect the include and library paths + for the new library - see vcvars32.bat (part of your Visual Studio + installation) for more details. Alternatively if STLPort is in c:/stlport then + you could use:

+

nmake INCLUDES="-Ic:/stlport/stlport" XLFLAGS="/LIBPATH:c:/stlport/lib" + -fvc6-stlport.mak

+

If you are building with the full STLPort v4.x, then use the vc6-stlport.mak + file provided and set the environment variable STLPORT_PATH to point to the + location of your STLport installation (Note that the full STLPort libraries + appear not to support single-thread static builds). +
+   +
+   +

+

GCC(2.95 and 3.x) +

+

There is a conservative makefile for the g++ compiler. From the command prompt + change to the <boost>/libs/regex/build directory and type: +

+

make -fgcc.mak +

+

At the end of the build process you should have a gcc sub-directory containing + release and debug versions of the library (libboost_regex.a and + libboost_regex_debug.a). When you build projects that use regex++, you will + need to add the boost install directory to your list of include paths and add + <boost>/libs/regex/build/gcc/libboost_regex.a to your list of library + files. +

+

There is also a makefile to build the library as a shared library:

+

make -fgcc-shared.mak

+

which will build libboost_regex.so and libboost_regex_debug.so.

+

Both of the these makefiles support the following environment variables:

+

CXXFLAGS: extra compiler options - note that this applies to both the debug and + release builds.

+

INCLUDES: additional include directories.

+

LDFLAGS: additional linker options.

+

LIBS: additional library files.

+

For the more adventurous there is a configure script in + <boost>/libs/config; see the config library + documentation.

+

Sun Workshop 6.1

+

There is a makefile for the sun (6.1) compiler (C++ version 3.12). From the + command prompt change to the <boost>/libs/regex/build directory and type: +

+

dmake -f sunpro.mak +

+

At the end of the build process you should have a sunpro sub-directory + containing single and multithread versions of the library (libboost_regex.a, + libboost_regex.so, libboost_regex_mt.a and libboost_regex_mt.so). When you + build projects that use regex++, you will need to add the boost install + directory to your list of include paths and add + <boost>/libs/regex/build/sunpro/ to your library search path. +

+

Both of the these makefiles support the following environment variables:

+

CXXFLAGS: extra compiler options - note that this applies to both the single + and multithreaded builds.

+

INCLUDES: additional include directories.

+

LDFLAGS: additional linker options.

+

LIBS: additional library files.

+

LIBSUFFIX: a suffix to mangle the library name with (defaults to nothing).

+

This makefile does not set any architecture specific options like -xarch=v9, + you can set these by defining the appropriate macros, for example:

+

dmake CXXFLAGS="-xarch=v9" LDFLAGS="-xarch=v9" LIBSUFFIX="_v9" -f sunpro.mak

+

will build v9 variants of the regex library named libboost_regex_v9.a etc.

+

Other compilers: +

+

There is a generic makefile (generic.mak) + provided in <boost-root>/libs/regex/build - see that makefile for details + of environment variables that need to be set before use. Alternatively you can + using the Jam based build system. If + you need to configure the library for your platform, then refer to the + config library documentation + . +

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/introduction.html b/doc/introduction.html new file mode 100644 index 00000000..cd00847a --- /dev/null +++ b/doc/introduction.html @@ -0,0 +1,176 @@ + + + + Boost.Regex: Introduction + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Introduction

+
+

Boost.Regex Index

+
+

+
+

+

Regular expressions are a form of pattern-matching that are often used in text + processing; many users will be familiar with the Unix utilities grep, sed + and awk, and the programming language Perl, each of which make + extensive use of regular expressions. Traditionally C++ users have been limited + to the POSIX C API's for manipulating regular expressions, and while regex++ + does provide these API's, they do not represent the best way to use the + library. For example regex++ can cope with wide character strings, or search + and replace operations (in a manner analogous to either sed or Perl), something + that traditional C libraries can not do.

+

The class boost::basic_regex is the key class in + this library; it represents a "machine readable" regular expression, and is + very closely modeled on std::basic_string, think of it as a string plus the + actual state-machine required by the regular expression algorithms. Like + std::basic_string there are two typedefs that are almost always the means by + which this class is referenced:

+
namespace boost{
+
+template <class charT, 
+          class traits = regex_traits<charT>, 
+          class Allocator = std::allocator<charT> >
+class basic_regex;
+
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+
+}
+

To see how this library can be used, imagine that we are writing a credit card + processing application. Credit card numbers generally come as a string of + 16-digits, separated into groups of 4-digits, and separated by either a space + or a hyphen. Before storing a credit card number in a database (not necessarily + something your customers will appreciate!), we may want to verify that the + number is in the correct format. To match any digit we could use the regular + expression [0-9], however ranges of characters like this are actually locale + dependent. Instead we should use the POSIX standard form [[:digit:]], or the + regex++ and Perl shorthand for this \d (note that many older libraries tended + to be hard-coded to the C-locale, consequently this was not an issue for them). + That leaves us with the following regular expression to validate credit card + number formats:

+

(\d{4}[- ]){3}\d{4}

+

Here the parenthesis act to group (and mark for future reference) + sub-expressions, and the {4} means "repeat exactly 4 times". This is an example + of the extended regular expression syntax used by Perl, awk and egrep. Regex++ + also supports the older "basic" syntax used by sed and grep, but this is + generally less useful, unless you already have some basic regular expressions + that you need to reuse.

+

Now let's take that expression and place it in some C++ code to validate the + format of a credit card number:

+
bool validate_card_format(const std::string s)
+{
+   static const boost::regex e("(\\d{4}[- ]){3}\\d{4}");
+   return regex_match(s, e);
+}
+

Note how we had to add some extra escapes to the expression: remember that the + escape is seen once by the C++ compiler, before it gets to be seen by the + regular expression engine, consequently escapes in regular expressions have to + be doubled up when embedding them in C/C++ code. Also note that all the + examples assume that your compiler supports Koenig lookup, if yours doesn't + (for example VC6), then you will have to add some boost:: prefixes to some of + the function calls in the examples.

+

Those of you who are familiar with credit card processing, will have realized + that while the format used above is suitable for human readable card numbers, + it does not represent the format required by online credit card systems; these + require the number as a string of 16 (or possibly 15) digits, without any + intervening spaces. What we need is a means to convert easily between the two + formats, and this is where search and replace comes in. Those who are familiar + with the utilities sed and Perl will already be ahead here; we + need two strings - one a regular expression - the other a "format + string" that provides a description of the text to replace the match + with. In regex++ this search and replace operation is performed with the + algorithm regex_replace, for our credit card example we can write two algorithms + like this to provide the format conversions:

+
// match any format with the regular expression:
+const boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z");
+const std::string machine_format("\\1\\2\\3\\4");
+const std::string human_format("\\1-\\2-\\3-\\4");
+
+std::string machine_readable_card_number(const std::string s)
+{
+   return regex_replace(s, e, machine_format, boost::match_default | boost::format_sed);
+}
+
+std::string human_readable_card_number(const std::string s)
+{
+   return regex_replace(s, e, human_format, boost::match_default | boost::format_sed);
+}
+

Here we've used marked sub-expressions in the regular expression to split out + the four parts of the card number as separate fields, the format string then + uses the sed-like syntax to replace the matched text with the reformatted + version.

+

In the examples above, we haven't directly manipulated the results of a regular + expression match, however in general the result of a match contains a number of + sub-expression matches in addition to the overall match. When the library needs + to report a regular expression match it does so using an instance of the class + match_results, as before there are typedefs of this class for the most + common cases: +

+
namespace boost{
+typedef match_results<const char*> cmatch;
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<std::string::const_iterator> smatch;
+typedef match_results<std::wstring::const_iterator> wsmatch; 
+}
+

The algorithms regex_search and + regex_grep (i.e. finding all matches in a string) make use of + match_results to report what matched.

+

Note that these algorithms are not restricted to searching regular C-strings, + any bidirectional iterator type can be searched, allowing for the possibility + of seamlessly searching almost any kind of data. +

+

For search and replace operations in addition to the algorithm + regex_replace that we have already seen, the algorithm + regex_format takes the result of a match and a format string, and + produces a new string by merging the two.

+

For those that dislike templates, there is a high level wrapper class RegEx + that is an encapsulation of the lower level template code - it provides a + simplified interface for those that don't need the full power of the library, + and supports only narrow characters, and the "extended" regular expression + syntax. +

+

The POSIX API functions: regcomp, regexec, regfree + and regerror, are available in both narrow character and Unicode versions, and + are provided for those who need compatibility with these API's. +

+

Finally, note that the library now has run-time localization + support, and recognizes the full POSIX regular expression syntax - including + advanced features like multi-character collating elements and equivalence + classes - as well as providing compatibility with other regular expression + libraries including GNU and BSD4 regex packages, and to a more limited extent + Perl 5. +

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998-2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + + + diff --git a/doc/localisation.html b/doc/localisation.html new file mode 100644 index 00000000..e4184fd8 --- /dev/null +++ b/doc/localisation.html @@ -0,0 +1,1032 @@ + + + + +Boost.Regex: Localisation + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Localisation

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Boost.regex provides extensive support for run-time +localization, the localization model used can be split into two +parts: front-end and back-end.

+ +

Front-end localization deals with everything which the user sees +- error messages, and the regular expression syntax itself. For +example a French application could change [[:word:]] to [[:mot:]] +and \w to \m. Modifying the front end locale requires active +support from the developer, by providing the library with a message +catalogue to load, containing the localized strings. Front-end +locale is affected by the LC_MESSAGES category only.

+ +

Back-end localization deals with everything that occurs after +the expression has been parsed - in other words everything that the +user does not see or interact with directly. It deals with case +conversion, collation, and character class membership. The back-end +locale does not require any intervention from the developer - the +library will acquire all the information it requires for the +current locale from the underlying operating system / run time +library. This means that if the program user does not interact with +regular expressions directly - for example if the expressions are +embedded in your C++ code - then no explicit localization is +required, as the library will take care of everything for you. For +example embedding the expression [[:word:]]+ in your code will +always match a whole word, if the program is run on a machine with, +for example, a Greek locale, then it will still match a whole word, +but in Greek characters rather than Latin ones. The back-end locale +is affected by the LC_TYPE and LC_COLLATE categories.

+ +

There are three separate localization mechanisms supported by +boost.regex:

+ +

Win32 localization model.

+ +

This is the default model when the library is compiled under +Win32, and is encapsulated by the traits class w32_regex_traits. +When this model is in effect there is a single global locale as +defined by the user's control panel settings, and returned by +GetUserDefaultLCID. All the settings used by boost.regex are +acquired directly from the operating system bypassing the C run +time library. Front-end localization requires a resource dll, +containing a string table with the user-defined strings. The traits +class exports the function:

+ +

static std::string set_message_catalogue(const std::string& +s);

+ +

which needs to be called with a string identifying the name of +the resource dll, before your code compiles any regular +expressions (but not necessarily before you construct any +basic_regex instances):

+ +

+boost::w32_regex_traits<char>::set_message_catalogue("mydll.dll");

+ +

Note that this API sets the dll name for both the narrow +and wide character specializations of w32_regex_traits.

+ +

This model does not currently support thread specific locales +(via SetThreadLocale under Windows NT), the library provides full +Unicode support under NT, under Windows 9x the library degrades +gracefully - characters 0 to 255 are supported, the remainder are +treated as "unknown" graphic characters.

+ +

C localization model.

+ +

This is the default model when the library is compiled under an +operating system other than Win32, and is encapsulated by the +traits class c_regex_traits, Win32 users can force this +model to take effect by defining the pre-processor symbol +BOOST_REGEX_USE_C_LOCALE. When this model is in effect there is a +single global locale, as set by setlocale. All settings are +acquired from your run time library, consequently Unicode support +is dependent upon your run time library implementation. Front end +localization requires a POSIX message catalogue. The traits class +exports the function:

+ +

static std::string set_message_catalogue(const std::string& +s);

+ +

which needs to be called with a string identifying the name of +the message catalogue, before your code compiles any regular +expressions (but not necessarily before you construct any +basic_regex instances):

+ +

+boost::c_regex_traits<char>::set_message_catalogue("mycatalogue");

+ +

Note that this API sets the dll name for both the narrow +and wide character specializations of c_regex_traits. If your run +time library does not support POSIX message catalogues, then you +can either provide your own implementation of <nl_types.h> or +define BOOST_RE_NO_CAT to disable front-end localization via +message catalogues.

+ +

Note that calling setlocale invalidates all compiled +regular expressions, calling setlocale(LC_ALL, "C") will +make this library behave equivalent to most traditional regular +expression libraries including version 1 of this library.

+ +

C++ localization model.

+ +

This model is only in effect if the library is built with the +pre-processor symbol BOOST_REGEX_USE_CPP_LOCALE defined. When this +model is in effect each instance of basic_regex<> has its own +instance of std::locale, class basic_regex<> also has a +member function imbue which allows the locale for the +expression to be set on a per-instance basis. Front end +localization requires a POSIX message catalogue, which will be +loaded via the std::messages facet of the expression's locale, the +traits class exports the symbol:

+ +

static std::string set_message_catalogue(const std::string& +s);

+ +

which needs to be called with a string identifying the name of +the message catalogue, before your code compiles any regular +expressions (but not necessarily before you construct any +basic_regex instances):

+ +

+boost::cpp_regex_traits<char>::set_message_catalogue("mycatalogue");

+ +

Note that calling basic_regex<>::imbue will invalidate any +expression currently compiled in that instance of +basic_regex<>. This model is the one which closest fits the +ethos of the C++ standard library, however it is the model which +will produce the slowest code, and which is the least well +supported by current standard library implementations, for example +I have yet to find an implementation of std::locale which supports +either message catalogues, or locales other than "C" or +"POSIX".

+ +

Finally note that if you build the library with a non-default +localization model, then the appropriate pre-processor symbol +(BOOST_REGEX_USE_C_LOCALE or BOOST_REGEX_USE_CPP_LOCALE) must be +defined both when you build the support library, and when you +include <boost/regex.hpp> or <boost/cregex.hpp> in your +code. The best way to ensure this is to add the #define to +<boost/regex/user.hpp>.

+ +

Providing a message catalogue:

+ +

In order to localize the front end of the library, you need to +provide the library with the appropriate message strings contained +either in a resource dll's string table (Win32 model), or a POSIX +message catalogue (C or C++ models). In the latter case the +messages must appear in message set zero of the catalogue. The +messages and their id's are as follows:
+  

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Message idMeaningDefault value 
 101The character used to start a +sub-expression."(" 
 102The character used to end a +sub-expression declaration.")" 
 103The character used to denote an end of +line assertion."$" 
 104The character used to denote the start +of line assertion."^" 
 105The character used to denote the +"match any character expression"."." 
 106The match zero or more times +repetition operator."*" 
 107The match one or more repetition +operator."+" 
 108The match zero or one repetition +operator."?" 
 109The character set opening +character."[" 
 110The character set closing +character."]" 
 111The alternation operator."|" 
 112The escape character."\\" 
 113The hash character (not currently +used)."#" 
 114The range operator."-" 
 115The repetition operator opening +character."{" 
 116The repetition operator closing +character."}" 
 117The digit characters."0123456789" 
 118The character which when preceded by +an escape character represents the word boundary assertion."b" 
 119The character which when preceded by +an escape character represents the non-word boundary +assertion."B" 
 120The character which when preceded by +an escape character represents the word-start boundary +assertion."<" 
 121The character which when preceded by +an escape character represents the word-end boundary +assertion.">" 
 122The character which when preceded by +an escape character represents any word character."w" 
 123The character which when preceded by +an escape character represents a non-word character."W" 
 124The character which when preceded by +an escape character represents a start of buffer assertion."`A" 
 125The character which when preceded by +an escape character represents an end of buffer assertion."'z" 
 126The newline character."\n" 
 127The comma separator."," 
 128The character which when preceded by +an escape character represents the bell character."a" 
 129The character which when preceded by +an escape character represents the form feed character."f" 
 130The character which when preceded by +an escape character represents the newline character."n" 
 131The character which when preceded by +an escape character represents the carriage return character."r" 
 132The character which when preceded by +an escape character represents the tab character."t" 
 133The character which when preceded by +an escape character represents the vertical tab character."v" 
 134The character which when preceded by +an escape character represents the start of a hexadecimal character +constant."x" 
 135The character which when preceded by +an escape character represents the start of an ASCII escape +character."c" 
 136The colon character.":" 
 137The equals character."=" 
 138The character which when preceded by +an escape character represents the ASCII escape character."e" 
 139The character which when preceded by +an escape character represents any lower case character."l" 
 140The character which when preceded by +an escape character represents any non-lower case character."L" 
 141The character which when preceded by +an escape character represents any upper case character."u" 
 142The character which when preceded by +an escape character represents any non-upper case character."U" 
 143The character which when preceded by +an escape character represents any space character."s" 
 144The character which when preceded by +an escape character represents any non-space character."S" 
 145The character which when preceded by +an escape character represents any digit character."d" 
 146The character which when preceded by +an escape character represents any non-digit character."D" 
 147The character which when preceded by +an escape character represents the end quote operator."E" 
 148The character which when preceded by +an escape character represents the start quote operator."Q" 
 149The character which when preceded by +an escape character represents a Unicode combining character +sequence."X" 
 150The character which when preceded by +an escape character represents any single character."C" 
 151The character which when preceded by +an escape character represents end of buffer operator."Z" 
 152The character which when preceded by +an escape character represents the continuation assertion."G" 
 153The character which when preceeded by (? indicates a zero width +negated forward lookahead assert.! 
+ +
+
+ + +

Custom error messages are loaded as follows: 

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Message IDError message IDDefault string 
 201REG_NOMATCH"No match" 
 202REG_BADPAT"Invalid regular expression" 
 203REG_ECOLLATE"Invalid collation character" 
 204REG_ECTYPE"Invalid character class name" 
 205REG_EESCAPE"Trailing backslash" 
 206REG_ESUBREG"Invalid back reference" 
 207REG_EBRACK"Unmatched [ or [^" 
 208REG_EPAREN"Unmatched ( or \\(" 
 209REG_EBRACE"Unmatched \\{" 
 210REG_BADBR"Invalid content of \\{\\}" 
 211REG_ERANGE"Invalid range end" 
 212REG_ESPACE"Memory exhausted" 
 213REG_BADRPT"Invalid preceding regular +expression" 
 214REG_EEND"Premature end of regular +expression" 
 215REG_ESIZE"Regular expression too big" 
 216REG_ERPAREN"Unmatched ) or \\)" 
 217REG_EMPTY"Empty expression" 
 218REG_E_UNKNOWN"Unknown error" 
+ +
+
+ + +

Custom character class names are loaded as followed: 

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Message IDDescriptionEquivalent default class name 
 300The character class name for +alphanumeric characters."alnum" 
 301The character class name for +alphabetic characters."alpha" 
 302The character class name for control +characters."cntrl" 
 303The character class name for digit +characters."digit" 
 304The character class name for graphics +characters."graph" 
 305The character class name for lower +case characters."lower" 
 306The character class name for printable +characters."print" 
 307The character class name for +punctuation characters."punct" 
 308The character class name for space +characters."space" 
 309The character class name for upper +case characters."upper" 
 310The character class name for +hexadecimal characters."xdigit" 
 311The character class name for blank +characters."blank" 
 312The character class name for word +characters."word" 
 313The character class name for Unicode +characters."unicode" 
+ +
+
+ + +

Finally, custom collating element names are loaded starting from +message id 400, and terminating when the first load thereafter +fails. Each message looks something like: "tagname string" where +tagname is the name used inside [[.tagname.]] and +string is the actual text of the collating element. Note that +the value of collating element [[.zero.]] is used for the +conversion of strings to numbers - if you replace this with another +value then that will be used for string parsing - for example use +the Unicode character 0x0660 for [[.zero.]] if you want to use +Unicode Arabic-Indic digits in your regular expressions in place of +Latin digits.

+ +

Note that the POSIX defined names for character classes and +collating elements are always available - even if custom names are +defined, in contrast, custom error messages, and custom syntax +messages replace the default ones.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/match_flag_type.html b/doc/match_flag_type.html new file mode 100644 index 00000000..0e89736a --- /dev/null +++ b/doc/match_flag_type.html @@ -0,0 +1,330 @@ + + + + +Boost.Regex: match_flag_type + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

match_flag_type

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Synopsis

+ +

The type match_flag_type is an implementation +defined bitmask type (17.3.2.1.2) that controls how a regular +expression is matched against a character sequence.

+ +
+namespace std{ namespace regex_constants{
+
+typedef bitmask_type match_flag_type;
+
+static const match_flag_type match_default = 0;
+static const match_flag_type match_not_bob;
+static const match_flag_type match_not_eob;
+static const match_flag_type match_not_bol;
+static const match_flag_type match_not_eol;
+static const match_flag_type match_not_bow;
+static const match_flag_type match_not_eow;
+static const match_flag_type match_any;
+static const match_flag_type match_not_null;
+static const match_flag_type match_continuous;
+static const match_flag_type match_partial;
+static const match_flag_type match_prev_avail;
+static const match_flag_type match_not_dot_newline;
+static const match_flag_type match_not_dot_null;
+
+static const match_flag_type format_default = 0;
+static const match_flag_type format_sed;
+static const match_flag_type format_perl;
+static const match_flag_type format_no_copy;
+static const match_flag_type format_first_only;
+static const match_flag_type format_all;
+
+} // namespace regex_constants
+} // namespace std
+
+ +

Description

+ +

The type match_flag_type is an implementation +defined bitmask type (17.3.2.1.2). When matching a regular +expression against a sequence of characters [first, last) then +setting its elements has the effects listed in the table below:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Effect if set

+
+

match_default

+
+

Specifies that matching of regular expressions proceeds without +any modification of the normal rules used in ECMA-262, ECMAScript +Language Specification, Chapter 15 part 10, RegExp (Regular +Expression) Objects (FWD.1)

+
match_not_bobSpecifies that the expression "\A" +should not match against the sub-sequence [first,first).
match_not_eobSpecifies that the expressions "\z" +and "\Z" should not match against the sub-sequence +[last,last).
+

match_not_bol

+
+

Specifies that the expression "^" should not be matched against +the sub-sequence [first,first).

+
+

match_not_eol

+
+

Specifies that the expression "$" should not be matched against +the sub-sequence [last,last).

+
+

match_not_bow

+
+

Specifies that the expression "\b" should not be matched against +the sub-sequence [first,first).

+
+

match_not_eow

+
+

Specifies that the expression "\b" should not be matched against +the sub-sequence [last,last).

+
+

match_any

+
+

Specifies that if more than one match is possible then any match +is an acceptable result.

+
+

match_not_null

+
+

Specifies that the expression can not be matched against an +empty sequence.

+
+

match_continuous

+
+

Specifies that the expression must match a sub-sequence that +begins at first.

+
+

match_partial

+
+

Specifies that if no match can be found, then it is acceptable +to return a match [from, last) where from!=last, if there exists +some sequence of characters [from,to) of which [from,last) is a +prefix, and which would result in a full match.

+
+

match_prev_avail

+
+

Specifies that --first is a valid iterator +position, when this flag is set then the flags +match_not_bol and match_not_bow are ignored by +the regular expression algorithms (RE.7) and iterators (RE.8).

+
match_not_dot_newlineSpecifies that the expression "." does +not match a newline character.
match_not_dot_nullSpecified that the expression "." does +not match a character null '\0'.
+

format_default

+
+

Specifies that when a regular expression match is to be replaced +by a new string, that the new string is constructed using the rules +used by the ECMAScript replace function in ECMA-262, ECMAScript +Language Specification, Chapter 15 part 5.4.11 +String.prototype.replace. (FWD.1). In addition during search and +replace operations then all non-overlapping occurrences of the +regular expression are located and replaced, and sections of the +input that did not match the expression, are copied unchanged to +the output string.

+
+

format_sed

+
+

Specifies that when a regular expression match is to be replaced +by a new string, that the new string is constructed using the rules +used by the Unix sed utility in IEEE Std 1003.1-2001, Portable +Operating SystemInterface (POSIX ), Shells and Utilities..

+
+

format_perl

+
+

Specifies that when a regular expression match is to be replaced +by a new string, that the new string is constructed using an +implementation defined superset of the rules used by the ECMAScript +replace function in ECMA-262, ECMAScript Language Specification, +Chapter 15 part 5.4.11 String.prototype.replace (FWD.1).

+
format_allSpecifies that all syntax +extensions are enabled, including conditional +(?ddexpression1:expression2) replacements.
+

format_no_copy

+
+

When specified during a search and replace operation, then +sections of the character container sequence being searched that do +match the regular expression, are not copied to the output +string.

+
+

format_first_only

+
+

When specified during a search and replace operation, then only +the first occurrence of the regular expression is replaced.

+
+ +
+
+ + +

+ +
+
+
+ + +

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/match_results.html b/doc/match_results.html new file mode 100644 index 00000000..9acc3afc --- /dev/null +++ b/doc/match_results.html @@ -0,0 +1,511 @@ + + + + +Boost.Regex: class match_results + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

class match_results

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Contents

+ +
+
Synopsis
+ +
Description
+
+ +

Synopsis

+ +

#include <boost/regex.hpp>

+ +

Regular expressions are different from many simple +pattern-matching algorithms in that as well as finding an overall +match they can also produce sub-expression matches: each +sub-expression being delimited in the pattern by a pair of +parenthesis (...). There has to be some method for reporting +sub-expression matches back to the user: this is achieved this by +defining a class match_results that acts as an indexed +collection of sub-expression matches, each sub-expression match +being contained in an object of type +sub_match .

+ +

Template class match_results denotes a collection of character +sequences representing the result of a regular expression match. +Objects of type match_results are passed to the algorithms regex_match and +regex_search, and are returned by the iterator regex_iterator .  Storage for the +collection is allocated and freed as necessary by the member +functions of class match_results.

+ +

The template class match_results conforms to the requirements of +a Sequence, as specified in (lib.sequence.reqmts), except that only +operations defined for const-qualified Sequences are supported.

+ +

Class template match_results is most commonly used as one of the +typedefs cmatch, wcmatch, smatch, or wsmatch:

+ +
+template <class BidirectionalIterator,
+          class Allocator = allocator<sub_match<BidirectionalIterator> >
+class match_results;
+
+typedef match_results<const char*> cmatch;
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<string::const_iterator> smatch;
+typedef match_results<wstring::const_iterator> wsmatch;
+
+template <class BidirectionalIterator,
+          class Allocator = allocator<sub_match<BidirectionalIterator> >
+class match_results
+{ 
+public: 
+   typedef          sub_match<BidirectionalIterator>                        value_type;
+   typedef          const value_type&                                       const_reference;
+   typedef          const_reference                                         reference;
+   typedef          implementation defined                                  const_iterator;
+   typedef          const_iterator                                          iterator;
+   typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+   typedef typename Allocator::size_type                                    size_type;
+   typedef          Allocator                                               allocator_type;
+   typedef typename iterator_traits<BidirectionalIterator>::value_type      char_type;
+   typedef          basic_string<char_type>                                 string_type;
+
+   // construct/copy/destroy:
+   explicit match_results(const Allocator& a = Allocator());
+   match_results(const match_results& m);
+   match_results& operator=(const match_results& m); 
+   ~match_results();
+
+   // size:
+   size_type size() const;
+   size_type max_size() const;
+   bool empty() const;
+   // element access:
+   difference_type length(int sub = 0) const;
+   difference_type position(unsigned int sub = 0) const;
+   string_type str(int sub = 0) const;
+   const_reference operator[](int n) const;
+
+   const_reference prefix() const;
+
+   const_reference suffix() const;
+   const_iterator begin() const;
+   const_iterator end() const;
+   // format:
+   template <class OutputIterator>
+   OutputIterator format(OutputIterator out,
+                         const string_type& fmt,
+                         match_flag_type flags = format_default) const;
+   string_type format(const string_type& fmt,
+                      match_flag_type flags = format_default) const;
+
+   allocator_type get_allocator() const;
+   void swap(match_results& that);
+};
+
+template <class BidirectionalIterator, class Allocator>
+bool operator == (const match_results<BidirectionalIterator, Allocator>& m1,
+                  const match_results<BidirectionalIterator, Allocator>& m2);
+template <class BidirectionalIterator, class Allocator>
+bool operator != (const match_results<BidirectionalIterator, Allocator>& m1,
+                  const match_results<BidirectionalIterator, Allocator>& m2);
+
+template <class charT, class traits, class BidirectionalIterator, class Allocator>
+basic_ostream<charT, traits>&
+   operator << (basic_ostream<charT, traits>& os,
+                const match_results<BidirectionalIterator, Allocator>& m);
+
+template <class BidirectionalIterator, class Allocator>
+void swap(match_results<BidirectionalIterator, Allocator>& m1,
+          match_results<BidirectionalIterator, Allocator>& m2);
+
+ +

Description

+ +

match_results constructors

+ +

In all match_results constructors, a copy of the +Allocator argument is used for any memory allocation performed by +the constructor or member functions during the lifetime of the +object.

+ +
+match_results(const Allocator& a = Allocator());
+
+ + +

Effects: Constructs an object of class match_results. The +postconditions of this function are indicated in the table:

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value

+
+

empty()

+
+

true

+
+

size()

+
+

0

+
+

str()

+
+

basic_string<charT>()

+
+
+ +

 

+ +
+match_results(const match_results& m);
+
+ + +

Effects: Constructs an object of class match_results, as +a copy of m.

+ +
+match_results& operator=(const match_results& m);
+
+ + +

Effects: Assigns m to *this. The postconditions of this +function are indicated in the table:

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value

+
+

empty()

+
+

m.empty().

+
+

size()

+
+

m.size().

+
+

str(n)

+
+

m.str(n) for all integers n < m.size().

+
+

prefix()

+
+

m.prefix().

+
+

suffix()

+
+

m.suffix().

+
+

(*this)[n]

+
+

m[n] for all integers n < m.size().

+
+

length(n)

+
+

m.length(n) for all integers n < m.size().

+
+

position(n)

+
+

m.position(n) for all integers n < m.size().

+
+
+ +

match_results size

+ +
+size_type size()const;
+
+ + +

Effects: Returns the number of sub_match elements stored +in *this.

+ +
+size_type max_size()const;
+
+ + +

Effects: Returns the maximum number of sub_match elements +that can be stored in *this.

+ +
+bool empty()const;
+
+ + +

Effects: Returns size() == 0.

+ +

match_results element access

+ +
+difference_type length(int sub = 0)const;
+
+ + +

Effects: Returns (*this)[sub].length().

+ +
+difference_type position(unsigned int sub = 0)const;
+
+ + +

Effects: Returns std::distance(prefix().first, +(*this)[sub].first).

+ +
+string_type str(int sub = 0)const;
+
+ + +

Effects: Returns +string_type((*this)[sub]).

+ +
+const_reference operator[](int n) const;
+
+ + +

Effects: Returns a reference to the +sub_match object representing the character sequence that +matched marked sub-expression n. If n == 0 then +returns a reference to a sub_match object representing +the character sequence that matched the whole regular +expression.

+ +
+const_reference prefix()const;
+
+ + +

Effects: Returns a reference to the +sub_match object representing the character sequence from +the start of the string being matched/searched, to the start of the +match found.

+ +
+const_reference suffix()const;
+
+ + +

Effects: Returns a reference to the +sub_match object representing the character sequence from +the end of the match found to the end of the string being +matched/searched.

+ +
+const_iterator begin()const;
+
+ + +

Effects: Returns a starting iterator that enumerates over +all the marked sub-expression matches stored in *this.

+ +
+const_iterator end()const;
+
+ + +

Effects: Returns a terminating iterator that enumerates +over all the marked sub-expression matches stored in *this.

+ +

match_results reformatting

+ +
+template <class OutputIterator>
+OutputIterator format(OutputIterator out,
+                      const string_type& fmt,
+                      match_flag_type flags = format_default);
+
+ + +

Requires: The type OutputIterator conforms to the Output +Iterator requirements (24.1.2).

+ + +

Effects: Copies the character sequence [fmt.begin(), +fmt.end()) to OutputIterator out. For each format +specifier or escape sequence in fmt, replace that sequence +with either the character(s) it represents, or the sequence of +characters within *this to which it refers. The bitmasks specified +in flags determines what +format specifiers or escape sequences +are recognized, by default this is the format used by ECMA-262, +ECMAScript Language Specification, Chapter 15 part 5.4.11 +String.prototype.replace.

+ + +

Returns: out.

+ +
+string_type format(const string_type& fmt,
+                   match_flag_type flags = format_default);
+
+ + +

Effects: Returns a copy of the string fmt. For +each format specifier or escape sequence in fmt, replace +that sequence with either the character(s) it represents, or the +sequence of characters within *this to which it refers. The +bitmasks specified in +flags determines what format +specifiers or escape sequences are recognized, by default this +is the format used by ECMA-262, ECMAScript Language Specification, +Chapter 15 part 5.4.11 String.prototype.replace.

+ +
+allocator_type get_allocator()const;
+
+ + +

Effects: Returns a copy of the Allocator that was passed +to the object's constructor.

+ +
+void swap(match_results& that);
+
+ + +

Effects: Swaps the contents of the two sequences.

+ + +

Postcondition: *this contains the sequence +of matched sub-expressions that were in that, +that contains the sequence of matched sub-expressions that +were in *this.

+ + +

Complexity: constant time.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/partial_matches.html b/doc/partial_matches.html new file mode 100644 index 00000000..3f4d2a53 --- /dev/null +++ b/doc/partial_matches.html @@ -0,0 +1,185 @@ + + + + Boost.Regex: Partial Matches + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Partial Matches

+
+

Boost.Regex Index

+
+

+
+

+

The match-flag match_partial can + be passed to the following algorithms: regex_match, + regex_search, and regex_grep. + When used it indicates that partial as well as full matches should be found. A + partial match is one that matched one or more characters at the end of the text + input, but did not match all of the regular expression (although it may have + done so had more input been available). Partial matches are typically used when + either validating data input (checking each character as it is entered on the + keyboard), or when searching texts that are either too long to load into memory + (or even into a memory mapped file), or are of indeterminate length (for + example the source may be a socket or similar). Partial and full matches can be + differentiated as shown in the following table (the variable M represents an + instance of match_results<> as filled in + by regex_match, regex_search or regex_grep):
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 ResultM[0].matchedM[0].firstM[0].second
No matchFalseUndefinedUndefinedUndefined
Partial matchTrueFalseStart of partial match.End of partial match (end of text).
Full matchTrueTrueStart of full match.End of full match.
+

+

The following example + tests to see whether the text could be a valid credit card number, as the user + presses a key, the character entered would be added to the string being built + up, and passed to is_possible_card_number. If this returns true + then the text could be a valid card number, so the user interface's OK button + would be enabled. If it returns false, then this is not yet a valid card + number, but could be with more input, so the user interface would disable the + OK button. Finally, if the procedure throws an exception the input could never + become a valid number, and the inputted character must be discarded, and a + suitable error indication displayed to the user.

+
#include <string>
+#include <iostream>
+#include <boost/regex.hpp>
+
+boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})");
+
+bool is_possible_card_number(const std::string& input)
+{
+   //
+   // return false for partial match, true for full match, or throw for
+   // impossible match based on what we have so far...
+   boost::match_results<std::string::const_iterator> what;
+   if(0 == boost::regex_match(input, what, e, boost::match_default | boost::match_partial))
+   {
+      // the input so far could not possibly be valid so reject it:
+      throw std::runtime_error("Invalid data entered - this could not possibly be a valid card number");
+   }
+   // OK so far so good, but have we finished?
+   if(what[0].matched)
+   {
+      // excellent, we have a result:
+      return true;
+   }
+   // what we have so far is only a partial match...
+   return false;
+}
+

In the following example, + text input is taken from a stream containing an unknown amount of text; this + example simply counts the number of html tags encountered in the stream. The + text is loaded into a buffer and searched a part at a time, if a partial match + was encountered, then the partial match gets searched a second time as the + start of the next batch of text:

+
#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <boost/regex.hpp>
+
+// match some kind of html tag:
+boost::regex e("<[^>]*>");
+// count how many:
+unsigned int tags = 0;
+// saved position of partial match:
+char* next_pos = 0;
+
+bool grep_callback(const boost::match_results<char*>& m)
+{
+   if(m[0].matched == false)
+   {
+      // save position and return:
+      next_pos = m[0].first;
+   }
+   else
+      ++tags;
+   return true;
+}
+
+void search(std::istream& is)
+{
+   char buf[4096];
+   next_pos = buf + sizeof(buf);
+   bool have_more = true;
+   while(have_more)
+   {
+      // how much do we copy forward from last try:
+      unsigned leftover = (buf + sizeof(buf)) - next_pos;
+      // and how much is left to fill:
+      unsigned size = next_pos - buf;
+      // copy forward whatever we have left:
+      memcpy(buf, next_pos, leftover);
+      // fill the rest from the stream:
+      unsigned read = is.readsome(buf + leftover, size);
+      // check to see if we've run out of text:
+      have_more = read == size;
+      // reset next_pos:
+      next_pos = buf + sizeof(buf);
+      // and then grep:
+      boost::regex_grep(grep_callback,
+                        buf,
+                        buf + read + leftover,
+                        e,
+                        boost::match_default | boost::match_partial);
+   }
+}
+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/performance.html b/doc/performance.html new file mode 100644 index 00000000..826dd83a --- /dev/null +++ b/doc/performance.html @@ -0,0 +1,54 @@ + + + + Boost.Regex: Performance + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Performance

+
+

Boost.Regex Index

+
+

+
+

+

The performance of Boost.regex in both recursive and non-recursive modes should + be broadly comparable to other regular expression libraries: recursive mode is + slightly faster (especially where memory allocation requires thread + synchronisation), but not by much.  The following pages compare + Boost.regex with various other regular expression libraries for the following + compilers:

+

Visual Studio.Net 2003 (recursive Boost.regex + implementation).

+

Gcc 3.2 (cygwin) (non-recursive Boost.regex + implementation).

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/posix_api.html b/doc/posix_api.html new file mode 100644 index 00000000..fdc3bba3 --- /dev/null +++ b/doc/posix_api.html @@ -0,0 +1,288 @@ + + + + Boost.Regex: POSIX API Compatibility Functions + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

POSIX API Compatibility Functions

+
+

Boost.Regex Index

+
+

+
+

+
#include <boost/cregex.hpp>
+or:
+#include <boost/regex.h>
+

The following functions are available for users who need a POSIX compatible C + library, they are available in both Unicode and narrow character versions, the + standard POSIX API names are macros that expand to one version or the other + depending upon whether UNICODE is defined or not. +

+

Important: Note that all the symbols defined here are enclosed inside + namespace boost when used in C++ programs, unless you use #include + <boost/regex.h> instead - in which case the symbols are still defined in + namespace boost, but are made available in the global namespace as well.

+

The functions are defined as: +

+
extern "C" {
+int regcompA(regex_tA*, const char*, int);
+unsigned int regerrorA(int, const regex_tA*, char*, unsigned int);
+int regexecA(const regex_tA*, const char*, unsigned int, regmatch_t*, int);
+void regfreeA(regex_tA*);
+
+int regcompW(regex_tW*, const wchar_t*, int);
+unsigned int regerrorW(int, const regex_tW*, wchar_t*, unsigned int);
+int regexecW(const regex_tW*, const wchar_t*, unsigned int, regmatch_t*, int);
+void regfreeW(regex_tW*);
+
+#ifdef UNICODE
+#define regcomp regcompW
+#define regerror regerrorW
+#define regexec regexecW
+#define regfree regfreeW
+#define regex_t regex_tW
+#else
+#define regcomp regcompA
+#define regerror regerrorA
+#define regexec regexecA
+#define regfree regfreeA
+#define regex_t regex_tA
+#endif
+}
+

All the functions operate on structure regex_t, which exposes two public + members: +

+

unsigned int re_nsub this is filled in by regcomp and indicates + the number of sub-expressions contained in the regular expression. +

+

const TCHAR* re_endp points to the end of the expression to compile when + the flag REG_PEND is set. +

+

Footnote: regex_t is actually a #define - it is either regex_tA or regex_tW + depending upon whether UNICODE is defined or not, TCHAR is either char or + wchar_t again depending upon the macro UNICODE. +

+

regcomp

+

regcomp takes a pointer to a regex_t, a pointer to the expression + to compile and a flags parameter which can be a combination of: +
+   +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 REG_EXTENDEDCompiles modern regular expressions. Equivalent to + regbase::char_classes | regbase::intervals | regbase::bk_refs. 
 REG_BASICCompiles basic (obsolete) regular expression syntax. + Equivalent to regbase::char_classes | regbase::intervals | regbase::limited_ops + | regbase::bk_braces | regbase::bk_parens | regbase::bk_refs. 
 REG_NOSPECAll characters are ordinary, the expression is a + literal string. 
 REG_ICASECompiles for matching that ignores character case. 
 REG_NOSUBHas no effect in this library. 
 REG_NEWLINEWhen this flag is set a dot does not match the + newline character. 
 REG_PENDWhen this flag is set the re_endp parameter of the + regex_t structure must point to the end of the regular expression to compile. 
 REG_NOCOLLATEWhen this flag is set then locale dependent collation + for character ranges is turned off. 
 REG_ESCAPE_IN_LISTS
+ , , , +
When this flag is set, then escape sequences are + permitted in bracket expressions (character sets). 
 REG_NEWLINE_ALT When this flag is set then the newline character is + equivalent to the alternation operator |. 
 REG_PERL Compiles Perl like regular expressions. 
 REG_AWKA shortcut for awk-like behavior: REG_EXTENDED | + REG_ESCAPE_IN_LISTS 
 REG_GREPA shortcut for grep like behavior: REG_BASIC | + REG_NEWLINE_ALT 
 REG_EGREP A shortcut for egrep like behavior: + REG_EXTENDED | REG_NEWLINE_ALT 
+

+

regerror

+

regerror takes the following parameters, it maps an error code to a human + readable string: +
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
 int codeThe error code. 
 const regex_t* eThe regular expression (can be null). 
 char* bufThe buffer to fill in with the error message. 
 unsigned int buf_sizeThe length of buf. 
+

+

If the error code is OR'ed with REG_ITOA then the message that results is the + printable name of the code rather than a message, for example "REG_BADPAT". If + the code is REG_ATIO then e must not be null and e->re_pend must + point to the printable name of an error code, the return value is then the + value of the error code. For any other value of code, the return value + is the number of characters in the error message, if the return value is + greater than or equal to buf_size then regerror will have to be + called again with a larger buffer.

+

regexec

+

regexec finds the first occurrence of expression e within string buf. + If len is non-zero then *m is filled in with what matched the + regular expression, m[0] contains what matched the whole string, m[1] + the first sub-expression etc, see regmatch_t in the header file + declaration for more details. The eflags parameter can be a combination + of: +
+   +

+

+ + + + + + + + + + + + + + + + + + + +
 REG_NOTBOLParameter buf does not represent the start of + a line. 
 REG_NOTEOLParameter buf does not terminate at the end of + a line. 
 REG_STARTENDThe string searched starts at buf + pmatch[0].rm_so + and ends at buf + pmatch[0].rm_eo. 
+

+

regfree

+

Finally regfree frees all the memory that was allocated by regcomp. +

+

Footnote: this is an abridged reference to the POSIX API functions, it is + provided for compatibility with other libraries, rather than an API to be used + in new code (unless you need access from a language other than C++). This + version of these functions should also happily coexist with other versions, as + the names used are macros that expand to the actual function names. +

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/redistributables.html b/doc/redistributables.html new file mode 100644 index 00000000..884fca7a --- /dev/null +++ b/doc/redistributables.html @@ -0,0 +1,84 @@ + + + + Boost.Regex: Redistributables and Library Names + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Redistributables and Library Names

+
+

Boost.Regex Index

+
+

+
+

+

If you are using Microsoft or Borland C++ and link to a dll version of the run + time library, then you will also link to one of the dll versions of boost.regex. + While these dll's are redistributable, there are no "standard" versions, so + when installing on the users PC, you should place these in a directory private + to your application, and not in the PC's directory path. Note that if you link + to a static version of your run time library, then you will also link to a + static version of boost.regex and no dll's will need to be distributed. The + possible boost.regex dll and library names are computed according to the following + formula:
+

+

+

"boost_regex_"
+ + BOOST_LIB_TOOLSET
+ + "_"
+ + BOOST_LIB_THREAD_OPT
+ + BOOST_LIB_RT_OPT
+ + BOOST_LIB_LINK_OPT
+ + BOOST_LIB_DEBUG_OPT
+
+ These are defined as:
+
+ BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
+
+ BOOST_LIB_THREAD_OPT: "s" for single thread builds,
+ "m" for multithread builds.
+
+ BOOST_LIB_RT_OPT: "s" for static runtime,
+ "d" for dynamic runtime.
+
+ BOOST_LIB_LINK_OPT: "s" for static link,
+ "i" for dynamic link.
+
+ BOOST_LIB_DEBUG_OPT: nothing for release builds,
+ "d" for debug builds,
+ "dd" for debug-diagnostic builds (_STLP_DEBUG).

+

+ Note: you can disable automatic library selection by defining the symbol + BOOST_REGEX_NO_LIB when compiling, this is useful if you want to statically + link even though you're using the dll version of your run time library, or if + you need to debug boost.regex. +

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/reg_expression.html b/doc/reg_expression.html new file mode 100644 index 00000000..a1fd6b56 --- /dev/null +++ b/doc/reg_expression.html @@ -0,0 +1,46 @@ + + + + Boost.Regex: Class reg_expression (deprecated) + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Class reg_expression (deprecated)

+
+

Boost.Regex Index

+
+

+
+

+

The use of class template reg_expression is deprecated: use + basic_regex instead.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/regbase.html b/doc/regbase.html new file mode 100644 index 00000000..f36ce38a --- /dev/null +++ b/doc/regbase.html @@ -0,0 +1,91 @@ + + + + +Boost.Regex: regbase + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

regbase

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

Use of the type boost::regbase is now deprecated, +and the type does not form a part of the +regular expression standardization proposal.  This type +still exists as a base class of boost::basic_regex, +and you can still refer to +boost::regbase::constant_name in your code, however for +maximum portability to other std regex implementations you should +instead use either:

+ +
+boost::regex_constants::constant_name
+
+ +

or

+ +
+boost::regex::constant_name
+
+ +

or

+ +
+boost::wregex::constant_name
+
+ +

+ +
+
+
+ + +

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/regex.html b/doc/regex.html new file mode 100644 index 00000000..785caf87 --- /dev/null +++ b/doc/regex.html @@ -0,0 +1,620 @@ + + + + +Boost.Regex: class RegEx (deprecated) + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

class RegEx (deprecated)

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

The high level wrapper class RegEx is now deprecated and does +not form a part of the +regular expression standardization proposal.  This type +still exists, and existing code will continue to compile, however +the following documentation is unlikely to be further updated.

+ +
+#include <boost/cregex.hpp>
+
+ +

The class RegEx provides a high level simplified interface to +the regular expression library, this class only handles narrow +character strings, and regular expressions always follow the +"normal" syntax - that is the same as the perl / ECMAScript +synatx.

+ +
+typedef bool (*GrepCallback)(const RegEx& expression);
+typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
+typedef bool (*FindFilesCallback)(const char* file);
+
+class  RegEx
+{
+public:
+   RegEx();
+   RegEx(const RegEx& o);
+   ~RegEx();
+   RegEx(const char* c, bool icase = false);
+   explicit RegEx(const std::string& s, bool icase = false);
+   RegEx& operator=(const RegEx& o);
+   RegEx& operator=(const char* p);
+   RegEx& operator=(const std::string& s);
+   unsigned int SetExpression(const char* p, bool icase = false);
+   unsigned int SetExpression(const std::string& s, bool icase = false);
+   std::string Expression()const;
+   //
+   // now matching operators: 
+   // 
+   bool Match(const char* p, unsigned int flags = match_default);
+   bool Match(const std::string& s, unsigned int flags = match_default); 
+   bool Search(const char* p, unsigned int flags = match_default); 
+   bool Search(const std::string& s, unsigned int flags = match_default); 
+   unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default); 
+   unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<std::string>& v, const char* p, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<std::string>& v, const std::string& s, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<unsigned int>& v, const char* p, unsigned int flags = match_default); 
+   unsigned int Grep(std::vector<unsigned int>& v, const std::string& s, unsigned int flags = match_default); 
+   unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default); 
+   unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default); 
+   unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default); 
+   unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default); 
+   std::string Merge(const std::string& in, const std::string& fmt, bool copy = true, unsigned int flags = match_default); 
+   std::string Merge(const char* in, const char* fmt, bool copy = true, unsigned int flags = match_default); 
+   unsigned Split(std::vector<std::string>& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0); 
+   // 
+   // now operators for returning what matched in more detail: 
+   // 
+   unsigned int Position(int i = 0)const; 
+   unsigned int Length(int i = 0)const; 
+   bool Matched(int i = 0)const;
+   unsigned int Line()const; 
+   unsigned int Marks() const; 
+   std::string What(int i)const; 
+   std::string operator[](int i)const ; 
+
+   static const unsigned int npos;
+};    
+
+ +

Member functions for class RegEx are defined as follows:
+  

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 RegEx();Default constructor, constructs an +instance of RegEx without any valid expression. 
 RegEx(const RegEx& o);Copy constructor, all the properties +of parameter o are copied. 
 RegEx(const char* c, +bool icase = false);Constructs an instance of RegEx, +setting the expression to c, if icase is true +then matching is insensitive to case, otherwise it is sensitive to +case. Throws bad_expression on failure. 
 RegEx(const std::string& s, +bool icase = false);Constructs an instance of RegEx, +setting the expression to s, if icase is true +then matching is insensitive to case, otherwise it is sensitive to +case. Throws bad_expression on failure. 
 RegEx& +operator=(const RegEx& o);Default assignment operator. 
 RegEx& +operator=(const char* p);Assignment operator, equivalent to +calling SetExpression(p, false). Throws +bad_expression on failure. 
 RegEx& +operator=(const std::string& s);Assignment operator, equivalent to +calling SetExpression(s, false). Throws +bad_expression on failure. 
 unsigned int +SetExpression(constchar* p, bool icase = +false);Sets the current expression to +p, if icase is true then matching is insensitive +to case, otherwise it is sensitive to case. Throws +bad_expression on failure. 
 unsigned int +SetExpression(const std::string& s, bool icase = +false);Sets the current expression to +s, if icase is true then matching is insensitive +to case, otherwise it is sensitive to case. Throws +bad_expression on failure. 
 std::string +Expression()const;Returns a copy of the current regular +expression. 
 bool Match(const +char* p, unsigned int flags = +match_default);Attempts to match the current +expression against the text p using the match flags +flags - see match flags. +Returns true if the expression matches the whole of the +input string. 
 bool Match(const +std::string& s, unsigned int flags = +match_default) ;Attempts to match the current +expression against the text s using the match flags +flags - see match flags. +Returns true if the expression matches the whole of the +input string. 
 bool Search(const +char* p, unsigned int flags = +match_default);Attempts to find a match for the +current expression somewhere in the text p using the match +flags flags - see match +flags. Returns true if the match succeeds. 
 bool Search(const +std::string& s, unsigned int flags = +match_default) ;Attempts to find a match for the +current expression somewhere in the text s using the match +flags flags - see match +flags. Returns true if the match succeeds. 
 unsigned int +Grep(GrepCallback cb, const char* p, unsigned +int flags = match_default);Finds all matches of the current +expression in the text p using the match flags flags +- see match flags. For each +match found calls the call-back function cb as: cb(*this); + +

If at any stage the call-back function returns false then the +grep operation terminates, otherwise continues until no further +matches are found. Returns the number of matches found.

+
 
 unsigned int +Grep(GrepCallback cb, const std::string& s, +unsigned int flags = match_default);Finds all matches of the current +expression in the text s using the match flags flags +- see match flags. For each +match found calls the call-back function cb as: cb(*this); + +

If at any stage the call-back function returns false then the +grep operation terminates, otherwise continues until no further +matches are found. Returns the number of matches found.

+
 
 unsigned int +Grep(std::vector<std::string>& v, const +char* p, unsigned int flags = +match_default);Finds all matches of the current +expression in the text p using the match flags flags +- see match flags. For each +match pushes a copy of what matched onto v. Returns the +number of matches found. 
 unsigned int +Grep(std::vector<std::string>& v, const +std::string& s, unsigned int flags = +match_default);Finds all matches of the current +expression in the text s using the match flags flags +- see match flags. For each +match pushes a copy of what matched onto v. Returns the +number of matches found. 
 unsigned int +Grep(std::vector<unsigned int>& v, const +char* p, unsigned int flags = +match_default);Finds all matches of the current +expression in the text p using the match flags flags +- see match flags. For each +match pushes the starting index of what matched onto v. +Returns the number of matches found. 
 unsigned int +Grep(std::vector<unsigned int>& v, const +std::string& s, unsigned int flags = +match_default);Finds all matches of the current +expression in the text s using the match flags flags +- see match flags. For each +match pushes the starting index of what matched onto v. +Returns the number of matches found. 
 unsigned int +GrepFiles(GrepFileCallback cb, const char* files, +bool recurse = false, unsigned int flags = +match_default);Finds all matches of the current +expression in the files files using the match flags +flags - see match flags. For +each match calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering further matches in the current file, or any +further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of matches found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 unsigned int +GrepFiles(GrepFileCallback cb, const std::string& files, +bool recurse = false, unsigned int +flags = match_default);Finds all matches of the current +expression in the files files using the match flags +flags - see match flags. For +each match calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering further matches in the current file, or any +further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of matches found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 unsigned int +FindFiles(FindFilesCallback cb, const char* files, +bool recurse = false, unsigned int +flags = match_default);Searches files to find all +those which contain at least one match of the current expression +using the match flags flags - see match flags. For each matching file +calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering any further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of files found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 unsigned int +FindFiles(FindFilesCallback cb, const std::string& +files, bool recurse = false, unsigned +int flags = match_default);Searches files to find all +those which contain at least one match of the current expression +using the match flags flags - see match flags. For each matching file +calls the call-back function cb.  + +

If the call-back returns false then the algorithm returns +without considering any further files. 

+ +

The parameter files can include wild card characters '*' +and '?', if the parameter recurse is true then searches +sub-directories for matching file names. 

+ +

Returns the total number of files found.

+ +

May throw an exception derived from std::runtime_error if file +io fails.

+
 
 std::string Merge(const +std::string& in, const std::string& fmt, bool +copy = true, unsigned int flags = +match_default);Performs a search and replace +operation: searches through the string in for all +occurrences of the current expression, for each occurrence replaces +the match with the format string fmt. Uses flags to +determine what gets matched, and how the format string should be +treated. If copy is true then all unmatched sections of +input are copied unchanged to output, if the flag +format_first_only is set then only the first occurance of the +pattern found is replaced. Returns the new string. See also format string syntax, match flags and format flags. 
 std::string Merge(const char* +in, const char* fmt, bool copy = true, +unsigned int flags = match_default);Performs a search and replace +operation: searches through the string in for all +occurrences of the current expression, for each occurrence replaces +the match with the format string fmt. Uses flags to +determine what gets matched, and how the format string should be +treated. If copy is true then all unmatched sections of +input are copied unchanged to output, if the flag +format_first_only is set then only the first occurance of the +pattern found is replaced. Returns the new string. See also format string syntax, match flags and format flags. 
 unsigned +Split(std::vector<std::string>& v, std::string& s, +unsigned flags = match_default, unsigned max_count = +~0);Splits the input string and pushes each one onto +the vector. If the expression contains no marked sub-expressions, +then one string is outputted for each section of the input that +does not match the expression. If the expression does contain +marked sub-expressions, then outputs one string for each marked +sub-expression each time a match occurs. Outputs no more than +max_count strings. Before returning, deletes from the input +string s all of the input that has been processed (all of +the string if max_count was not reached). Returns the number +of strings pushed onto the vector. 
 unsigned int +Position(int i = 0)const;Returns the position of what matched +sub-expression i. If i = 0 then returns the position +of the whole match. Returns RegEx::npos if the supplied index is +invalid, or if the specified sub-expression did not participate in +the match. 
 unsigned int +Length(int i = 0)const;Returns the length of what matched +sub-expression i. If i = 0 then returns the length of +the whole match. Returns RegEx::npos if the supplied index is +invalid, or if the specified sub-expression did not participate in +the match. 
 bool Matched(int i = +0)const;Returns true if sub-expression i was matched, false +otherwise. 
 unsigned int +Line()const;Returns the line on which the match +occurred, indexes start from 1 not zero, if no match occurred then +returns RegEx::npos. 
 unsigned int Marks() +const;Returns the number of marked +sub-expressions contained in the expression. Note that this +includes the whole match (sub-expression zero), so the value +returned is always >= 1. 
 std::string What(int +i)const;Returns a copy of what matched +sub-expression i. If i = 0 then returns a copy of the +whole match. Returns a null string if the index is invalid or if +the specified sub-expression did not participate in a match. 
 std::string +operator[](int i)const ;Returns what(i); + +

Can be used to simplify access to sub-expression matches, and +make usage more perl-like.

+
 
+ +
+
+ + +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/regex_format.html b/doc/regex_format.html new file mode 100644 index 00000000..786353e8 --- /dev/null +++ b/doc/regex_format.html @@ -0,0 +1,213 @@ + + + + +Boost.Regex: Algorithm regex_format (deprecated) + + + + +

+ + + + + + + +
+

+"C++

+
+

Boost.Regex

+ +

Algorithm regex_format (deprecated)

+
+

+"Boost.Regex

+
+ +
+
+ + +
+

The algorithm regex_format is deprecated; new code should use +match_results::format instead.  Existing code will continue to +compile, the following documentation is taken from the previous +version of boost.regex and will not be further updated:

+ +

Algorithm regex_format

+ +
+#include <boost/regex.hpp>
+
+ +

The algorithm regex_format takes the results of a match and +creates a new string based upon a +format string, regex_format can be used for search and replace +operations:

+ +
+template <class OutputIterator, class iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+                            const match_results<iterator, Allocator>& m,
+                            const charT* fmt,
+                            match_flag_type flags = 0);
+template <class OutputIterator, class iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+                            const match_results<iterator, Allocator>& m,
+                            const std::basic_string<charT>& fmt,
+                            match_flag_type flags = 0);
+
+ +

The library also defines the following convenience variation of +regex_format, which returns the result directly as a string, rather +than outputting to an iterator [note - this version may not be +available, or may be available in a more limited form, depending +upon your compilers capabilities]:

+ +
+template <class iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format
+                                 (const match_results<iterator, Allocator>& m, 
+                                  const charT* fmt,
+                                  match_flag_type flags = 0);
+
+template <class iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format
+                                 (const match_results<iterator, Allocator>& m, 
+                                  const std::basic_string<charT>& fmt,
+                                  match_flag_type flags = 0);
+
+ +

Parameters to the main version of the function are passed as +follows:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 OutputIterator outAn output iterator type, the output +string is sent to this iterator. Typically this would be a +std::ostream_iterator. 
 const +match_results<iterator, Allocator>& mAn instance of match_results<> +obtained from one of the matching algorithms above, and denoting +what matched. 
 const charT* fmtA format string that determines how +the match is transformed into the new string. 
 unsigned flagsOptional flags which describe how the +format string is to be interpreted. 
+ +
+
+ + +

Format flags are defined as +follows:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 format_allEnables all syntax options (perl-like +plus extentions). 
 format_sedAllows only a sed-like syntax. 
 format_perlAllows only a perl-like syntax. 
 format_no_copyDisables copying of unmatched sections +to the output string during +regex_merge operations. 
 format_first_onlyWhen this flag is set only the first occurance will be replaced +(applies to regex_merge only). 
+ +
+
+ + +

The format string syntax (and available options) is described +more fully under format strings +.

+ +

+ +
+

Revised + +17 May 2003 +

+ +

© Copyright John +Maddock 1998- + +2003 +

+ +

Permission to use, copy, modify, distribute and +sell this software and its documentation for any purpose is hereby +granted without fee, provided that the above copyright notice +appear in all copies and that both that copyright notice and this +permission notice appear in supporting documentation. Dr John +Maddock makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty.

+ + + + diff --git a/doc/regex_grep.html b/doc/regex_grep.html new file mode 100644 index 00000000..0c6f1218 --- /dev/null +++ b/doc/regex_grep.html @@ -0,0 +1,386 @@ + + + + Boost.Regex: Algorithm regex_grep (deprecated) + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_grep (deprecated)

+
+

Boost.Regex Index

+
+
+
+
+

The algorithm regex_grep is deprecated in favor of regex_iterator + which provides a more convenient and standard library friendly interface.

+

The following documentation is taken unchanged from the previous boost release, + and will not be updated in future.

+
+
+#include <boost/regex.hpp>
+
+

regex_grep allows you to search through a bidirectional-iterator range and + locate all the (non-overlapping) matches with a given regular expression. The + function is declared as:

+
+template <class Predicate, class iterator, class charT, class traits, class Allocator>
+unsigned int regex_grep(Predicate foo,
+                         iterator first,
+                         iterator last,
+                         const basic_regex<charT, traits, Allocator>& e,
+                         unsigned flags = match_default)
+
+

The library also defines the following convenience versions, which take either + a const charT*, or a const std::basic_string<>& in place of a pair of + iterators [note - these versions may not be available, or may be available in a + more limited form, depending upon your compilers capabilities]:

+
+template <class Predicate, class charT, class Allocator, class traits>
+unsigned int regex_grep(Predicate foo, 
+              const charT* str, 
+              const basic_regex<charT, traits, Allocator>& e, 
+              unsigned flags = match_default);
+
+template <class Predicate, class ST, class SA, class Allocator, class charT, class traits>
+unsigned int regex_grep(Predicate foo, 
+              const std::basic_string<charT, ST, SA>& s, 
+              const basic_regex<charT, traits, Allocator>& e, 
+              unsigned flags = match_default);
+
+

The parameters for the primary version of regex_grep have the following + meanings: 

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 fooA predicate function object or function pointer, see + below for more information. 
 firstThe start of the range to search. 
 lastThe end of the range to search. 
 eThe regular expression to search for. 
 flagsThe flags that determine how matching is carried out, + one of the match_flags enumerators. 
+
+
+

The algorithm finds all of the non-overlapping matches of the expression e, for + each match it fills a match_results<iterator, + Allocator> structure, which contains information on what matched, and calls + the predicate foo, passing the match_results<iterator, Allocator> as a + single argument. If the predicate returns true, then the grep operation + continues, otherwise it terminates without searching for further matches. The + function returns the number of matches found.

+

The general form of the predicate is:

+
+struct grep_predicate
+{
+   bool operator()(const match_results<iterator_type, typename expression_type::alloc_type::template rebind<sub_match<BidirectionalIterator> >::other>& m);
+};
+
+

Note that in almost every case the allocator parameter can be omitted, when + specifying the match_results type, + alternatively one of the typedefs cmatch, wcmatch, smatch or wsmatch can be + used.

+

For example the regular expression "a*b" would find one match in the string + "aaaaab" and two in the string "aaabb".

+

Remember this algorithm can be used for a lot more than implementing a version + of grep, the predicate can be and do anything that you want, grep utilities + would output the results to the screen, another program could index a file + based on a regular expression and store a set of bookmarks in a list, or a text + file conversion utility would output to file. The results of one regex_grep can + even be chained into another regex_grep to create recursive parsers.

+

The algorithm may throw std::runtime_error if the complexity + of matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Example: convert + the example from regex_search to use regex_grep instead:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+
+// IndexClasses: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+
+const char* re = 
+   // possibly leading whitespace:   
+   "^[[:space:]]*" 
+   // possible template declaration:
+   "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
+   // class or struct:
+   "(class|struct)[[:space:]]*" 
+   // leading declspec macros etc:
+   "("
+      "\\<\\w+\\>"
+      "("
+         "[[:blank:]]*\\([^)]*\\)"
+      ")?"
+      "[[:space:]]*"
+   ")*" 
+   // the class name
+   "(\\<\\w*\\>)[[:space:]]*" 
+   // template specialisation parameters
+   "(<[^;:{]+>)?[[:space:]]*"
+   // terminate in { or :
+   "(\\{|:[^;\\{()]*\\{)";
+
+boost::regex expression(re); 
+class IndexClassesPred 
+{ 
+   map_type& m; 
+   std::string::const_iterator base; 
+public: 
+   IndexClassesPred(map_type& a, std::string::const_iterator b) : m(a), base(b) {} 
+   bool operator()(const  smatch& what) 
+   { 
+      // what[0] contains the whole string 
+      // what[5] contains the class name. 
+      // what[6] contains the template specialisation if any. 
+      // add class name and position to map: 
+      m[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+                what[5].first - base; 
+      return true; 
+   } 
+}; 
+void IndexClasses(map_type& m, const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   regex_grep(IndexClassesPred(m, start), start, end, expression); 
+}
+
+

Example: Use + regex_grep to call a global callback function:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+
+const char* re = 
+   // possibly leading whitespace:   
+   "^[[:space:]]*" 
+   // possible template declaration:
+   "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
+   // class or struct:
+   "(class|struct)[[:space:]]*" 
+   // leading declspec macros etc:
+   "("
+      "\\<\\w+\\>"
+      "("
+         "[[:blank:]]*\\([^)]*\\)"
+      ")?"
+      "[[:space:]]*"
+   ")*" 
+   // the class name
+   "(\\<\\w*\\>)[[:space:]]*" 
+   // template specialisation parameters
+   "(<[^;:{]+>)?[[:space:]]*"
+   // terminate in { or :
+   "(\\{|:[^;\\{()]*\\{)";
+
+boost::regex expression(re);
+map_type class_index; 
+std::string::const_iterator base; 
+
+bool grep_callback(const  boost::smatch& what) 
+{ 
+   // what[0] contains the whole string 
+   // what[5] contains the class name. 
+   // what[6] contains the template specialisation if any. 
+   // add class name and position to map: 
+   class_index[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+                what[5].first - base; 
+   return true; 
+} 
+void IndexClasses(const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   base = start; 
+   regex_grep(grep_callback, start, end, expression, match_default); 
+}
+ 
+
+

Example: use + regex_grep to call a class member function, use the standard library adapters std::mem_fun + and std::bind1st to convert the member function into a predicate:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+#include <functional> 
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+class class_index 
+{ 
+   boost::regex expression; 
+   map_type index; 
+   std::string::const_iterator base; 
+   bool  grep_callback(boost::smatch what); 
+public: 
+   void IndexClasses(const std::string& file); 
+   class_index() 
+      : index(), 
+        expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?" 
+                   "(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?" 
+                   "[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?" 
+                   "(\\{|:[^;\\{()]*\\{)" 
+                   ){} 
+}; 
+bool  class_index::grep_callback(boost::smatch what) 
+{ 
+   // what[0] contains the whole string 
+   // what[5] contains the class name. 
+   // what[6] contains the template specialisation if any. 
+   // add class name and position to map: 
+   index[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+               what[5].first - base; 
+   return true; 
+} 
+
+void class_index::IndexClasses(const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   base = start; 
+   regex_grep(std::bind1st(std::mem_fun(&class_index::grep_callback), this), 
+              start, 
+              end, 
+              expression); 
+} 
+ 
+
+

Finally, C++ + Builder users can use C++ Builder's closure type as a callback argument:

+
+#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+#include <functional> 
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+class class_index 
+{ 
+   boost::regex expression; 
+   map_type index; 
+   std::string::const_iterator base; 
+   typedef  boost::smatch arg_type; 
+   bool grep_callback(const arg_type& what); 
+public: 
+   typedef bool (__closure* grep_callback_type)(const arg_type&); 
+   void IndexClasses(const std::string& file); 
+   class_index() 
+      : index(), 
+        expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?" 
+                   "(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?" 
+                   "[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?" 
+                   "(\\{|:[^;\\{()]*\\{)" 
+                   ){} 
+}; 
+
+bool class_index::grep_callback(const arg_type& what) 
+{ 
+   // what[0] contains the whole string    
+// what[5] contains the class name.    
+// what[6] contains the template specialisation if any.    
+// add class name and position to map:    
+index[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+               what[5].first - base; 
+   return true; 
+} 
+
+void class_index::IndexClasses(const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+   base = start; 
+   class_index::grep_callback_type cl = &(this->grep_callback); 
+   regex_grep(cl, 
+            start, 
+            end, 
+            expression); 
+}
+
+

+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_iterator.html b/doc/regex_iterator.html new file mode 100644 index 00000000..4a24769b --- /dev/null +++ b/doc/regex_iterator.html @@ -0,0 +1,427 @@ + + + + Boost.Regex: regex_iterator + + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

regex_iterator

+
+

Boost.Regex Index

+
+
+
+
+

Contents

+
+
Synopsis
Description
+ Examples
+
+

Synopsis

+

The iterator type regex_iterator will enumerate all of the regular expression + matches found in some sequence: dereferencing a regex_iterator yields a + reference to a match_results object.

+
+template <class BidirectionalIterator, 
+          class charT = iterator_traits<BidirectionalIterator>::value_type,
+          class traits = regex_traits<charT>,
+          class Allocator = allocator<charT> >
+class regex_iterator 
+{
+public:
+   typedef          basic_regex<charT, traits, Allocator>                   regex_type;
+   typedef          match_results<BidirectionalIterator>                    value_type;
+   typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+   typedef          const value_type*                                       pointer;
+   typedef          const value_type&                                       reference;
+   typedef          std::forward_iterator_tag                               iterator_category;
+   
+   regex_iterator();
+   regex_iterator(BidirectionalIterator a, BidirectionalIterator b, 
+                  const regex_type& re, 
+                  match_flag_type m = match_default);
+   regex_iterator(const regex_iterator&);
+   regex_iterator& operator=(const regex_iterator&);
+   bool operator==(const regex_iterator&);
+   bool operator!=(const regex_iterator&);
+   const value_type& operator*();
+   const value_type* operator->();
+   regex_iterator& operator++();
+   regex_iterator operator++(int);
+};
+
+
+

Description

+

A regex_iterator is constructed from a pair of iterators, and enumerates all + occurrences of a regular expression within that iterator range.

+
+regex_iterator();
+
+ +

Effects: constructs an end of sequence regex_iterator.

+
+regex_iterator(BidirectionalIterator a, BidirectionalIterator b, 
+               const regex_type& re, 
+               match_flag_type m = match_default);
+
+ +

Effects: constructs a regex_iterator that will enumerate all occurrences + of the expression re, within the sequence [a,b), and found + using match flags m.  The object re must exist for the + lifetime of the regex_iterator.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
+regex_iterator(const regex_iterator& that);
+
+ +

Effects: constructs a copy of that.

+ +

Postconditions: *this == that.

+
+regex_iterator& operator=(const regex_iterator&);
+
+ +

Effects: sets *this equal to those in that.

+ +

Postconditions: *this == that.

+
+bool operator==(const regex_iterator& that);
+
+ +

Effects: returns true if *this is equal to that.

+
+bool operator!=(const regex_iterator&);
+
+ +

Effects: returns !(*this == that).

+
+const value_type& operator*();
+
+

Effects: dereferencing a regex_iterator object it yields a + const reference to a match_results object, + whose members are set as follows:

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value

+
+

(*it).size()

+
+

re.mark_count()

+
+

(*it).empty()

+
+

false

+
+

(*it).prefix().first

+
+

The end of the last match found, or the start of the underlying sequence if + this is the first match enumerated

+
+

(*it).prefix().last

+
+

(*it)[0].first

+
+

(*it).prefix().matched

+
+

(*it).prefix().first != (*it).prefix().second

+
+

(*it).suffix().first

+
+

(*it)[0].second

+
+

(*it).suffix().last

+
+

The end of the underlying sequence.

+
+

(*it).suffix().matched

+
+

(*it).suffix().first != (*it).suffix().second

+
+

(*it)[0].first

+
+

The start of the sequence of characters that matched the regular expression

+
+

(*it)[0].second

+
+

The end of the sequence of characters that matched the regular expression

+
+

(*it)[0].matched

+
+

true if a full match was found, and false if it was a + partial match (found as a result of the match_partial flag being + set).

+
+

(*it)[n].first

+
+

For all integers n < (*it).size(), the start of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

(*it)[n].second

+
+

For all integers n < (*it).size(), the end of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

(*it)[n].matched

+
+

For all integers n < (*it).size(), true if sub-expression n participated + in the match, false otherwise.

+
(*it).position(n)For all integers n < (*it).size(), then the + distance from the start of the underlying sequence to the start of + sub-expression match n.
+
+
+
+const value_type* operator->();
+
+ +

Effects: returns &(*this).

+
+regex_iterator& operator++();
+
+

Effects: moves the iterator to the next match in the + underlying sequence, or the end of sequence iterator if none if found. +  When the last match found matched a zero length string, then the + regex_iterator will find the next match as follows: if there exists a non-zero + length match that starts at the same location as the last one, then returns it, + otherwise starts looking for the next (possibly zero length) match from one + position to the right of the last match.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+ +

Returns: *this.

+
+regex_iterator operator++(int);
+
+ +

Effects: constructs a copy result of *this, + then calls ++(*this).

+ +

Returns: result.

+

Examples

+

The following example + takes a C++ source file and builds up an index of class names, and the location + of that class in the file.

+
+#include <string>
+#include <map>
+#include <fstream>
+#include <iostream>
+#include <boost/regex.hpp>
+
+using namespace std;
+
+// purpose:
+// takes the contents of a file in the form of a string
+// and searches for all the C++ class definitions, storing
+// their locations in a map of strings/int's
+
+typedef std::map<std::string, std::string::difference_type, std::less<std::string> > map_type;
+
+const char* re = 
+   // possibly leading whitespace:   
+   "^[[:space:]]*" 
+   // possible template declaration:
+   "(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
+   // class or struct:
+   "(class|struct)[[:space:]]*" 
+   // leading declspec macros etc:
+   "("
+      "\\<\\w+\\>"
+      "("
+         "[[:blank:]]*\\([^)]*\\)"
+      ")?"
+      "[[:space:]]*"
+   ")*" 
+   // the class name
+   "(\\<\\w*\\>)[[:space:]]*" 
+   // template specialisation parameters
+   "(<[^;:{]+>)?[[:space:]]*"
+   // terminate in { or :
+   "(\\{|:[^;\\{()]*\\{)";
+
+
+boost::regex expression(re);
+map_type class_index;
+
+bool regex_callback(const boost::match_results<std::string::const_iterator>& what)
+{
+   // what[0] contains the whole string
+   // what[5] contains the class name.
+   // what[6] contains the template specialisation if any.
+   // add class name and position to map:
+   class_index[what[5].str() + what[6].str()] = what.position(5);
+   return true;
+}
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   s.reserve(is.rdbuf()->in_avail());
+   char c;
+   while(is.get(c))
+   {
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+int main(int argc, const char** argv)
+{
+   std::string text;
+   for(int i = 1; i < argc; ++i)
+   {
+      cout << "Processing file " << argv[i] << endl;
+      std::ifstream fs(argv[i]);
+      load_file(text, fs);
+      // construct our iterators:
+      boost::regex_iterator<std::string::const_iterator> m1(text.begin(), text.end(), expression);
+      boost::regex_iterator<std::string::const_iterator> m2;
+      std::for_each(m1, m2, ®ex_callback);
+      // copy results:
+      cout << class_index.size() << " matches found" << endl;
+      map_type::iterator c, d;
+      c = class_index.begin();
+      d = class_index.end();
+      while(c != d)
+      {
+         cout << "class \"" << (*c).first << "\" found at index: " << (*c).second << endl;
+         ++c;
+      }
+      class_index.erase(class_index.begin(), class_index.end());
+   }
+   return 0;
+}
+
+
+

Revised + + 17 May 2003 +

+

© Copyright John Maddock 1998- + + 2003 +

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_match.html b/doc/regex_match.html new file mode 100644 index 00000000..1345180b --- /dev/null +++ b/doc/regex_match.html @@ -0,0 +1,317 @@ + + + + Boost.Regex: Algorithm regex_match + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_match

+
+

Boost.Regex Index

+
+

+
+

+

Contents

+
+
Synopsis
Description
+ Examples
+
+

Synopsis

+
#include <boost/regex.hpp> 
+

The algorithm regex _match determines whether a given regular expression + matches a given sequence denoted by a pair of bidirectional-iterators, the + algorithm is defined as follows, note that the result is true only if the + expression matches the whole of the input sequence, the main use of + this function is data input validation. +

template <class BidirectionalIterator, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 match_results<BidirectionalIterator, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class BidirectionalIterator, class charT, class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class charT, class Allocator, class traits, class Allocator2>
+bool regex_match(const charT* str, match_results<const charT*, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class ST, class SA, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
+                 const basic_regex<charT, traits, Allocator2>& e, 
+                 match_flag_type flags = match_default);
+                 
+template <class charT, class traits, class Allocator2>
+bool regex_match(const charT* str,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+                 
+template <class ST, class SA, class charT, class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+
+

Description

+
template <class BidirectionalIterator, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 match_results<BidirectionalIterator, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Requires: Type BidirectionalIterator meets the requirements of a + Bidirectional Iterator (24.1.4).

+

Effects: Determines whether there is an exact match between the regular + expression e, and all of the character sequence [first, last), parameter + flags is used to control how the expression + is matched against the character sequence. Returns true if such a match + exists, false otherwise.

+

Throws: std::runtime_error if the complexity of matching the + expression against an N character string begins to exceed O(N2), or + if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Postconditions: If the function returns false, then the effect on + parameter m is undefined, otherwise the effects on parameter m are + given in the table:

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element +

+
+

Value +

+
+

m.size()

+
+

e.mark_count()

+
+

m.empty()

+
+

false

+
+

m.prefix().first

+
+

first

+
+

m.prefix().last

+
+

first

+
+

m.prefix().matched

+
+

false

+
+

m.suffix().first

+
+

last

+
+

m.suffix().last

+
+

last

+
+

m.suffix().matched

+
+

false

+
+

m[0].first

+
+

first

+
+

m[0].second

+
+

last

+
+

m[0].matched

+
+

true if a full match was found, and false if it was + a partial match (found as a result of the match_partial flag being + set).

+
+

m[n].first

+
+

For all integers n < m.size(), the start of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].second

+
+

For all integers n < m.size(), the end of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].matched

+
+

For all integers n < m.size(), true if sub-expression n participated + in the match, false otherwise.

+
+
+

+
+
 
+
template <class BidirectionalIterator, class charT, class traits, class Allocator2>
+bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Behaves "as if" by constructing an instance of + match_results<BidirectionalIterator> what, + and then returning the result of regex_match(first, last, what, e, flags).

+
template <class charT, class Allocator, class traits, class Allocator2>
+bool regex_match(const charT* str, match_results<const charT*, Allocator>& m,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(str, str + + char_traits<charT>::length(str), m, e, flags).

+
template <class ST, class SA, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
+                 const basic_regex<charT, traits, Allocator2>& e, 
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(s.begin(), s.end(), m, e, + flags).

+
template <class charT, class traits, class Allocator2>
+bool regex_match(const charT* str,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(str, str + + char_traits<charT>::length(str), e, flags).

+
template <class ST, class SA, class charT, class traits, class Allocator2>
+bool regex_match(const basic_string<charT, ST, SA>& s,
+                 const basic_regex<charT, traits, Allocator2>& e,
+                 match_flag_type flags = match_default);
+

Effects: Returns the result of regex_match(s.begin(), s.end(), e, + flags). +

Examples

+

The following example + processes an ftp response: +

+
#include <stdlib.h> 
+#include <boost/regex.hpp> 
+#include <string> 
+#include <iostream> 
+
+using namespace boost; 
+
+regex expression("([0-9]+)(\\-| |$)(.*)"); 
+
+// process_ftp: 
+// on success returns the ftp response code, and fills 
+// msg with the ftp response message. 
+int process_ftp(const char* response, std::string* msg) 
+{ 
+   cmatch what; 
+   if(regex_match(response, what, expression)) 
+   { 
+      // what[0] contains the whole string 
+      // what[1] contains the response code 
+      // what[2] contains the separator character 
+      // what[3] contains the text message. 
+      if(msg) 
+         msg->assign(what[3].first, what[3].second); 
+      return std::atoi(what[1].first); 
+   } 
+   // failure did not match 
+   if(msg) 
+      msg->erase(); 
+   return -1; 
+}
+      

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_merge.html b/doc/regex_merge.html new file mode 100644 index 00000000..00c35d76 --- /dev/null +++ b/doc/regex_merge.html @@ -0,0 +1,47 @@ + + + + Boost.Regex: Algorithm regex_merge (deprecated) + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_merge (deprecated)

+
+

Boost.Regex Index

+
+

+
+

+

Algorithm regex_merge has been renamed regex_replace, + existing code will continue to compile, but new code should use + regex_replace instead.

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/doc/regex_replace.html b/doc/regex_replace.html new file mode 100644 index 00000000..1e13b553 --- /dev/null +++ b/doc/regex_replace.html @@ -0,0 +1,213 @@ + + + + Boost.Regex: Algorithm regex_replace + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_replace

+
+

Boost.Regex Index

+
+

+
+

Contents

+
+
Synopsis
Description
+ Examples
+

Synopsis

+
#include <boost/regex.hpp> 
+

The algorithm regex_replace searches through a string finding + all the matches to the regular expression: for each match it then calls + match_results::format to format the string and sends the result to the + output iterator. Sections of text that do not match are copied to the output + unchanged only if the flags parameter does not have the flag + format_no_copy set. If the flag format_first_only + is set then only the first occurrence is replaced rather than all + occurrences. 

template <class OutputIterator, class BidirectionalIterator, class traits,
+          class Allocator, class charT>
+OutputIterator regex_replace(OutputIterator out,
+                           BidirectionalIterator first,
+                           BidirectionalIterator last,
+                           const basic_regex<charT, traits, Allocator>& e,
+                           const basic_string<charT>& fmt,
+                           match_flag_type flags = match_default);
+
+template <class traits, class Allocator, class charT>
+basic_string<charT> regex_replace(const basic_string<charT>& s,
+                            const basic_regex<charT, traits, Allocator>& e,
+                            const basic_string<charT>& fmt,
+                            match_flag_type flags = match_default);
+
+
+

Description

+
template <class OutputIterator, class BidirectionalIterator, class traits,
+          class Allocator, class charT>
+OutputIterator regex_replace(OutputIterator out,
+                           BidirectionalIterator first,
+                           BidirectionalIterator last,
+                           const basic_regex<charT, traits, Allocator>& e,
+                           const basic_string<charT>& fmt,
+                           match_flag_type flags = match_default);
+

Effects: Finds all the non-overlapping matches m of type match_results<BidirectionalIterator> + that occur within the sequence [first, last). If no such matches are + found and !(flags & format_no_copy) then calls std::copy(first, + last, out). Otherwise, for each match found, if !(flags & + format_no_copy) calls std::copy(m.prefix().first, m.prefix().last, + out), and then calls m.format(out, fmt, flags). Finally + if !(flags & format_no_copy) calls std::copy(last_m.suffix().first, + last_m,suffix().last, out) where last_m is a copy of the + last match found. If flags & format_first_only is non-zero + then only the first match found is replaced.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Returns: out. +

+
template <class traits, class Allocator, class charT>
+basic_string<charT> regex_replace(const basic_string<charT>& s,
+                            const basic_regex<charT, traits, Allocator>& e,
+                            const basic_string<charT>& fmt,
+                            match_flag_type flags = match_default);
+

Effects: Constructs an object basic_string<charT> result, + calls regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt, + flags), and then returns result. +

Examples

+

The following example + takes C/C++ source code as input, and outputs syntax highlighted HTML code.

+

+
#include <fstream>
+#include <sstream>
+#include <string>
+#include <iterator>
+#include <boost/regex.hpp>
+#include <fstream>
+#include <iostream>
+
+// purpose:
+// takes the contents of a file and transform to
+// syntax highlighted code in html format
+
+boost::regex e1, e2;
+extern const char* expression_text;
+extern const char* format_string;
+extern const char* pre_expression;
+extern const char* pre_format;
+extern const char* header_text;
+extern const char* footer_text;
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   s.reserve(is.rdbuf()->in_avail());
+   char c;
+   while(is.get(c))
+   {
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+int main(int argc, const char** argv)
+{
+   try{
+   e1.assign(expression_text);
+   e2.assign(pre_expression);
+   for(int i = 1; i < argc; ++i)
+   {
+      std::cout << "Processing file " << argv[i] << std::endl;
+      std::ifstream fs(argv[i]);
+      std::string in;
+      load_file(in, fs);
+      std::string out_name(std::string(argv[i]) + std::string(".htm"));
+      std::ofstream os(out_name.c_str());
+      os << header_text;
+      // strip '<' and '>' first by outputting to a
+      // temporary string stream
+      std::ostringstream t(std::ios::out | std::ios::binary);
+      std::ostream_iterator<char, char> oi(t);
+      boost::regex_replace(oi, in.begin(), in.end(),
+      e2, pre_format, boost::match_default | boost::format_all);
+      // then output to final output stream
+      // adding syntax highlighting:
+      std::string s(t.str());
+      std::ostream_iterator<char, char> out(os);
+      boost::regex_replace(out, s.begin(), s.end(),
+      e1, format_string, boost::match_default | boost::format_all);
+      os << footer_text;
+   }
+   }
+   catch(...)
+   { return -1; }
+   return 0;
+}
+
+extern const char* pre_expression = "(<)|(>)|\\r";
+extern const char* pre_format = "(?1<)(?2>)";
+
+
+const char* expression_text = // preprocessor directives: index 1
+                              "(^[[:blank:]]*#(?:[^\\\\\\n]|\\\\[^\\n[:punct:][:word:]]*[\\n[:punct:][:word:]])*)|"
+                              // comment: index 2
+                              "(//[^\\n]*|/\\*.*?\\*/)|"
+                              // literals: index 3
+                              "\\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\\.)?[[:digit:]]+(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\\>|"
+                              // string literals: index 4
+                              "('(?:[^\\\\']|\\\\.)*'|\"(?:[^\\\\\"]|\\\\.)*\")|"
+                              // keywords: index 5
+                              "\\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import"
+                              "|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall"
+                              "|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool"
+                              "|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete"
+                              "|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto"
+                              "|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected"
+                              "|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast"
+                              "|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned"
+                              "|using|virtual|void|volatile|wchar_t|while)\\>"
+                              ;
+
+const char* format_string = "(?1<font color=\"#008040\">$&</font>)"
+                            "(?2<I><font color=\"#000080\">$&</font></I>)"
+                            "(?3<font color=\"#0000A0\">$&</font>)"
+                            "(?4<font color=\"#0000FF\">$&</font>)"
+                            "(?5<B>$&</B>)";
+
+const char* header_text = "<HTML>\n<HEAD>\n"
+                          "<TITLE>Auto-generated html formated source</TITLE>\n"
+                          "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=windows-1252\">\n"
+                          "</HEAD>\n"
+                          "<BODY LINK=\"#0000ff\" VLINK=\"#800080\" BGCOLOR=\"#ffffff\">\n"
+                          "<P> </P>\n<PRE>";
+
+const char* footer_text = "</PRE>\n</BODY>\n\n";
+      
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_search.html b/doc/regex_search.html new file mode 100644 index 00000000..a7fcd9b8 --- /dev/null +++ b/doc/regex_search.html @@ -0,0 +1,328 @@ + + + + Boost.Regex: Algorithm regex_search + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_search

+
+

Boost.Regex Index

+
+

+
+

Contents

+
+
Synopsis
Description
+ Examples
+

Synopsis

+
#include <boost/regex.hpp> 
+

+

The algorithm regex_search will search a range denoted by a pair of + bidirectional-iterators for a given regular expression. The algorithm uses + various heuristics to reduce the search time by only checking for a match if a + match could conceivably start at that position. The algorithm is defined as + follows: +

template <class BidirectionalIterator, 
+          class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
+                  match_results<BidirectionalIterator, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+                  
+template <class ST, class SA, 
+          class Allocator, class charT,
+          class traits, class Allocator2> 
+bool regex_search(const basic_string<charT, ST, SA>& s, 
+                  match_results<
+                      typename basic_string<charT, ST,SA>::const_iterator, 
+                      Allocator>& m, 
+                  const basic_regex<charT, traits, Allocator2>& e, 
+                  match_flag_type flags = match_default); 
+          
+template<class charT, class Allocator, class traits, 
+         class Allocator2> 
+bool regex_search(const charT* str, 
+                  match_results<const charT*, Allocator>& m, 
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+                  
+template <class BidirectionalIterator, class Allocator,
+          class charT, class traits>                
+bool regex_search(BidirectionalIterator first, BidirectionalIterator last, 
+                  const basic_regex<charT, traits, Allocator>& e, 
+                  match_flag_type flags = match_default); 
+                  
+template <class charT, class Allocator, 
+          class traits> 
+bool regex_search(const charT* str, 
+                  const basic_regex<charT, traits, Allocator>& e, 
+                  match_flag_type flags = match_default); 
+                  
+template<class ST, class SA,
+         class Allocator, class charT, 
+         class traits>
+bool regex_search(const basic_string<charT, ST, SA>& s,
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+
+

Description

+
template <class BidirectionalIterator, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
+                  match_results<BidirectionalIterator, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+

Requires: Type BidirectionalIterator meets the requirements of a + Bidirectional Iterator (24.1.4).

+

Effects: Determines whether there is some sub-sequence within + [first,last) that matches the regular expression e, parameter flags + is used to control how the expression is matched against the character + sequence. Returns true if such a sequence exists, false otherwise.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Postconditions: If the function returns false, then the effect on + parameter m is undefined, otherwise the effects on parameter m are + given in the table:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Element

+
+

Value +

+
+

m.size()

+
+

e.mark_count()

+
+

m.empty()

+
+

false

+
+

m.prefix().first

+
+

first

+
+

m.prefix().last

+
+

m[0].first

+
+

m.prefix().matched

+
+

m.prefix().first != m.prefix().second

+
+

m.suffix().first

+
+

m[0].second

+
+

m.suffix().last

+
+

last

+
+

m.suffix().matched

+
+

m.suffix().first != m.suffix().second

+
+

m[0].first

+
+

The start of the sequence of characters that matched the regular expression

+
+

m[0].second

+
+

The end of the sequence of characters that matched the regular expression

+
+

m[0].matched

+
+

true if a full match was found, and false if it was + a partial match (found as a result of the match_partial flag being + set).

+
+

m[n].first

+
+

For all integers n < m.size(), the start of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].second

+
+

For all integers n < m.size(), the end of the sequence that matched + sub-expression n. Alternatively, if sub-expression n did not participate + in the match, then last.

+
+

m[n].matched

+
+

For all integers n < m.size(), true if sub-expression n participated + in the match, false otherwise.

+
+
+
+
template <class charT, class Allocator, class traits, class Allocator2>
+bool regex_search(const charT* str, match_results<const charT*, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(str, str + + char_traits<charT>::length(str), m, e, flags).

+
template <class ST, class SA, class Allocator, class charT,
+          class traits, class Allocator2>
+bool regex_search(const basic_string<charT, ST, SA>& s,
+                  match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
+                  const basic_regex<charT, traits, Allocator2>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(s.begin(), s.end(), m, + e, flags).

+
template <class iterator, class Allocator, class charT,
+          class traits>
+bool regex_search(iterator first, iterator last,
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+

Effects: Behaves "as if" by constructing an instance of + match_results<BidirectionalIterator> what, + and then returning the result of regex_search(first, last, what, e, flags).

+
template <class charT, class Allocator, class traits>
+bool regex_search(const charT* str
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(str, str + + char_traits<charT>::length(str), e, flags).

+
template <class ST, class SA, class Allocator, class charT,
+          class traits>
+bool regex_search(const basic_string<charT, ST, SA>& s,
+                  const basic_regex<charT, traits, Allocator>& e,
+                  match_flag_type flags = match_default);
+

Effects: Returns the result of regex_search(s.begin(), s.end(), e, + flags). +

Examples

+

The following example, + takes the contents of a file in the form of a string, and searches for all the + C++ class declarations in the file. The code will work regardless of the way + that std::string is implemented, for example it could easily be modified to + work with the SGI rope class, which uses a non-contiguous storage strategy.

+

+
#include <string> 
+#include <map> 
+#include <boost/regex.hpp> 
+
+// purpose: 
+// takes the contents of a file in the form of a string 
+// and searches for all the C++ class definitions, storing 
+// their locations in a map of strings/int's 
+typedef std::map<std::string, int, std::less<std::string> > map_type; 
+
+boost::regex expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>[[:space:]]*)?(\\{|:[^;\\{()]*\\{)"); 
+
+void IndexClasses(map_type& m, const std::string& file) 
+{ 
+   std::string::const_iterator start, end; 
+   start = file.begin(); 
+   end = file.end(); 
+      boost::match_results<std::string::const_iterator> what; 
+   unsigned int flags = boost::match_default; 
+   while(regex_search(start, end, what, expression, flags)) 
+   { 
+      // what[0] contains the whole string 
+      // what[5] contains the class name. 
+      // what[6] contains the template specialisation if any. 
+      // add class name and position to map: 
+      m[std::string(what[5].first, what[5].second) + std::string(what[6].first, what[6].second)] = 
+                what[5].first - file.begin(); 
+      // update search position: 
+      start = what[0].second; 
+      // update flags: 
+      flags |= boost::match_prev_avail; 
+      flags |= boost::match_not_bob; 
+   } 
+}
+     
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_split.html b/doc/regex_split.html new file mode 100644 index 00000000..e1eba954 --- /dev/null +++ b/doc/regex_split.html @@ -0,0 +1,148 @@ + + + + Boost.Regex: Algorithm regex_split (deprecated) + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

Algorithm regex_split (deprecated)

+
+

Boost.Regex Index

+
+

+
+

+

The algorithm regex_split has been deprecated in favor of the iterator + regex_token_iterator which has a more flexible and powerful interface, + as well as following the more usual standard library "pull" rather than "push" + semantics.

+

Code which uses regex_split will continue to compile, the following + documentation is taken from the previous boost.regex version:

+

Algorithm regex_split

+
#include <boost/regex.hpp> 
+

Algorithm regex_split performs a similar operation to the perl split operation, + and comes in three overloaded forms: +

+
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+std::size_t regex_split(OutputIterator out, 
+                        std::basic_string<charT, Traits1, Alloc1>& s, 
+                        const basic_regex<charT, Traits2, Alloc2>& e,
+                        unsigned flags,
+                        std::size_t max_split);
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+std::size_t regex_split(OutputIterator out, 
+                        std::basic_string<charT, Traits1, Alloc1>& s, 
+                        const basic_regex<charT, Traits2, Alloc2>& e,
+                        unsigned flags = match_default);
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1>
+std::size_t regex_split(OutputIterator out, 
+                        std::basic_string<charT, Traits1, Alloc1>& s);
+

Effects: Each version of the algorithm takes an + output-iterator for output, and a string for input. If the expression contains + no marked sub-expressions, then the algorithm writes one string onto the + output-iterator for each section of input that does not match the expression. + If the expression does contain marked sub-expressions, then each time a match + is found, one string for each marked sub-expression will be written to the + output-iterator. No more than max_split strings will be written to the + output-iterator. Before returning, all the input processed will be deleted from + the string s (if max_split is not reached then all of s will + be deleted). Returns the number of strings written to the output-iterator. If + the parameter max_split is not specified then it defaults to UINT_MAX. + If no expression is specified, then it defaults to "\s+", and splitting occurs + on whitespace. +

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+

Example: the + following function will split the input string into a series of tokens, and + remove each token from the string s: +

+
unsigned tokenise(std::list<std::string>& l, std::string& s)
+{
+   return boost::regex_split(std::back_inserter(l), s);
+}
+

Example: the + following short program will extract all of the URL's from a html file, and + print them out to cout: +

+
#include <list>
+#include <fstream>
+#include <iostream>
+#include <boost/regex.hpp>
+
+boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
+               boost::regbase::normal | boost::regbase::icase);
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   //
+   // attempt to grow string buffer to match file size,
+   // this doesn't always work...
+   s.reserve(is.rdbuf()-&gtin_avail());
+   char c;
+   while(is.get(c))
+   {
+      // use logarithmic growth stategy, in case
+      // in_avail (above) returned zero:
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+
+int main(int argc, char** argv)
+{
+   std::string s;
+   std::list<std::string> l;
+
+   for(int i = 1; i < argc; ++i)
+   {
+      std::cout << "Findings URL's in " << argv[i] << ":" << std::endl;
+      s.erase();
+      std::ifstream is(argv[i]);
+      load_file(s, is);
+      boost::regex_split(std::back_inserter(l), s, e);
+      while(l.size())
+      {
+         s = *(l.begin());
+         l.pop_front();
+         std::cout << s << std::endl;
+      }
+   }
+   return 0;
+}
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_token_iterator.html b/doc/regex_token_iterator.html new file mode 100644 index 00000000..03e2e64e --- /dev/null +++ b/doc/regex_token_iterator.html @@ -0,0 +1,286 @@ + + + + Boost.Regex: regex_token_iterator + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

regex_token_iterator

+
+

Boost.Regex Index

+
+

+
+

Contents

+
+
Synopsis
Description
+ Examples
+

Synopsis

+

The template class regex_token_iterator is an iterator adapter; + that is to say it represents a new view of an existing iterator sequence, by + enumerating all the occurrences of a regular expression within that sequence, + and presenting one or more new strings for each match found. Each position + enumerated by the iterator is a string that represents what matched a + particular sub-expression within the regular expression. When class regex_token_iterator + is used to enumerate a single sub-expression with index -1, then the iterator + performs field splitting: that is to say it enumerates one string for each + section of the character container sequence that does not match the regular + expression specified.

+
+template <class BidirectionalIterator, 
+          class charT = iterator_traits<BidirectionalIterator>::value_type,
+          class traits = regex_traits<charT>,
+          class Allocator = allocator<charT> >
+class regex_token_iterator 
+{
+public:
+   typedef          basic_regex<charT, traits, Allocator>                   regex_type;
+   typedef          basic_string<charT>                                     value_type;
+   typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
+   typedef          const value_type*                                       pointer;
+   typedef          const value_type&                                       reference;
+   typedef          std::forward_iterator_tag                               iterator_category;
+   
+   regex_token_iterator();
+   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                        int submatch = 0, match_flag_type m = match_default);
+   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                        const std::vector<int>& submatches, match_flag_type m = match_default);
+   template <std::size_t N>
+   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                        const int (&submatches)[N], match_flag_type m = match_default);
+   regex_token_iterator(const regex_token_iterator&);
+   regex_token_iterator& operator=(const regex_token_iterator&);
+   bool operator==(const regex_token_iterator&);
+   bool operator!=(const regex_token_iterator&);
+   const value_type& operator*();
+   const value_type* operator->();
+   regex_token_iterator& operator++();
+   regex_token_iterator operator++(int);
+};
+
+

Description

+
regex_token_iterator();
+

Effects: constructs an end of sequence iterator.

+
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                     int submatch = 0, match_flag_type m = match_default);
+

Preconditions: !re.empty().

+

Effects: constructs a regex_token_iterator that will enumerate one + string for each regular expression match of the expression re found + within the sequence [a,b), using match flags m.  The + string enumerated is the sub-expression submatch for each match + found; if submatch is -1, then enumerates all the text sequences that + did not match the expression re (that is to performs field splitting).

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                     const std::vector<int>& submatches, match_flag_type m = match_default);
+

Preconditions: submatches.size() && !re.empty().

+

Effects: constructs a regex_token_iterator that will enumerate submatches.size() + strings for each regular expression match of the expression re found + within the sequence [a,b), using match flags m.  For + each match found one string will be enumerated for each sub-expression + index contained within submatches vector; if submatches[0] + is -1, then the first string enumerated for each match will be all of the text + from end of the last match to the start of the current match, in addition there + will be one extra string enumerated when no more matches can be found: from the + end of the last match found, to the end of the underlying sequence.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
template <std::size_t N>
+regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, 
+                     const int (&submatches)[R], match_flag_type m = match_default);
+

Preconditions: !re.empty().

+

Effects: constructs a regex_token_iterator that will + enumerate R strings for each regular expression match of the + expression re found within the sequence [a,b), using match + flags m.  For each match found one string will be + enumerated for each sub-expression index contained within the submatches + array; if submatches[0] is -1, then the first string enumerated + for each match will be all of the text from end of the last match to the start + of the current match, in addition there will be one extra string enumerated + when no more matches can be found: from the end of the last match found, to the + end of the underlying sequence.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+
regex_token_iterator(const regex_token_iterator& that);
+

Effects: constructs a copy of that.

+

Postconditions: *this == that.

+
regex_token_iterator& operator=(const regex_token_iterator& that);
+

Effects: sets *this to be equal to that.

+

Postconditions: *this == that.

+
bool operator==(const regex_token_iterator&);
+

+ Effects: returns true if *this is the same position as that.

+
bool operator!=(const regex_token_iterator&);
+

+ Effects: returns !(*this == that).

+
const value_type& operator*();
+

+ Effects: returns the current string being enumerated.

+
const value_type* operator->();
+

+ Effects: returns &(*this).

+
regex_token_iterator& operator++();
+

+ Effects: Moves on to the next string to be enumerated.

+

Throws: std::runtime_error if the complexity of + matching the expression against an N character string begins to exceed O(N2), + or if the program runs out of stack space while matching the expression (if + Boost.regex is configured in recursive mode), + or if the matcher exhausts it's permitted memory allocation (if Boost.regex is + configured in non-recursive mode).

+ +

+ Returns: *this.

regex_token_iterator& operator++(int);
+

Effects: constructs a copy result of *this, + then calls ++(*this).

+

Returns: result. +

Examples

+

The following example + takes a string and splits it into a series of tokens:

+
+#include <iostream>
+#include <boost/regex.hpp>
+
+using namespace std;
+
+int main(int argc)
+{
+   string s;
+   do{
+      if(argc == 1)
+      {
+         cout << "Enter text to split (or \"quit\" to exit): ";
+         getline(cin, s);
+         if(s == "quit") break;
+      }
+      else
+         s = "This is a string of tokens";
+
+      boost::regex re("\\s+");
+      boost::regex_token_iterator<std::string::const_iterator> i(s.begin(), s.end(), re, -1);
+      boost::regex_token_iterator<std::string::const_iterator> j;
+
+      unsigned count = 0;
+      while(i != j)
+      {
+         cout << *i++ << endl;
+         count++;
+      }
+      cout << "There were " << count << " tokens found." << endl;
+
+   }while(argc == 1);
+   return 0;
+}
+
+
+

The following example + takes a html file and outputs a list of all the linked files:

+
+#include <fstream>
+#include <iostream>
+#include <iterator>
+#include <boost/regex.hpp>
+
+boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
+               boost::regex::normal | boost::regbase::icase);
+
+void load_file(std::string& s, std::istream& is)
+{
+   s.erase();
+   //
+   // attempt to grow string buffer to match file size,
+   // this doesn't always work...
+   s.reserve(is.rdbuf()->in_avail());
+   char c;
+   while(is.get(c))
+   {
+      // use logarithmic growth stategy, in case
+      // in_avail (above) returned zero:
+      if(s.capacity() == s.size())
+         s.reserve(s.capacity() * 3);
+      s.append(1, c);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   std::string s;
+   int i;
+   for(i = 1; i < argc; ++i)
+   {
+      std::cout << "Findings URL's in " << argv[i] << ":" << std::endl;
+      s.erase();
+      std::ifstream is(argv[i]);
+      load_file(s, is);
+      boost::regex_token_iterator<std::string::const_iterator>
+         i(s.begin(), s.end(), e, 1);
+      boost::regex_token_iterator<std::string::const_iterator> j;
+      while(i != j)
+      {
+         std::cout << *i++ << std::endl;
+      }
+   }
+   //
+   // alternative method:
+   // test the array-literal constructor, and split out the whole
+   // match as well as $1....
+   //
+   for(i = 1; i < argc; ++i)
+   {
+      std::cout << "Findings URL's in " << argv[i] << ":" << std::endl;
+      s.erase();
+      std::ifstream is(argv[i]);
+      load_file(s, is);
+      const int subs[] = {1, 0,};
+      boost::regex_token_iterator<std::string::const_iterator>
+         i(s.begin(), s.end(), e, subs);
+      boost::regex_token_iterator<std::string::const_iterator> j;
+      while(i != j)
+      {
+         std::cout << *i++ << std::endl;
+      }
+   }
+
+   return 0;
+}
+
+
+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + diff --git a/doc/regex_traits.html b/doc/regex_traits.html new file mode 100644 index 00000000..a359e2e9 --- /dev/null +++ b/doc/regex_traits.html @@ -0,0 +1,48 @@ + + + + Boost.Regex: class regex_traits + + + + +

+ + + + + + +
+

C++ Boost

+
+

Boost.Regex

+

class regex_traits

+
+

Boost.Regex Index

+
+

+
+

+

Under construction.

+

The current boost.regex traits class design will be migrated to that specified + in the regular + expression standardization proposal

+

+


+

+

Revised + + 17 May 2003 + +

+

© Copyright John Maddock 1998- 2003

+

Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting documentation. + Dr John Maddock makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty.

+ + + diff --git a/example/Jamfile b/example/Jamfile index f57f7a32..1392b2f8 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -38,11 +38,14 @@ test-suite regex-examples : [ regex-test-run snippets/regex_grep_example_4.cpp : $(BOOST_ROOT)/boost/rational.hpp ] [ regex-test-run snippets/regex_match_example.cpp : -auto ] [ regex-test-run snippets/regex_merge_example.cpp : $(BOOST_ROOT)/boost/rational.hpp ] +[ regex-test-run snippets/regex_replace_example.cpp : $(BOOST_ROOT)/boost/rational.hpp ] [ regex-test-run snippets/regex_search_example.cpp : $(BOOST_ROOT)/boost/rational.hpp ] [ regex-test-run snippets/regex_split_example_1.cpp : -auto ] -[ regex-test-run snippets/regex_split_example_2.cpp : $(BOOST_ROOT)/libs/regex/index.htm ] +[ regex-test-run snippets/regex_split_example_2.cpp : $(BOOST_ROOT)/libs/regex/doc/index.html ] ; + + diff --git a/example/jgrep/jgrep.cpp b/example/jgrep/jgrep.cpp index 696a18b0..4e4caad2 100644 --- a/example/jgrep/jgrep.cpp +++ b/example/jgrep/jgrep.cpp @@ -19,6 +19,7 @@ */ #include +#include #include #ifdef JM_OLD_IOSTREAM #include @@ -33,7 +34,11 @@ using std::endl; # pragma hrdstop #endif +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #include "jgrep.h" @@ -47,10 +52,10 @@ class ogrep_predicate unsigned int& lines; const char* filename; unsigned int last_line; - iterator end_of_storage; + iterator end_of_storage, last_line_start; public: - ogrep_predicate(unsigned int& i, const char* p, iterator e) : lines(i), filename(p), last_line(-1), end_of_storage(e) {} - ogrep_predicate(const ogrep_predicate& o) : lines(o.lines), filename(o.filename), last_line(o.last_line), end_of_storage(o.end_of_storage) {} + ogrep_predicate(unsigned int& i, const char* p, iterator start, iterator end) : lines(i), filename(p), last_line(-1), end_of_storage(end), last_line_start(start) {} + ogrep_predicate(const ogrep_predicate& o) : lines(o.lines), filename(o.filename), last_line(o.last_line), end_of_storage(o.end_of_storage), last_line_start(o.last_line_start) {} bool operator () (const boost::match_results& i); }; @@ -63,42 +68,54 @@ public: template bool ogrep_predicate::operator()(const boost::match_results& i) { + // if we haven't printed the filename yet, then do it now: if(last_line == (unsigned int)-1) + { cout << "File " << filename << ":" << endl; - if(last_line != i.line()) + last_line = 0; + } + // calculate which line we are on, by adding the number of newlines + // we've skipped in the last search: + int current_line = last_line + std::count(last_line_start, end_of_storage, '\n'); + // if we haven't already printed this line out, then do it now: + if(last_line != current_line) { ++lines; - last_line = i.line(); + last_line = current_line; if(count_only == 0) { if(show_lines) - cout << i.line() << "\t"; - iterator ptr = i.line_start(); - while((ptr != end_of_storage) && (*ptr != '\n'))++ptr; - iterator pos = i.line_start(); - while(pos != ptr) + cout << current_line << "\t"; + const char* nls = "\n"; + iterator ptr = std::find_end(last_line_start, i[0].first, nls, nls+1); + ++ptr; + iterator ptr2 = ptr; + while((ptr2 != end_of_storage) && (*ptr2 != '\n'))++ptr2; + while(ptr != ptr2) { - cout.put(*pos); - ++pos; + cout.put(*ptr); + ++ptr; } cout << endl; } } + // set the last line seen to the start of the current match: + last_line_start = i[0].first; return true; } +using namespace boost; void process_grep(const char* file) { try{ - using namespace boost; mapfile f(file); unsigned int count = 0; - ogrep_predicate oi(count, file, f.end()); + ogrep_predicate::allocator_type> oi(count, file, f.begin(), f.end()); if(files_only) { bool ok; - boost::match_results m; + boost::match_results m; ok = regex_search(f.begin(), f.end(), m, e, match_not_dot_newline | match_not_dot_null); if(ok) cout << "File " << file << endl; diff --git a/example/jgrep/main.cpp b/example/jgrep/main.cpp index 53250826..9fc8b697 100644 --- a/example/jgrep/main.cpp +++ b/example/jgrep/main.cpp @@ -34,7 +34,11 @@ using std::endl; # pragma hrdstop #endif +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #include "jgrep.h" #ifndef JM_ALGO_INCLUDED @@ -165,6 +169,8 @@ void parse_switch(const char* flag) } } +using namespace boost; + void HandleFile(const char* wild) { using namespace boost; @@ -226,14 +232,14 @@ void HandleArg(const char* arg) { if(words_only == 0) { - e.set_expression(arg, use_case ? regbase::normal : regbase::normal | regbase::icase); + e.set_expression(arg, use_case ? regex::normal : regbase::normal | regbase::icase); //ei.set_expression(arg); } else { char* buf = new char[std::strlen(arg) + 8]; std::sprintf(buf, "\\<%s\\>", arg); - e.set_expression(buf, use_case ? regbase::normal : regbase::normal | regbase::icase); + e.set_expression(buf, use_case ? regex::normal : regbase::normal | regbase::icase); //ei.set_expression(buf); delete[] buf; } @@ -255,7 +261,7 @@ void HandleArg(const char* arg) } if(words_only) std::strcat(buf2, "\\>"); - e.set_expression(buf2, use_case ? regbase::normal : regbase::normal | regbase::icase); + e.set_expression(buf2, use_case ? regex::normal : regbase::normal | regbase::icase); //ei.set_expression(buf2); delete[] buf2; } diff --git a/example/snippets/credit_card_example.cpp b/example/snippets/credit_card_example.cpp index 08ab41d2..7a59a99a 100644 --- a/example/snippets/credit_card_example.cpp +++ b/example/snippets/credit_card_example.cpp @@ -35,12 +35,12 @@ const std::string human_format("\\1-\\2-\\3-\\4"); std::string machine_readable_card_number(const std::string& s) { - return boost::regex_merge(s, e, machine_format, boost::match_default | boost::format_sed); + return boost::regex_replace(s, e, machine_format, boost::match_default | boost::format_sed); } std::string human_readable_card_number(const std::string& s) { - return boost::regex_merge(s, e, human_format, boost::match_default | boost::format_sed); + return boost::regex_replace(s, e, human_format, boost::match_default | boost::format_sed); } #include diff --git a/example/snippets/regex_grep_example_1.cpp b/example/snippets/regex_grep_example_1.cpp index de9dd2c4..46438e09 100644 --- a/example/snippets/regex_grep_example_1.cpp +++ b/example/snippets/regex_grep_example_1.cpp @@ -29,7 +29,7 @@ // and searches for all the C++ class definitions, storing // their locations in a map of strings/int's -typedef std::map > map_type; +typedef std::map > map_type; const char* re = // possibly leading whitespace: @@ -61,7 +61,7 @@ class IndexClassesPred std::string::const_iterator base; public: IndexClassesPred(map_type& a, std::string::const_iterator b) : m(a), base(b) {} - bool operator()(const boost::match_results& what) + bool operator()(const boost::match_results& what) { // what[0] contains the whole string // what[5] contains the class name. diff --git a/example/snippets/regex_grep_example_2.cpp b/example/snippets/regex_grep_example_2.cpp index 3be53491..3045e094 100644 --- a/example/snippets/regex_grep_example_2.cpp +++ b/example/snippets/regex_grep_example_2.cpp @@ -30,7 +30,7 @@ // and searches for all the C++ class definitions, storing // their locations in a map of strings/int's -typedef std::map > map_type; +typedef std::map > map_type; const char* re = // possibly leading whitespace: @@ -59,7 +59,7 @@ boost::regex expression(re); map_type class_index; std::string::const_iterator base; -bool grep_callback(const boost::match_results& what) +bool grep_callback(const boost::match_results& what) { // what[0] contains the whole string // what[5] contains the class name. diff --git a/example/snippets/regex_grep_example_3.cpp b/example/snippets/regex_grep_example_3.cpp index ea70fae8..787fcb9a 100644 --- a/example/snippets/regex_grep_example_3.cpp +++ b/example/snippets/regex_grep_example_3.cpp @@ -31,7 +31,7 @@ // and searches for all the C++ class definitions, storing // their locations in a map of strings/int's -typedef std::map > map_type; +typedef std::map > map_type; const char* re = // possibly leading whitespace: @@ -62,7 +62,7 @@ class class_index map_type index; std::string::const_iterator base; - bool grep_callback(boost::match_results what); + bool grep_callback(boost::match_results what); public: map_type& get_map() { return index; } void IndexClasses(const std::string& file); @@ -72,7 +72,7 @@ public: {} }; -bool class_index::grep_callback(boost::match_results what) +bool class_index::grep_callback(boost::match_results what) { // what[0] contains the whole string // what[5] contains the class name. diff --git a/example/snippets/regex_grep_example_4.cpp b/example/snippets/regex_grep_example_4.cpp index cfc88865..105e9b93 100644 --- a/example/snippets/regex_grep_example_4.cpp +++ b/example/snippets/regex_grep_example_4.cpp @@ -63,9 +63,9 @@ class class_index boost::regex expression; map_type index; std::string::const_iterator base; - typedef boost::match_results arg_type; + typedef boost::match_results arg_type; - bool grep_callback(const boost::match_results& what); + bool grep_callback(const boost::match_results& what); public: map_type& get_map() { return index; } typedef bool (__closure* grep_callback_type)(const arg_type&); @@ -76,7 +76,7 @@ public: {} }; -bool class_index::grep_callback(const boost::match_results& what) +bool class_index::grep_callback(const boost::match_results& what) { // what[0] contains the whole string // what[5] contains the class name. diff --git a/example/snippets/regex_merge_example.cpp b/example/snippets/regex_merge_example.cpp index e6b49bdd..7741b444 100644 --- a/example/snippets/regex_merge_example.cpp +++ b/example/snippets/regex_merge_example.cpp @@ -73,12 +73,12 @@ int main(int argc, const char** argv) // temporary string stream std::ostringstream t(std::ios::out | std::ios::binary); std::ostream_iterator oi(t); - boost::regex_merge(oi, in.begin(), in.end(), e2, pre_format); + boost::regex_merge(oi, in.begin(), in.end(), e2, pre_format, boost::match_default | boost::format_all); // then output to final output stream // adding syntax highlighting: std::string s(t.str()); std::ostream_iterator out(os); - boost::regex_merge(out, s.begin(), s.end(), e1, format_string); + boost::regex_merge(out, s.begin(), s.end(), e1, format_string, boost::match_default | boost::format_all); os << footer_text; } } diff --git a/example/snippets/regex_search_example.cpp b/example/snippets/regex_search_example.cpp index 2b3d85d2..dea9bb5a 100644 --- a/example/snippets/regex_search_example.cpp +++ b/example/snippets/regex_search_example.cpp @@ -29,7 +29,7 @@ // and searches for all the C++ class definitions, storing // their locations in a map of strings/int's -typedef std::map > map_type; +typedef std::map > map_type; const char* re = // possibly leading whitespace: @@ -62,7 +62,7 @@ void IndexClasses(map_type& m, const std::string& file) start = file.begin(); end = file.end(); boost::match_results what; - unsigned int flags = boost::match_default; + boost::match_flag_type flags = boost::match_default; while(boost::regex_search(start, end, what, expression, flags)) { // what[0] contains the whole string diff --git a/example/snippets/regex_split_example_2.cpp b/example/snippets/regex_split_example_2.cpp index 94d63295..9d237d38 100644 --- a/example/snippets/regex_split_example_2.cpp +++ b/example/snippets/regex_split_example_2.cpp @@ -28,7 +28,7 @@ #include boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"", - boost::regbase::normal | boost::regbase::icase); + boost::regex::normal | boost::regbase::icase); void load_file(std::string& s, std::istream& is) { diff --git a/include/boost/cregex.hpp b/include/boost/cregex.hpp index e35a6c36..b57354fd 100644 --- a/include/boost/cregex.hpp +++ b/include/boost/cregex.hpp @@ -24,7 +24,15 @@ #ifndef BOOST_RE_CREGEX_HPP #define BOOST_RE_CREGEX_HPP +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #endif // include guard diff --git a/include/boost/regex.hpp b/include/boost/regex.hpp index b5227e45..21692007 100644 --- a/include/boost/regex.hpp +++ b/include/boost/regex.hpp @@ -28,7 +28,15 @@ #ifndef BOOST_RE_REGEX_HPP #define BOOST_RE_REGEX_HPP +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #endif // include diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 107824d8..a74f1d97 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -27,44 +27,7 @@ // this has to go *before* we include any std lib headers: // #if defined(__BORLANDC__) -# if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551) - // problems with std::basic_string and dll RTL: -# if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE) -# ifdef BOOST_REGEX_BUILD_DLL -# error _RWSTD_COMPILE_INSTANTIATE must not be defined when building regex++ as a DLL -# else -# pragma message("Defining _RWSTD_COMPILE_INSTANTIATE when linking to the DLL version of the RTL may produce memory corruption problems in std::basic_string, as a result of separate versions of basic_string's static data in the RTL and you're exe/dll: be warned!!") -# endif -# endif -# ifndef _RTLDLL - // this is harmless for a staic link: -# define _RWSTD_COMPILE_INSTANTIATE -# endif -# endif -# if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL) - // C++ Builder 4 and earlier, we can't tell whether we should be using - // the VCL runtime or not, do a static link instead: -# define BOOST_REGEX_STATIC_LINK -# endif - // - // VCL support: - // if we're building a console app then there can't be any VCL (can there?) -# if !defined(__CONSOLE__) && !defined(_NO_VCL) -# define BOOST_REGEX_USE_VCL -# endif - // - // if this isn't Win32 then don't automatically select link - // libraries: - // -# ifndef _Windows -# ifndef BOOST_REGEX_NO_LIB -# define BOOST_REGEX_NO_LIB -# endif -# ifndef BOOST_REGEX_STATIC_LINK -# define BOOST_REGEX_STATIC_LINK -# endif -# endif - +# include #endif /***************************************************************************** @@ -83,17 +46,18 @@ # include # include -# include -# include # include # include # include # include # include # include +# include +# include # include # include # include +# include #else // // C build, @@ -130,7 +94,7 @@ # define BOOST_NO_WREGEX # endif #else -# if defined(__sgi) && defined(__SGI_STL_PORT) +# if defined(__sgi) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) // STLPort on IRIX is misconfigured: does not compile // as a temporary fix include instead and prevent inclusion // of STLPort version of @@ -140,8 +104,7 @@ # endif #ifdef __cplusplus -# include -# include +# include #endif #endif @@ -259,7 +222,7 @@ using std::distance; #endif #if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) -# include +# include #endif /***************************************************************************** @@ -327,6 +290,9 @@ using std::distance; # define BOOST_REGEX_MAX_PATH 200 #endif +#ifndef BOOST_REGEX_MAX_STATE_COUNT +# define BOOST_REGEX_MAX_STATE_COUNT 100000000 +#endif /***************************************************************************** @@ -340,15 +306,13 @@ using std::distance; // If there are no exceptions then we must report critical-errors // the only way we know how; by terminating. // -#ifdef __BORLANDC__ -// seems not to make stderr usable with Borland: -#include -#endif # define BOOST_REGEX_NOEH_ASSERT(x)\ if(0 == (x))\ {\ - std::fprintf(stderr, "Error: critical regex++ failure in \"%s\"", #x);\ - std::abort();\ + std::string s("Error: critical regex++ failure in: ");\ + s.append(#x);\ + std::runtime_error e(s);\ + boost::throw_exception(e);\ } #else // @@ -416,6 +380,94 @@ public: # endif #endif +/***************************************************************************** + * + * Stack protection under MS Windows: + * + ****************************************************************************/ + +#if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3) +# if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) && !defined(__GNUC__) +# define BOOST_REGEX_HAS_MS_STACK_GUARD +# endif +#elif defined(BOOST_REGEX_HAS_MS_STACK_GUARD) +# undef BOOST_REGEX_HAS_MS_STACK_GUARD +#endif + +#if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD) + +namespace boost{ +namespace re_detail{ + +BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page(); + +} +} + +#endif + + +/***************************************************************************** + * + * Error handling: + * + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace boost{ +namespace re_detail{ + +BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_regex_exception(const std::string& s); + +template +void raise_error(const traits& t, unsigned code) +{ + (void)t; // warning suppression + raise_regex_exception(t.error_string(code)); +} + +} +} + +#endif + +/***************************************************************************** + * + * Algorithm selection and configuration: + * + ****************************************************************************/ + +#if !defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_NON_RECURSIVE) +# if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && !defined(_STLP_DEBUG) && !defined(__STL_DEBUG) +# define BOOST_REGEX_RECURSIVE +# else +# define BOOST_REGEX_NON_RECURSIVE +# endif +#endif + +#ifdef BOOST_REGEX_NON_RECURSIVE +# ifdef BOOST_REGEX_RECURSIVE +# error "Can't set both BOOST_REGEX_RECURSIVE and BOOST_REGEX_NON_RECURSIVE" +# endif +# ifndef BOOST_REGEX_BLOCKSIZE +# define BOOST_REGEX_BLOCKSIZE 4096 +# endif +# if BOOST_REGEX_BLOCKSIZE < 512 +# error "BOOST_REGEX_BLOCKSIZE must be at least 512" +# endif +# ifndef BOOST_REGEX_MAX_BLOCKS +# define BOOST_REGEX_MAX_BLOCKS 1024 +# endif +# ifdef BOOST_REGEX_HAS_MS_STACK_GUARD +# undef BOOST_REGEX_HAS_MS_STACK_GUARD +# endif +# ifndef BOOST_REGEX_MAX_CACHE_BLOCKS +# define BOOST_REGEX_MAX_CACHE_BLOCKS 16 +# endif +#endif + + /***************************************************************************** * * Fix broken compilers that wrongly #define some symbols: @@ -424,120 +476,16 @@ public: #ifdef __cplusplus -#ifdef BOOST_NO_CTYPE_FUNCTIONS - -// Make functions out of the macros. -// Use parentheses so the macros don't screw us up. -inline int (isalpha)(int c) { return isalpha(c); } -inline int (iscntrl)(int c) { return iscntrl(c); } -inline int (isdigit)(int c) { return isdigit(c); } -inline int (islower)(int c) { return islower(c); } -inline int (ispunct)(int c) { return ispunct(c); } -inline int (isspace)(int c) { return isspace(c); } -inline int (isupper)(int c) { return isupper(c); } -inline int (isxdigit)(int c) { return isxdigit(c); } - -#endif - // the following may be defined as macros; this is // incompatable with std::something syntax, we have // no choice but to undef them? -#ifdef memcpy -#undef memcpy -#endif -#ifdef memmove -#undef memmove -#endif -#ifdef memset -#undef memset -#endif #ifdef sprintf #undef sprintf #endif -#ifdef strcat -#undef strcat -#endif -#ifdef strcmp -#undef strcmp -#endif -#ifdef strcpy -#undef strcpy -#endif -#ifdef strlen -#undef strlen -#endif #ifdef swprintf #undef swprintf #endif -#ifdef wcslen -#undef wcslen -#endif -#ifdef wcscpy -#undef wcscpy -#endif -#ifdef wcscmp -#undef wcscmp -#endif -#ifdef isalpha -#undef isalpha -#endif -#ifdef iscntrl -#undef iscntrl -#endif -#ifdef isdigit -#undef isdigit -#endif -#ifdef islower -#undef islower -#endif -#ifdef isupper -#undef isupper -#endif -#ifdef ispunct -#undef ispunct -#endif -#ifdef isspace -#undef isspace -#endif -#ifdef isxdigit -#undef isxdigit -#endif - -#ifdef tolower -#undef tolower -#endif -#ifdef iswalpha -#undef iswalpha -#endif -#ifdef iswcntrl -#undef iswcntrl -#endif -#ifdef iswdigit -#undef iswdigit -#endif -#ifdef iswlower -#undef iswlower -#endif -#ifdef iswpunct -#undef iswpunct -#endif -#ifdef iswspace -#undef iswspace -#endif -#ifdef iswupper -#undef iswupper -#endif -#ifdef iswxdigit -#undef iswxdigit -#endif -#ifdef towlower -#undef towlower -#endif -#ifdef wcsxfrm -#undef wcsxfrm -#endif - #endif /***************************************************************************** @@ -551,44 +499,13 @@ inline int (isxdigit)(int c) { return isxdigit(c); } namespace std{ using ::ptrdiff_t; using ::size_t; - using ::memcpy; - using ::memmove; - using ::memset; - using ::memcmp; using ::sprintf; - using ::strcat; - using ::strcmp; - using ::strcpy; - using ::strlen; - using ::strxfrm; - using ::isalpha; - using ::iscntrl; - using ::isdigit; - using ::islower; - using ::isupper; - using ::ispunct; - using ::isspace; - using ::isxdigit; - using ::tolower; using ::abs; using ::setlocale; # ifndef BOOST_NO_WREGEX # ifndef BOOST_NO_SWPRINTF using ::swprintf; # endif - using ::wcslen; - using ::wcscpy; - using ::wcscmp; - using ::iswalpha; - using ::iswcntrl; - using ::iswdigit; - using ::iswlower; - using ::iswpunct; - using ::iswspace; - using ::iswupper; - using ::iswxdigit; - using ::towlower; - using ::wcsxfrm; using ::wcstombs; using ::mbstowcs; # if !defined(BOOST_NO_STD_LOCALE) && !defined (__STL_NO_NATIVE_MBSTATE_T) && !defined(_STLP_NO_NATIVE_MBSTATE_T) @@ -640,11 +557,3 @@ inline void pointer_construct(T* p, const T& t) #endif - - - - - - - - diff --git a/include/boost/regex/config/borland.hpp b/include/boost/regex/config/borland.hpp new file mode 100644 index 00000000..c87e6b47 --- /dev/null +++ b/include/boost/regex/config/borland.hpp @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE boost/regex/config/borland.hpp + * VERSION see + * DESCRIPTION: regex borland-specific config setup. + */ + + +#if defined(__BORLANDC__) +# if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551) + // problems with std::basic_string and dll RTL: +# if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE) +# ifdef BOOST_REGEX_BUILD_DLL +# error _RWSTD_COMPILE_INSTANTIATE must not be defined when building regex++ as a DLL +# else +# pragma message("Defining _RWSTD_COMPILE_INSTANTIATE when linking to the DLL version of the RTL may produce memory corruption problems in std::basic_string, as a result of separate versions of basic_string's static data in the RTL and you're exe/dll: be warned!!") +# endif +# endif +# ifndef _RTLDLL + // this is harmless for a staic link: +# define _RWSTD_COMPILE_INSTANTIATE +# endif +# endif +# if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL) + // C++ Builder 4 and earlier, we can't tell whether we should be using + // the VCL runtime or not, do a static link instead: +# define BOOST_REGEX_STATIC_LINK +# endif + // + // VCL support: + // if we're building a console app then there can't be any VCL (can there?) +# if !defined(__CONSOLE__) && !defined(_NO_VCL) +# define BOOST_REGEX_USE_VCL +# endif + // + // if this isn't Win32 then don't automatically select link + // libraries: + // +# ifndef _Windows +# ifndef BOOST_REGEX_NO_LIB +# define BOOST_REGEX_NO_LIB +# endif +# ifndef BOOST_REGEX_STATIC_LINK +# define BOOST_REGEX_STATIC_LINK +# endif +# endif + +#endif + diff --git a/include/boost/regex/config/cstring.hpp b/include/boost/regex/config/cstring.hpp new file mode 100644 index 00000000..4c607698 --- /dev/null +++ b/include/boost/regex/config/cstring.hpp @@ -0,0 +1,226 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE boost/regex/config/cstring.hpp + * VERSION see + * DESCRIPTION: regex narrow character string fixes. + */ + +#ifndef BOOST_REGEX_CONFIG_CSTRING_HPP +#define BOOST_REGEX_CONFIG_CSTRING_HPP + +#include +#include +#include + +namespace std{ + +#ifndef BOOST_NO_STDC_NAMESPACE +extern "C"{ +#endif + +// Any function that is a macro is converted into an inline function: +#ifdef memcmp +inline int (memcmp)(const void * p1, const void * p2, size_t s) +{ return memcmp(p1, p2, s); } +#undef memcmp +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::memcmp; +#endif + +#ifdef memcpy +inline void *(memcpy)(void * p1, const void *p2, size_t s) +{ return memcpy(p1, p2, s); } +#undef memcpy +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::memcpy; +#endif + +#ifdef memmove +inline void *(memmove)(void *, const void *, size_t) +{ return memmove(p1,p2,s); } +#undef memmove +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::memmove; +#endif + +#ifdef memset +inline void *(memset)(void *p, int a, size_t b) +{ return memset(p,a,b); } +#undef memset +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::memset; +#endif + +#ifdef strcat +inline char *(strcat)(char *p1, const char *p2) +{ return strcat(p1,p2); } +#undef strcat +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::strcat; +#endif + +#ifdef strcmp +inline int (strcmp)(const char *p1, const char *p2) +{ return strcmp(p1,p2); } +#undef strcmp +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::strcmp; +#endif + +#ifdef strcoll +inline int (strcoll)(const char *p1, const char *p2) +{ return strcoll(p1,p2); } +#undef strcoll +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::strcoll; +#endif + +#ifdef strcpy +inline char *(strcpy)(char *p1, const char *p2) +{ return strcpy(p1,p2); } +#undef strcpy +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::strcpy; +#endif + +#ifdef strlen +inline size_t (strlen)(const char *p) +{ return strlen(p); } +#undef strlen +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::strlen; +#endif + +#ifdef strxfrm +inline size_t (strxfrm)(char *p1, const char *p2, size_t s) +{ return strxfrm(p1,p2,s); } +#undef strxfrm +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::strxfrm; +#endif + +#ifdef isalnum +inline int (isalnum)(int i) +{ return isalnum(i); } +#undef isalnum +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isalnum; +#endif + +#ifdef isalpha +inline int (isalpha)(int i) +{ return isalpha(i); } +#undef isalpha +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isalpha; +#endif + +#ifdef iscntrl +inline int (iscntrl)(int i) +{ return iscntrl(i); } +#undef iscntrl +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iscntrl; +#endif + +#ifdef isdigit +inline int (isdigit)(int i) +{ return isdigit(i); } +#undef isdigit +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isdigit; +#endif + +#ifdef isgraph +inline int (isgraph)(int i) +{ return isgraph(i); } +#undef isgraph +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isgraph; +#endif + +#ifdef islower +inline int (islower)(int i) +{ return islower(i); } +#undef islower +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::islower; +#endif + +#ifdef isprint +inline int (isprint)(int i) +{ return isprint(i); } +#undef isprint +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isprint; +#endif + +#ifdef ispunct +inline int (ispunct)(int i) +{ return ispunct(i); } +#undef ispunct +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::ispunct; +#endif + +#ifdef isspace +inline int (isspace)(int i) +{ return isspace(i); } +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isspace; +#endif + +#ifdef isupper +inline int (isupper)(int i) +{ return isupper(i); } +#undef isupper +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isupper; +#endif + +#ifdef isxdigit +inline int (isxdigit)(int i) +{ return isxdigit(i); } +#undef isxdigit +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::isxdigit; +#endif + +#ifdef tolower +inline int (tolower)(int i) +{ return tolower(i); } +#undef tolower +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::tolower; +#endif + +#ifdef toupper +inline int (toupper)(int i) +{ return toupper(i); } +#undef toupper +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::toupper; +#endif + +#ifndef BOOST_NO_STDC_NAMESPACE +} // extern "C" +#endif + +} // namespace std + +#endif diff --git a/include/boost/regex/config/cwchar.hpp b/include/boost/regex/config/cwchar.hpp new file mode 100644 index 00000000..0403a252 --- /dev/null +++ b/include/boost/regex/config/cwchar.hpp @@ -0,0 +1,187 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE boost/regex/config/cwchar.hpp + * VERSION see + * DESCRIPTION: regex wide character string fixes. + */ + +#ifndef BOOST_REGEX_CONFIG_CWCHAR_HPP +#define BOOST_REGEX_CONFIG_CWCHAR_HPP + +#include +#include +#include + +namespace std{ + +#ifndef BOOST_NO_STDC_NAMESPACE +extern "C"{ +#endif + +#ifdef iswalnum +inline int (iswalnum)(wint_t i) +{ return iswalnum(i); } +#undef iswalnum +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswalnum; +#endif + +#ifdef iswalpha +inline int (iswalpha)(wint_t i) +{ return iswalpha(i); } +#undef iswalpha +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswalpha; +#endif + +#ifdef iswcntrl +inline int (iswcntrl)(wint_t i) +{ return iswcntrl(i); } +#undef iswcntrl +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswcntrl; +#endif + +#ifdef iswdigit +inline int (iswdigit)(wint_t i) +{ return iswdigit(i); } +#undef iswdigit +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswdigit; +#endif + +#ifdef iswgraph +inline int (iswgraph)(wint_t i) +{ return iswgraph(i); } +#undef iswgraph +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswgraph; +#endif + +#ifdef iswlower +inline int (iswlower)(wint_t i) +{ return iswlower(i); } +#undef iswlower +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswlower; +#endif + +#ifdef iswprint +inline int (iswprint)(wint_t i) +{ return iswprint(i); } +#undef iswprint +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswprint; +#endif + +#ifdef iswpunct +inline int (iswpunct)(wint_t i) +{ return iswpunct(i); } +#undef iswpunct +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswpunct; +#endif + +#ifdef iswspace +inline int (iswspace)(wint_t i) +{ return iswspace(i); } +#undef iswspace +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswspace; +#endif + +#ifdef iswupper +inline int (iswupper)(wint_t i) +{ return iswupper(i); } +#undef iswupper +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswupper; +#endif + +#ifdef iswxdigit +inline int (iswxdigit)(wint_t i) +{ return iswxdigit(i); } +#undef iswxdigit +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::iswxdigit; +#endif + +#ifdef towlower +inline wint_t (towlower)(wint_t i) +{ return towlower(i); } +#undef towlower +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::towlower; +#endif + +#ifdef towupper +inline wint_t (towupper)(wint_t i) +{ return towupper(i); } +#undef towupper +#elif defined(BOOST_NO_STDC_NAMESPACE) +using :: towupper; +#endif + +#ifdef wcscmp +inline int (wcscmp)(const wchar_t *p1, const wchar_t *p2) +{ return wcscmp(p1,p2); } +#undef wcscmp +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::wcscmp; +#endif + +#ifdef wcscoll +inline int (wcscoll)(const wchar_t *p1, const wchar_t *p2) +{ return wcscoll(p1,p2); } +#undef wcscoll +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::wcscoll; +#endif + +#ifdef wcscpy +inline wchar_t *(wcscpy)(wchar_t *p1, const wchar_t *p2) +{ return wcscpy(p1,p2); } +#undef wcscpy +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::wcscpy; +#endif + +#ifdef wcslen +inline size_t (wcslen)(const wchar_t *p) +{ return wcslen(p); } +#undef wcslen +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::wcslen; +#endif + +#ifdef wcsxfrm +size_t wcsxfrm(wchar_t *p1, const wchar_t *p2, size_t s) +{ return wcsxfrm(p1,p2,s); } +#undef wcsxfrm +#elif defined(BOOST_NO_STDC_NAMESPACE) +using ::wcsxfrm; +#endif + + +#ifndef BOOST_NO_STDC_NAMESPACE +} // extern "C" +#endif + +} // namespace std + +#endif diff --git a/include/boost/regex/config/regex_library_include.hpp b/include/boost/regex/config/regex_library_include.hpp new file mode 100644 index 00000000..80a0043f --- /dev/null +++ b/include/boost/regex/config/regex_library_include.hpp @@ -0,0 +1,205 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_libary_include.hpp + * VERSION see + * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +/************************************************************************* + +Libraries for Borland and Microsoft compilers are automatically +selected here, the name of the lib is selected according to the following +formula: + +BOOST_LIB_NAME + + "_" + + BOOST_LIB_TOOLSET + + "_" + + BOOST_LIB_THREAD_OPT + + BOOST_LIB_RT_OPT + + BOOST_LIB_LINK_OPT + + BOOST_LIB_DEBUG_OPT + +These are defined as: + +BOOST_LIB_NAME: The base name of the lib (boost_regex). + +BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc). + +BOOST_LIB_THREAD_OPT: "s" for single thread builds, + "m" for multithread builds. + +BOOST_LIB_RT_OPT: "s" for static runtime, + "d" for dynamic runtime. + +BOOST_LIB_LINK_OPT: "s" for static link, + "i" for dynamic link. + +BOOST_LIB_DEBUG_OPT: nothing for release builds, + "d" for debug builds, + "dd" for debug-diagnostic builds (_STLP_DEBUG). + +***************************************************************************/ + +#if !defined(BOOST_REGEX_LIBRARY_INCLUDE_HPP) && !defined(BOOST_REGEX_NO_LIB) +#define BOOST_REGEX_LIBRARY_INCLUDE_HPP + +#define BOOST_LIB_NAME "boost_regex" + +// +// select toolset: +// +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) + + // vc6-stlport: +# define BOOST_LIB_TOOLSET "vc6-stlport" + +#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1200) + + // vc6: +# define BOOST_LIB_TOOLSET "vc6" + +#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) + + // vc6-stlport: +# define BOOST_LIB_TOOLSET "vc7-stlport" + +#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) + + // vc7: +# define BOOST_LIB_TOOLSET "vc7" + +#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) + + // vc71-stlport: +# define BOOST_LIB_TOOLSET "vc71-stlport" + +#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310) + + // vc71: +# define BOOST_LIB_TOOLSET "vc71" + +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) + + // CBuilder 6: +# define BOOST_LIB_TOOLSET "bcb6" + +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) + + // CBuilder 6: +# define BOOST_LIB_TOOLSET "bcb5" + +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x540) + + // CBuilder 6: +# define BOOST_LIB_TOOLSET "bcb4" + +#endif + +// +// select thread opt: +// +#if defined(_MT) || defined(__MT__) +# define BOOST_LIB_THREAD_OPT "m" +#else +# define BOOST_LIB_THREAD_OPT "s" +#endif + +// +// select runtime opt: +// +#if defined(_DLL) || defined(_RTLDLL) +# define BOOST_LIB_RT_OPT "d" +#else +# define BOOST_LIB_RT_OPT "s" +#endif + +// +// select linkage opt: +// +#if defined(BOOST_REGEX_STATIC_LINK) && defined(BOOST_REGEX_DYN_LINK) +# undef BOOST_REGEX_STATIC_LINK +#endif +#if (defined(_DLL) || defined(_RTLDLL)) && !defined(BOOST_REGEX_STATIC_LINK) +# define BOOST_LIB_LINK_OPT "i" +#else +# define BOOST_LIB_LINK_OPT "s" +#endif + +// +// select debug opt: +// +#if defined(BOOST_MSVC) && defined(_DEBUG) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG)) +# define BOOST_LIB_DEBUG_OPT "dd" +#elif defined(BOOST_MSVC) && defined(_DEBUG) +# define BOOST_LIB_DEBUG_OPT "d" +#elif defined(__BORLANDC__) && (__BORLANDC__ == 0x560) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG)) +# define BOOST_LIB_DEBUG_OPT "dd" +#else +# define BOOST_LIB_DEBUG_OPT +#endif + +// +// now include the lib: +// +#if defined(BOOST_LIB_NAME) \ + && defined(BOOST_LIB_TOOLSET) \ + && defined(BOOST_LIB_THREAD_OPT) \ + && defined(BOOST_LIB_RT_OPT) \ + && defined(BOOST_LIB_LINK_OPT) \ + && defined(BOOST_LIB_DEBUG_OPT) + +# pragma comment(lib, BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_LINK_OPT BOOST_LIB_DEBUG_OPT ".lib") + +#endif + +// +// finally undef any macros we may have set: +// +#if defined(BOOST_LIB_NAME) +# undef BOOST_LIB_NAME +#endif +#if defined(BOOST_LIB_TOOLSET) +# undef BOOST_LIB_TOOLSET +#endif +#if defined(BOOST_LIB_THREAD_OPT) +# undef BOOST_LIB_THREAD_OPT +#endif +#if defined(BOOST_LIB_RT_OPT) +# undef BOOST_LIB_RT_OPT +#endif +#if defined(BOOST_LIB_LINK_OPT) +# undef BOOST_LIB_LINK_OPT +#endif +#if defined(BOOST_LIB_DEBUG_OPT) +# undef BOOST_LIB_DEBUG_OPT +#endif + + +#endif // BOOST_REGEX_LIBRARY_INCLUDE_HPP + + + + + + + + + diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index dd16dddd..9fdad69c 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -23,7 +23,9 @@ #ifndef BOOST_RE_PAT_EXCEPT_HPP #define BOOST_RE_PAT_EXCEPT_HPP +#ifndef BOOST_REGEX_CONFIG_HPP #include +#endif namespace boost{ diff --git a/include/boost/regex/regex_traits.hpp b/include/boost/regex/regex_traits.hpp index cee79a1e..09f9cc66 100644 --- a/include/boost/regex/regex_traits.hpp +++ b/include/boost/regex/regex_traits.hpp @@ -23,8 +23,18 @@ #ifndef BOOST_REGEX_TRAITS_HPP #define BOOST_REGEX_TRAITS_HPP -#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED -#include +#ifndef BOOST_REGEX_CONFIG_HPP +# include +#endif + +#ifdef BOOST_REGEX_V3 +# ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED +# include +# endif +#else +# ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED +# include +# endif #endif #endif // include diff --git a/include/boost/regex/user.hpp b/include/boost/regex/user.hpp index 463c0f2a..8141e10b 100644 --- a/include/boost/regex/user.hpp +++ b/include/boost/regex/user.hpp @@ -28,9 +28,9 @@ // locale: // #define BOOST_REGEX_USE_CPP_LOCALE -// define this if you want to statically link to regex, -// even when the runtime is a dll (Probably Win32 specific): -// #define BOOST_REGEX_STATIC_LINK +// define this if you want to dynamically link to regex, +// if the runtime library is also a dll (Probably Win32 specific): +// #define BOOST_REGEX_DYN_LINK // define this if you don't want the lib to automatically // select its link libraries: @@ -53,5 +53,32 @@ // cause more problems than they are worth: // #define BOOST_REGEX_NO_FWD +// define this if your compiler can't cope with the new +// version 4 regex code. +// #define BOOST_REGEX_V3 +// define this if your compiler supports MS Windows structured +// exception handling. +// #define BOOST_REGEX_HAS_MS_STACK_GUARD +// define this if you want to use the recursive algorithm +// even if BOOST_REGEX_HAS_MS_STACK_GUARD is not defined. +// #define BOOST_REGEX_RECURSIVE + +// define this if you want to use the non-recursive +// algorithm, even if the recursive version would be the default. +// #define BOOST_REGEX_NON_RECURSIVE + +// define this if you want to set the size of the memory blocks +// used by the non-recursive algorithm. +// #define BOOST_REGEX_BLOCKSIZE 4096 + +// define this if you want to set the maximum number of memory blocks +// used by the non-recursive algorithm. +// #define BOOST_REGEX_MAX_BLOCKS 1024 + +// define this if you want to set the maximum number of memory blocks +// cached by the non-recursive algorithm: Normally this is 16, but can be +// higher if you have multiple threads all using boost.regex, or lower +// if you don't want boost.regex to cache memory. +// #define BOOST_REGEX_MAX_CACHE_BLOCKS 16 diff --git a/include/boost/regex/v3/cregex.hpp b/include/boost/regex/v3/cregex.hpp index 2112abf8..fdae77d9 100644 --- a/include/boost/regex/v3/cregex.hpp +++ b/include/boost/regex/v3/cregex.hpp @@ -182,6 +182,7 @@ enum match_flags match_max = match_all }; +typedef unsigned long match_flag_type; #ifdef __cplusplus } // extern "C" @@ -254,29 +255,29 @@ public: // // now matching operators: // - bool Match(const char* p, unsigned int flags = match_default); - bool Match(const std::string& s, unsigned int flags = match_default) { return Match(s.c_str(), flags); } - bool Search(const char* p, unsigned int flags = match_default); - bool Search(const std::string& s, unsigned int flags = match_default) { return Search(s.c_str(), flags); } - unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default); - unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default) { return Grep(cb, s.c_str(), flags); } - unsigned int Grep(std::vector& v, const char* p, unsigned int flags = match_default); - unsigned int Grep(std::vector& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); } - unsigned int Grep(std::vector& v, const char* p, unsigned int flags = match_default); - unsigned int Grep(std::vector& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); } + bool Match(const char* p, match_flag_type flags = match_default); + bool Match(const std::string& s, match_flag_type flags = match_default) { return Match(s.c_str(), flags); } + bool Search(const char* p, match_flag_type flags = match_default); + bool Search(const std::string& s, match_flag_type flags = match_default) { return Search(s.c_str(), flags); } + unsigned int Grep(GrepCallback cb, const char* p, match_flag_type flags = match_default); + unsigned int Grep(GrepCallback cb, const std::string& s, match_flag_type flags = match_default) { return Grep(cb, s.c_str(), flags); } + unsigned int Grep(std::vector& v, const char* p, match_flag_type flags = match_default); + unsigned int Grep(std::vector& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); } + unsigned int Grep(std::vector& v, const char* p, match_flag_type flags = match_default); + unsigned int Grep(std::vector& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); } #ifndef BOOST_REGEX_NO_FILEITER - unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default); - unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); } - unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default); - unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); } + unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default); + unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); } + unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default); + unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); } #endif std::string Merge(const std::string& in, const std::string& fmt, - bool copy = true, unsigned int flags = match_default); + bool copy = true, match_flag_type flags = match_default); std::string Merge(const char* in, const char* fmt, - bool copy = true, unsigned int flags = match_default); + bool copy = true, match_flag_type flags = match_default); - std::size_t Split(std::vector& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0); + std::size_t Split(std::vector& v, std::string& s, match_flag_type flags = match_default, unsigned max_count = ~0); // // now operators for returning what matched in more detail: // diff --git a/include/boost/regex/v3/regex_match.hpp b/include/boost/regex/v3/regex_match.hpp index ad5362c4..e9b29cf4 100644 --- a/include/boost/regex/v3/regex_match.hpp +++ b/include/boost/regex/v3/regex_match.hpp @@ -215,11 +215,7 @@ public: } void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*) { -#ifndef BOOST_NO_STD_DISTANCE - difference_type dist = std::distance(a,b); -#else - difference_type dist = b - a; -#endif + difference_type dist = boost::re_detail::distance(a,b); states *= states; difference_type lim = std::numeric_limits::max() - 1000 - states; if(dist > (difference_type)(lim / states)) diff --git a/include/boost/regex/v3/regex_traits.hpp b/include/boost/regex/v3/regex_traits.hpp index bd8b6413..087581bf 100644 --- a/include/boost/regex/v3/regex_traits.hpp +++ b/include/boost/regex/v3/regex_traits.hpp @@ -626,6 +626,8 @@ public: cpp_regex_traits(); ~cpp_regex_traits(); + void swap(cpp_regex_traits&); + static std::size_t BOOST_REGEX_CALL length(const char_type* p) { return std::strlen(p); @@ -764,6 +766,7 @@ public: locale_type BOOST_REGEX_CALL imbue(locale_type l); locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; } std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const; + void swap(cpp_regex_traits&); struct sentry { diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp new file mode 100644 index 00000000..f84fbc41 --- /dev/null +++ b/include/boost/regex/v4/basic_regex.hpp @@ -0,0 +1,395 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE basic_regex.cpp + * VERSION see + * DESCRIPTION: Declares template class basic_regex (note that member function + * bodies are in regex_compile.hpp). + */ + +#ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP +#define BOOST_REGEX_V4_BASIC_REGEX_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ +// +// class reg_expression +// represents the compiled +// regular expression: +// + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable : 4251 4231 4660) +#endif + +#ifdef BOOST_REGEX_NO_FWD +template , class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +#else +template +#endif +class reg_expression : public regbase +{ +public: + // typedefs: + typedef typename traits::size_type traits_size_type; + typedef typename traits::uchar_type traits_uchar_type; + typedef typename traits::string_type traits_string_type; + typedef charT char_type; + typedef traits traits_type; + + typedef charT value_type; + typedef charT& reference; + typedef const charT& const_reference; + typedef const charT* const_iterator; + typedef const_iterator iterator; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::size_type size_type; + typedef Allocator allocator_type; + typedef Allocator alloc_type; + typedef regex_constants::syntax_option_type flag_type; + // locale_type + // placeholder for actual locale type used by the + // traits class to localise *this. + typedef typename traits::locale_type locale_type; + +public: + explicit reg_expression(const Allocator& a = Allocator()); + explicit reg_expression(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()); + reg_expression(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator()); + reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator()); + reg_expression(const reg_expression&); + ~reg_expression(); + reg_expression& BOOST_REGEX_CALL operator=(const reg_expression&); + reg_expression& BOOST_REGEX_CALL operator=(const charT* ptr) + { + set_expression(ptr, regex_constants::normal | regex_constants::use_except); + return *this; + } + + // + // assign: + reg_expression& assign(const reg_expression& that) + { return *this = that; } + reg_expression& assign(const charT* ptr, flag_type f = regex_constants::normal) + { + set_expression(ptr, f | regex_constants::use_except); + return *this; + } + + reg_expression& assign(const charT* first, + const charT* last, + flag_type f = regex_constants::normal) + { + set_expression(first, last, f | regex_constants::use_except); + return *this; + } +#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !(defined(__IBMCPP__) && (__IBMCPP__ <= 502)) + + template + unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string& p, flag_type f = regex_constants::normal) + { return set_expression(p.data(), p.data() + p.size(), f); } + + template + explicit reg_expression(const std::basic_string& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()) + : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regex_constants::use_except); } + + template + reg_expression(I first, I last, flag_type f = regex_constants::normal, const Allocator& al = Allocator()) + : data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0) + { + size_type len = last-first; + scoped_array a(new charT[len]); + std::copy(first, last, a.get()); + set_expression(a.get(), a.get() + len, f | regex_constants::use_except); + } + + template + reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string& p) + { + set_expression(p.c_str(), p.c_str() + p.size(), regex_constants::normal | regex_constants::use_except); + return *this; + } + + template + reg_expression& BOOST_REGEX_CALL assign( + const std::basic_string& s, + flag_type f = regex_constants::normal) + { + set_expression(s.c_str(), s.c_str() + s.size(), f | regex_constants::use_except); + return *this; + } + + template + reg_expression& BOOST_REGEX_CALL assign(fwd_iterator first, + fwd_iterator last, + flag_type f = regex_constants::normal) + { + size_type len = last-first; + scoped_array a(new charT[len]); + std::copy(first, last, a.get()); + set_expression(a.get(), a.get() + len, f | regex_constants::use_except); + return *this; + } +#else + unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string& p, flag_type f = regex_constants::normal) + { return set_expression(p.data(), p.data() + p.size(), f | regex_constants::use_except); } + + reg_expression(const std::basic_string& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()) + : data(a), pkmp(0) { set_expression(p, f | regex_constants::use_except); } + + reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string& p) + { + set_expression(p.c_str(), p.c_str() + p.size(), regex_constants::normal | regex_constants::use_except); + return *this; + } + + reg_expression& BOOST_REGEX_CALL assign( + const std::basic_string& s, + flag_type f = regex_constants::normal) + { + set_expression(s.c_str(), s.c_str() + s.size(), f | regex_constants::use_except); + return *this; + } + +#endif + + + // + // allocator access: + Allocator BOOST_REGEX_CALL get_allocator()const; + // + // locale: + locale_type BOOST_REGEX_CALL imbue(locale_type l){ return traits_inst.imbue(l); } + locale_type BOOST_REGEX_CALL getloc()const{ return traits_inst.getloc(); } + // + // flags: + flag_type BOOST_REGEX_CALL getflags()const + { return flags(); } + // + // str: + std::basic_string BOOST_REGEX_CALL str()const + { + std::basic_string result; + if(this->error_code() == 0) + result = std::basic_string(_expression, _expression_len); + return result; + } + // + // begin, end: + const_iterator BOOST_REGEX_CALL begin()const + { return (this->error_code() ? 0 : _expression); } + const_iterator BOOST_REGEX_CALL end()const + { return (this->error_code() ? 0 : _expression + _expression_len); } + // + // swap: + void BOOST_REGEX_CALL swap(reg_expression&)throw(); + // + // size: + size_type BOOST_REGEX_CALL size()const + { return (this->error_code() ? 0 : _expression_len); } + // + // max_size: + size_type BOOST_REGEX_CALL max_size()const + { return UINT_MAX; } + // + // empty: + bool BOOST_REGEX_CALL empty()const + { return 0 != this->error_code(); } + + unsigned BOOST_REGEX_CALL mark_count()const { return (this->error_code() ? 0 : marks); } + int BOOST_REGEX_CALL compare(const reg_expression&) const; + bool BOOST_REGEX_CALL operator==(const reg_expression& e)const + { return compare(e) == 0; } + bool operator != (const basic_regex& e) + { return compare(e) != 0; } + bool BOOST_REGEX_CALL operator<(const reg_expression& e)const + { return compare(e) < 0; } + bool BOOST_REGEX_CALL operator>(const reg_expression& e)const + { return compare(e) > 0; } + bool BOOST_REGEX_CALL operator<=(const reg_expression& e)const + { return compare(e) <= 0; } + bool BOOST_REGEX_CALL operator>=(const reg_expression& e)const + { return compare(e) >= 0; } + + // + // The following are deprecated as public interfaces + // but are available for compatibility with earlier versions. + allocator_type BOOST_REGEX_CALL allocator()const; + const charT* BOOST_REGEX_CALL expression()const { return (this->error_code() ? 0 : _expression); } + unsigned int BOOST_REGEX_CALL set_expression(const charT* p, const charT* end, flag_type f = regex_constants::normal); + unsigned int BOOST_REGEX_CALL set_expression(const charT* p, flag_type f = regex_constants::normal) { return set_expression(p, p + traits_type::length(p), f); } + // + // this should be private but template friends don't work: + const traits_type& get_traits()const { return traits_inst; } + unsigned int BOOST_REGEX_CALL error_code()const + { + return error_code_; + } + +private: + traits_type traits_inst; // traits class in use + re_detail::raw_storage data; // our state machine + unsigned _restart_type; // search method to use + unsigned marks; // number of marked sub-expressions + int repeats; // number of repeats + unsigned char* startmap; // characters that can match the first state(s) in the machine + std::size_t _expression_len; // length of the expression + std::size_t _leading_len; // length of any leading literal + const charT* _leading_string; // leading literal string + std::size_t _leading_string_len; // and it's length + re_detail::kmp_info* pkmp; // pointer to Knuth Morris Pratt state machine when available + unsigned error_code_; // our current status + charT* _expression; // the expression we just compiled if any + + void BOOST_REGEX_CALL compile_maps(); + void BOOST_REGEX_CALL compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal = 0)const; + bool BOOST_REGEX_CALL probe_start(re_detail::re_syntax_base* node, charT c, re_detail::re_syntax_base* terminal)const; + bool BOOST_REGEX_CALL probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const; + void BOOST_REGEX_CALL fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces); + void BOOST_REGEX_CALL move_offsets(re_detail::re_syntax_base* j, unsigned size); + re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set(const charT*& first, const charT* last); + re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_aux(re_detail::jstack& singles, re_detail::jstack& ranges, re_detail::jstack& classes, re_detail::jstack& equivalents, bool isnot, const re_detail::_narrow_type&); + re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_aux(re_detail::jstack& singles, re_detail::jstack& ranges, re_detail::jstack& classes, re_detail::jstack& equivalents, bool isnot, const re_detail::_wide_type&); + re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot = false); + unsigned int BOOST_REGEX_CALL parse_inner_set(const charT*& first, const charT* last); + + re_detail::re_syntax_base* BOOST_REGEX_CALL add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size = sizeof(re_detail::re_syntax_base)); + re_detail::re_syntax_base* BOOST_REGEX_CALL add_literal(re_detail::re_syntax_base* dat, charT c); + charT BOOST_REGEX_CALL parse_escape(const charT*& first, const charT* last); + void BOOST_REGEX_CALL parse_range(const charT*& first, const charT* last, unsigned& min, unsigned& max); + bool BOOST_REGEX_CALL skip_space(const charT*& first, const charT* last); + unsigned int BOOST_REGEX_CALL probe_restart(re_detail::re_syntax_base* dat); + unsigned int BOOST_REGEX_CALL fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end); + void BOOST_REGEX_CALL fail(unsigned int err); + +protected: + static int BOOST_REGEX_CALL repeat_count(const reg_expression& e) + { return e.repeats; } + static unsigned int BOOST_REGEX_CALL restart_type(const reg_expression& e) + { return e._restart_type; } + static const re_detail::re_syntax_base* BOOST_REGEX_CALL first(const reg_expression& e) + { return (const re_detail::re_syntax_base*)e.data.data(); } + static const unsigned char* BOOST_REGEX_CALL get_map(const reg_expression& e) + { return e.startmap; } + static std::size_t BOOST_REGEX_CALL leading_length(const reg_expression& e) + { return e._leading_len; } + static const re_detail::kmp_info* get_kmp(const reg_expression& e) + { return e.pkmp; } + static bool BOOST_REGEX_CALL can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&); + static bool BOOST_REGEX_CALL can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&); +}; + +template +void swap(reg_expression& a, reg_expression& b) +{ + a.swap(b); +} + +#ifndef BOOST_NO_STD_LOCALE +template +std::basic_ostream& + operator << (std::basic_ostream& os, + const reg_expression& e) +{ + return (os << e.str()); +} +#else +template +std::ostream& operator << (std::ostream& os, const reg_expression& e) +{ + return (os << e.str()); +} +#endif + +// +// We want to rename reg_expression basic_regex but maintain +// backwards compatibility, so class basic_regex is just a thin +// wrapper around reg_expression: +// +#ifdef BOOST_REGEX_NO_FWD +template , class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +#else +template +#endif +class basic_regex : public reg_expression +{ +public: + typedef typename reg_expression::flag_type flag_type; + typedef typename reg_expression::size_type size_type; + explicit basic_regex(const Allocator& a = Allocator()) + : reg_expression(a){} + explicit basic_regex(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()) + : reg_expression(p,f,a){} + basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator()) + : reg_expression(p1,p2,f,a){} + basic_regex(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator()) + : reg_expression(p,len,f,a){} + basic_regex(const basic_regex& that) + : reg_expression(that){} + ~basic_regex(){} + basic_regex& BOOST_REGEX_CALL operator=(const basic_regex& that) + { + this->assign(that); + return *this; + } + basic_regex& BOOST_REGEX_CALL operator=(const charT* ptr) + { + this->assign(ptr); + return *this; + } +#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !(defined(__IBMCPP__) && (__IBMCPP__ <= 502)) + template + explicit basic_regex(const std::basic_string& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()) + : reg_expression(p,f,a){} + + template + basic_regex(I first, I last, flag_type f = regex_constants::normal, const Allocator& al = Allocator()) + : reg_expression(first, last, f, a){} + + template + basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string& p) + { + this->assign(p); + return *this; + } +#else + basic_regex(const std::basic_string& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator()) + : reg_expression(p,f,a){} + + basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string& p) + { + this->assign(p); + return *this; + } +#endif +}; + +#ifdef BOOST_MSVC +#pragma warning (pop) +#endif + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/char_regex_traits.hpp b/include/boost/regex/v4/char_regex_traits.hpp new file mode 100644 index 00000000..dbaa7ae9 --- /dev/null +++ b/include/boost/regex/v4/char_regex_traits.hpp @@ -0,0 +1,85 @@ +/* + * + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE char_regex_traits.cpp + * VERSION see + * DESCRIPTION: Declares deprecated traits classes char_regex_traits<>. + */ + + +#ifndef BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP +#define BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ + +namespace deprecated{ +// +// class char_regex_traits_i +// provides case insensitive traits classes (deprecated): +template +class char_regex_traits_i : public regex_traits {}; + +template<> +class char_regex_traits_i : public regex_traits +{ +public: + typedef char char_type; + typedef unsigned char uchar_type; + typedef unsigned int size_type; + typedef regex_traits base_type; + + char BOOST_REGEX_CALL translate(char c, bool)const + { + return static_cast*>(this)->translate(c, true); + } +}; + +#ifndef BOOST_NO_WREGEX +template<> +class char_regex_traits_i : public regex_traits +{ +public: + typedef wchar_t char_type; + typedef unsigned short uchar_type; + typedef unsigned int size_type; + typedef regex_traits base_type; + + wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool)const + { + return static_cast*>(this)->translate(c, true); + } + boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const + { + boost::uint_fast32_t result = static_cast*>(this)->lookup_classname(first, last); + if((result & base_type::char_class_upper) == base_type::char_class_upper) + result |= base_type::char_class_alpha; + return result; + } +}; +#endif +} // namespace deprecated +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif // include diff --git a/include/boost/regex/v4/cregex.hpp b/include/boost/regex/v4/cregex.hpp new file mode 100644 index 00000000..db01056a --- /dev/null +++ b/include/boost/regex/v4/cregex.hpp @@ -0,0 +1,293 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE cregex.cpp + * VERSION see + * DESCRIPTION: Declares POSIX API functions + * + boost::RegEx high level wrapper. + */ + +#ifndef BOOST_RE_CREGEX_HPP_INCLUDED +#define BOOST_RE_CREGEX_HPP_INCLUDED + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif +#include + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +/* include these defs only for POSIX compatablity */ +#ifdef __cplusplus +namespace boost{ +extern "C" { +#endif + +#if defined(__cplusplus) && !defined(BOOST_NO_STDC_NAMESPACE) +typedef std::ptrdiff_t regoff_t; +typedef std::size_t regsize_t; +#else +typedef ptrdiff_t regoff_t; +typedef size_t regsize_t; +#endif + +typedef struct +{ + unsigned int re_magic; + unsigned int re_nsub; /* number of parenthesized subexpressions */ + const char* re_endp; /* end pointer for REG_PEND */ + void* guts; /* none of your business :-) */ + match_flag_type eflags; /* none of your business :-) */ +} regex_tA; + +#ifndef BOOST_NO_WREGEX +typedef struct +{ + unsigned int re_magic; + unsigned int re_nsub; /* number of parenthesized subexpressions */ + const wchar_t* re_endp; /* end pointer for REG_PEND */ + void* guts; /* none of your business :-) */ + match_flag_type eflags; /* none of your business :-) */ +} regex_tW; +#endif + +typedef struct +{ + regoff_t rm_so; /* start of match */ + regoff_t rm_eo; /* end of match */ +} regmatch_t; + +/* regcomp() flags */ +typedef enum{ + REG_BASIC = 0000, + REG_EXTENDED = 0001, + REG_ICASE = 0002, + REG_NOSUB = 0004, + REG_NEWLINE = 0010, + REG_NOSPEC = 0020, + REG_PEND = 0040, + REG_DUMP = 0200, + REG_NOCOLLATE = 0400, + REG_ESCAPE_IN_LISTS = 01000, + REG_NEWLINE_ALT = 02000, + REG_PERLEX = 04000, + + REG_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS | REG_PERLEX, + REG_AWK = REG_EXTENDED | REG_ESCAPE_IN_LISTS, + REG_GREP = REG_BASIC | REG_NEWLINE_ALT, + REG_EGREP = REG_EXTENDED | REG_NEWLINE_ALT, + + REG_ASSERT = 15, + REG_INVARG = 16, + REG_ATOI = 255, /* convert name to number (!) */ + REG_ITOA = 0400 /* convert number to name (!) */ +} reg_comp_flags; + +/* regexec() flags */ +typedef enum{ + REG_NOTBOL = 00001, + REG_NOTEOL = 00002, + REG_STARTEND = 00004 +} reg_exec_flags; + +BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA*, const char*, int); +BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int, const regex_tA*, char*, regsize_t); +BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int); +BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeA(regex_tA*); + +#ifndef BOOST_NO_WREGEX +BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW*, const wchar_t*, int); +BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int, const regex_tW*, wchar_t*, regsize_t); +BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW*, const wchar_t*, regsize_t, regmatch_t*, int); +BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*); +#endif + +#ifdef UNICODE +#define regcomp regcompW +#define regerror regerrorW +#define regexec regexecW +#define regfree regfreeW +#define regex_t regex_tW +#else +#define regcomp regcompA +#define regerror regerrorA +#define regexec regexecA +#define regfree regfreeA +#define regex_t regex_tA +#endif + +/* regerror() flags */ +typedef enum +{ + REG_NOERROR = 0, /* Success. */ + REG_NOMATCH = 1, /* Didn't find a match (for regexec). */ + + /* POSIX regcomp return error codes. (In the order listed in the + standard.) */ + REG_BADPAT = 2, /* Invalid pattern. */ + REG_ECOLLATE = 3, /* Undefined collating element. */ + REG_ECTYPE = 4, /* Invalid character class name. */ + REG_EESCAPE = 5, /* Trailing backslash. */ + REG_ESUBREG = 6, /* Invalid back reference. */ + REG_EBRACK = 7, /* Unmatched left bracket. */ + REG_EPAREN = 8, /* Parenthesis imbalance. */ + REG_EBRACE = 9, /* Unmatched \{. */ + REG_BADBR = 10, /* Invalid contents of \{\}. */ + REG_ERANGE = 11, /* Invalid range end. */ + REG_ESPACE = 12, /* Ran out of memory. */ + REG_BADRPT = 13, /* No preceding re for repetition op. */ + REG_EEND = 14, /* unexpected end of expression */ + REG_ESIZE = 15, /* expression too big */ + REG_ERPAREN = 16, /* unmatched right parenthesis */ + REG_EMPTY = 17, /* empty expression */ + REG_E_MEMORY = REG_ESIZE, /* out of memory */ + REG_E_UNKNOWN = 18 /* unknown error */ +} reg_errcode_t; + + +#ifdef __cplusplus +} // extern "C" +} // namespace +#endif + + +#ifdef __BORLANDC__ + #if __BORLANDC__ > 0x520 + #pragma option pop + #endif +#endif + + +// +// C++ high level wrapper goes here: +// +#if defined(__cplusplus) +#include +#include +namespace boost{ + +#ifdef __BORLANDC__ + #if __BORLANDC__ == 0x530 + #pragma option push -a4 -b + #elif __BORLANDC__ > 0x530 + #pragma option push -a8 -b + #endif +#endif + +class RegEx; + +namespace re_detail{ + +class RegExData; +struct pred1; +struct pred2; +struct pred3; +struct pred4; + +} // namespace re_detail + +#if defined(BOOST_MSVC) || defined(__BORLANDC__) +typedef bool (__cdecl *GrepCallback)(const RegEx& expression); +typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression); +typedef bool (__cdecl *FindFilesCallback)(const char* file); +#else +typedef bool (*GrepCallback)(const RegEx& expression); +typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression); +typedef bool (*FindFilesCallback)(const char* file); +#endif + +class BOOST_REGEX_DECL RegEx +{ +private: + re_detail::RegExData* pdata; +public: + RegEx(); + RegEx(const RegEx& o); + ~RegEx(); + explicit RegEx(const char* c, bool icase = false); + explicit RegEx(const std::string& s, bool icase = false); + RegEx& operator=(const RegEx& o); + RegEx& operator=(const char* p); + RegEx& operator=(const std::string& s){ return this->operator=(s.c_str()); } + unsigned int SetExpression(const char* p, bool icase = false); + unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); } + std::string Expression()const; + unsigned int error_code()const; + // + // now matching operators: + // + bool Match(const char* p, match_flag_type flags = match_default); + bool Match(const std::string& s, match_flag_type flags = match_default) { return Match(s.c_str(), flags); } + bool Search(const char* p, match_flag_type flags = match_default); + bool Search(const std::string& s, match_flag_type flags = match_default) { return Search(s.c_str(), flags); } + unsigned int Grep(GrepCallback cb, const char* p, match_flag_type flags = match_default); + unsigned int Grep(GrepCallback cb, const std::string& s, match_flag_type flags = match_default) { return Grep(cb, s.c_str(), flags); } + unsigned int Grep(std::vector& v, const char* p, match_flag_type flags = match_default); + unsigned int Grep(std::vector& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); } + unsigned int Grep(std::vector& v, const char* p, match_flag_type flags = match_default); + unsigned int Grep(std::vector& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); } +#ifndef BOOST_REGEX_NO_FILEITER + unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default); + unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); } + unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default); + unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); } +#endif + + std::string Merge(const std::string& in, const std::string& fmt, + bool copy = true, match_flag_type flags = match_default); + std::string Merge(const char* in, const char* fmt, + bool copy = true, match_flag_type flags = match_default); + + std::size_t Split(std::vector& v, std::string& s, match_flag_type flags = match_default, unsigned max_count = ~0); + // + // now operators for returning what matched in more detail: + // + std::size_t Position(int i = 0)const; + std::size_t Length(int i = 0)const; + bool Matched(int i = 0)const; + unsigned int Marks()const; + std::string What(int i = 0)const; + std::string operator[](int i)const { return What(i); } + + static const unsigned int npos; + + friend struct re_detail::pred1; + friend struct re_detail::pred2; + friend struct re_detail::pred3; + friend struct re_detail::pred4; +}; + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif + +#endif // include guard + + + + + + + + + diff --git a/include/boost/regex/v4/fileiter.hpp b/include/boost/regex/v4/fileiter.hpp new file mode 100644 index 00000000..eaf18ba2 --- /dev/null +++ b/include/boost/regex/v4/fileiter.hpp @@ -0,0 +1,456 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE fileiter.hpp + * VERSION see + * DESCRIPTION: Declares various platform independent file and + * directory iterators, plus binary file input in + * the form of class map_file. + */ + +#ifndef BOOST_RE_FILEITER_HPP_INCLUDED +#define BOOST_RE_FILEITER_HPP_INCLUDED + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +#ifndef BOOST_REGEX_NO_FILEITER + +#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(BOOST_REGEX_NO_W32) +#error "Sorry, can't mix with STL code and gcc compiler: if you ran configure, try again with configure --disable-ms-windows" +#define BOOST_REGEX_FI_WIN32_MAP +#define BOOST_REGEX_FI_POSIX_DIR +#elif (defined(__WIN32__) || defined(_WIN32) || defined(WIN32)) && !defined(BOOST_REGEX_NO_W32) +#define BOOST_REGEX_FI_WIN32_MAP +#define BOOST_REGEX_FI_WIN32_DIR +#else +#define BOOST_REGEX_FI_POSIX_MAP +#define BOOST_REGEX_FI_POSIX_DIR +#endif + +#if defined(BOOST_REGEX_FI_WIN32_MAP)||defined(BOOST_REGEX_FI_WIN32_DIR) +#include +#endif + +#if defined(BOOST_REGEX_FI_WIN32_DIR) + +namespace boost{ + namespace re_detail{ + +typedef WIN32_FIND_DATAA _fi_find_data; +typedef HANDLE _fi_find_handle; + + } // namespace re_detail + +} // namespace boost + +#define _fi_invalid_handle INVALID_HANDLE_VALUE +#define _fi_dir FILE_ATTRIBUTE_DIRECTORY + +#elif defined(BOOST_REGEX_FI_POSIX_DIR) + +#include +#include +#include +#include +#include +#include + +#if defined(__SUNPRO_CC) +using std::list; +#endif + +#ifndef MAX_PATH +#define MAX_PATH 256 +#endif + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +struct _fi_find_data +{ + unsigned dwFileAttributes; + char cFileName[MAX_PATH]; +}; + +struct _fi_priv_data; + +typedef _fi_priv_data* _fi_find_handle; +#define _fi_invalid_handle 0 +#define _fi_dir 1 + +_fi_find_handle _fi_FindFirstFile(const char* lpFileName, _fi_find_data* lpFindFileData); +bool _fi_FindNextFile(_fi_find_handle hFindFile, _fi_find_data* lpFindFileData); +bool _fi_FindClose(_fi_find_handle hFindFile); + +#ifdef __BORLANDC__ + #if __BORLANDC__ > 0x520 + #pragma option pop + #endif +#endif + + } // namespace re_detail +} // namespace boost + +#ifdef FindFirstFile + #undef FindFirstFile +#endif +#ifdef FindNextFile + #undef FindNextFile +#endif +#ifdef FindClose + #undef FindClose +#endif + +#define FindFirstFileA _fi_FindFirstFile +#define FindNextFileA _fi_FindNextFile +#define FindClose _fi_FindClose + +#endif + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #if __BORLANDC__ == 0x530 + #pragma option push -a4 -b + #elif __BORLANDC__ > 0x530 + #pragma option push -a8 -b + #endif +#endif + +#ifdef BOOST_REGEX_FI_WIN32_MAP // win32 mapfile + +class BOOST_REGEX_DECL mapfile +{ + HANDLE hfile; + HANDLE hmap; + const char* _first; + const char* _last; +public: + + typedef const char* iterator; + + mapfile(){ hfile = hmap = 0; _first = _last = 0; } + mapfile(const char* file){ hfile = hmap = 0; _first = _last = 0; open(file); } + ~mapfile(){ close(); } + void open(const char* file); + void close(); + const char* begin(){ return _first; } + const char* end(){ return _last; } + size_t size(){ return _last - _first; } + bool valid(){ return (hfile != 0) && (hfile != INVALID_HANDLE_VALUE); } +}; + + +#else + +class BOOST_REGEX_DECL mapfile_iterator; + +class BOOST_REGEX_DECL mapfile +{ + typedef char* pointer; + std::FILE* hfile; + long int _size; + pointer* _first; + pointer* _last; + mutable std::list condemed; + enum sizes + { + buf_size = 4096 + }; + void lock(pointer* node)const; + void unlock(pointer* node)const; +public: + + typedef mapfile_iterator iterator; + + mapfile(){ hfile = 0; _size = 0; _first = _last = 0; } + mapfile(const char* file){ hfile = 0; _size = 0; _first = _last = 0; open(file); } + ~mapfile(){ close(); } + void open(const char* file); + void close(); + iterator begin()const; + iterator end()const; + unsigned long size()const{ return _size; } + bool valid()const{ return hfile != 0; } + friend class mapfile_iterator; +}; + +class BOOST_REGEX_DECL mapfile_iterator +#if !defined(BOOST_NO_STD_ITERATOR) || defined(BOOST_MSVC_STD_ITERATOR) +: public std::iterator +#endif +{ + typedef mapfile::pointer internal_pointer; + internal_pointer* node; + const mapfile* file; + unsigned long offset; + long position()const + { + return file ? ((node - file->_first) * mapfile::buf_size + offset) : 0; + } + void position(long pos) + { + if(file) + { + node = file->_first + (pos / mapfile::buf_size); + offset = pos % mapfile::buf_size; + } + } +public: + typedef std::ptrdiff_t difference_type; + typedef char value_type; + typedef const char* pointer; + typedef const char& reference; + typedef std::random_access_iterator_tag iterator_category; + + mapfile_iterator() { node = 0; file = 0; offset = 0; } + mapfile_iterator(const mapfile* f, long position) + { + file = f; + node = f->_first + position / mapfile::buf_size; + offset = position % mapfile::buf_size; + if(file) + file->lock(node); + } + mapfile_iterator(const mapfile_iterator& i) + { + file = i.file; + node = i.node; + offset = i.offset; + if(file) + file->lock(node); + } + ~mapfile_iterator() + { + if(file && node) + file->unlock(node); + } + mapfile_iterator& operator = (const mapfile_iterator& i); + char operator* ()const + { + assert(node >= file->_first); + assert(node < file->_last); + return file ? *(*node + sizeof(int) + offset) : char(0); + } + char operator[] (long off)const + { + mapfile_iterator tmp(*this); + tmp += off; + return *tmp; + } + mapfile_iterator& operator++ (); + mapfile_iterator operator++ (int); + mapfile_iterator& operator-- (); + mapfile_iterator operator-- (int); + + mapfile_iterator& operator += (long off) + { + position(position() + off); + return *this; + } + mapfile_iterator& operator -= (long off) + { + position(position() - off); + return *this; + } + + friend inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j) + { + return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset); + } + + friend inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return !(i == j); + } + + friend inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() < j.position(); + } + friend inline bool operator>(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() > j.position(); + } + friend inline bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() <= j.position(); + } + friend inline bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() >= j.position(); + } + + friend mapfile_iterator operator + (const mapfile_iterator& i, long off); + friend mapfile_iterator operator + (long off, const mapfile_iterator& i) + { + mapfile_iterator tmp(i); + return tmp += off; + } + friend mapfile_iterator operator - (const mapfile_iterator& i, long off); + friend inline long operator - (const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() - j.position(); + } +}; + +#endif + +// _fi_sep determines the directory separator, either '\\' or '/' +BOOST_REGEX_DECL extern const char* _fi_sep; + +struct file_iterator_ref +{ + _fi_find_handle hf; + _fi_find_data _data; + long count; +}; + + +class BOOST_REGEX_DECL file_iterator +{ + char* _root; + char* _path; + char* ptr; + file_iterator_ref* ref; + +public: + typedef std::ptrdiff_t difference_type; + typedef const char* value_type; + typedef const char** pointer; + typedef const char*& reference; + typedef std::input_iterator_tag iterator_category; + + file_iterator(); + file_iterator(const char* wild); + ~file_iterator(); + file_iterator(const file_iterator&); + file_iterator& operator=(const file_iterator&); + const char* root()const { return _root; } + const char* path()const { return _path; } + const char* name()const { return ptr; } + _fi_find_data* data() { return &(ref->_data); } + void next(); + file_iterator& operator++() { next(); return *this; } + file_iterator operator++(int); + const char* operator*() { return path(); } + + friend inline bool operator == (const file_iterator& f1, const file_iterator& f2) + { + return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); + } + + friend inline bool operator != (const file_iterator& f1, const file_iterator& f2) + { + return !(f1 == f2); + } + +}; + +// dwa 9/13/00 - suppress unused parameter warning +inline bool operator < (const file_iterator&, const file_iterator&) +{ + return false; +} + + +class BOOST_REGEX_DECL directory_iterator +{ + char* _root; + char* _path; + char* ptr; + file_iterator_ref* ref; + +public: + typedef std::ptrdiff_t difference_type; + typedef const char* value_type; + typedef const char** pointer; + typedef const char*& reference; + typedef std::input_iterator_tag iterator_category; + + directory_iterator(); + directory_iterator(const char* wild); + ~directory_iterator(); + directory_iterator(const directory_iterator& other); + directory_iterator& operator=(const directory_iterator& other); + + const char* root()const { return _root; } + const char* path()const { return _path; } + const char* name()const { return ptr; } + _fi_find_data* data() { return &(ref->_data); } + void next(); + directory_iterator& operator++() { next(); return *this; } + directory_iterator operator++(int); + const char* operator*() { return path(); } + + static const char* separator() { return _fi_sep; } + + friend inline bool operator == (const directory_iterator& f1, const directory_iterator& f2) + { + return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); + } + + + friend inline bool operator != (const directory_iterator& f1, const directory_iterator& f2) + { + return !(f1 == f2); + } + + }; + +inline bool operator < (const directory_iterator&, const directory_iterator&) +{ + return false; +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + + +} // namespace re_detail +using boost::re_detail::directory_iterator; +using boost::re_detail::file_iterator; +using boost::re_detail::mapfile; +} // namespace boost + +#endif // BOOST_REGEX_NO_FILEITER +#endif // BOOST_RE_FILEITER_HPP + + + + + + + + + + + + + + + + + diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp new file mode 100644 index 00000000..1ec9498a --- /dev/null +++ b/include/boost/regex/v4/instances.hpp @@ -0,0 +1,135 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE instances.cpp + * VERSION see + * DESCRIPTION: Defines those template instances that are placed in the + * library rather than in the users object files. + */ + +// +// note no include guard, we may include this multiple times: +// +#ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES + +namespace boost{ + +// +// this header can be included multiple times, each time with +// a different character type, BOOST_REGEX_CHAR_T must be defined +// first: +// +#ifndef BOOST_REGEX_CHAR_T +# error "BOOST_REGEX_CHAR_T not defined" +#endif + +// +// what follows is compiler specific: +// + +#ifdef __BORLANDC__ + +#pragma option push -a8 -b -Vx -Ve -pc + +# ifndef BOOST_REGEX_INSTANTIATE +# pragma option push -Jgx +# endif + +template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >; + +# ifndef BOOST_REGEX_INSTANTIATE +# pragma option pop +# endif + +#pragma option pop + +#elif defined(BOOST_MSVC) + +# ifndef BOOST_REGEX_INSTANTIATE +# define template extern template +# endif + +#pragma warning(push) +#pragma warning(disable : 4251 4231 4660) + +template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >; + +#pragma warning(pop) + +# ifdef template +# undef template +# endif + +#elif !defined(BOOST_REGEX_HAS_DLL_RUNTIME) + +// +// for each [member] function declare a full specialisation of that +// [member] function, then instantiate it in one translation unit. +// This is not guarenteed to work according to the standard, but in +// practice it should work for all compilers (unless they use a realy +// perverse name mangling convention). Unfortunately this approach +// does *not* work for Win32 style import/export, because that can +// alter the class layout. +// + +# ifndef BOOST_REGEX_INSTANTIATE +# define template template<> +# endif + +template reg_expression::reg_expression(const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)&); +template reg_expression::reg_expression(const BOOST_REGEX_CHAR_T* p, reg_expression::flag_type f, const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)& a); +template reg_expression::reg_expression(const BOOST_REGEX_CHAR_T* p, size_type len, reg_expression::flag_type f, const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)&); +template reg_expression::reg_expression(const reg_expression&); +template reg_expression::~reg_expression(); +template reg_expression& BOOST_REGEX_CALL reg_expression::operator=(const reg_expression&); +template BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) BOOST_REGEX_CALL reg_expression::get_allocator()const; +template bool BOOST_REGEX_CALL reg_expression::operator==(const reg_expression&)const; +template bool BOOST_REGEX_CALL reg_expression::operator<(const reg_expression&)const; +template BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) BOOST_REGEX_CALL reg_expression::allocator()const; +template unsigned int BOOST_REGEX_CALL reg_expression::set_expression(const BOOST_REGEX_CHAR_T* p, const BOOST_REGEX_CHAR_T* end, reg_expression::flag_type f); +template void BOOST_REGEX_CALL reg_expression::compile_maps(); +template void BOOST_REGEX_CALL reg_expression::compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const; +template bool BOOST_REGEX_CALL reg_expression::probe_start(re_detail::re_syntax_base* node, BOOST_REGEX_CHAR_T c, re_detail::re_syntax_base* terminal)const; +template bool BOOST_REGEX_CALL reg_expression::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const; +template void BOOST_REGEX_CALL reg_expression::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces); +template void BOOST_REGEX_CALL reg_expression::move_offsets(re_detail::re_syntax_base* j, unsigned size); +template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last); +template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set_aux(re_detail::jstack::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& singles, re_detail::jstack::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack& classes, re_detail::jstack::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& equivalents, bool isnot, const re_detail::_narrow_type&); +template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set_aux(re_detail::jstack::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& singles, re_detail::jstack::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack& classes, re_detail::jstack::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& equivalents, bool isnot, const re_detail::_wide_type&); +template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot); +template unsigned int BOOST_REGEX_CALL reg_expression::parse_inner_set(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last); +template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size); +template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::add_literal(re_detail::re_syntax_base* dat, BOOST_REGEX_CHAR_T c); +template BOOST_REGEX_CHAR_T BOOST_REGEX_CALL reg_expression::parse_escape(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last); +template void BOOST_REGEX_CALL reg_expression::parse_range(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, unsigned& min, unsigned& max); +template bool BOOST_REGEX_CALL reg_expression::skip_space(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last); +template unsigned int BOOST_REGEX_CALL reg_expression::probe_restart(re_detail::re_syntax_base* dat); +template unsigned int BOOST_REGEX_CALL reg_expression::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end); +template void BOOST_REGEX_CALL reg_expression::fail(unsigned int err); + +# ifdef template +# undef template +# endif + +#endif + +} // namespace boost + +#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES + + + diff --git a/include/boost/regex/v4/iterator_category.hpp b/include/boost/regex/v4/iterator_category.hpp new file mode 100644 index 00000000..23cf5e43 --- /dev/null +++ b/include/boost/regex/v4/iterator_category.hpp @@ -0,0 +1,85 @@ +/* + * + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_match.hpp + * VERSION see + * DESCRIPTION: Iterator traits for selecting an iterator type as + * an integral constant expression. + */ + + +#ifndef BOOST_REGEX_ITERATOR_CATEGORY_HPP +#define BOOST_REGEX_ITERATOR_CATEGORY_HPP + +#include +#include +#include + +namespace boost{ +namespace detail{ + +template +struct is_random_imp +{ +private: + typedef typename std::iterator_traits::iterator_category cat; +public: + BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible::value)); +}; + +template +struct is_random_pointer_imp +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template +struct is_random_imp_selector +{ + template + struct rebind + { + typedef is_random_imp type; + }; +}; + +template <> +struct is_random_imp_selector +{ + template + struct rebind + { + typedef is_random_pointer_imp type; + }; +}; + +} + +template +struct is_random_access_iterator +{ +private: + typedef detail::is_random_imp_selector< ::boost::is_pointer::value> selector; + typedef typename selector::template rebind bound_type; + typedef typename bound_type::type answer; +public: + BOOST_STATIC_CONSTANT(bool, value = answer::value); +}; + +} + +#endif diff --git a/include/boost/regex/v4/iterator_traits.hpp b/include/boost/regex/v4/iterator_traits.hpp new file mode 100644 index 00000000..42f22241 --- /dev/null +++ b/include/boost/regex/v4/iterator_traits.hpp @@ -0,0 +1,106 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE iterator_traits.cpp + * VERSION see + * DESCRIPTION: Declares iterator traits workarounds. + */ + +#ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP +#define BOOST_REGEX_V4_ITERATOR_TRAITS_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ +namespace re_detail{ + +#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template +struct regex_iterator_traits +{ + typedef typename T::iterator_category iterator_category; + typedef typename T::value_type value_type; +#if !defined(BOOST_NO_STD_ITERATOR) + typedef typename T::difference_type difference_type; + typedef typename T::pointer pointer; + typedef typename T::reference reference; +#else + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type& reference; +#endif +}; + +template +struct pointer_iterator_traits +{ + typedef std::ptrdiff_t difference_type; + typedef T value_type; + typedef T* pointer; + typedef T& reference; + typedef std::random_access_iterator_tag iterator_category; +}; +template +struct const_pointer_iterator_traits +{ + typedef std::ptrdiff_t difference_type; + typedef T value_type; + typedef const T* pointer; + typedef const T& reference; + typedef std::random_access_iterator_tag iterator_category; +}; + +template<> +struct regex_iterator_traits : pointer_iterator_traits{}; +template<> +struct regex_iterator_traits : const_pointer_iterator_traits{}; +template<> +struct regex_iterator_traits : pointer_iterator_traits{}; +template<> +struct regex_iterator_traits : const_pointer_iterator_traits{}; + +#if defined(__SGI_STL_PORT) && defined(__STL_DEBUG) +template<> +struct regex_iterator_traits : pointer_iterator_traits{}; +template<> +struct regex_iterator_traits : const_pointer_iterator_traits{}; +#ifndef BOOST_NO_STD_WSTRING +template<> +struct regex_iterator_traits : pointer_iterator_traits{}; +template<> +struct regex_iterator_traits : const_pointer_iterator_traits{}; +#endif // BOOST_NO_WSTRING +#endif // stport + +#else + +template +struct regex_iterator_traits : public std::iterator_traits {}; + +#endif + +} // namespace re_detail +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp new file mode 100644 index 00000000..b12c3519 --- /dev/null +++ b/include/boost/regex/v4/match_flags.hpp @@ -0,0 +1,132 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE match_flags.hpp + * VERSION see + * DESCRIPTION: Declares match_flags type. + */ + +#ifndef BOOST_REGEX_V4_MATCH_FLAGS +#define BOOST_REGEX_V4_MATCH_FLAGS + +#ifdef __cplusplus +# include +#endif + +#ifdef __cplusplus +namespace boost{ + namespace regex_constants{ +#endif + +typedef enum _match_flags +{ + match_default = 0, + match_not_bol = 1, // first is not start of line + match_not_eol = match_not_bol << 1, // last is not end of line + match_not_bob = match_not_eol << 1, // first is not start of buffer + match_not_eob = match_not_bob << 1, // last is not end of buffer + match_not_bow = match_not_eob << 1, // first is not start of word + match_not_eow = match_not_bow << 1, // last is not end of word + match_not_dot_newline = match_not_eow << 1, // \n is not matched by '.' + match_not_dot_null = match_not_dot_newline << 1, // '\0' is not matched by '.' + match_prev_avail = match_not_dot_null << 1, // *--first is a valid expression + match_init = match_prev_avail << 1, // internal use + match_any = match_init << 1, // don't care what we match + match_not_null = match_any << 1, // string can't be null + match_continuous = match_not_null << 1, // each grep match must continue from + // uninterupted from the previous one + match_partial = match_continuous << 1, // find partial matches + + match_stop = match_partial << 1, // stop after first match (grep) V3 only + match_not_initial_null = match_stop, // don't match initial null, V4 only + match_all = match_stop << 1, // must find the whole of input even if match_any is set + match_perl = match_all << 1, // Use perl matching rules + match_posix = match_perl << 1, // Use POSIX matching rules + match_nosubs = match_posix << 1, // don't trap marked subs + match_max = match_nosubs, + + format_perl = 0, // perl style replacement + format_default = 0, // ditto. + format_sed = match_max << 1, // sed style replacement. + format_all = format_sed << 1, // enable all extentions to sytax. + format_no_copy = format_all << 1, // don't copy non-matching segments. + format_first_only = format_no_copy << 1, // Only replace first occurance. + format_is_if = format_first_only << 1 // internal use only. + +} match_flags; + +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1200) +typedef unsigned long match_flag_type; +#else +typedef match_flags match_flag_type; + + +#ifdef __cplusplus +inline match_flags operator&(match_flags m1, match_flags m2) +{ return static_cast(static_cast(m1) & static_cast(m2)); } +inline match_flags operator|(match_flags m1, match_flags m2) +{ return static_cast(static_cast(m1) | static_cast(m2)); } +inline match_flags operator^(match_flags m1, match_flags m2) +{ return static_cast(static_cast(m1) ^ static_cast(m2)); } +inline match_flags operator~(match_flags m1) +{ return static_cast(~static_cast(m1)); } +inline match_flags& operator&=(match_flags& m1, match_flags m2) +{ m1 = m1&m2; return m1; } +inline match_flags& operator|=(match_flags& m1, match_flags m2) +{ m1 = m1|m2; return m1; } +inline match_flags& operator^=(match_flags& m1, match_flags m2) +{ m1 = m1^m2; return m1; } +#endif +#endif + +#ifdef __cplusplus +} // namespace regex_constants +// +// import names into boost for backwards compatiblity: +// +using regex_constants::match_flag_type; +using regex_constants::match_default; +using regex_constants::match_not_bol; +using regex_constants::match_not_eol; +using regex_constants::match_not_bob; +using regex_constants::match_not_eob; +using regex_constants::match_not_bow; +using regex_constants::match_not_eow; +using regex_constants::match_not_dot_newline; +using regex_constants::match_not_dot_null; +using regex_constants::match_prev_avail; +//using regex_constants::match_init; +using regex_constants::match_any; +using regex_constants::match_not_null; +using regex_constants::match_continuous; +using regex_constants::match_partial; +//using regex_constants::match_stop; +using regex_constants::match_all; +using regex_constants::match_perl; +using regex_constants::match_posix; +using regex_constants::match_nosubs; +//using regex_constants::match_max; +using regex_constants::format_all; +using regex_constants::format_sed; +using regex_constants::format_perl; +using regex_constants::format_no_copy; +using regex_constants::format_first_only; +//using regex_constants::format_is_if; + +} // namespace boost +#endif // __cplusplus +#endif // include guard diff --git a/include/boost/regex/v4/match_results.hpp b/include/boost/regex/v4/match_results.hpp new file mode 100644 index 00000000..b767e415 --- /dev/null +++ b/include/boost/regex/v4/match_results.hpp @@ -0,0 +1,320 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE match_results.cpp + * VERSION see + * DESCRIPTION: Declares template class match_results. + */ + +#ifndef BOOST_REGEX_V4_MATCH_RESULTS_HPP +#define BOOST_REGEX_V4_MATCH_RESULTS_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ + +template ) + > +class match_results +{ +private: +#ifndef BOOST_NO_STD_ALLOCATOR + typedef std::vector, Allocator> vector_type; +#else + typedef std::vector > vector_type; +#endif +public: + typedef sub_match value_type; + typedef const value_type& const_reference; + typedef const_reference reference; + typedef typename vector_type::const_iterator const_iterator; + typedef const_iterator iterator; + typedef typename re_detail::regex_iterator_traits< + RandomAccessIterator>::difference_type difference_type; + typedef typename Allocator::size_type size_type; + typedef Allocator allocator_type; + typedef typename re_detail::regex_iterator_traits< + RandomAccessIterator>::value_type char_type; + typedef std::basic_string string_type; + + // construct/copy/destroy: + explicit match_results(const Allocator& a = Allocator()) +#ifndef BOOST_NO_STD_ALLOCATOR + : m_subs(a), m_base() {} +#else + : m_subs(), m_base() { (void)a; } +#endif + match_results(const match_results& m) + : m_subs(m.m_subs), m_base(m.m_base) {} + match_results& operator=(const match_results& m) + { + m_subs = m.m_subs; + m_base = m.m_base; + return *this; + } + ~match_results(){} + + // size: + size_type size() const + { return m_subs.size() - 2; } + size_type max_size() const + { return m_subs.max_size(); } + bool empty() const + { return m_subs.size() < 2; } + // element access: + difference_type length(int sub = 0) const + { + sub += 2; + if((sub < (int)m_subs.size()) && (sub > 0)) + return m_subs[sub].length(); + return 0; + } + difference_type position(unsigned int sub = 0) const + { + sub += 2; + if(sub < m_subs.size()) + { + const sub_match& s = m_subs[sub]; + if(s.matched) + { + return boost::re_detail::distance((RandomAccessIterator)(m_base), (RandomAccessIterator)(s.first)); + } + } + return ~static_cast(0); + } + string_type str(int sub = 0) const + { + sub += 2; + string_type result; + if(sub < m_subs.size() && (sub > 0)) + { + const sub_match& s = m_subs[sub]; + if(s.matched) + { + result = s; + } + } + return result; + } + const_reference operator[](int sub) const + { + sub += 2; + if(sub < (int)m_subs.size() && (sub >= 0)) + { + return m_subs[sub]; + } + assert(0); + // we should never get here: + return m_subs[0]; + } + + const_reference prefix() const + { + return (*this)[-1]; + } + + const_reference suffix() const + { + return (*this)[-2]; + } + const_iterator begin() const + { + return (m_subs.size() > 2) ? (m_subs.begin() + 2) : m_subs.end(); + } + const_iterator end() const + { + m_subs.end(); + } + // format: + template + OutputIterator format(OutputIterator out, + const string_type& fmt, + match_flag_type flags = format_default) const + { + return regex_format(out, *this, fmt, flags); + } + string_type format(const string_type& fmt, + match_flag_type flags = format_default) const + { + return regex_format(*this, fmt, flags); + } + + allocator_type get_allocator() const + { +#ifndef BOOST_NO_STD_ALLOCATOR + return m_subs.get_allocator(); +#else + return allocator_type(); +#endif + } + void swap(match_results& that) + { + std::swap(m_subs, that.m_subs); + std::swap(m_base, that.m_base); + } + bool operator==(const match_results& that)const + { + return (m_subs == that.m_subs) && (m_base == that.m_base); + } + bool operator!=(const match_results& that)const + { return !(*this == that); } + + // + // private access functions: + void BOOST_REGEX_CALL set_second(RandomAccessIterator i) + { + assert(m_subs.size() > 2); + m_subs[2].second = i; + m_subs[2].matched = true; + m_subs[0].first = i; + m_subs[0].matched = (m_subs[0].first != m_subs[0].second); + } + + void BOOST_REGEX_CALL set_second(RandomAccessIterator i, size_type pos, bool m = true) + { + pos += 2; + assert(m_subs.size() > pos); + m_subs[pos].second = i; + m_subs[pos].matched = m; + if(pos == 2) + { + m_subs[0].first = i; + m_subs[0].matched = (m_subs[0].first != m_subs[0].second); + } + } + void BOOST_REGEX_CALL set_size(size_type n, RandomAccessIterator i, RandomAccessIterator j) + { + value_type v(j); + size_type len = m_subs.size(); + if(len > n + 2) + { + m_subs.erase(m_subs.begin()+n+2); + std::fill(m_subs.begin(), m_subs.end(), v); + } + else + { + std::fill(m_subs.begin(), m_subs.end(), v); + if(n+2 != len) + m_subs.insert(m_subs.end(), n+2-len, v); + } + m_subs[1].first = i; + } + void BOOST_REGEX_CALL set_base(RandomAccessIterator pos) + { + m_base = pos; + } + void BOOST_REGEX_CALL set_first(RandomAccessIterator i) + { + // set up prefix: + m_subs[1].second = i; + m_subs[1].matched = (m_subs[1].first != i); + // set up $0: + m_subs[2].first = i; + // zero out everything else: + for(size_type n = 3; n < m_subs.size(); ++n) + { + m_subs[n].first = m_subs[n].second = m_subs[0].second; + m_subs[n].matched = false; + } + } + void BOOST_REGEX_CALL set_first(RandomAccessIterator i, size_type pos) + { + assert(pos+2 < m_subs.size()); + if(pos) + m_subs[pos+2].first = i; + else + set_first(i); + } + void BOOST_REGEX_CALL maybe_assign(const match_results& m); + + +private: + vector_type m_subs; // subexpressions + RandomAccessIterator m_base; // where the search started from +}; + +template +void BOOST_REGEX_CALL match_results::maybe_assign(const match_results& m) +{ + const_iterator p1, p2; + p1 = begin(); + p2 = m.begin(); + RandomAccessIterator base = (*this)[-1].first; + std::size_t len1 = 0; + std::size_t len2 = 0; + std::size_t base1 = 0; + std::size_t base2 = 0; + std::size_t i; + for(i = 0; i < size(); ++i) + { + // + // leftmost takes priority over longest: + base1 = boost::re_detail::distance(base, p1->first); + base2 = boost::re_detail::distance(base, p2->first); + if(base1 < base2) return; + if(base2 < base1) break; + + len1 = boost::re_detail::distance(p1->first, p1->second); + len2 = boost::re_detail::distance(p2->first, p2->second); + if((len1 != len2) || ((p1->matched == false) && (p2->matched == true))) + break; + if((p1->matched == true) && (p2->matched == false)) + return; + ++p1; + ++p2; + } + if(i == size()) + return; + if(base2 < base1) + *this = m; + else if((len2 > len1) || ((p1->matched == false) && (p2->matched == true)) ) + *this = m; +} + +template +void swap(match_results& a, match_results& b) +{ + a.swap(b); +} + +#ifndef BOOST_NO_STD_LOCALE +template +std::basic_ostream& + operator << (std::basic_ostream& os, + const match_results& s) +{ + return (os << s.str()); +} +#else +template +std::ostream& operator << (std::ostream& os, + const match_results& s) +{ + return (os << s.str()); +} +#endif + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/mem_block_cache.hpp b/include/boost/regex/v4/mem_block_cache.hpp new file mode 100644 index 00000000..75e1928e --- /dev/null +++ b/include/boost/regex/v4/mem_block_cache.hpp @@ -0,0 +1,97 @@ + /* + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE mem_block_cache.hpp + * VERSION see + * DESCRIPTION: memory block cache used by the non-recursive matcher. + */ + +#ifndef BOOST_REGEX_V4_MEM_BLOCK_CACHE_HPP +#define BOOST_REGEX_V4_MEM_BLOCK_CACHE_HPP + +#include +#include + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ +namespace re_detail{ + +struct mem_block_node +{ + mem_block_node* next; +}; + +struct mem_block_cache +{ + // this member has to be statically initialsed: + mem_block_node* next; + unsigned cached_blocks; + + ~mem_block_cache() + { + while(next) + { + mem_block_node* old = next; + next = next->next; + ::operator delete(old); + } + } + void* get() + { +#ifdef BOOST_HAS_THREADS + re_detail::cs_guard g(*re_detail::p_re_lock); +#endif + if(next) + { + mem_block_node* result = next; + next = next->next; + --cached_blocks; + return result; + } + return ::operator new(BOOST_REGEX_BLOCKSIZE); + } + void put(void* p) + { +#ifdef BOOST_HAS_THREADS + re_detail::cs_guard g(*re_detail::p_re_lock); +#endif + if(cached_blocks >= BOOST_REGEX_MAX_CACHE_BLOCKS) + { + ::operator delete(p); + } + else + { + mem_block_node* old = static_cast(p); + old->next = next; + next = old; + ++cached_blocks; + } + } +}; + +extern mem_block_cache block_cache; + +} +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp new file mode 100644 index 00000000..fcbd9882 --- /dev/null +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -0,0 +1,436 @@ +/* + * + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + +#ifndef BOOST_REGEX_MATCHER_HPP +#define BOOST_REGEX_MATCHER_HPP + +#include +#include + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8026 -w-8027 +#endif + +namespace boost{ +namespace re_detail{ + + // +// Unfortunately Rogue Waves standard library appears to have a bug +// in std::basic_string::compare that results in eroneous answers +// in some cases (tested with Borland C++ 5.1, Rogue Wave lib version +// 0x020101) the test case was: +// {39135,0} < {0xff,0} +// which succeeds when it should not. +// +#ifndef _RWSTD_VER +# define STR_COMP(s,p) s.compare(p) +#else +template +inline int string_compare(const std::basic_string& s, const C* p) +{ return s.compare(p); } +inline int string_compare(const std::string& s, const char* p) +{ return std::strcmp(s.c_str(), p); } +# ifndef BOOST_NO_WREGEX +inline int string_compare(const std::wstring& s, const wchar_t* p) +{ return std::wcscmp(s.c_str(), p); } +#endif +# define STR_COMP(s,p) string_compare(s,p) +#endif + +template +inline const charT* re_skip_past_null(const charT* p) +{ + while (*p != 0) ++p; + return ++p; +} + +template +iterator BOOST_REGEX_CALL re_is_set_member(iterator next, + iterator last, + const re_set_long* set_, + const reg_expression& e) +{ + const charT* p = reinterpret_cast(set_+1); + iterator ptr; + unsigned int i; + bool icase = e.flags() & regex_constants::icase; + + if(next == last) return next; + + typedef typename traits_type::string_type traits_string_type; + const traits_type& traits_inst = e.get_traits(); + + // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never + // referenced + (void)traits_inst; + + // try and match a single character, could be a multi-character + // collating element... + for(i = 0; i < set_->csingles; ++i) + { + ptr = next; + if(*p == 0) + { + // treat null string as special case: + if(traits_inst.translate(*ptr, icase) != *p) + { + while(*p == 0)++p; + continue; + } + return set_->isnot ? next : (ptr == next) ? ++next : ptr; + } + else + { + while(*p && (ptr != last)) + { + if(traits_inst.translate(*ptr, icase) != *p) + break; + ++p; + ++ptr; + } + + if(*p == 0) // if null we've matched + return set_->isnot ? next : (ptr == next) ? ++next : ptr; + + p = re_skip_past_null(p); // skip null + } + } + + charT col = traits_inst.translate(*next, icase); + + + if(set_->cranges || set_->cequivalents) + { + traits_string_type s2(1, col); + traits_string_type s1; + // + // try and match a range, NB only a single character can match + if(set_->cranges) + { + if((e.flags() & regex_constants::collate) == 0) + s1 = s2; + else + traits_inst.transform(s1, s2); + for(i = 0; i < set_->cranges; ++i) + { + if(STR_COMP(s1, p) <= 0) + { + while(*p)++p; + ++p; + if(STR_COMP(s1, p) >= 0) + return set_->isnot ? next : ++next; + } + else + { + // skip first string + while(*p)++p; + ++p; + } + // skip second string + while(*p)++p; + ++p; + } + } + // + // try and match an equivalence class, NB only a single character can match + if(set_->cequivalents) + { + traits_inst.transform_primary(s1, s2); + for(i = 0; i < set_->cequivalents; ++i) + { + if(STR_COMP(s1, p) == 0) + return set_->isnot ? next : ++next; + // skip string + while(*p)++p; + ++p; + } + } + } + if(traits_inst.is_class(col, set_->cclasses) == true) + return set_->isnot ? next : ++next; + return set_->isnot ? ++next : next; +} + +template +struct access_t : public reg_expression +{ + typedef typename is_byte::width_type width_type; + typedef reg_expression base_type; + typedef charT char_type; + typedef traits traits_type; + typedef Allocator alloc_type; + + static int repeat_count(const base_type& b) + { return base_type::repeat_count(b); } + static unsigned int restart_type(const base_type& b) + { return base_type::restart_type(b); } + static const re_syntax_base* first(const base_type& b) + { return base_type::first(b); } + static const unsigned char* get_map(const base_type& b) + { return base_type::get_map(b); } + static std::size_t leading_length(const base_type& b) + { return base_type::leading_length(b); } + static const kmp_info* get_kmp(const base_type& b) + { return base_type::get_kmp(b); } + static bool can_start(char_type c, const unsigned char* _map, unsigned char mask) + { + return reg_expression::can_start(c, _map, mask, width_type()); + } +}; + + +template +class repeater_count +{ + repeater_count** stack; + repeater_count* next; + int id; + unsigned count; // the number of iterations so far + BidiIterator start_pos; // where the last repeat started +public: + repeater_count(repeater_count** s) + { + stack = s; + next = 0; + id = -1; + count = 0; + } + repeater_count(int i, repeater_count** s, BidiIterator start) + : start_pos(start) + { + id = i; + stack = s; + next = *stack; + *stack = this; + if(id > next->id) + count = 0; + else + { + repeater_count* p = next; + while(p->id != id) + p = p->next; + count = p->count; + start_pos = p->start_pos; + } + } + ~repeater_count() + { + *stack = next; + } + unsigned get_count() { return count; } + int get_id() { return id; } + int operator++() { return ++count; } + bool check_null_repeat(const BidiIterator& pos, unsigned max) + { + // this is called when we are about to start a new repeat, + // if the last one was NULL move our count to max, + // otherwise save the current position. + bool result = (count == 0) ? false : (pos == start_pos); + if(result) + count = max; + else + start_pos = pos; + return result; + } +}; + +struct saved_state; + +template +class perl_matcher +{ +public: + typedef typename boost::re_detail::regex_iterator_traits::value_type char_type; + typedef perl_matcher self_type; + typedef bool (self_type::*matcher_proc_type)(void); + typedef access_t access; + typedef typename traits::size_type traits_size_type; + typedef typename traits::uchar_type traits_uchar_type; + typedef typename is_byte::width_type width_type; + typedef typename regex_iterator_traits::difference_type difference_type; + + perl_matcher(BidiIterator first, BidiIterator end, + match_results& what, + const reg_expression& e, + match_flag_type f); + + bool match(); + bool find(); + + void setf(match_flag_type f) + { m_match_flags |= f; } + void unsetf(match_flag_type f) + { m_match_flags &= ~f; } + +private: + void estimate_max_state_count(std::random_access_iterator_tag*); + void estimate_max_state_count(void*); + bool match_prefix(); + bool match_all_states(); + + // match procs, stored in s_match_vtable: + bool match_startmark(); + bool match_endmark(); + bool match_literal(); + bool match_start_line(); + bool match_end_line(); + bool match_wild(); + bool match_match(); + bool match_word_boundary(); + bool match_within_word(); + bool match_word_start(); + bool match_word_end(); + bool match_buffer_start(); + bool match_buffer_end(); + bool match_backref(); + bool match_long_set(); + bool match_set(); + bool match_jump(); + bool match_alt(); + bool match_rep(); + bool match_combining(); + bool match_soft_buffer_end(); + bool match_restart_continue(); + bool match_long_set_repeat(); + bool match_set_repeat(); + bool match_char_repeat(); + bool match_dot_repeat_fast(); + bool match_dot_repeat_slow(); + bool backtrack_till_match(unsigned count); + + // find procs stored in s_find_vtable: + bool find_restart_any(); + bool find_restart_word(); + bool find_restart_line(); + bool find_restart_buf(); + bool find_restart_lit(); + +private: + // final result structure to be filled in: + match_results& m_result; + // temporary result for POSIX matches: + scoped_ptr > m_temp_match; + // pointer to actual result structure to fill in: + match_results* m_presult; + // start of sequence being searched: + BidiIterator base; + // end of sequence being searched: + BidiIterator last; + // current character being examined: + BidiIterator position; + // where to restart next search after failed match attempt: + BidiIterator restart; + // where the current search started from, acts as base for $` during grep: + BidiIterator search_base; + // the expression being examined: + const reg_expression& re; + // the expression's traits class: + const traits& traits_inst; + // the next state in the machine being matched: + const re_syntax_base* pstate; + // matching flags in use: + match_flag_type m_match_flags; + // how many states we have examined so far: + difference_type state_count; + // max number of states to examine before giving up: + difference_type max_state_count; + // whether we should ignore case or not: + bool icase; + // set to true when (position == last), indicates that we may have a partial match: + bool m_has_partial_match; + // set to true whenever we get a match: + bool m_has_found_match; + // the current repeat being examined: + repeater_count* next_count; + // the first repeat being examined (top of linked list): + repeater_count rep_obj; + + // table of functions to match states: + static const matcher_proc_type s_match_vtable[]; + // table of functions to search for matching attempt start: + static const matcher_proc_type s_find_vtable[]; + + +#ifdef BOOST_REGEX_NON_RECURSIVE + // + // additional members for non-recursive version: + // + typedef bool (self_type::*unwind_proc_type)(bool); + + void extend_stack(); + bool unwind(bool); + bool unwind_end(bool); + bool unwind_paren(bool); + bool unwind_recursion_stopper(bool); + bool unwind_assertion(bool); + bool unwind_alt(bool); + bool unwind_repeater_counter(bool); + bool unwind_extra_block(bool); + bool unwind_greedy_single_repeat(bool); + bool unwind_slow_dot_repeat(bool); + bool unwind_fast_dot_repeat(bool); + bool unwind_char_repeat(bool); + bool unwind_short_set_repeat(bool); + bool unwind_long_set_repeat(bool); + bool unwind_non_greedy_repeat(bool); + void destroy_single_repeat(); + void push_matched_paren(int index, const sub_match& sub); + void push_recursion_stopper(); + void push_assertion(const re_syntax_base* ps, bool positive); + void push_alt(const re_syntax_base* ps); + void push_repeater_count(int i, repeater_count** s); + void push_single_repeat(unsigned c, const re_repeat* r, BidiIterator last_position, int id); + void push_non_greedy_repeat(const re_syntax_base* ps); + + + // pointer to base of stack: + saved_state* m_stack_base; + // pointer to current stack position: + saved_state* m_backup_state; + // determines what value to return when unwinding from recursion, + // allows for mixed recursive/non-recursive algorithm: + bool m_recursive_result; + // how many memory blocks have we used up?: + unsigned used_block_count; + // table of pointers to unwind proceedures: + static const unwind_proc_type s_unwind_table[]; +#endif + + // these operations aren't allowed, so are declared private: + perl_matcher& operator=(const perl_matcher&); + perl_matcher(const perl_matcher&); +}; + +} // namespace re_detail + +} // namespace boost + +// +// include the implementation of perl_matcher: +// +#ifdef BOOST_REGEX_RECURSIVE +#include +#else +#include +#include +#endif +// this one has to be last: +#include + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp new file mode 100644 index 00000000..4a950467 --- /dev/null +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -0,0 +1,832 @@ +/* + * + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE perl_matcher_common.cpp + * VERSION see + * DESCRIPTION: Definitions of perl_matcher member functions that are + * common to both the recursive and non-recursive versions. + */ + +#ifndef BOOST_REGEX_V4_PERL_MATCHER_COMMON_HPP +#define BOOST_REGEX_V4_PERL_MATCHER_COMMON_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 -w-8066 -w-8008 +#endif + +namespace boost{ +namespace re_detail{ + +template +perl_matcher::perl_matcher(BidiIterator first, BidiIterator end, + match_results& what, + const reg_expression& e, + match_flag_type f) + : m_result(what), base(first), last(end), + position(first), re(e), traits_inst(e.get_traits()), + next_count(&rep_obj), rep_obj(&next_count) +{ + typedef typename regex_iterator_traits::iterator_category category; + + pstate = 0; + m_match_flags = f; + icase = re.flags() & regex_constants::icase; + estimate_max_state_count(static_cast(0)); + if(!(m_match_flags & (match_perl|match_posix))) + { + if(re.flags() & regex_constants::perlex) + m_match_flags |= match_perl; + else + m_match_flags |= match_posix; + } + if(m_match_flags & match_posix) + { + m_temp_match.reset(new match_results()); + m_presult = m_temp_match.get(); + } + else + m_presult = &m_result; +#ifdef BOOST_REGEX_NON_RECURSIVE + m_stack_base = 0; + m_backup_state = 0; +#endif +} + +template +void perl_matcher::estimate_max_state_count(std::random_access_iterator_tag*) +{ + difference_type dist = boost::re_detail::distance(base, last); + traits_size_type states = static_cast(re.size()); + states *= states; + difference_type lim = std::numeric_limits::max() - 1000 - states; + if(dist > (difference_type)(lim / states)) + max_state_count = lim; + else + max_state_count = 1000 + states * dist; +} +template +void perl_matcher::estimate_max_state_count(void*) +{ + // we don't know how long the sequence is: + max_state_count = BOOST_REGEX_MAX_STATE_COUNT; +} + + + +template +bool perl_matcher::match() +{ +#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD + __try{ +#endif + // initialise our stack if we are non-recursive: +#ifdef BOOST_REGEX_NON_RECURSIVE + save_state_init init(&m_stack_base, &m_backup_state); + used_block_count = BOOST_REGEX_MAX_BLOCKS; + try{ +#endif + + // reset our state machine: + position = base; + search_base = base; + state_count = 0; + m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last); + m_presult->set_base(base); + if(m_match_flags & match_posix) + m_result = *m_presult; + if(0 == match_prefix()) + return false; + return m_result[0].second == last; + +#ifdef BOOST_REGEX_NON_RECURSIVE + } + catch(...) + { + // unwind all pushed states, apart from anything else this + // ensures that all the states are correctly destructed + // not just the memory freed. + while(unwind(true)){} + throw; + } +#endif +#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD + }__except(EXCEPTION_STACK_OVERFLOW == GetExceptionCode()) + { + reset_stack_guard_page(); + } + // we only get here after a stack overflow: + raise_error(traits_inst, REG_E_MEMORY); + // and we never really get here at all: + return false; +#endif +} + +template +bool perl_matcher::find() +{ +#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD + __try{ +#endif + + // initialise our stack if we are non-recursive: +#ifdef BOOST_REGEX_NON_RECURSIVE + save_state_init init(&m_stack_base, &m_backup_state); + used_block_count = BOOST_REGEX_MAX_BLOCKS; + try{ +#endif + + state_count = 0; + if((m_match_flags & regex_constants::match_init) == 0) + { + // reset our state machine: + position = base; + search_base = base; + pstate = access::first(re); + m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last); + m_presult->set_base(base); + m_match_flags |= regex_constants::match_init; + } + else + { + // start again: + search_base = position = (*m_presult)[0].second; + // If last match was null and match_not_null was not set then increment + // our start position, otherwise we go into an infinite loop: + if(((m_match_flags & match_not_null) == 0) && (m_presult->length() == 0)) + { + if(position == last) + return false; + else + ++position; + } + // reset $` start: + m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last); + if(base != search_base) + m_match_flags |= match_prev_avail; + } + if(m_match_flags & match_posix) + { + m_result.set_size(re.mark_count(), base, last); + m_result.set_base(base); + } + + // find out what kind of expression we have: + unsigned type = (m_match_flags & match_continuous) ? + static_cast(regbase::restart_continue) + : static_cast(access::restart_type(re)); + + // call the appropriate search routine: + matcher_proc_type proc = s_find_vtable[type]; + return (this->*proc)(); + +#ifdef BOOST_REGEX_NON_RECURSIVE + } + catch(...) + { + // unwind all pushed states, apart from anything else this + // ensures that all the states are correctly destructed + // not just the memory freed. + while(unwind(true)){} + throw; + } +#endif +#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD + }__except(EXCEPTION_STACK_OVERFLOW == GetExceptionCode()) + { + reset_stack_guard_page(); + } + // we only get here after a stack overflow: + raise_error(traits_inst, REG_E_MEMORY); + // and we never really get here at all: + return false; +#endif +} + +template +bool perl_matcher::match_prefix() +{ + m_has_partial_match = false; + m_has_found_match = false; + pstate = access::first(re); + m_presult->set_first(position); + restart = position; + match_all_states(); + if(!m_has_found_match && m_has_partial_match && (m_match_flags & match_partial)) + { + m_has_found_match = true; + m_presult->set_second(last, 0, false); + position = last; + } + if(!m_has_found_match) + position = restart; // reset search postion + return m_has_found_match; +} + +template +bool perl_matcher::match_endmark() +{ + int index = static_cast(pstate)->index; + if(index > 0) + { + if((m_match_flags & match_nosubs) == 0) + m_presult->set_second(position, index); + } + else if(index < 0) + { + // matched forward lookahead: + pstate = 0; + return true; + } + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_literal() +{ + unsigned int len = static_cast(pstate)->length; + const char_type* what = reinterpret_cast(static_cast(pstate) + 1); + // + // compare string with what we stored in + // our records: + for(unsigned int i = 0; i < len; ++i, ++position) + { + if((position == last) || (traits_inst.translate(*position, icase) != what[i])) + return false; + } + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_start_line() +{ + if((position == base) && ((m_match_flags & match_prev_avail) == 0)) + { + if((m_match_flags & match_not_bol) == 0) + { + pstate = pstate->next.p; + return true; + } + return false; + } + + // check the previous value character: + BidiIterator t(position); + --t; + if(position != last) + { + if(traits_inst.is_separator(*t) && !((*t == '\r') && (*position == '\n')) ) + { + pstate = pstate->next.p; + return true; + } + } + else if(traits_inst.is_separator(*t)) + { + pstate = pstate->next.p; + return true; + } + return false; +} + +template +bool perl_matcher::match_end_line() +{ + if(position != last) + { + // we're not yet at the end so *first is always valid: + if(traits_inst.is_separator(*position)) + { + if((position != base) || (m_match_flags & match_prev_avail)) + { + // check that we're not in the middle of \r\n sequence + BidiIterator t(position); + --t; + if((*t == '\r') && (*position == '\n')) + { + return false; + } + } + pstate = pstate->next.p; + return true; + } + } + else if((m_match_flags & match_not_eol) == 0) + { + pstate = pstate->next.p; + return true; + } + return false; +} + +template +bool perl_matcher::match_wild() +{ + if(position == last) + return false; + if(traits_inst.is_separator(*position) && (m_match_flags & match_not_dot_newline)) + return false; + if((*position == char_type(0)) && (m_match_flags & match_not_dot_null)) + return false; + pstate = pstate->next.p; + ++position; + return true; +} + +template +bool perl_matcher::match_match() +{ + if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first)) + return false; + if((m_match_flags & match_all) && (position != last)) + return false; + if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base)) + return false; + m_presult->set_second(position); + pstate = 0; + m_has_found_match = true; + if((m_match_flags & (match_posix|match_any)) == match_posix) + { + m_result.maybe_assign(*m_presult); + return false; + } + return true; +} + +template +bool perl_matcher::match_word_boundary() +{ + bool b; // indcates whether next character is a word character + if(position != last) + { + // prev and this character must be opposites: + #if defined(BOOST_REGEX_USE_C_LOCALE) && defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ < 95) + b = traits::is_class(*position, traits::char_class_word); + #else + b = traits_inst.is_class(*position, traits::char_class_word); + #endif + } + else + { + b = (m_match_flags & match_not_eow) ? true : false; + } + if((position == base) && ((m_match_flags & match_prev_avail) == 0)) + { + if(m_match_flags & match_not_bow) + b ^= true; + else + b ^= false; + } + else + { + --position; + b ^= traits_inst.is_class(*position, traits::char_class_word); + ++position; + } + if(b) + { + pstate = pstate->next.p; + return true; + } + return false; // no match if we get to here... +} + +template +bool perl_matcher::match_within_word() +{ + if(position == last) + return false; + // both prev and this character must be traits::char_class_word: + if(traits_inst.is_class(*position, traits::char_class_word)) + { + bool b; + if((position == base) && ((m_match_flags & match_prev_avail) == 0)) + return false; + else + { + --position; + b = traits_inst.is_class(*position, traits::char_class_word); + ++position; + } + if(b) + { + pstate = pstate->next.p; + return true; + } + } + return false; +} + +template +bool perl_matcher::match_word_start() +{ + if(position == last) + return false; // can't be starting a word if we're already at the end of input + if(!traits_inst.is_class(*position, traits::char_class_word)) + return false; // next character isn't a word character + if((position == base) && ((m_match_flags & match_prev_avail) == 0)) + { + if(m_match_flags & match_not_bow) + return false; // no previous input + } + else + { + // otherwise inside buffer: + BidiIterator t(position); + --t; + if(traits_inst.is_class(*t, traits::char_class_word)) + return false; // previous character not non-word + } + // OK we have a match: + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_word_end() +{ + if((position == base) && ((m_match_flags & match_prev_avail) == 0)) + return false; // start of buffer can't be end of word + BidiIterator t(position); + --t; + if(traits_inst.is_class(*t, traits::char_class_word) == false) + return false; // previous character wasn't a word character + + if(position == last) + { + if(m_match_flags & match_not_eow) + return false; // end of buffer but not end of word + } + else + { + // otherwise inside buffer: + if(traits_inst.is_class(*position, traits::char_class_word)) + return false; // next character is a word character + } + pstate = pstate->next.p; + return true; // if we fall through to here then we've succeeded +} + +template +bool perl_matcher::match_buffer_start() +{ + if((position != base) || (m_match_flags & match_not_bob)) + return false; + // OK match: + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_buffer_end() +{ + if((position != last) || (m_match_flags & match_not_eob)) + return false; + // OK match: + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_backref() +{ + // compare with what we previously matched: + BidiIterator i = (*m_presult)[static_cast(pstate)->index].first; + BidiIterator j = (*m_presult)[static_cast(pstate)->index].second; + while(i != j) + { + if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase))) + return false; + ++i; + ++position; + } + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_long_set() +{ + // let the traits class do the work: + if(position == last) + return false; + BidiIterator t = re_is_set_member(position, last, static_cast(pstate), re); + if(t != position) + { + pstate = pstate->next.p; + position = t; + return true; + } + return false; +} + +template +bool perl_matcher::match_set() +{ + if(position == last) + return false; + if(static_cast(pstate)->_map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + pstate = pstate->next.p; + ++position; + return true; + } + return false; +} + +template +bool perl_matcher::match_jump() +{ + pstate = static_cast(pstate)->alt.p; + return true; +} + +template +bool perl_matcher::match_combining() +{ + if(position == last) + return false; + if(traits_inst.is_combining(traits_inst.translate(*position, icase))) + return false; + ++position; + while((position != last) && traits_inst.is_combining(traits_inst.translate(*position, icase))) + ++position; + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_soft_buffer_end() +{ + if(m_match_flags & match_not_eob) + return false; + BidiIterator p(position); + while((p != last) && traits_inst.is_separator(traits_inst.translate(*p, icase)))++p; + if(p != last) + return false; + pstate = pstate->next.p; + return true; +} + +template +bool perl_matcher::match_restart_continue() +{ + if(position == search_base) + { + pstate = pstate->next.p; + return true; + } + return false; +} + +template +bool perl_matcher::find_restart_any() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const unsigned char* _map = access::get_map(re); + while(true) + { + // skip everything we can't match: + while((position != last) && !access::can_start(*position, _map, (unsigned char)mask_any) ) + ++position; + if(position == last) + { + // run out of characters, try a null match if possible: + if(access::first(re)->can_be_null) + return match_prefix(); + return false; + } + // now try and obtain a match: + if(match_prefix()) + return true; + if(position == last) + return false; + ++position; + } + return false; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::find_restart_word() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + // do search optimised for word starts: + const unsigned char* _map = access::get_map(re); + if((m_match_flags & match_prev_avail) || (position != base)) + --position; + else if(match_prefix()) + return true; + do + { + while((position != last) && traits_inst.is_class(*position, traits::char_class_word)) + ++position; + while((position != last) && !traits_inst.is_class(*position, traits::char_class_word)) + ++position; + if(position == last) + return false; + + if(access::can_start(*position, _map, (unsigned char)mask_any) ) + { + if(match_prefix()) + return true; + } + if(position == last) + return false; + } while(true); + return false; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::find_restart_line() +{ + // do search optimised for line starts: + const unsigned char* _map = access::get_map(re); + if(match_prefix()) + return true; + while(position != last) + { + while((position != last) && (*position != '\n')) + ++position; + if(position == last) + return false; + ++position; + if(position == last) + { + if((access::first(re)->can_be_null) && match_prefix()) + return true; + return false; + } + + if( access::can_start(*position, _map, (unsigned char)mask_any) ) + { + if(match_prefix()) + return true; + } + if(position == last) + return false; + ++position; + } + return false; +} + +template +bool perl_matcher::find_restart_buf() +{ + if((position == base) && ((m_match_flags & match_not_bob) == 0)) + return match_prefix(); + return false; +} + +template +bool perl_matcher::find_restart_lit() +{ + if(position == last) + return false; // can't possibly match if we're at the end already + + unsigned type = (m_match_flags & match_continuous) ? + static_cast(regbase::restart_continue) + : static_cast(access::restart_type(re)); + + const kmp_info* info = access::get_kmp(re); + int len = info->len; + const char_type* x = info->pstr; + int j = 0; + bool icase = re.flags() & regex_constants::icase; + while (position != last) + { + while((j > -1) && (x[j] != traits_inst.translate(*position, icase))) + j = info->kmp_next[j]; + ++position; + ++j; + if(j >= len) + { + if(type == regbase::restart_fixed_lit) + { + std::advance(position, -j); + restart = position; + std::advance(restart, len); + m_result.set_first(position); + m_result.set_second(restart); + position = restart; + return true; + } + else + { + restart = position; + std::advance(position, -j); + if(match_prefix()) + return true; + else + { + for(int k = 0; (restart != position) && (k < j); ++k, --restart) + {} // dwa 10/20/2000 - warning suppression for MWCW + if(restart != last) + ++restart; + position = restart; + j = 0; //we could do better than this... + } + } + } + } + if((m_match_flags & match_partial) && (position == last) && j) + { + // we need to check for a partial match: + restart = position; + std::advance(position, -j); + return match_prefix(); + } + return false; +} + +template +typename perl_matcher::matcher_proc_type const +perl_matcher::s_match_vtable[] = +{ + (&perl_matcher::match_startmark), + &perl_matcher::match_endmark, + &perl_matcher::match_literal, + &perl_matcher::match_start_line, + &perl_matcher::match_end_line, + &perl_matcher::match_wild, + &perl_matcher::match_match, + &perl_matcher::match_word_boundary, + &perl_matcher::match_within_word, + &perl_matcher::match_word_start, + &perl_matcher::match_word_end, + &perl_matcher::match_buffer_start, + &perl_matcher::match_buffer_end, + &perl_matcher::match_backref, + &perl_matcher::match_long_set, + &perl_matcher::match_set, + &perl_matcher::match_jump, + &perl_matcher::match_alt, + &perl_matcher::match_rep, + &perl_matcher::match_combining, + &perl_matcher::match_soft_buffer_end, + &perl_matcher::match_restart_continue, +#if 0 + &perl_matcher::match_rep, + &perl_matcher::match_rep, + &perl_matcher::match_rep, + &perl_matcher::match_rep, +#else +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) + &perl_matcher::match_dot_repeat_fast, +#else + (::boost::is_random_access_iterator::value ? &perl_matcher::match_dot_repeat_fast : &perl_matcher::match_dot_repeat_slow), +#endif + &perl_matcher::match_char_repeat, + &perl_matcher::match_set_repeat, + &perl_matcher::match_long_set_repeat, +#endif +}; + +template +typename perl_matcher::matcher_proc_type const +perl_matcher::s_find_vtable[] = +{ + &perl_matcher::find_restart_any, + &perl_matcher::find_restart_word, + &perl_matcher::find_restart_line, + &perl_matcher::find_restart_buf, + &perl_matcher::match_prefix, + &perl_matcher::find_restart_lit, + &perl_matcher::find_restart_lit, +}; + +} // namespace re_detail + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp new file mode 100644 index 00000000..e3f122be --- /dev/null +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -0,0 +1,1230 @@ +/* + * + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE perl_matcher_common.cpp + * VERSION see + * DESCRIPTION: Definitions of perl_matcher member functions that are + * specific to the non-recursive implementation. + */ + +#ifndef BOOST_REGEX_V4_PERL_MATCHER_NON_RECURSIVE_HPP +#define BOOST_REGEX_V4_PERL_MATCHER_NON_RECURSIVE_HPP + +#include + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 -w-8066 -w-8008 +#endif + +namespace boost{ +namespace re_detail{ + +template +inline void destroy(T* p) +{ + (void)p; // warning suppression + p->~T(); +} + +enum saved_state_type +{ + saved_type_end = 0, + saved_type_paren = 1, + saved_type_recurse = 2, + saved_type_assertion = 3, + saved_state_alt = 4, + saved_state_repeater_count = 5, + saved_state_extra_block = 6, + saved_state_greedy_single_repeat = 7, + saved_state_rep_slow_dot = 8, + saved_state_rep_fast_dot = 9, + saved_state_rep_char = 10, + saved_state_rep_short_set = 11, + saved_state_rep_long_set = 12, + saved_state_non_greedy_long_repeat = 13 +}; + +struct saved_state +{ + unsigned int id; + saved_state(unsigned i) : id(i) {} +}; + +template +struct saved_matched_paren : public saved_state +{ + int index; + sub_match sub; + saved_matched_paren(int i, const sub_match& s) : saved_state(1), index(i), sub(s){}; +}; + +template +struct saved_position : public saved_state +{ + const re_syntax_base* pstate; + BidiIterator position; + saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){}; +}; + +template +struct saved_assertion : public saved_position +{ + bool positive; + saved_assertion(bool p, const re_syntax_base* ps, BidiIterator pos) + : saved_position(ps, pos, saved_type_assertion), positive(p){}; +}; + +template +struct saved_repeater : public saved_state +{ + repeater_count count; + saved_repeater(int i, repeater_count** s, BidiIterator start) + : saved_state(saved_state_repeater_count), count(i,s,start){} +}; + +struct saved_extra_block : public saved_state +{ + saved_state *base, *end; + saved_extra_block(saved_state* b, saved_state* e) + : saved_state(saved_state_extra_block), base(b), end(e) {} +}; + +struct save_state_init +{ + saved_state** stack; + save_state_init(saved_state** base, saved_state** end) + : stack(base) + { + *base = static_cast(block_cache.get()); + *end = reinterpret_cast(reinterpret_cast(*base)+BOOST_REGEX_BLOCKSIZE); + --(*end); + new (*end)saved_state(0); + assert(*end > *base); + } + ~save_state_init() + { + block_cache.put(*stack); + *stack = 0; + } +}; + +template +struct saved_single_repeat : public saved_state +{ + unsigned count; + const re_repeat* rep; + BidiIterator last_position; + saved_single_repeat(unsigned c, const re_repeat* r, BidiIterator lp, int id) + : saved_state(id), count(c), rep(r), last_position(lp){} +}; + +template +bool perl_matcher::match_all_states() +{ + push_recursion_stopper(); + do{ + while(pstate) + { + matcher_proc_type proc = s_match_vtable[pstate->type]; + ++state_count; + if(!(this->*proc)()) + { + if(state_count > max_state_count) + raise_error(traits_inst, REG_ESPACE); + if((m_match_flags & match_partial) && (position == last)) + m_has_partial_match = true; + if(false == unwind(false)) + return m_recursive_result; + } + } + }while(unwind(true)); + return m_recursive_result; +} + +template +void perl_matcher::extend_stack() +{ + if(used_block_count) + { + --used_block_count; + saved_state* stack_base; + saved_state* backup_state; + stack_base = static_cast(block_cache.get()); + backup_state = reinterpret_cast(reinterpret_cast(stack_base)+BOOST_REGEX_BLOCKSIZE); + saved_extra_block* block = static_cast(backup_state); + --block; + new (block) saved_extra_block(m_stack_base, m_backup_state); + m_stack_base = stack_base; + m_backup_state = block; + } + else + raise_error(traits_inst, REG_E_MEMORY); +} + +template +inline void perl_matcher::push_matched_paren(int index, const sub_match& sub) +{ + assert(index); + saved_matched_paren* pmp = static_cast*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast*>(m_backup_state); + --pmp; + } + new (pmp)saved_matched_paren(index, sub); + m_backup_state = pmp; +} + +template +inline void perl_matcher::push_recursion_stopper() +{ + saved_state* pmp = m_backup_state; + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = m_backup_state; + --pmp; + } + new (pmp)saved_state(saved_type_recurse); + m_backup_state = pmp; +} + +template +inline void perl_matcher::push_assertion(const re_syntax_base* ps, bool positive) +{ + saved_assertion* pmp = static_cast*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast*>(m_backup_state); + --pmp; + } + new (pmp)saved_assertion(positive, ps, position); + m_backup_state = pmp; +} + +template +inline void perl_matcher::push_alt(const re_syntax_base* ps) +{ + saved_position* pmp = static_cast*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast*>(m_backup_state); + --pmp; + } + new (pmp)saved_position(ps, position, saved_state_alt); + m_backup_state = pmp; +} + +template +inline void perl_matcher::push_non_greedy_repeat(const re_syntax_base* ps) +{ + saved_position* pmp = static_cast*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast*>(m_backup_state); + --pmp; + } + new (pmp)saved_position(ps, position, saved_state_non_greedy_long_repeat); + m_backup_state = pmp; +} + +template +inline void perl_matcher::push_repeater_count(int i, repeater_count** s) +{ + saved_repeater* pmp = static_cast*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast*>(m_backup_state); + --pmp; + } + new (pmp)saved_repeater(i, s, position); + m_backup_state = pmp; +} + +template +inline void perl_matcher::push_single_repeat(unsigned c, const re_repeat* r, BidiIterator last_position, int id) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast*>(m_backup_state); + --pmp; + } + new (pmp)saved_single_repeat(c, r, last_position, id); + m_backup_state = pmp; +} + +template +bool perl_matcher::match_startmark() +{ + int index = static_cast(pstate)->index; + switch(index) + { + case 0: + pstate = pstate->next.p; + break; + case -1: + case -2: + { + // forward lookahead assert: + const re_syntax_base* next_pstate = static_cast(pstate->next.p)->alt.p->next.p; + pstate = pstate->next.p->next.p; + push_assertion(next_pstate, index == -1); + break; + } + case -3: + { + // independent sub-expression: + const re_syntax_base* next_pstate = static_cast(pstate->next.p)->alt.p->next.p; + pstate = pstate->next.p->next.p; + bool r = match_all_states(); + pstate = next_pstate; + return r; + } + default: + { + assert(index > 0); + if((m_match_flags & match_nosubs) == 0) + { + push_matched_paren(index, (*m_presult)[index]); + m_presult->set_first(position, index); + } + pstate = pstate->next.p; + break; + } + } + return true; +} + +template +bool perl_matcher::match_alt() +{ + bool take_first, take_second; + const re_jump* jmp = static_cast(pstate); + + // find out which of these two alternatives we need to take: + if(position == last) + { + take_first = jmp->can_be_null & mask_take; + take_second = jmp->can_be_null & mask_skip; + } + else + { + take_first = access::can_start(*position, jmp->_map, (unsigned char)mask_take); + take_second = access::can_start(*position, jmp->_map, (unsigned char)mask_skip); + } + + if(take_first) + { + // we can take the first alternative, + // see if we need to push next alternative: + if(take_second) + { + push_alt(jmp->alt.p); + } + pstate = pstate->next.p; + return true; + } + if(take_second) + { + pstate = jmp->alt.p; + return true; + } + return false; // neither option is possible +} + +template +bool perl_matcher::match_rep() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127 4244) +#endif + const re_repeat* rep = static_cast(pstate); + + // find out which of these two alternatives we need to take: + bool take_first, take_second; + if(position == last) + { + take_first = rep->can_be_null & mask_take; + take_second = rep->can_be_null & mask_skip; + } + else + { + take_first = access::can_start(*position, rep->_map, (unsigned char)mask_take); + take_second = access::can_start(*position, rep->_map, (unsigned char)mask_skip); + } + + if(take_first || (next_count->get_id() != rep->id)) + { + // we're moving to a different repeat from the last + // one, so set up a counter object: + push_repeater_count(rep->id, &next_count); + } + // + // If we've had at least one repeat already, and the last one + // matched the NULL string then set the repeat count to + // maximum: + // + next_count->check_null_repeat(position, rep->max); + + if(next_count->get_count() < rep->min) + { + // we must take the repeat: + if(take_first) + { + // increase the counter: + ++(*next_count); + pstate = rep->next.p; + return true; + } + return false; + } + + if(rep->greedy) + { + // try and take the repeat if we can: + if((next_count->get_count() < rep->max) && take_first) + { + if(take_second) + { + // store position in case we fail: + push_alt(rep->alt.p); + } + // increase the counter: + ++(*next_count); + pstate = rep->next.p; + return true; + } + else if(take_second) + { + pstate = rep->alt.p; + return true; + } + return false; // can't take anything, fail... + } + else // non-greedy + { + // try and skip the repeat if we can: + if(take_second) + { + // store position in case we fail: + push_non_greedy_repeat(rep->next.p); + pstate = rep->alt.p; + return true; + } + if((next_count->get_count() < rep->max) && take_first) + { + // increase the counter: + ++(*next_count); + pstate = rep->next.p; + return true; + } + } + return false; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_dot_repeat_slow() +{ + unsigned count = 0; + const re_repeat* rep = static_cast(pstate); + re_syntax_base* psingle = rep->next.p; + // match compulsary repeats first: + while(count < rep->min) + { + pstate = psingle; + if(!match_wild()) + return false; + ++count; + } + if(rep->greedy) + { + // repeat for as long as we can: + while(count < rep->max) + { + pstate = psingle; + if(!match_wild()) + break; + ++count; + } + // remember where we got to if this is a leading repeat: + if((rep->leading) && (count < rep->max)) + restart = position; + // push backtrack info if available: + if(count - rep->min) + push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); + // jump to next state: + pstate = rep->alt.p; + return true; + } + else + { + // non-greedy, push state and return true if we can skip: + if(count < rep->max) + push_single_repeat(count, rep, position, saved_state_rep_slow_dot); + pstate = rep->alt.p; + return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); + } +} + +template +bool perl_matcher::match_dot_repeat_fast() +{ + if(m_match_flags & (match_not_dot_newline | match_not_dot_null)) + return match_dot_repeat_slow(); + + const re_repeat* rep = static_cast(pstate); + unsigned count = std::min(static_cast(re_detail::distance(position, last)), (rep->greedy ? rep->max : rep->min)); + if(rep->min > count) + return false; // not enough text left to match + std::advance(position, count); + + if(rep->greedy) + { + if((rep->leading) && (count < rep->max)) + restart = position; + // push backtrack info if available: + if(count - rep->min) + push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); + // jump to next state: + pstate = rep->alt.p; + return true; + } + else + { + // non-greedy, push state and return true if we can skip: + if(count < rep->max) + push_single_repeat(count, rep, position, saved_state_rep_fast_dot); + pstate = rep->alt.p; + return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); + } +} + +template +bool perl_matcher::match_char_repeat() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const re_repeat* rep = static_cast(pstate); + assert(1 == static_cast(rep->next.p)->length); + const char_type what = *reinterpret_cast(static_cast(rep->next.p) + 1); + unsigned count = 0; + // + // start by working out how much we can skip: + // + unsigned desired = rep->greedy ? rep->max : rep->min; + if(::boost::is_random_access_iterator::value) + { + BidiIterator end = position; + end += std::min((unsigned)re_detail::distance(position, last), desired); + BidiIterator origin(position); + while((position != end) && (traits_inst.translate(*position, icase) == what)) + { + ++position; + } + count = (unsigned)re_detail::distance(origin, position); + } + else + { + while((count < desired) && (position != last) && (traits_inst.translate(*position, icase) == what)) + { + ++position; + ++count; + } + } + + if(count < rep->min) + return false; + + if(rep->greedy) + { + if((rep->leading) && (count < rep->max)) + restart = position; + // push backtrack info if available: + if(count - rep->min) + push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); + // jump to next state: + pstate = rep->alt.p; + return true; + } + else + { + // non-greedy, push state and return true if we can skip: + if(count < rep->max) + push_single_repeat(count, rep, position, saved_state_rep_char); + pstate = rep->alt.p; + return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); + } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_set_repeat() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const re_repeat* rep = static_cast(pstate); + const unsigned char* map = static_cast(rep->next.p)->_map; + unsigned count = 0; + // + // start by working out how much we can skip: + // + unsigned desired = rep->greedy ? rep->max : rep->min; + if(::boost::is_random_access_iterator::value) + { + BidiIterator end = position; + end += std::min((unsigned)re_detail::distance(position, last), desired); + BidiIterator origin(position); + while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + ++position; + } + count = (unsigned)re_detail::distance(origin, position); + } + else + { + while((count < desired) && (position != last) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + ++position; + ++count; + } + } + + if(count < rep->min) + return false; + + if(rep->greedy) + { + if((rep->leading) && (count < rep->max)) + restart = position; + // push backtrack info if available: + if(count - rep->min) + push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); + // jump to next state: + pstate = rep->alt.p; + return true; + } + else + { + // non-greedy, push state and return true if we can skip: + if(count < rep->max) + push_single_repeat(count, rep, position, saved_state_rep_short_set); + pstate = rep->alt.p; + return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); + } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_long_set_repeat() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const re_repeat* rep = static_cast(pstate); + const re_set_long* set = static_cast(pstate->next.p); + unsigned count = 0; + // + // start by working out how much we can skip: + // + unsigned desired = rep->greedy ? rep->max : rep->min; + if(::boost::is_random_access_iterator::value) + { + BidiIterator end = position; + end += std::min((unsigned)re_detail::distance(position, last), desired); + BidiIterator origin(position); + while((position != end) && (position != re_is_set_member(position, last, set, re))) + { + ++position; + } + count = (unsigned)re_detail::distance(origin, position); + } + else + { + while((count < desired) && (position != last) && (position != re_is_set_member(position, last, set, re))) + { + ++position; + ++count; + } + } + + if(count < rep->min) + return false; + + if(rep->greedy) + { + if((rep->leading) && (count < rep->max)) + restart = position; + // push backtrack info if available: + if(count - rep->min) + push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); + // jump to next state: + pstate = rep->alt.p; + return true; + } + else + { + // non-greedy, push state and return true if we can skip: + if(count < rep->max) + push_single_repeat(count, rep, position, saved_state_rep_long_set); + pstate = rep->alt.p; + return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); + } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +/**************************************************************************** + +Unwind and associated proceedures follow, these perform what normal stack +unwinding does in the recursive implementation. + +****************************************************************************/ + +template +bool perl_matcher::unwind(bool have_match) +{ + m_recursive_result = have_match; + unwind_proc_type unwinder; + bool cont; + // + // keep unwinding our stack until we have something to do: + // + do + { + unwinder = s_unwind_table[m_backup_state->id]; + cont = (this->*unwinder)(m_recursive_result); + }while(cont); + // + // return true if we have more states to try: + // + return pstate ? true : false; +} + +template +bool perl_matcher::unwind_end(bool) +{ + pstate = 0; // nothing left to search + return false; // end of stack nothing more to search +} + +template +bool perl_matcher::unwind_paren(bool have_match) +{ + saved_matched_paren* pmp = static_cast*>(m_backup_state); + // restore previous values if no match was found: + if(have_match == false) + { + m_presult->set_first(pmp->sub.first, pmp->index); + m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched); + } + // unwind stack: + m_backup_state = pmp+1; + destroy(pmp); + return true; // keep looking +} + +template +bool perl_matcher::unwind_recursion_stopper(bool) +{ + destroy(m_backup_state++); + pstate = 0; // nothing left to search + return false; // end of stack nothing more to search +} + +template +bool perl_matcher::unwind_assertion(bool r) +{ + saved_assertion* pmp = static_cast*>(m_backup_state); + pstate = pmp->pstate; + position = pmp->position; + bool result = (r == pmp->positive); + m_recursive_result = pmp->positive ? r : !r; + destroy(pmp++); + m_backup_state = pmp; + return !result; // return false if the assertion was matched to stop search. +} + +template +bool perl_matcher::unwind_alt(bool r) +{ + saved_position* pmp = static_cast*>(m_backup_state); + if(!r) + { + pstate = pmp->pstate; + position = pmp->position; + } + destroy(pmp++); + m_backup_state = pmp; + return r; +} + +template +bool perl_matcher::unwind_repeater_counter(bool) +{ + saved_repeater* pmp = static_cast*>(m_backup_state); + destroy(pmp++); + m_backup_state = pmp; + return true; // keep looking +} + +template +bool perl_matcher::unwind_extra_block(bool) +{ + saved_extra_block* pmp = static_cast(m_backup_state); + void* condemmed = m_stack_base; + m_stack_base = pmp->base; + m_backup_state = pmp->end; + destroy(pmp); + block_cache.put(condemmed); + return true; // keep looking +} + +template +inline void perl_matcher::destroy_single_repeat() +{ + saved_single_repeat* p = static_cast*>(m_backup_state); + destroy(p++); + m_backup_state = p; +} + +template +bool perl_matcher::unwind_greedy_single_repeat(bool r) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + + // if we have a match, just discard this state: + if(r) + { + destroy_single_repeat(); + return true; + } + + const re_repeat* rep = pmp->rep; + unsigned count = pmp->count; + assert(rep->next.p); + assert(rep->alt.p); + + count -= rep->min; + + if((m_match_flags & match_partial) && (position == last)) + m_has_partial_match = true; + + assert(count); + position = pmp->last_position; + + // backtrack till we can skip out: + do + { + --position; + --count; + ++state_count; + }while(count && !access::can_start(*position, rep->_map, mask_skip)); + + // if we've hit base, destroy this state: + if(count == 0) + { + destroy_single_repeat(); + if(!access::can_start(*position, rep->_map, mask_skip)) + return true; + } + else + { + pmp->count = count + rep->min; + pmp->last_position = position; + } + pstate = rep->alt.p; + return false; +} + +template +bool perl_matcher::unwind_slow_dot_repeat(bool r) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + + // if we have a match, just discard this state: + if(r) + { + destroy_single_repeat(); + return true; + } + + const re_repeat* rep = pmp->rep; + unsigned count = pmp->count; + assert(rep->type == syntax_element_dot_rep); + assert(rep->next.p); + assert(rep->alt.p); + assert(rep->next.p->type == syntax_element_wild); + + assert(count < rep->max); + pstate = rep->next.p; + position = pmp->last_position; + + if(position != last) + { + // wind forward until we can skip out of the repeat: + do + { + if(!match_wild()) + { + // failed repeat match, discard this state and look for another: + destroy_single_repeat(); + return true; + } + ++count; + ++state_count; + pstate = rep->next.p; + }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip)); + } + if(position == last) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(rep->can_be_null & mask_skip) + return true; + } + else if(count == rep->max) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(!access::can_start(*position, rep->_map, mask_skip)) + return true; + } + else + { + pmp->count = count; + pmp->last_position = position; + } + pstate = rep->alt.p; + return false; +} + +template +bool perl_matcher::unwind_fast_dot_repeat(bool r) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + + // if we have a match, just discard this state: + if(r) + { + destroy_single_repeat(); + return true; + } + + const re_repeat* rep = pmp->rep; + unsigned count = pmp->count; + + assert(count < rep->max); + position = pmp->last_position; + if(position != last) + { + + // wind forward until we can skip out of the repeat: + do + { + ++position; + ++count; + ++state_count; + }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip)); + } + + if(position == last) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(rep->can_be_null & mask_skip) + return true; + } + else if(count == rep->max) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(!access::can_start(*position, rep->_map, mask_skip)) + return true; + } + else + { + pmp->count = count; + pmp->last_position = position; + } + pstate = rep->alt.p; + return false; +} + +template +bool perl_matcher::unwind_char_repeat(bool r) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + + // if we have a match, just discard this state: + if(r) + { + destroy_single_repeat(); + return true; + } + + const re_repeat* rep = pmp->rep; + unsigned count = pmp->count; + pstate = rep->next.p; + const char_type what = *reinterpret_cast(static_cast(pstate) + 1); + position = pmp->last_position; + + assert(rep->type == syntax_element_char_rep); + assert(rep->next.p); + assert(rep->alt.p); + assert(rep->next.p->type == syntax_element_literal); + assert(count < rep->max); + + if(position != last) + { + // wind forward until we can skip out of the repeat: + do + { + if(traits_inst.translate(*position, icase) != what) + { + // failed repeat match, discard this state and look for another: + destroy_single_repeat(); + return true; + } + ++count; + ++ position; + ++state_count; + pstate = rep->next.p; + }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip)); + } + if(position == last) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(rep->can_be_null & mask_skip) + return true; + } + else if(count == rep->max) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(!access::can_start(*position, rep->_map, mask_skip)) + return true; + } + else + { + pmp->count = count; + pmp->last_position = position; + } + pstate = rep->alt.p; + return false; +} + +template +bool perl_matcher::unwind_short_set_repeat(bool r) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + + // if we have a match, just discard this state: + if(r) + { + destroy_single_repeat(); + return true; + } + + const re_repeat* rep = pmp->rep; + unsigned count = pmp->count; + pstate = rep->next.p; + const unsigned char* map = static_cast(rep->next.p)->_map; + position = pmp->last_position; + + assert(rep->type == syntax_element_short_set_rep); + assert(rep->next.p); + assert(rep->alt.p); + assert(rep->next.p->type == syntax_element_set); + assert(count < rep->max); + + if(position != last) + { + // wind forward until we can skip out of the repeat: + do + { + if(!map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + // failed repeat match, discard this state and look for another: + destroy_single_repeat(); + return true; + } + ++count; + ++ position; + ++state_count; + pstate = rep->next.p; + }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip)); + } + if(position == last) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(rep->can_be_null & mask_skip) + return true; + } + else if(count == rep->max) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(!access::can_start(*position, rep->_map, mask_skip)) + return true; + } + else + { + pmp->count = count; + pmp->last_position = position; + } + pstate = rep->alt.p; + return false; +} + +template +bool perl_matcher::unwind_long_set_repeat(bool r) +{ + saved_single_repeat* pmp = static_cast*>(m_backup_state); + + // if we have a match, just discard this state: + if(r) + { + destroy_single_repeat(); + return true; + } + + const re_repeat* rep = pmp->rep; + unsigned count = pmp->count; + pstate = rep->next.p; + const re_set_long* set = static_cast(pstate); + position = pmp->last_position; + + assert(rep->type == syntax_element_long_set_rep); + assert(rep->next.p); + assert(rep->alt.p); + assert(rep->next.p->type == syntax_element_long_set); + assert(position != last); + assert(count < rep->max); + + if(position != last) + { + // wind forward until we can skip out of the repeat: + do + { + if(position == re_is_set_member(position, last, set, re)) + { + // failed repeat match, discard this state and look for another: + destroy_single_repeat(); + return true; + } + ++position; + ++count; + ++state_count; + pstate = rep->next.p; + }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip)); + } + if(position == last) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(rep->can_be_null & mask_skip) + return true; + } + else if(count == rep->max) + { + // can't repeat any more, remove the pushed state: + destroy_single_repeat(); + if(!access::can_start(*position, rep->_map, mask_skip)) + return true; + } + else + { + pmp->count = count; + pmp->last_position = position; + } + pstate = rep->alt.p; + return false; +} + +template +bool perl_matcher::unwind_non_greedy_repeat(bool r) +{ + saved_position* pmp = static_cast*>(m_backup_state); + if(!r) + { + position = pmp->position; + pstate = pmp->pstate; + ++(*next_count); + } + destroy(pmp++); + m_backup_state = pmp; + return r; +} + +template +typename perl_matcher::unwind_proc_type const +perl_matcher::s_unwind_table[] = +{ + &perl_matcher::unwind_end, + &perl_matcher::unwind_paren, + &perl_matcher::unwind_recursion_stopper, + &perl_matcher::unwind_assertion, + &perl_matcher::unwind_alt, + &perl_matcher::unwind_repeater_counter, + &perl_matcher::unwind_extra_block, + &perl_matcher::unwind_greedy_single_repeat, + &perl_matcher::unwind_slow_dot_repeat, + &perl_matcher::unwind_fast_dot_repeat, + &perl_matcher::unwind_char_repeat, + &perl_matcher::unwind_short_set_repeat, + &perl_matcher::unwind_long_set_repeat, + &perl_matcher::unwind_non_greedy_repeat, +}; + +} +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp new file mode 100644 index 00000000..bef1cc42 --- /dev/null +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -0,0 +1,661 @@ +/* + * + * Copyright (c) 2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE perl_matcher_common.cpp + * VERSION see + * DESCRIPTION: Definitions of perl_matcher member functions that are + * specific to the recursive implementation. + */ + +#ifndef BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP +#define BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 -w-8066 -w-8008 +#endif + +namespace boost{ +namespace re_detail{ + +template +class backup_subex +{ + int index; + sub_match sub; +public: + template + backup_subex(const match_results& w, int i) + : index(i), sub(w[i]) {} + template + void restore(match_results& w) + { + w.set_first(sub.first, index); + w.set_second(sub.second, index, sub.matched); + } +}; + +template +bool perl_matcher::match_all_states() +{ + if(state_count > max_state_count) + raise_error(traits_inst, REG_ESPACE); + while(pstate) + { + matcher_proc_type proc = s_match_vtable[pstate->type]; + ++state_count; + if(!(this->*proc)()) + { + if((m_match_flags & match_partial) && (position == last)) + m_has_partial_match = true; + return 0; + } + } + return true; +} + +template +bool perl_matcher::match_startmark() +{ + int index = static_cast(pstate)->index; + bool r = true; + switch(index) + { + case 0: + pstate = pstate->next.p; + break; + case -1: + case -2: + { + // forward lookahead assert: + BidiIterator old_position(position); + const re_syntax_base* next_pstate = static_cast(pstate->next.p)->alt.p->next.p; + pstate = pstate->next.p->next.p; + r = match_all_states(); + pstate = next_pstate; + position = old_position; + if((r && (index != -1)) || (!r && (index != -2))) + r = false; + else + r = true; + break; + } + case -3: + { + // independent sub-expression: + const re_syntax_base* next_pstate = static_cast(pstate->next.p)->alt.p->next.p; + pstate = pstate->next.p->next.p; + r = match_all_states(); + pstate = next_pstate; + break; + } + default: + { + assert(index > 0); + if((m_match_flags & match_nosubs) == 0) + { + backup_subex sub(*m_presult, index); + m_presult->set_first(position, index); + pstate = pstate->next.p; + r = match_all_states(); + if(r == false) + sub.restore(*m_presult); + } + else + { + pstate = pstate->next.p; + } + break; + } + } + return r; +} + +template +bool perl_matcher::match_alt() +{ + bool take_first, take_second; + const re_jump* jmp = static_cast(pstate); + + // find out which of these two alternatives we need to take: + if(position == last) + { + take_first = jmp->can_be_null & mask_take; + take_second = jmp->can_be_null & mask_skip; + } + else + { + take_first = access::can_start(*position, jmp->_map, (unsigned char)mask_take); + take_second = access::can_start(*position, jmp->_map, (unsigned char)mask_skip); + } + + if(take_first) + { + // we can take the first alternative, + // see if we need to push next alternative: + if(take_second) + { + BidiIterator oldposition(position); + const re_syntax_base* old_pstate = jmp->alt.p; + pstate = pstate->next.p; + if(!match_all_states()) + { + pstate = old_pstate; + position = oldposition; + } + return true; + } + pstate = pstate->next.p; + return true; + } + if(take_second) + { + pstate = jmp->alt.p; + return true; + } + return false; // neither option is possible +} + +template +bool perl_matcher::match_rep() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127 4244) +#endif + const re_repeat* rep = static_cast(pstate); + if(next_count->get_id() != rep->id) + { + // we're moving to a different repeat from the last + // one, so set up a counter object and recurse: + repeater_count r(rep->id, &next_count, position); + return match_rep(); + } + // + // If we've had at least one repeat already, and the last one + // matched the NULL string then set the repeat count to + // maximum: + // + next_count->check_null_repeat(position, rep->max); + + // find out which of these two alternatives we need to take: + bool take_first, take_second; + if(position == last) + { + take_first = rep->can_be_null & mask_take; + take_second = rep->can_be_null & mask_skip; + } + else + { + take_first = access::can_start(*position, rep->_map, (unsigned char)mask_take); + take_second = access::can_start(*position, rep->_map, (unsigned char)mask_skip); + } + + if(next_count->get_count() < rep->min) + { + // we must take the repeat: + if(take_first) + { + // increase the counter: + ++(*next_count); + pstate = rep->next.p; + return match_all_states(); + } + return false; + } + + if(rep->greedy) + { + // try and take the repeat if we can: + if((next_count->get_count() < rep->max) && take_first) + { + // store position in case we fail: + BidiIterator pos = position; + // increase the counter: + ++(*next_count); + pstate = rep->next.p; + if(match_all_states()) + return true; + // failed repeat, reset posistion and fall through for alternative: + position = pos; + } + if(take_second) + { + pstate = rep->alt.p; + return true; + } + return false; // can't take anything, fail... + } + else // non-greedy + { + // try and skip the repeat if we can: + if(take_second) + { + // store position in case we fail: + BidiIterator pos = position; + pstate = rep->alt.p; + if(match_all_states()) + return true; + // failed alternative, reset posistion and fall through for repeat: + position = pos; + } + if((next_count->get_count() < rep->max) && take_first) + { + // increase the counter: + ++(*next_count); + pstate = rep->next.p; + return match_all_states(); + } + } + return false; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_dot_repeat_slow() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + unsigned count = 0; + const re_repeat* rep = static_cast(pstate); + re_syntax_base* psingle = rep->next.p; + // match compulsary repeats first: + while(count < rep->min) + { + pstate = psingle; + if(!match_wild()) + return false; + ++count; + } + if(rep->greedy) + { + // normal repeat: + while(count < rep->max) + { + pstate = psingle; + if(!match_wild()) + break; + ++count; + } + if((rep->leading) && (count < rep->max)) + restart = position; + pstate = rep; + return backtrack_till_match(count - rep->min); + } + else + { + // non-greedy, keep trying till we get a match: + BidiIterator save_pos; + do + { + if((rep->leading) && (rep->max == UINT_MAX)) + restart = position; + pstate = rep->alt.p; + save_pos = position; + ++state_count; + if(match_all_states()) + return true; + if(count >= rep->max) + return false; + ++count; + pstate = psingle; + position = save_pos; + if(!match_wild()) + return false; + }while(true); + } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_dot_repeat_fast() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + if(m_match_flags & (match_not_dot_newline | match_not_dot_null)) + return match_dot_repeat_slow(); + // + // start by working out how much we can skip: + // + const re_repeat* rep = static_cast(pstate); + unsigned count = std::min(static_cast(re_detail::distance(position, last)), (rep->greedy ? rep->max : rep->min)); + if(rep->min > count) + return false; // not enough text left to match + std::advance(position, count); + if((rep->leading) && (count < rep->max) && (rep->greedy)) + restart = position; + if(rep->greedy) + return backtrack_till_match(count - rep->min); + + // non-greedy, keep trying till we get a match: + BidiIterator save_pos; + do + { + while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip)) + { + ++position; + ++count; + } + if((rep->leading) && (count == UINT_MAX)) + restart = position; + pstate = rep->alt.p; + save_pos = position; + ++state_count; + if(match_all_states()) + return true; + if(count >= rep->max) + return false; + if(position == last) + return false; + position = ++save_pos; + ++count; + }while(true); +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_char_repeat() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const re_repeat* rep = static_cast(pstate); + assert(1 == static_cast(rep->next.p)->length); + const char_type what = *reinterpret_cast(static_cast(rep->next.p) + 1); + unsigned count = 0; + // + // start by working out how much we can skip: + // + unsigned desired = rep->greedy ? rep->max : rep->min; + if(::boost::is_random_access_iterator::value) + { + BidiIterator end = position; + end += std::min((unsigned)re_detail::distance(position, last), desired); + BidiIterator origin(position); + while((position != end) && (traits_inst.translate(*position, icase) == what)) + { + ++position; + } + count = (unsigned)re_detail::distance(origin, position); + } + else + { + while((count < desired) && (position != last) && (traits_inst.translate(*position, icase) == what)) + { + ++position; + ++count; + } + } + if((rep->leading) && (count < rep->max) && (rep->greedy)) + restart = position; + if(count < rep->min) + return false; + + if(rep->greedy) + return backtrack_till_match(count - rep->min); + + // non-greedy, keep trying till we get a match: + BidiIterator save_pos; + do + { + while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip)) + { + if((traits_inst.translate(*position, icase) == what)) + { + ++position; + ++count; + } + else + return false; // counldn't repeat even though it was the only option + } + if((rep->leading) && (rep->max == UINT_MAX)) + restart = position; + pstate = rep->alt.p; + save_pos = position; + ++state_count; + if(match_all_states()) + return true; + if(count >= rep->max) + return false; + if(position == last) + return false; + position = ++save_pos; + ++count; + }while(true); +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_set_repeat() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const re_repeat* rep = static_cast(pstate); + const unsigned char* map = static_cast(rep->next.p)->_map; + unsigned count = 0; + // + // start by working out how much we can skip: + // + unsigned desired = rep->greedy ? rep->max : rep->min; + if(::boost::is_random_access_iterator::value) + { + BidiIterator end = position; + end += std::min((unsigned)re_detail::distance(position, last), desired); + BidiIterator origin(position); + while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + ++position; + } + count = (unsigned)re_detail::distance(origin, position); + } + else + { + while((count < desired) && (position != last) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + ++position; + ++count; + } + } + if((rep->leading) && (count < rep->max) && (rep->greedy)) + restart = position; + if(count < rep->min) + return false; + + if(rep->greedy) + return backtrack_till_match(count - rep->min); + + // non-greedy, keep trying till we get a match: + BidiIterator save_pos; + do + { + while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip)) + { + if(map[(traits_uchar_type)traits_inst.translate(*position, icase)]) + { + ++position; + ++count; + } + else + return false; // counldn't repeat even though it was the only option + } + if((rep->leading) && (rep->max == UINT_MAX)) + restart = position; + pstate = rep->alt.p; + save_pos = position; + ++state_count; + if(match_all_states()) + return true; + if(count >= rep->max) + return false; + if(position == last) + return false; + position = ++save_pos; + ++count; + }while(true); +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::match_long_set_repeat() +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + const re_repeat* rep = static_cast(pstate); + const re_set_long* set = static_cast(pstate->next.p); + unsigned count = 0; + // + // start by working out how much we can skip: + // + unsigned desired = rep->greedy ? rep->max : rep->min; + if(::boost::is_random_access_iterator::value) + { + BidiIterator end = position; + end += std::min((unsigned)re_detail::distance(position, last), desired); + BidiIterator origin(position); + while((position != end) && (position != re_is_set_member(position, last, set, re))) + { + ++position; + } + count = (unsigned)re_detail::distance(origin, position); + } + else + { + while((count < desired) && (position != last) && (position != re_is_set_member(position, last, set, re))) + { + ++position; + ++count; + } + } + if((rep->leading) && (count < rep->max) && (rep->greedy)) + restart = position; + if(count < rep->min) + return false; + + if(rep->greedy) + return backtrack_till_match(count - rep->min); + + // non-greedy, keep trying till we get a match: + BidiIterator save_pos; + do + { + while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip)) + { + if(position != re_is_set_member(position, last, set, re)) + { + ++position; + ++count; + } + else + return false; // counldn't repeat even though it was the only option + } + if((rep->leading) && (rep->max == UINT_MAX)) + restart = position; + pstate = rep->alt.p; + save_pos = position; + ++state_count; + if(match_all_states()) + return true; + if(count >= rep->max) + return false; + if(position == last) + return false; + position = ++save_pos; + ++count; + }while(true); +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +template +bool perl_matcher::backtrack_till_match(unsigned count) +{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4127) +#endif + if((m_match_flags & match_partial) && (position == last)) + m_has_partial_match = true; + + const re_repeat* rep = static_cast(pstate); + BidiIterator backtrack = position; + if(position == last) + { + if(rep->can_be_null & mask_skip) + { + pstate = rep->alt.p; + if(match_all_states()) + return true; + } + if(count) + { + position = --backtrack; + --count; + } + else + return false; + } + do + { + while(count && !access::can_start(*position, rep->_map, mask_skip)) + { + --position; + --count; + ++state_count; + } + pstate = rep->alt.p; + backtrack = position; + if(match_all_states()) + return true; + if(count == 0) + return false; + position = --backtrack; + ++state_count; + --count; + }while(true); +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +} + +} // namespace re_detail +} // namespace boost + + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/regbase.hpp b/include/boost/regex/v4/regbase.hpp new file mode 100644 index 00000000..2e3294b0 --- /dev/null +++ b/include/boost/regex/v4/regbase.hpp @@ -0,0 +1,151 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regbase.cpp + * VERSION see + * DESCRIPTION: Declares class regbase. + */ + +#ifndef BOOST_REGEX_V4_REGBASE_HPP +#define BOOST_REGEX_V4_REGBASE_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ +// +// class regbase +// handles error codes and flags +// +class BOOST_REGEX_DECL regbase +{ +public: + enum flag_type_ + { + escape_in_lists = 1, // '\' special inside [...] + char_classes = escape_in_lists << 1, // [[:CLASS:]] allowed + intervals = char_classes << 1, // {x,y} allowed + limited_ops = intervals << 1, // all of + ? and | are normal characters + newline_alt = limited_ops << 1, // \n is the same as | + bk_plus_qm = newline_alt << 1, // uses \+ and \? + bk_braces = bk_plus_qm << 1, // uses \{ and \} + bk_parens = bk_braces << 1, // uses \( and \) + bk_refs = bk_parens << 1, // \d allowed + bk_vbar = bk_refs << 1, // uses \| + + use_except = bk_vbar << 1, // exception on error + failbit = use_except << 1, // error flag + literal = failbit << 1, // all characters are literals + icase = literal << 1, // characters are matched regardless of case + nocollate = 0, // don't use locale specific collation (deprecated) + collate = icase << 1, // use locale specific collation + perlex = collate << 1, // perl extensions + nosubs = perlex << 1, // don't mark sub-expressions + optimize = 0, // not really supported + + basic = char_classes | intervals | limited_ops | bk_braces | bk_parens | bk_refs | collate, + extended = char_classes | intervals | bk_refs | collate, + normal = perlex | escape_in_lists | char_classes | intervals | bk_refs | nocollate, + emacs = bk_braces | bk_parens | bk_refs | bk_vbar, + awk = extended | escape_in_lists, + grep = basic | newline_alt, + egrep = extended | newline_alt, + sed = basic, + perl = normal, + ECMAScript = normal, + JavaScript = normal, + JScript = normal + }; + typedef unsigned int flag_type; + + enum restart_info + { + restart_any = 0, + restart_word = 1, + restart_line = 2, + restart_buf = 3, + restart_continue = 4, + restart_lit = 5, + restart_fixed_lit = 6 + }; + + flag_type BOOST_REGEX_CALL flags()const + { + return _flags; + } + + regbase(); + regbase(const regbase& b); + void swap(regbase& that) + { std::swap(_flags, that._flags); } +protected: + flag_type _flags; +}; + +// +// provide std lib proposal compatible constants: +// +namespace regex_constants{ + + enum flag_type_ + { + escape_in_lists = ::boost::regbase::escape_in_lists, + char_classes = ::boost::regbase::char_classes, + intervals = ::boost::regbase::intervals, + limited_ops = ::boost::regbase::limited_ops, + newline_alt = ::boost::regbase::newline_alt, + bk_plus_qm = ::boost::regbase::bk_plus_qm, + bk_braces = ::boost::regbase::bk_braces, + bk_parens = ::boost::regbase::bk_parens, + bk_refs = ::boost::regbase::bk_refs, + bk_vbar = ::boost::regbase::bk_vbar, + + use_except = ::boost::regbase::use_except, + failbit = ::boost::regbase::failbit, + literal = ::boost::regbase::literal, + icase = ::boost::regbase::icase, + nocollate = ::boost::regbase::nocollate, + collate = ::boost::regbase::collate, + perlex = ::boost::regbase::perlex, + nosubs = ::boost::regbase::nosubs, + optimize = ::boost::regbase::optimize, + + basic = ::boost::regbase::basic, + extended = ::boost::regbase::extended, + normal = ::boost::regbase::normal, + emacs = ::boost::regbase::emacs, + awk = ::boost::regbase::awk, + grep = ::boost::regbase::grep, + egrep = ::boost::regbase::egrep, + sed = basic, + perl = normal, + ECMAScript = normal, + JavaScript = normal, + JScript = normal + }; + typedef ::boost::regbase::flag_type syntax_option_type; + +} // namespace regex_constants + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/regex.hpp b/include/boost/regex/v4/regex.hpp new file mode 100644 index 00000000..34c3c4ea --- /dev/null +++ b/include/boost/regex/v4/regex.hpp @@ -0,0 +1,196 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex.cpp + * VERSION see + * DESCRIPTION: Declares boost::reg_expression<> and associated + * functions and classes. This header is the main + * entry point for the template regex code. + */ + +#ifndef BOOST_RE_REGEX_HPP_INCLUDED +#define BOOST_RE_REGEX_HPP_INCLUDED + +#ifndef BOOST_RE_CREGEX_HPP +#include +#endif + +#ifdef __cplusplus + +// what follows is all C++ don't include in C builds!! + +#ifdef BOOST_REGEX_DEBUG +# include +#endif + +#include +#include +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif +#ifndef BOOST_REGEX_FWD_HPP +#include +#endif +#ifndef BOOST_REGEX_STACK_HPP +#include +#endif +#ifndef BOOST_REGEX_RAW_BUFFER_HPP +#include +#endif +#ifndef BOOST_REGEX_KMP_HPP +#include +#endif +#ifndef BOOST_RE_PAT_EXCEPT_HPP +#include +#endif +#ifndef BOOST_REGEX_TRAITS_HPP +#include +#endif +#include +#include + +#ifndef BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_STATES_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_REGBASE_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_SUB_MATCH_HPP +#include +#endif +#ifndef BOOST_REGEX_FORMAT_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_MATCH_RESULTS_HPP +#include +#endif +#ifndef BOOST_REGEX_COMPILE_HPP +#include +#endif + +// +// template instances: +// +#define BOOST_REGEX_CHAR_T char +#ifdef BOOST_REGEX_NARROW_INSTANTIATE +# define BOOST_REGEX_INSTANTIATE +#endif +#include +#undef BOOST_REGEX_CHAR_T +#ifdef BOOST_REGEX_INSTANTIATE +# undef BOOST_REGEX_INSTANTIATE +#endif + +#ifndef BOOST_NO_WREGEX +#define BOOST_REGEX_CHAR_T wchar_t +#ifdef BOOST_REGEX_WIDE_INSTANTIATE +# define BOOST_REGEX_INSTANTIATE +#endif +#include +#undef BOOST_REGEX_CHAR_T +#ifdef BOOST_REGEX_INSTANTIATE +# undef BOOST_REGEX_INSTANTIATE +#endif +#endif + + +namespace boost{ +#ifdef BOOST_REGEX_NO_FWD +typedef reg_expression, BOOST_DEFAULT_ALLOCATOR(char)> regex; +#ifndef BOOST_NO_WREGEX +typedef reg_expression, BOOST_DEFAULT_ALLOCATOR(wchar_t)> wregex; +#endif +#endif + +typedef match_results cmatch; +typedef match_results smatch; +#ifndef BOOST_NO_WREGEX +typedef match_results wcmatch; +typedef match_results wsmatch; +#endif + +} // namespace boost +#ifndef BOOST_REGEX_MATCH_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_REGEX_SEARCH_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_REGEX_GREP_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_REGEX_REPLACE_HPP +#include +#endif +#ifndef BOOST_REGEX_V4_REGEX_MERGE_HPP +#include +#endif +#ifndef BOOST_REGEX_SPLIT_HPP +#include +#endif +#ifndef BOOST_REGEX_ITERATOR_HPP +#include +#endif +#ifndef BOOST_REGEX_TOKEN_ITERATOR_HPP +#include +#endif + +#endif // __cplusplus + +#endif // include + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/boost/regex/v4/regex_compile.hpp b/include/boost/regex/v4/regex_compile.hpp new file mode 100644 index 00000000..28f81d31 --- /dev/null +++ b/include/boost/regex/v4/regex_compile.hpp @@ -0,0 +1,2180 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_compile.hpp + * VERSION see + * DESCRIPTION: Declares reg_expression<> member functions. This is + * an internal header file, do not include directly. + */ + +#ifndef BOOST_REGEX_COMPILE_HPP +#define BOOST_REGEX_COMPILE_HPP + +namespace boost{ +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8004 +#endif + namespace re_detail{ + + +template +struct kmp_translator +{ + typedef typename traits::char_type char_type; + bool icase; + const traits* pt; + kmp_translator(bool c, traits* p) : icase(c), pt(p) {} + char_type operator()(char_type c) + { + return pt->translate(c, icase); + } +}; + + +template +bool BOOST_REGEX_CALL re_maybe_set_member(charT c, + const re_set_long* set_, + const reg_expression& e) +{ + const charT* p = reinterpret_cast(set_+1); + bool icase = e.flags() & regex_constants::icase; + charT col = e.get_traits().translate(c, icase); + for(unsigned int i = 0; i < set_->csingles; ++i) + { + if(col == *p) + return set_->isnot ? false : true; + + while(*p)++p; + ++p; // skip null + } + return set_->isnot ? true : false; +} + +} // namespace re_detail + + +template +inline bool BOOST_REGEX_CALL reg_expression::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&) +{ + if((traits_size_type)(traits_uchar_type)c >= 256) + return true; + return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask); +} + +template +inline bool BOOST_REGEX_CALL reg_expression::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&) +{ + return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask); +} + +template +reg_expression::reg_expression(const Allocator& a) + : regbase(), data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) +{ +} + +template +reg_expression::reg_expression(const charT* p, flag_type f, const Allocator& a) + : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) +{ + set_expression(p, f | regex_constants::use_except); +} + +template +reg_expression::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a) + : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) +{ + set_expression(p1, p2, f | regex_constants::use_except); +} + +template +reg_expression::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a) + : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) +{ + set_expression(p, p + len, f | regex_constants::use_except); +} + +template +reg_expression::reg_expression(const reg_expression& e) + : regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY), _expression(0) +{ + // + // we do a deep copy only if e is a valid expression, otherwise fail. + // + if(e.error_code() == 0) + { + const charT* pe = e.expression(); + set_expression(pe, pe + e._expression_len, e.flags() | regex_constants::use_except); + } + else + { + _flags = e.flags() & ~(regex_constants::use_except); + fail(e.error_code()); + } +} + +template +reg_expression::~reg_expression() +{ + if(pkmp) + re_detail::kmp_free(pkmp, data.allocator()); +} + +template +reg_expression& BOOST_REGEX_CALL reg_expression::operator=(const reg_expression& e) +{ + // + // we do a deep copy only if e is a valid expression, otherwise fail. + // + if(this == &e) return *this; + _flags = use_except; + fail(e.error_code()); + if(error_code() == 0) + set_expression(e._expression, e._expression + e._expression_len, e.flags() | regex_constants::use_except); + return *this; +} + +template +int BOOST_REGEX_CALL reg_expression::compare(const reg_expression& e)const +{ + if(_flags != e.flags()) + return _flags - e.flags(); + return str().compare(e.str()); +} + +template +void BOOST_REGEX_CALL reg_expression::swap(reg_expression& that)throw() +{ + traits_inst.swap(that.traits_inst); + data.swap(that.data); + static_cast(*this).swap(that); + + std::swap(_restart_type, that._restart_type); + std::swap(marks, that.marks); + std::swap(repeats, that.repeats); + std::swap(startmap, that.startmap); + std::swap(_expression_len, that._expression_len); + std::swap(_leading_len, that._leading_len); + std::swap(_leading_string, that._leading_string); + std::swap(_leading_string_len, that._leading_string_len); + std::swap(pkmp, that.pkmp); + std::swap(error_code_, that.error_code_); + std::swap(_expression, that._expression); +} + +template +Allocator BOOST_REGEX_CALL reg_expression::allocator()const +{ + return data.allocator(); +} + +template +Allocator BOOST_REGEX_CALL reg_expression::get_allocator()const +{ + return data.allocator(); +} + +template +unsigned int BOOST_REGEX_CALL reg_expression::parse_inner_set(const charT*& first, const charT* last) +{ + // + // we have an inner [...] construct + // + jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set); + const charT* base = first; + while( (first != last) + && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) != traits_type::syntax_close_set) ) + ++first; + if(first == last) + return 0; + ++first; + if((first-base) < 5) + return 0; + if(*(base+1) != *(first-2)) + return 0; + unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1)); + if((result == traits_type::syntax_colon) && ((first-base) == 5)) + { + return traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2)); + } + return ((result == traits_type::syntax_colon) || (result == traits_type::syntax_dot) || (result == traits_type::syntax_equal)) ? result : 0; +} + + +template +bool BOOST_REGEX_CALL reg_expression::skip_space(const charT*& first, const charT* last) +{ + // + // returns true if we get to last: + // + while((first != last) && (traits_inst.is_class(*first, traits_type::char_class_space) == true)) + { + ++first; + } + return first == last; +} + +template +void BOOST_REGEX_CALL reg_expression::parse_range(const charT*& ptr, const charT* end, unsigned& min, unsigned& max) +{ + // + // we have {x} or {x,} or {x,y} NB no spaces inside braces + // anything else is illegal + // On input ptr points to "{" + // + ++ptr; + if(skip_space(ptr, end)) + { + fail(REG_EBRACE); + return; + } + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_digit) + { + fail(REG_BADBR); + return; + } + min = traits_inst.toi(ptr, end, 10); + if(skip_space(ptr, end)) + { + fail(REG_EBRACE); + return; + } + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_comma) + { + //we have a second interval: + ++ptr; + if(skip_space(ptr, end)) + { + fail(REG_EBRACE); + return; + } + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_digit) + max = traits_inst.toi(ptr, end, 10); + else + max = (unsigned)-1; + } + else + max = min; + + // validate input: + if(skip_space(ptr, end)) + { + fail(REG_EBRACE); + return; + } + if(max < min) + { + fail(REG_ERANGE); + return; + } + if(_flags & bk_braces) + { + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_slash) + { + fail(REG_BADBR); + return; + } + else + { + // back\ is OK now check the } + ++ptr; + if((ptr == end) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace)) + { + fail(REG_BADBR); + return; + } + } + } + else if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace) + { + fail(REG_BADBR); + return; + } +} + +template +charT BOOST_REGEX_CALL reg_expression::parse_escape(const charT*& first, const charT* last) +{ + charT c(*first); + traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*first; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + traits_size_type syntax = traits_inst.syntax_type(c_unsigned); + switch(syntax) + { + case traits_type::syntax_a: + c = '\a'; + ++first; + break; + case traits_type::syntax_f: + c = '\f'; + ++first; + break; + case traits_type::syntax_n: + c = '\n'; + ++first; + break; + case traits_type::syntax_r: + c = '\r'; + ++first; + break; + case traits_type::syntax_t: + c = '\t'; + ++first; + break; + case traits_type::syntax_v: + c = '\v'; + ++first; + break; + case traits_type::syntax_x: + ++first; + if(first == last) + { + fail(REG_EESCAPE); + break; + } + // maybe have \x{ddd} + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) == traits_type::syntax_open_brace) + { + ++first; + if(first == last) + { + fail(REG_EESCAPE); + break; + } + if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false) + { + fail(REG_BADBR); + break; + } + c = (charT)traits_inst.toi(first, last, -16); + if((first == last) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) != traits_type::syntax_close_brace)) + { + fail(REG_BADBR); + } + ++first; + break; + } + else + { + if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false) + { + fail(REG_BADBR); + break; + } + c = (charT)traits_inst.toi(first, last, -16); + } + break; + case traits_type::syntax_c: + ++first; + if(first == last) + { + fail(REG_EESCAPE); + break; + } + if(((traits_uchar_type)(*first) < (traits_uchar_type)'@') + || ((traits_uchar_type)(*first) > (traits_uchar_type)127) ) + { + fail(REG_EESCAPE); + return (charT)0; + } + c = (charT)((traits_uchar_type)(*first) - (traits_uchar_type)'@'); + ++first; + break; + case traits_type::syntax_e: + c = (charT)27; + ++first; + break; + case traits_type::syntax_digit: + c = (charT)traits_inst.toi(first, last, -8); + break; + default: + //c = *first; + ++first; + } + return c; +} + +template +void BOOST_REGEX_CALL reg_expression::compile_maps() +{ + re_detail::re_syntax_base* record = static_cast(data.data()); + // always compile the first _map: + std::memset(startmap, 0, 256); + record->can_be_null = 0; + compile_map(record, startmap, 0, re_detail::mask_all); + + while(record->type != re_detail::syntax_element_match) + { + if((record->type == re_detail::syntax_element_alt) || (record->type == re_detail::syntax_element_rep)) + { + std::memset(&(static_cast(record)->_map), 0, 256); + record->can_be_null = 0; + compile_map(record->next.p, static_cast(record)->_map, &(record->can_be_null), re_detail::mask_take, static_cast(record)->alt.p); + compile_map(static_cast(record)->alt.p, static_cast(record)->_map, &(record->can_be_null), re_detail::mask_skip); + if(record->type == re_detail::syntax_element_rep) + { + re_detail::re_repeat* rep = static_cast(record); + // set whether this is a singleton repeat or not: + if(rep->next.p->next.p->next.p == rep->alt.p) + { + switch(rep->next.p->type) + { + case re_detail::syntax_element_wild: + rep->type = re_detail::syntax_element_dot_rep; + break; + case re_detail::syntax_element_literal: + rep->type = re_detail::syntax_element_char_rep; + break; + case re_detail::syntax_element_set: + rep->type = re_detail::syntax_element_short_set_rep; + break; + case re_detail::syntax_element_long_set: + if(static_cast(rep->next.p)->singleton) + rep->type = re_detail::syntax_element_long_set_rep; + break; + default: + break; + } + } + } + } + else + { + record->can_be_null = 0; + compile_map(record, 0, &(record->can_be_null), re_detail::mask_all); + } + record = record->next.p; + } + record->can_be_null = re_detail::mask_all; +} + +template +bool BOOST_REGEX_CALL reg_expression::probe_start( + re_detail::re_syntax_base* node, charT cc, re_detail::re_syntax_base* terminal) const +{ + unsigned int c; + + switch(node->type) + { + case re_detail::syntax_element_startmark: + if(static_cast(node)->index == -1) + { + return probe_start(node->next.p->next.p, cc, terminal) + && probe_start(static_cast(node->next.p)->alt.p, cc, terminal); + } + else if(static_cast(node)->index == -3) + { + return probe_start(node->next.p->next.p, cc, terminal); + } + // doesn't tell us anything about the next character, so: + return probe_start(node->next.p, cc, terminal); + case re_detail::syntax_element_endmark: + if(static_cast(node)->index == -3) + { + return true; + } + // fall through: + case re_detail::syntax_element_start_line: + case re_detail::syntax_element_word_boundary: + case re_detail::syntax_element_buffer_start: + case re_detail::syntax_element_restart_continue: + // doesn't tell us anything about the next character, so: + return probe_start(node->next.p, cc, terminal); + case re_detail::syntax_element_literal: + // only the first character of the literal can match: + // note these have already been translated: + if(*reinterpret_cast(static_cast(node)+1) == traits_inst.translate(cc, (_flags & regex_constants::icase))) + return true; + return false; + case re_detail::syntax_element_end_line: + // next character (if there is one!) must be a newline: + if(traits_inst.is_separator(traits_inst.translate(cc, (_flags & regex_constants::icase)))) + return true; + return false; + case re_detail::syntax_element_wild: + return true; + case re_detail::syntax_element_match: + return true; + case re_detail::syntax_element_within_word: + case re_detail::syntax_element_word_start: + return traits_inst.is_class(traits_inst.translate(cc, (_flags & regex_constants::icase)), traits_type::char_class_word); + case re_detail::syntax_element_word_end: + // what follows must not be a word character, + return traits_inst.is_class(traits_inst.translate(cc, (_flags & regex_constants::icase)), traits_type::char_class_word) ? false : true; + case re_detail::syntax_element_buffer_end: + // we can be null, nothing must follow, + // NB we assume that this is followed by + // re_detail::syntax_element_match, if its not then we can + // never match anything anyway!! + return false; + case re_detail::syntax_element_soft_buffer_end: + // we can be null, only newlines must follow, + // NB we assume that this is followed by + // re_detail::syntax_element_match, if its not then we can + // never match anything anyway!! + return traits_inst.is_separator(traits_inst.translate(cc, (_flags & regex_constants::icase))); + case re_detail::syntax_element_backref: + // there's no easy way to determine this + // which is not to say it can't be done! + // for now: + return true; + case re_detail::syntax_element_long_set: + // we can not be null, + // we need to add already translated values in the set + // to values in the _map + return re_detail::re_maybe_set_member(cc, static_cast(node), *this) || (re_detail::re_is_set_member(static_cast(&cc), static_cast(&cc+1), static_cast(node), *this) != &cc); + case re_detail::syntax_element_set: + // set all the elements that are set in corresponding set: + c = (traits_size_type)(traits_uchar_type)traits_inst.translate(cc, (_flags & regex_constants::icase)); + return static_cast(node)->_map[c] != 0; + case re_detail::syntax_element_jump: + if(static_cast(node)->alt.p < node) + { + // backwards jump, + // caused only by end of repeat section, we'll treat this + // the same as a match, because the sub-expression has matched. + if(node->next.p == terminal) + return true; // null repeat - we can always take this + else + { + // + // take the jump, add in fix for the fact that if the + // repeat that we're jumping to has non-zero minimum count + // then we need to add in the possiblity that we could still + // skip that repeat. + re_detail::re_syntax_base* next = static_cast(node)->alt.p; + bool b = probe_start(next, cc, terminal); + if((next->type == re_detail::syntax_element_rep) && (static_cast(next)->min != 0)) + { + b = b || probe_start(static_cast(next)->alt.p, cc, terminal); + } + return b; + } + } + else + // take the jump and compile: + return probe_start(static_cast(node)->alt.p, cc, terminal); + case re_detail::syntax_element_alt: + // we need to take the OR of the two alternatives: + return probe_start(static_cast(node)->alt.p, cc, terminal) || probe_start(node->next.p, cc, terminal); + case re_detail::syntax_element_rep: + case re_detail::syntax_element_char_rep: + case re_detail::syntax_element_dot_rep: + case re_detail::syntax_element_long_set_rep: + case re_detail::syntax_element_short_set_rep: + // we need to take the OR of the two alternatives + if(static_cast(node)->min == 0) + return probe_start(node->next.p, cc, static_cast(node)->alt.p) || probe_start(static_cast(node)->alt.p, cc, terminal); + else + return probe_start(node->next.p, cc, static_cast(node)->alt.p); + case re_detail::syntax_element_combining: + return !traits_inst.is_combining(traits_inst.translate(cc, (_flags & regex_constants::icase))); + } + return false; +} + +template +bool BOOST_REGEX_CALL reg_expression::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const +{ + switch(node->type) + { + case re_detail::syntax_element_endmark: + if(static_cast(node)->index == -3) + { + return true; + } + // fall through: + case re_detail::syntax_element_startmark: + case re_detail::syntax_element_start_line: + case re_detail::syntax_element_word_boundary: + case re_detail::syntax_element_buffer_start: + case re_detail::syntax_element_restart_continue: + case re_detail::syntax_element_end_line: + case re_detail::syntax_element_word_end: + // doesn't tell us anything about the next character, so: + return probe_start_null(node->next.p, terminal); + case re_detail::syntax_element_match: + case re_detail::syntax_element_buffer_end: + case re_detail::syntax_element_soft_buffer_end: + case re_detail::syntax_element_backref: + return true; + case re_detail::syntax_element_jump: + if(static_cast(node)->alt.p < node) + { + // backwards jump, + // caused only by end of repeat section, we'll treat this + // the same as a match, because the sub-expression has matched. + // this is only caused by NULL repeats as in "(a*)*" or "(\<)*" + // these are really nonsensence and make the matching code much + // harder, it would be nice to get rid of them altogether. + if(node->next.p == terminal) + return true; + else + return probe_start_null(static_cast(node)->alt.p, terminal); + } + else + // take the jump and compile: + return probe_start_null(static_cast(node)->alt.p, terminal); + case re_detail::syntax_element_alt: + // we need to take the OR of the two alternatives: + return probe_start_null(static_cast(node)->alt.p, terminal) || probe_start_null(node->next.p, terminal); + case re_detail::syntax_element_rep: + // only need to consider skipping the repeat: + return probe_start_null(static_cast(node)->alt.p, terminal); + default: + break; + } + return false; +} + +template +void BOOST_REGEX_CALL reg_expression::compile_map( + re_detail::re_syntax_base* node, unsigned char* _map, + unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const +{ + if(_map) + { + for(unsigned int i = 0; i < 256; ++i) + { + if(probe_start(node, (charT)i, terminal)) + _map[i] |= mask; + } + } + if(pnull && probe_start_null(node, terminal)) + *pnull |= mask; +} + +template +void BOOST_REGEX_CALL reg_expression::move_offsets(re_detail::re_syntax_base* j, unsigned size) +{ +# ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4127) +#endif + // move all offsets starting with j->link forward by size + // called after an insert: + j = reinterpret_cast(reinterpret_cast(data.data()) + j->next.i); + while(true) + { + switch(j->type) + { + case re_detail::syntax_element_rep: + static_cast(j)->alt.i += size; + j->next.i += size; + break; + case re_detail::syntax_element_jump: + case re_detail::syntax_element_alt: + static_cast(j)->alt.i += size; + j->next.i += size; + break; + default: + j->next.i += size; + break; + } + if(j->next.i == size) + break; + j = reinterpret_cast(reinterpret_cast(data.data()) + j->next.i); + } +# ifdef BOOST_MSVC +# pragma warning(pop) +#endif +} + +template +re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot) +{ + typedef typename re_detail::is_byte::width_type width_type; + re_detail::jstack singles(64, data.allocator()); + re_detail::jstack ranges(64, data.allocator()); + re_detail::jstack classes(64, data.allocator()); + re_detail::jstack equivalents(64, data.allocator()); + classes.push(cls); + if(dat) + { + data.align(); + dat->next.i = data.size(); + } + return compile_set_aux(singles, ranges, classes, equivalents, isnot, width_type()); +} + +template +re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set(const charT*& first, const charT* last) +{ + re_detail::jstack singles(64, data.allocator()); + re_detail::jstack ranges(64, data.allocator()); + re_detail::jstack classes(64, data.allocator()); + re_detail::jstack equivalents(64, data.allocator()); + bool has_digraphs = false; + jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set); + ++first; + bool started = false; + bool done = false; + bool isnot = false; + + enum last_type + { + last_single, + last_none, + last_dash + }; + + unsigned l = last_none; + traits_string_type s; + + while((first != last) && !done) + { + traits_size_type c = (traits_size_type)(traits_uchar_type)*first; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + traits_size_type syntax = traits_inst.syntax_type(c); + switch(syntax) + { + case traits_type::syntax_caret: + if(!started && !isnot) + { + isnot = true; + } + else + { + s = (charT)c; + goto char_set_literal; + } + break; + case traits_type::syntax_open_set: + { + if((_flags & char_classes) == 0) + { + s = (charT)c; + goto char_set_literal; + } + // check to see if we really have a class: + const charT* base = first; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + unsigned int inner_set = parse_inner_set(first, last); + switch(inner_set) + { + case traits_type::syntax_colon: + { + if(l == last_dash) + { + fail(REG_ERANGE); + return 0; + } + boost::uint_fast32_t id = traits_inst.lookup_classname(base+2, first-2); + if(_flags & regex_constants::icase) + { + if((id == traits_type::char_class_upper) || (id == traits_type::char_class_lower)) + { + id = traits_type::char_class_alpha; + } + } + if(id == 0) + { + fail(REG_ECTYPE); + return 0; + } + classes.push(id); + started = true; + l = last_none; + } + break; + case traits_type::syntax_dot: + // + // we have a collating element [.collating-name.] + // + if(traits_inst.lookup_collatename(s, base+2, first-2)) + { + --first; + if(s.size() > 1) + has_digraphs = true; + if(s.size())goto char_set_literal; + } + fail(REG_ECOLLATE); + return 0; + case traits_type::syntax_equal: + // + // we have an equivalence class [=collating-name=] + // + if(traits_inst.lookup_collatename(s, base+2, first-2)) + { + std::size_t len = s.size(); + if(len) + { + unsigned i = 0; + while(i < len) + { + s[i] = traits_inst.translate(s[i], (_flags & regex_constants::icase)); + ++i; + } + traits_string_type s2; + traits_inst.transform_primary(s2, s); + equivalents.push(s2); + started = true; + l = last_none; + break; + } + } + fail(REG_ECOLLATE); + return 0; + case traits_type::syntax_left_word: + if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set)) + { + ++first; + return add_simple(0, re_detail::syntax_element_word_start); + } + fail(REG_EBRACK); + return 0; + case traits_type::syntax_right_word: + if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set)) + { + ++first; + return add_simple(0, re_detail::syntax_element_word_end); + } + fail(REG_EBRACK); + return 0; + default: + if(started == false) + { + unsigned int t = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1)); + if((t != traits_type::syntax_colon) && (t != traits_type::syntax_dot) && (t != traits_type::syntax_equal)) + { + first = base; + s = (charT)c; + goto char_set_literal; + } + } + fail(REG_EBRACK); + return 0; + } + if(first == last) + { + fail(REG_EBRACK); + return 0; + } + continue; + } + case traits_type::syntax_close_set: + if(started == false) + { + s = (charT)c; + goto char_set_literal; + } + done = true; + break; + case traits_type::syntax_dash: + if(!started) + { + s = (charT)c; + goto char_set_literal; + } + ++first; + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set) + { + --first; + s = (charT)c; + goto char_set_literal; + } + if((singles.empty() == true) || (l != last_single)) + { + fail(REG_ERANGE); + return 0; + } + ranges.push(singles.peek()); + if(singles.peek().size() <= 1) // leave digraphs and ligatures in place + singles.pop(); + l = last_dash; + continue; + case traits_type::syntax_slash: + if(_flags & regex_constants::escape_in_lists) + { + ++first; + if(first == last) + continue; + traits_size_type c = (traits_size_type)(traits_uchar_type)*first; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + traits_size_type syntax = traits_inst.syntax_type(c); + switch(syntax) + { + case traits_type::syntax_w: + if(l == last_dash) + { + fail(REG_ERANGE); + return 0; + } + classes.push(traits_type::char_class_word); + started = true; + l = last_none; + ++first; + continue; + case traits_type::syntax_d: + if(l == last_dash) + { + fail(REG_ERANGE); + return 0; + } + classes.push(traits_type::char_class_digit); + started = true; + l = last_none; + ++first; + continue; + case traits_type::syntax_s: + if(l == last_dash) + { + fail(REG_ERANGE); + return 0; + } + classes.push(traits_type::char_class_space); + started = true; + l = last_none; + ++first; + continue; + case traits_type::syntax_l: + if(l == last_dash) + { + fail(REG_ERANGE); + return 0; + } + classes.push(traits_type::char_class_lower); + started = true; + l = last_none; + ++first; + continue; + case traits_type::syntax_u: + if(l == last_dash) + { + fail(REG_ERANGE); + return 0; + } + classes.push(traits_type::char_class_upper); + started = true; + l = last_none; + ++first; + continue; + case traits_type::syntax_W: + case traits_type::syntax_D: + case traits_type::syntax_S: + case traits_type::syntax_U: + case traits_type::syntax_L: + fail(REG_EESCAPE); + return 0; + default: + c = parse_escape(first, last); + --first; + s = (charT)c; + goto char_set_literal; + } + } + else + { + s = (charT)c; + goto char_set_literal; + } + default: + s = (charT)c; + char_set_literal: + unsigned i = 0; + // get string length to stop us going past the end of string (DWA) + std::size_t len = s.size(); + while(i < len) + { + s[i] = traits_inst.translate(s[i], (_flags & regex_constants::icase)); + ++i; + } + started = true; + if(l == last_dash) + { + ranges.push(s); + l = last_none; + if(s.size() > 1) // add ligatures to singles list as well + singles.push(s); + } + else + { + singles.push(s); + l = last_single; + } + } + ++first; + } + if(!done) + return 0; + + typedef typename re_detail::is_byte::width_type width_type; + + re_detail::re_syntax_base* result; + if(has_digraphs) + result = compile_set_aux(singles, ranges, classes, equivalents, isnot, re_detail::_wide_type()); + else + result = compile_set_aux(singles, ranges, classes, equivalents, isnot, width_type()); + #ifdef __BORLANDC__ + // delayed throw: + if((result == 0) && (_flags & regex_constants::use_except)) + fail(error_code()); + #endif + return result; +} + +template +re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set_aux(re_detail::jstack& singles, re_detail::jstack& ranges, re_detail::jstack& classes, re_detail::jstack& equivalents, bool isnot, const re_detail::_wide_type&) +{ + size_type base = data.size(); + data.extend(sizeof(re_detail::re_set_long)); + unsigned int csingles = 0; + unsigned int cranges = 0; + boost::uint_fast32_t cclasses = 0; + unsigned int cequivalents = 0; + bool nocollate_state = !(flags() & regex_constants::collate); + bool singleton = true; + + while(singles.empty() == false) + { + ++csingles; + const traits_string_type& s = singles.peek(); + std::size_t len = (s.size() + 1) * sizeof(charT); + if(len > sizeof(charT)) + singleton = false; + std::memcpy(reinterpret_cast(data.extend(len)), s.c_str(), len); + singles.pop(); + } + while(ranges.empty() == false) + { + traits_string_type c1, c2; + if(nocollate_state) + c1 = ranges.peek(); + else + traits_inst.transform(c1, ranges.peek()); + ranges.pop(); + if(nocollate_state) + c2 = ranges.peek(); + else + traits_inst.transform(c2, ranges.peek()); + ranges.pop(); + if(c1 < c2) + { + // for some reason bc5 crashes when throwing exceptions + // from here - probably an EH-compiler bug, but hard to + // be sure... + // delay throw to later: + #ifdef __BORLANDC__ + boost::uint_fast32_t f = _flags; + _flags &= ~regex_constants::use_except; + #endif + fail(REG_ERANGE); + #ifdef __BORLANDC__ + _flags = f; + #endif + return 0; + } + ++cranges; + std::size_t len = (re_detail::re_strlen(c1.c_str()) + 1) * sizeof(charT); + std::memcpy(data.extend(len), c1.c_str(), len); + len = (re_detail::re_strlen(c2.c_str()) + 1) * sizeof(charT); + std::memcpy(data.extend(len), c2.c_str(), len); + } + while(classes.empty() == false) + { + cclasses |= classes.peek(); + classes.pop(); + } + while(equivalents.empty() == false) + { + ++cequivalents; + const traits_string_type& s = equivalents.peek(); + std::size_t len = (re_detail::re_strlen(s.c_str()) + 1) * sizeof(charT); + std::memcpy(reinterpret_cast(data.extend(len)), s.c_str(), len); + equivalents.pop(); + } + + re_detail::re_set_long* dat = reinterpret_cast(reinterpret_cast(data.data()) + base); + dat->type = re_detail::syntax_element_long_set; + dat->csingles = csingles; + dat->cranges = cranges; + dat->cclasses = cclasses; + dat->cequivalents = cequivalents; + dat->isnot = isnot; + dat->next.i = 0; + dat->singleton = isnot ? true : singleton; + return dat; +} + +template +re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::compile_set_aux(re_detail::jstack& singles, re_detail::jstack& ranges, re_detail::jstack& classes, re_detail::jstack& equivalents, bool isnot, const re_detail::_narrow_type&) +{ + re_detail::re_set* dat = reinterpret_cast(data.extend(sizeof(re_detail::re_set))); + std::memset(dat, 0, sizeof(re_detail::re_set)); + + while(singles.empty() == false) + { + dat->_map[(traits_size_type)(traits_uchar_type)*(singles.peek().c_str())] = re_detail::mask_all; + singles.pop(); + } + while(ranges.empty() == false) + { + traits_string_type c1, c2, c3, c4; + + if((flags() & regex_constants::collate) == 0) + c1 = ranges.peek(); + else + traits_inst.transform(c1, ranges.peek()); + ranges.pop(); + if((flags() & regex_constants::collate) == 0) + c2 = ranges.peek(); + else + traits_inst.transform(c2, ranges.peek()); + ranges.pop(); + + if(c1 < c2) + { + // for some reason bc5 crashes when throwing exceptions + // from here - probably an EH-compiler bug, but hard to + // be sure... + // delay throw to later: + #ifdef __BORLANDC__ + boost::uint_fast32_t f = _flags; + _flags &= ~regex_constants::use_except; + #endif + fail(REG_ERANGE); + #ifdef __BORLANDC__ + _flags = f; + #endif + return 0; + } + for(unsigned int i = 0; i < 256; ++i) + { + c4 = (charT)i; + if((flags() & regex_constants::collate) == 0) + c3 = c4; + else + traits_inst.transform(c3, c4); + if((c3 <= c1) && (c3 >= c2)) + dat->_map[i] = re_detail::mask_all; + } + } + while(equivalents.empty() == false) + { + traits_string_type c1, c2; + for(unsigned int i = 0; i < 256; ++i) + { + c2 = (charT)i; + traits_inst.transform_primary(c1, c2); + if(c1 == equivalents.peek()) + dat->_map[i] = re_detail::mask_all; + } + equivalents.pop(); + } + + boost::uint_fast32_t flags = 0; + while(classes.empty() == false) + { + flags |= classes.peek(); + classes.pop(); + } + if(flags) + { + for(unsigned int i = 0; i < 256; ++i) + { + if(traits_inst.is_class(charT(i), flags)) + dat->_map[(traits_uchar_type)traits_inst.translate((charT)i, (_flags & regex_constants::icase))] = re_detail::mask_all; + } + } + + if(isnot) + { + for(unsigned int i = 0; i < 256; ++i) + { + dat->_map[i] = !dat->_map[i]; + } + } + + dat->type = re_detail::syntax_element_set; + dat->next.i = 0; + return dat; +} + +#ifndef __CODEGUARD__ +// this must not be inline when Borland's codeguard support is turned +// on, otherwise we _will_ get surious codeguard errors... +inline +#endif + re_detail::re_syntax_base* add_offset(void* base, std::ptrdiff_t off) +{ + return reinterpret_cast(reinterpret_cast(base) + off); +} + + +template +void BOOST_REGEX_CALL reg_expression::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces) +{ + typedef typename boost::detail::rebind_allocator::type b_alloc; + + register unsigned char* base = reinterpret_cast(b); + register re_detail::re_syntax_base* ptr = b; + bool* pb = 0; + b_alloc a(data.allocator()); +#ifndef BOOST_NO_EXCEPTIONS + try + { +#endif + pb = a.allocate(cbraces); + BOOST_REGEX_NOEH_ASSERT(pb) + for(unsigned i = 0; i < cbraces; ++i) + pb[i] = false; + + repeats = 0; + + while(ptr->next.i) + { + switch(ptr->type) + { + case re_detail::syntax_element_rep: + jm_assert(data.size() > static_cast(ptr)->alt.i); + static_cast(ptr)->alt.p = add_offset(base, static_cast(ptr)->alt.i); +#ifdef BOOST_REGEX_DEBUG + if((re_detail::padding_mask & reinterpret_cast(static_cast(ptr)->alt.p)) && (static_cast(ptr)->alt.p != b)) + { + jm_trace("padding mis-aligment in repeat jump to object type: " << static_cast(ptr)->alt.p->type) + //jm_assert(0 == (padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p)); + } +#endif + static_cast(ptr)->id = repeats; + ++repeats; + goto rebase; + case re_detail::syntax_element_jump: + case re_detail::syntax_element_alt: + jm_assert(data.size() > static_cast(ptr)->alt.i); + static_cast(ptr)->alt.p = add_offset(base, static_cast(ptr)->alt.i); +#ifdef BOOST_REGEX_DEBUG + if((re_detail::padding_mask & reinterpret_cast(static_cast(ptr)->alt.p) && (static_cast(ptr)->alt.p != b))) + { + jm_trace("padding mis-aligment in alternation jump to object type: " << static_cast(ptr)->alt.p->type) + //jm_assert(0 == (padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p)); + } +#endif + goto rebase; + case re_detail::syntax_element_backref: + if((static_cast(ptr)->index >= (int)cbraces) || (pb[static_cast(ptr)->index] == false) ) + { + fail(REG_ESUBREG); + a.deallocate(pb, cbraces); + return; + } + goto rebase; + case re_detail::syntax_element_endmark: + if(static_cast(ptr)->index > 0) + pb[static_cast(ptr)->index] = true; + goto rebase; + default: + rebase: + jm_assert(data.size() > ptr->next.i); + ptr->next.p = add_offset(base, ptr->next.i); +#ifdef BOOST_REGEX_DEBUG + if((re_detail::padding_mask & (int)(ptr->next.p)) && (static_cast(ptr)->alt.p != b)) + { + jm_trace("padding mis-alignment in next record of type " << ptr->next.p->type) + jm_assert(0 == (re_detail::padding_mask & (int)(ptr->next.p))); + } +#endif + ptr = ptr->next.p; + } + } + a.deallocate(pb, cbraces); + pb = 0; +#ifndef BOOST_NO_EXCEPTIONS + } + catch(...) + { + if(pb) + a.deallocate(pb, cbraces); + throw; + } +#endif +} + + +template +unsigned int BOOST_REGEX_CALL reg_expression::set_expression(const charT* p, const charT* end, flag_type f) +{ +# ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4127) +#endif +#ifdef __OpenBSD__ + // strxfrm not working on OpenBSD?? + f &= ~regex_constants::collate; +#endif + + if(p == expression()) + { + traits_string_type s(p, end); + return set_expression(s.c_str(), s.c_str() + s.size(), f); + } + typedef typename traits_type::sentry sentry_t; + sentry_t sent(traits_inst); + if(sent){ + + const charT* base = p; + data.clear(); + _flags = f; + fail(REG_NOERROR); // clear any error + + if(p >= end) + { + fail(REG_EMPTY); + return error_code(); + } + + const charT* ptr = p; + marks = 0; + re_detail::jstack mark(64, data.allocator()); + re_detail::jstack markid(64, data.allocator()); + std::size_t last_mark_popped = 0; + register traits_size_type c; + register re_detail::re_syntax_base* dat; + + unsigned rep_min = 0; + unsigned rep_max = 0; + + // + // set up header: + // + ++marks; + dat = 0; + + if(_flags & regex_constants::literal) + { + while(ptr != end) + { + dat = add_literal(dat, traits_inst.translate(*ptr, (_flags & regex_constants::icase))); + ++ptr; + } + } + + while (ptr < end) + { + c = (traits_size_type)(traits_uchar_type)*ptr; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + traits_size_type syntax = traits_inst.syntax_type(c); + switch(syntax) + { + case traits_type::syntax_open_bracket: + if(_flags & bk_parens) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + open_bracked_jump: + // extend: + dat = add_simple(dat, re_detail::syntax_element_startmark, sizeof(re_detail::re_brace)); + if(_flags & nosubs) + { + markid.push(0); + static_cast(dat)->index = 0; + } + else + { + markid.push(marks); + static_cast(dat)->index = marks++; + } + mark.push(data.index(dat)); + ++ptr; + // + // check for perl like (?...) extention syntax + c = (traits_size_type)(traits_uchar_type)*ptr; + if(((_flags & (bk_parens|perlex)) == perlex) && (traits_type::syntax_question == traits_inst.syntax_type(c))) + { + ++ptr; + c = (traits_size_type)(traits_uchar_type)*ptr; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + traits_size_type syntax = traits_inst.syntax_type(c); + switch(syntax) + { + case traits_type::syntax_colon: + static_cast(dat)->index = 0; + --marks; + markid.pop(); + markid.push(0); + ++ptr; + continue; + case traits_type::syntax_equal: + static_cast(dat)->index = -1; + markid.pop(); + markid.push(-1); + common_forward_assert: + --marks; + ++ptr; + // extend: + dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size); + data.align(); + // + // we don't know what value to put here yet, + // use an arbitrarily large value for now + // and check it later: + static_cast(dat)->alt.i = INT_MAX/2; + mark.push(data.size() - re_detail::re_jump_size); + continue; + case traits_type::syntax_right_word: + static_cast(dat)->index = -3; + markid.pop(); + markid.push(-3); + goto common_forward_assert; + case traits_type::syntax_not: + static_cast(dat)->index = -2; + markid.pop(); + markid.push(-2); + goto common_forward_assert; + case traits_type::syntax_hash: + // comment just skip it: + static_cast(dat)->index = 0; + --marks; + markid.pop(); + mark.pop(); + do{ + ++ptr; + c = (traits_size_type)(traits_uchar_type)*ptr; + }while(traits_type::syntax_close_bracket != traits_inst.syntax_type(c)); + ++ptr; + continue; + default: + // + // error, return to standard parsing and let that handle the error: + --ptr; + continue; + } + } + break; + case traits_type::syntax_close_bracket: + if(_flags & bk_parens) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + + close_bracked_jump: + if(dat) + { + data.align(); + dat->next.i = data.size(); + } + + if(mark.empty()) + { + fail(REG_EPAREN); + return error_code(); + } + // see if we have an empty alternative: + if(mark.peek() == data.index(dat) ) + { + re_detail::re_syntax_base* para = reinterpret_cast(reinterpret_cast(data.data()) + mark.peek()); + if(para->type == re_detail::syntax_element_jump) + { + fail(REG_EMPTY); + return error_code(); + } + } + + // pop any pushed alternatives and set the target end destination: + dat = reinterpret_cast(reinterpret_cast(data.data()) + mark.peek()); + while(dat->type == re_detail::syntax_element_jump) + { + static_cast(dat)->alt.i = data.size(); + mark.pop(); + if(mark.empty()) + { + fail(REG_EPAREN); + return error_code(); + } + dat = reinterpret_cast(reinterpret_cast(data.data()) + mark.peek()); + } + + dat = add_simple(0, re_detail::syntax_element_endmark, sizeof(re_detail::re_brace)); + static_cast(dat)->index = markid.peek(); + markid.pop(); + last_mark_popped = mark.peek(); + mark.pop(); + ++ptr; + break; + case traits_type::syntax_char: + dat = add_literal(dat, (charT)c); + ++ptr; + break; + case traits_type::syntax_slash: + { + if(++ptr == end) + { + fail(REG_EESCAPE); + return error_code(); + } + c = (traits_size_type)(traits_uchar_type)*ptr; + // this is only used for the switch(), but cannot be folded in + // due to a bug in Comeau 4.2.44beta3 + traits_size_type syntax = traits_inst.syntax_type(c); + switch(syntax) + { + case traits_type::syntax_open_bracket: + if(_flags & bk_parens) + goto open_bracked_jump; + break; + case traits_type::syntax_close_bracket: + if(_flags & bk_parens) + goto close_bracked_jump; + break; + case traits_type::syntax_plus: + if((_flags & bk_plus_qm) && ((_flags & limited_ops) == 0)) + { + rep_min = 1; + rep_max = (unsigned)-1; + goto repeat_jump; + } + break; + case traits_type::syntax_question: + if((_flags & bk_plus_qm) && ((_flags & limited_ops) == 0)) + { + rep_min = 0; + rep_max = 1; + goto repeat_jump; + } + break; + case traits_type::syntax_or: + if(((_flags & bk_vbar) == 0) || (_flags & limited_ops)) + break; + goto alt_string_jump; + case traits_type::syntax_open_brace: + if( ((_flags & bk_braces) == 0) || ((_flags & intervals) == 0)) + break; + + // we have {x} or {x,} or {x,y}: + parse_range(ptr, end, rep_min, rep_max); + goto repeat_jump; + + case traits_type::syntax_digit: + if(_flags & bk_refs) + { + // update previous: + int i = traits_inst.toi((charT)c); + if(i == 0) + { + // we can have \025 which means take char whose + // code is 25 (octal), so parse string: + c = traits_inst.toi(ptr, end, -8); + --ptr; + break; + } + dat = add_simple(dat, re_detail::syntax_element_backref, sizeof(re_detail::re_brace)); + static_cast(dat)->index = i; + ++ptr; + continue; + } + break; + case traits_type::syntax_b: // re_detail::syntax_element_word_boundary + dat = add_simple(dat, re_detail::syntax_element_word_boundary); + ++ptr; + continue; + case traits_type::syntax_B: + dat = add_simple(dat, re_detail::syntax_element_within_word); + ++ptr; + continue; + case traits_type::syntax_left_word: + dat = add_simple(dat, re_detail::syntax_element_word_start); + ++ptr; + continue; + case traits_type::syntax_right_word: + dat = add_simple(dat, re_detail::syntax_element_word_end); + ++ptr; + continue; + case traits_type::syntax_w: //re_detail::syntax_element_word_char + dat = compile_set_simple(dat, traits_type::char_class_word); + ++ptr; + continue; + case traits_type::syntax_W: + dat = compile_set_simple(dat, traits_type::char_class_word, true); + ++ptr; + continue; + case traits_type::syntax_d: //re_detail::syntax_element_word_char + dat = compile_set_simple(dat, traits_type::char_class_digit); + ++ptr; + continue; + case traits_type::syntax_D: + dat = compile_set_simple(dat, traits_type::char_class_digit, true); + ++ptr; + continue; + case traits_type::syntax_s: //re_detail::syntax_element_word_char + dat = compile_set_simple(dat, traits_type::char_class_space); + ++ptr; + continue; + case traits_type::syntax_S: + dat = compile_set_simple(dat, traits_type::char_class_space, true); + ++ptr; + continue; + case traits_type::syntax_l: //re_detail::syntax_element_word_char + dat = compile_set_simple(dat, traits_type::char_class_lower); + ++ptr; + continue; + case traits_type::syntax_L: + dat = compile_set_simple(dat, traits_type::char_class_lower, true); + ++ptr; + continue; + case traits_type::syntax_u: //re_detail::syntax_element_word_char + dat = compile_set_simple(dat, traits_type::char_class_upper); + ++ptr; + continue; + case traits_type::syntax_U: + dat = compile_set_simple(dat, traits_type::char_class_upper, true); + ++ptr; + continue; + case traits_type::syntax_Q: + ++ptr; + while(true) + { + if(ptr == end) + { + fail(REG_EESCAPE); + return error_code(); + } + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_slash) + { + ++ptr; + if((ptr != end) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_E)) + break; + else + { + dat = add_literal(dat, *(ptr-1)); + continue; + } + } + dat = add_literal(dat, *ptr); + ++ptr; + } + ++ptr; + continue; + case traits_type::syntax_C: + dat = add_simple(dat, re_detail::syntax_element_wild); + ++ptr; + continue; + case traits_type::syntax_X: + dat = add_simple(dat, re_detail::syntax_element_combining); + ++ptr; + continue; + case traits_type::syntax_Z: + dat = add_simple(dat, re_detail::syntax_element_soft_buffer_end); + ++ptr; + continue; + case traits_type::syntax_G: + dat = add_simple(dat, re_detail::syntax_element_restart_continue); + ++ptr; + continue; + case traits_type::syntax_start_buffer: + dat = add_simple(dat, re_detail::syntax_element_buffer_start); + ++ptr; + continue; + case traits_type::syntax_end_buffer: + dat = add_simple(dat, re_detail::syntax_element_buffer_end); + ++ptr; + continue; + default: + c = (traits_size_type)(traits_uchar_type)parse_escape(ptr, end); + dat = add_literal(dat, (charT)c); + continue; + } + dat = add_literal(dat, (charT)c); + ++ptr; + break; + } + case traits_type::syntax_dollar: + dat = add_simple(dat, re_detail::syntax_element_end_line, sizeof(re_detail::re_syntax_base)); + ++ptr; + continue; + case traits_type::syntax_caret: + dat = add_simple(dat, re_detail::syntax_element_start_line, sizeof(re_detail::re_syntax_base)); + ++ptr; + continue; + case traits_type::syntax_dot: + dat = add_simple(dat, re_detail::syntax_element_wild, sizeof(re_detail::re_syntax_base)); + ++ptr; + continue; + case traits_type::syntax_star: + rep_min = 0; + rep_max = (unsigned)-1; + + repeat_jump: + { + std::ptrdiff_t offset; + if(dat == 0) + { + fail(REG_BADRPT); + return error_code(); + } + switch(dat->type) + { + case re_detail::syntax_element_endmark: + offset = last_mark_popped; + break; + case re_detail::syntax_element_literal: + if(static_cast(dat)->length > 1) + { + // update previous: + charT lit = *reinterpret_cast(reinterpret_cast(dat) + sizeof(re_detail::re_literal) + ((static_cast(dat)->length-1)*sizeof(charT))); + --static_cast(dat)->length; + dat = add_simple(dat, re_detail::syntax_element_literal, sizeof(re_detail::re_literal) + sizeof(charT)); + static_cast(dat)->length = 1; + *reinterpret_cast(static_cast(dat)+1) = lit; + } + offset = reinterpret_cast(dat) - reinterpret_cast(data.data()); + break; + case re_detail::syntax_element_backref: + case re_detail::syntax_element_long_set: + case re_detail::syntax_element_set: + case re_detail::syntax_element_wild: + case re_detail::syntax_element_combining: + // we're repeating a single item: + offset = reinterpret_cast(dat) - reinterpret_cast(data.data()); + break; + default: + fail(REG_BADRPT); + return error_code(); + } + data.align(); + dat->next.i = data.size(); + //unsigned pos = (char*)dat - (char*)data.data(); + + // add the trailing jump: + dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size); + static_cast(dat)->alt.i = 0; + + // now insert the leading repeater: + dat = static_cast(data.insert(offset, re_detail::re_repeater_size)); + dat->next.i = (reinterpret_cast(dat) - reinterpret_cast(data.data())) + re_detail::re_repeater_size; + dat->type = re_detail::syntax_element_rep; + static_cast(dat)->alt.i = data.size(); + static_cast(dat)->min = rep_min; + static_cast(dat)->max = rep_max; + static_cast(dat)->leading = false; + static_cast(dat)->greedy = true; + move_offsets(dat, re_detail::re_repeater_size); + ++ptr; + // + // now check to see if we have a non-greedy repeat: + if((ptr != end) && (_flags & (perlex | limited_ops | bk_plus_qm | bk_braces)) == perlex) + { + c = (traits_size_type)(traits_uchar_type)*ptr; + if(traits_type::syntax_question == traits_inst.syntax_type(c)) + { + // OK repeat is non-greedy: + static_cast(dat)->greedy = false; + ++ptr; + } + } + dat = reinterpret_cast(reinterpret_cast(data.data()) + data.size() - re_detail::re_jump_size); + static_cast(dat)->alt.i = offset; + continue; + } + case traits_type::syntax_plus: + if(_flags & (bk_plus_qm | limited_ops)) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + rep_min = 1; + rep_max = (unsigned)-1; + goto repeat_jump; + case traits_type::syntax_question: + if(_flags & (bk_plus_qm | limited_ops)) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + rep_min = 0; + rep_max = 1; + goto repeat_jump; + case traits_type::syntax_open_set: + // update previous: + if(dat) + { + data.align(); + dat->next.i = data.size(); + } + // extend: + dat = compile_set(ptr, end); + if(dat == 0) + { + if((_flags & regex_constants::failbit) == 0) + fail(REG_EBRACK); + return error_code(); + } + break; + case traits_type::syntax_or: + { + if(_flags & (bk_vbar | limited_ops)) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + + alt_string_jump: + + // update previous: + if(dat == 0) + { + // start of pattern can't have empty "|" + fail(REG_EMPTY); + return error_code(); + } + // see if we have an empty alternative: + if(mark.empty() == false) + if(mark.peek() == data.index(dat)) + { + fail(REG_EMPTY); + return error_code(); + } + // extend: + dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size); + data.align(); + // + // we don't know what value to put here yet, + // use an arbitrarily large value for now + // and check it later (TODO!) + static_cast(dat)->alt.i = INT_MAX/2; + + // now work out where to insert: + std::size_t offset = 0; + if(mark.empty() == false) + { + // we have a '(' or '|' to go back to: + offset = mark.peek(); + re_detail::re_syntax_base* base = reinterpret_cast(reinterpret_cast(data.data()) + offset); + offset = base->next.i; + } + re_detail::re_jump* j = static_cast(data.insert(offset, re_detail::re_jump_size)); + j->type = re_detail::syntax_element_alt; + j->next.i = offset + re_detail::re_jump_size; + j->alt.i = data.size(); + move_offsets(j, re_detail::re_jump_size); + dat = reinterpret_cast(reinterpret_cast(data.data()) + data.size() - re_detail::re_jump_size); + mark.push(data.size() - re_detail::re_jump_size); + ++ptr; + break; + } + case traits_type::syntax_open_brace: + if((_flags & bk_braces) || ((_flags & intervals) == 0)) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + // we have {x} or {x,} or {x,y}: + parse_range(ptr, end, rep_min, rep_max); + goto repeat_jump; + case traits_type::syntax_newline: + if(_flags & newline_alt) + goto alt_string_jump; + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + case traits_type::syntax_close_brace: + if(_flags & bk_braces) + { + dat = add_literal(dat, (charT)c); + ++ptr; + continue; + } + fail(REG_BADPAT); + return error_code(); + default: + dat = add_literal(dat, (charT)c); + ++ptr; + break; + } // switch + } // while + + // + // update previous: + if(dat) + { + data.align(); + dat->next.i = data.size(); + } + + // see if we have an empty alternative: + if(mark.empty() == false) + if(mark.peek() == data.index(dat) ) + { + re_detail::re_syntax_base* para = reinterpret_cast(reinterpret_cast(data.data()) + mark.peek()); + if(para->type == re_detail::syntax_element_jump) + { + fail(REG_EMPTY); + return error_code(); + } + } + // + // set up tail: + // + if(mark.empty() == false) + { + // pop any pushed alternatives and set the target end destination: + dat = reinterpret_cast(reinterpret_cast(data.data()) + mark.peek()); + while(dat->type == re_detail::syntax_element_jump) + { + static_cast(dat)->alt.i = data.size(); + mark.pop(); + if(mark.empty() == true) + break; + dat = reinterpret_cast(reinterpret_cast(data.data()) + mark.peek()); + } + } + + dat = static_cast(data.extend(sizeof(re_detail::re_syntax_base))); + dat->type = re_detail::syntax_element_match; + dat->next.i = 0; + + if(mark.empty() == false) + { + fail(REG_EPAREN); + return error_code(); + } + + // + // allocate space for start _map: + startmap = reinterpret_cast(data.extend(256 + ((end - base + 1) * sizeof(charT)))); + // + // and copy the expression we just compiled: + _expression = reinterpret_cast(reinterpret_cast(startmap) + 256); + _expression_len = end - base; + std::memcpy(_expression, base, _expression_len * sizeof(charT)); + *(_expression + _expression_len) = charT(0); + + // + // now we need to apply fixups to the array + // so that we can use pointers and not indexes + fixup_apply(static_cast(data.data()), marks); + + // check for error during fixup: + if(_flags & regex_constants::failbit) + return error_code(); + + // + // finally compile the maps so that we can make intelligent choices + // whenever we encounter an alternative: + compile_maps(); + if(pkmp) + { + re_detail::kmp_free(pkmp, data.allocator()); + pkmp = 0; + } + re_detail::re_syntax_base* sbase = static_cast(data.data()); + _restart_type = probe_restart(sbase); + _leading_len = fixup_leading_rep(sbase, 0); + if((sbase->type == re_detail::syntax_element_literal) && (sbase->next.p->type == re_detail::syntax_element_match)) + { + _restart_type = restart_fixed_lit; + if(0 == pkmp) + { + charT* p1 = reinterpret_cast(reinterpret_cast(sbase) + sizeof(re_detail::re_literal)); + charT* p2 = p1 + static_cast(sbase)->length; + pkmp = re_detail::kmp_compile(p1, p2, charT(), re_detail::kmp_translator(_flags®ex_constants::icase, &traits_inst), data.allocator()); + } + } + return error_code(); + + } // sentry + return REG_EMPTY; + +# ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +} + +template +re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size) +{ + if(dat) + { + data.align(); + dat->next.i = data.size(); + } + if(size < sizeof(re_detail::re_syntax_base)) + size = sizeof(re_detail::re_syntax_base); + dat = static_cast(data.extend(size)); + dat->type = type; + dat->next.i = 0; + return dat; +} + +template +re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression::add_literal(re_detail::re_syntax_base* dat, charT c) +{ + if(dat && (dat->type == re_detail::syntax_element_literal)) + { + // add another charT to the list: + std::ptrdiff_t pos = reinterpret_cast(dat) - reinterpret_cast(data.data()); + *reinterpret_cast(data.extend(sizeof(charT))) = traits_inst.translate(c, (_flags & regex_constants::icase)); + dat = reinterpret_cast(reinterpret_cast(data.data()) + pos); + ++(static_cast(dat)->length); + } + else + { + // extend: + dat = add_simple(dat, re_detail::syntax_element_literal, sizeof(re_detail::re_literal) + sizeof(charT)); + static_cast(dat)->length = 1; + *reinterpret_cast(reinterpret_cast(dat)+1) = traits_inst.translate(c, (_flags & regex_constants::icase)); + } + return dat; +} + +template +unsigned int BOOST_REGEX_CALL reg_expression::probe_restart(re_detail::re_syntax_base* dat) +{ + switch(dat->type) + { + case re_detail::syntax_element_startmark: + case re_detail::syntax_element_endmark: + if(static_cast(dat)->index == -2) + return regbase::restart_any; + return probe_restart(dat->next.p); + case re_detail::syntax_element_start_line: + return regbase::restart_line; + case re_detail::syntax_element_word_start: + return regbase::restart_word; + case re_detail::syntax_element_buffer_start: + return regbase::restart_buf; + case re_detail::syntax_element_restart_continue: + return regbase::restart_continue; + default: + return regbase::restart_any; + } +} + +template +unsigned int BOOST_REGEX_CALL reg_expression::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end) +{ + unsigned int len = 0; + bool leading_lit = end ? false : true; + while(dat != end) + { + switch(dat->type) + { + case re_detail::syntax_element_literal: + len += static_cast(dat)->length; + if((leading_lit) && (static_cast(dat)->length > 2)) + { + // we can do a literal search for the leading literal string + // using Knuth-Morris-Pratt (or whatever), and only then check for + // matches. We need a decent length string though to make it + // worth while. + _leading_string = reinterpret_cast(reinterpret_cast(dat) + sizeof(re_detail::re_literal)); + _leading_string_len = static_cast(dat)->length; + _restart_type = restart_lit; + leading_lit = false; + const charT* p1 = _leading_string; + const charT* p2 = _leading_string + _leading_string_len; + pkmp = re_detail::kmp_compile(p1, p2, charT(), re_detail::kmp_translator(_flags®ex_constants::icase, &traits_inst), data.allocator()); + } + leading_lit = false; + break; + case re_detail::syntax_element_wild: + ++len; + leading_lit = false; + break; + case re_detail::syntax_element_match: + return len; + case re_detail::syntax_element_backref: + //case re_detail::syntax_element_jump: + case re_detail::syntax_element_alt: + case re_detail::syntax_element_combining: + return 0; + case re_detail::syntax_element_long_set: + { + // we need to verify that there are no multi-character + // collating elements inside the repeat: + if(!static_cast(dat)->singleton) + return 0; + ++len; + leading_lit = false; + break; + } + case re_detail::syntax_element_set: + ++len; + leading_lit = false; + break; + case re_detail::syntax_element_rep: + case re_detail::syntax_element_dot_rep: + case re_detail::syntax_element_char_rep: + case re_detail::syntax_element_short_set_rep: + case re_detail::syntax_element_long_set_rep: + if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast(dat)->alt.p) )) + { + static_cast(dat)->leading = leading_lit; + return len; + } + return len; + case re_detail::syntax_element_startmark: + if(static_cast(dat)->index == -2) + return 0; + // fall through: + default: + break; + } + dat = dat->next.p; + } + return len; +} + +template +void BOOST_REGEX_CALL reg_expression::fail(unsigned int err) +{ + error_code_ = err; + if(err) + { + _flags |= regex_constants::failbit; +#ifndef BOOST_NO_EXCEPTIONS + if(_flags & regex_constants::use_except) + { + re_detail::raise_error(traits_inst, err); + } +#endif + } + else + _flags &= ~regex_constants::failbit; +} + + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + + +#endif // BOOST_REGEX_COMPILE_HPP + + + + + + + + + diff --git a/include/boost/regex/v4/regex_cstring.hpp b/include/boost/regex/v4/regex_cstring.hpp new file mode 100644 index 00000000..99495024 --- /dev/null +++ b/include/boost/regex/v4/regex_cstring.hpp @@ -0,0 +1,134 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_cstring.hpp + * VERSION see + * DESCRIPTION: This is an internal header file, do not include directly. + * String support and helper functions, for regular + * expression library. + */ + +#ifndef BOOST_REGEX_CSTRING_HPP +#define BOOST_REGEX_CSTRING_HPP + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +#include + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +// +// start by defining some template function aliases for C API functions: +// + +template +std::size_t BOOST_REGEX_CALL re_strlen(const charT *s) +{ + std::size_t len = 0; + while(*s) + { + ++s; + ++len; + } + return len; +} + +inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s) +{ + return std::strlen(s); +} + +#ifndef BOOST_NO_WREGEX + +inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s) +{ + return std::wcslen(s); +} + +#endif + +#ifndef BOOST_NO_WREGEX +BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::basic_string& out, const std::basic_string& in); +#endif +BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in); + +template +void BOOST_REGEX_CALL re_trunc_primary(std::basic_string& s) +{ + for(unsigned int i = 0; i < s.size(); ++i) + { + if(s[i] <= 1) + { + s.erase(i); + break; + } + } +} + +inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2) +{ + #if defined(__BORLANDC__) && defined(strcpy) + return ::strcpy(s1, s2); + #else + return std::strcpy(s1, s2); + #endif +} + +#ifndef BOOST_NO_WREGEX + +inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2) +{ + return std::wcscpy(s1, s2); +} + +#endif + + +template +charT* BOOST_REGEX_CALL re_strdup(const charT* p) +{ + charT* buf = new charT[re_strlen(p) + 1]; + re_strcpy(buf, p); + return buf; +} + +template +inline void BOOST_REGEX_CALL re_strfree(charT* p) +{ + delete[] p; +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace re_detail +} // namespace boost + +#endif // BOOST_REGEX_CSTRING_HPP + + + + + diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp new file mode 100644 index 00000000..e0331c26 --- /dev/null +++ b/include/boost/regex/v4/regex_format.hpp @@ -0,0 +1,534 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_format.hpp + * VERSION see + * DESCRIPTION: Provides formatting output routines for search and replace + * operations. Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_FORMAT_HPP +#define BOOST_REGEX_FORMAT_HPP + + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8037 +#endif + +// +// Forward declaration: +// +template +class match_results; + +namespace re_detail{ + +template +O BOOST_REGEX_CALL re_copy_out(O out, I first, I last) +{ + while(first != last) + { + *out = *first; + ++out; + ++first; + } + return out; +} + +template +void BOOST_REGEX_CALL re_skip_format(const charT*& fmt, const traits_type& traits_inst) +{ + // dwa 9/13/00 - suppress incorrect unused parameter warning for MSVC + (void)traits_inst; + + typedef typename traits_type::size_type traits_size_type; + typedef typename traits_type::uchar_type traits_uchar_type; + typedef typename traits_type::string_type traits_string_type; + + unsigned int parens = 0; + unsigned int c; + while(*fmt) + { + c = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)); + if((c == traits_type::syntax_colon) && (parens == 0)) + { + ++fmt; + return; + } + else if(c == traits_type::syntax_close_bracket) + { + if(parens == 0) + { + ++fmt; + return; + } + --parens; + } + else if(c == traits_type::syntax_open_bracket) + ++parens; + else if(c == traits_type::syntax_slash) + { + ++fmt; + if(*fmt == 0) + return; + } + ++fmt; + } +} + +#ifdef BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN + +// +// ugly hack for buggy output iterators + +template +inline void oi_assign(T* p, T v) +{ + ::boost::re_detail::pointer_destroy(p); + pointer_construct(p, v); +} + +#else + +template +inline void oi_assign(T* p, T v) +{ + // + // if you get a compile time error in here then you either + // need to rewrite your output iterator to make it assignable + // (as is required by the standard), or define + // BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN to use the ugly hack above + *p = v; +} + +#endif + + +#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE) +// +// Ugly ugly hack, +// template don't merge if they contain switch statements so declare these +// templates in unnamed namespace (ie with internal linkage), each translation +// unit then gets its own local copy, it works seemlessly but bloats the app. +namespace{ +#endif + +// +// algorithm reg_format: +// takes the result of a match and a format string +// and merges them to produce a new string which +// is sent to an OutputIterator, +// _reg_format_aux does the actual work: +// +template +OutputIterator BOOST_REGEX_CALL _reg_format_aux(OutputIterator out, + const match_results& m, + const charT*& fmt, + match_flag_type flags, const traits_type& traits_inst) +{ + const charT* fmt_end = fmt; + while(*fmt_end) ++ fmt_end; + + typedef typename traits_type::size_type traits_size_type; + typedef typename traits_type::uchar_type traits_uchar_type; + typedef typename traits_type::string_type traits_string_type; + + while(*fmt) + { + switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt))) + { + case traits_type::syntax_dollar: + if(flags & format_sed) + { + // no perl style replacement, + // $ is an ordinary character: + goto default_opt; + } + ++fmt; + if(*fmt == 0) // oops trailing $ + { + --fmt; + *out = *fmt; + ++out; + return out; + } + switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt))) + { + case traits_type::syntax_start_buffer: + oi_assign(&out, re_copy_out(out, Iterator(m[-1].first), Iterator(m[-1].second))); + ++fmt; + continue; + case traits_type::syntax_end_buffer: + oi_assign(&out, re_copy_out(out, Iterator(m[-2].first), Iterator(m[-2].second))); + ++fmt; + continue; + case traits_type::syntax_digit: + { +expand_sub: + unsigned int index = traits_inst.toi(fmt, fmt_end, 10); + if(index < m.size()) + oi_assign(&out, re_copy_out(out, Iterator(m[index].first), Iterator(m[index].second))); + continue; + } + } + // anything else: + if(*fmt == '&') + { + oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second))); + ++fmt; + } + else + { + // probably an error, treat as a literal '$' + --fmt; + *out = *fmt; + ++out; + ++fmt; + } + continue; + case traits_type::syntax_slash: + { + // escape sequence: + ++fmt; + charT c(*fmt); + if(*fmt == 0) + { + --fmt; + *out = *fmt; + ++out; + ++fmt; + return out; + } + switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt))) + { + case traits_type::syntax_a: + c = '\a'; + ++fmt; + break; + case traits_type::syntax_f: + c = '\f'; + ++fmt; + break; + case traits_type::syntax_n: + c = '\n'; + ++fmt; + break; + case traits_type::syntax_r: + c = '\r'; + ++fmt; + break; + case traits_type::syntax_t: + c = '\t'; + ++fmt; + break; + case traits_type::syntax_v: + c = '\v'; + ++fmt; + break; + case traits_type::syntax_x: + ++fmt; + if(fmt == fmt_end) + { + *out = *--fmt; + ++out; + return out; + } + // maybe have \x{ddd} + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) == traits_type::syntax_open_brace) + { + ++fmt; + if(fmt == fmt_end) + { + fmt -= 2; + *out = *fmt; + ++out; + ++fmt; + continue; + } + if(traits_inst.is_class(*fmt, traits_type::char_class_xdigit) == false) + { + fmt -= 2; + *out = *fmt; + ++out; + ++fmt; + continue; + } + c = (charT)traits_inst.toi(fmt, fmt_end, -16); + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) != traits_type::syntax_close_brace) + { + while(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) != traits_type::syntax_slash) + --fmt; + ++fmt; + *out = *fmt; + ++out; + ++fmt; + continue; + } + ++fmt; + break; + } + else + { + if(traits_inst.is_class(*fmt, traits_type::char_class_xdigit) == false) + { + --fmt; + *out = *fmt; + ++out; + ++fmt; + continue; + } + c = (charT)traits_inst.toi(fmt, fmt_end, -16); + } + break; + case traits_type::syntax_c: + ++fmt; + if(fmt == fmt_end) + { + --fmt; + *out = *fmt; + ++out; + return out; + } + if(((typename traits_type::uchar_type)(*fmt) < (typename traits_type::uchar_type)'@') + || ((typename traits_type::uchar_type)(*fmt) > (typename traits_type::uchar_type)127) ) + { + --fmt; + *out = *fmt; + ++out; + ++fmt; + break; + } + c = (charT)((typename traits_type::uchar_type)(*fmt) - (typename traits_type::uchar_type)'@'); + ++fmt; + break; + case traits_type::syntax_e: + c = (charT)27; + ++fmt; + break; + case traits_type::syntax_digit: + if(flags & format_sed) + goto expand_sub; + else + c = (charT)traits_inst.toi(fmt, fmt_end, -8); + break; + default: + //c = *fmt; + ++fmt; + } + *out = c; + ++out; + continue; + } + case traits_type::syntax_open_bracket: + if(0 == (flags & format_all)) + { + *out = *fmt; + ++out; + ++fmt; + continue; + } + else + { + ++fmt; // recurse + oi_assign(&out, _reg_format_aux(out, m, fmt, flags, traits_inst)); + continue; + } + case traits_type::syntax_close_bracket: + if(0 == (flags & format_all)) + { + *out = *fmt; + ++out; + ++fmt; + continue; + } + else + { + ++fmt; // return from recursion + return out; + } + case traits_type::syntax_colon: + if(flags & regex_constants::format_is_if) + { + ++fmt; + return out; + } + *out = *fmt; + ++out; + ++fmt; + continue; + case traits_type::syntax_question: + { + if(0 == (flags & format_all)) + { + *out = *fmt; + ++out; + ++fmt; + continue; + } + else + { + ++fmt; + if(*fmt == 0) + { + --fmt; + *out = *fmt; + ++out; + ++fmt; + return out; + } + unsigned int id = traits_inst.toi(fmt, fmt_end, 10); + if(m[id].matched) + { + oi_assign(&out, _reg_format_aux(out, m, fmt, flags | regex_constants::format_is_if, traits_inst)); + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon) + re_skip_format(fmt, traits_inst); + } + else + { + re_skip_format(fmt, traits_inst); + if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon) + oi_assign(&out, _reg_format_aux(out, m, fmt, flags | regex_constants::format_is_if, traits_inst)); + } + return out; + } + } + default: +default_opt: + if((flags & format_sed) && (*fmt == '&')) + { + oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second))); + ++fmt; + continue; + } + *out = *fmt; + ++out; + ++fmt; + } + } + + return out; +} + +#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE) +} // namespace +#endif + +template +class string_out_iterator +{ + S* out; +public: + string_out_iterator(S& s) : out(&s) {} + string_out_iterator& operator++() { return *this; } + string_out_iterator& operator++(int) { return *this; } + string_out_iterator& operator*() { return *this; } + string_out_iterator& operator=(typename S::value_type v) + { + out->append(1, v); + return *this; + } +}; + +template +class merge_out_predicate +{ + OutputIterator* out; + Iterator* last; + const charT* fmt; + match_flag_type flags; + const traits_type* pt; + // rebind allocator to correct type: + typedef typename detail::rebind_allocator, Allocator>::type alloc_type; + +public: + merge_out_predicate(OutputIterator& o, Iterator& pi, const charT* f, match_flag_type format_flags, const traits_type& p) + : out(&o), last(&pi), fmt(f), flags(format_flags), pt(&p){} + + ~merge_out_predicate() {} + bool BOOST_REGEX_CALL operator()(const boost::match_results& m) + { + const charT* f = fmt; + if(0 == (flags & format_no_copy)) + oi_assign(out, re_copy_out(*out, Iterator(m[-1].first), Iterator(m[-1].second))); + oi_assign(out, _reg_format_aux(*out, m, f, flags, *pt)); + *last = m[-2].first; + return flags & format_first_only ? false : true; + } +}; + +} // namespace re_detail + +template +OutputIterator regex_format(OutputIterator out, + const match_results& m, + const charT* fmt, + match_flag_type flags = format_all + ) +{ + regex_traits t; + return re_detail::_reg_format_aux(out, m, fmt, flags, t); +} + +template +OutputIterator regex_format(OutputIterator out, + const match_results& m, + const std::basic_string& fmt, + match_flag_type flags = format_all + ) +{ + regex_traits t; + const charT* start = fmt.c_str(); + return re_detail::_reg_format_aux(out, m, start, flags, t); +} + +template +std::basic_string regex_format(const match_results& m, + const charT* fmt, + match_flag_type flags = format_all) +{ + std::basic_string result; + re_detail::string_out_iterator > i(result); + regex_format(i, m, fmt, flags); + return result; +} + +template +std::basic_string regex_format(const match_results& m, + const std::basic_string& fmt, + match_flag_type flags = format_all) +{ + std::basic_string result; + re_detail::string_out_iterator > i(result); + regex_format(i, m, fmt.c_str(), flags); + return result; +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // BOOST_REGEX_FORMAT_HPP + + + + + diff --git a/include/boost/regex/v4/regex_fwd.hpp b/include/boost/regex/v4/regex_fwd.hpp new file mode 100644 index 00000000..02c16571 --- /dev/null +++ b/include/boost/regex/v4/regex_fwd.hpp @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_fwd.cpp + * VERSION see + * DESCRIPTION: Forward declares boost::reg_expression<> and + * associated typedefs. + */ + +#ifndef BOOST_REGEX_FWD_HPP_INCLUDED +#define BOOST_REGEX_FWD_HPP_INCLUDED + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif +#include + +// +// define BOOST_REGEX_NO_FWD if this +// header doesn't work! +// +#ifdef BOOST_REGEX_NO_FWD +# ifndef BOOST_RE_REGEX_HPP +# include +# endif +#else + +// +// If there isn't good enough wide character support then there will +// be no wide character regular expressions: +// +#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX) +# define BOOST_NO_WREGEX +#endif + +namespace boost{ + +template +class regex_traits; + +template , class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +class reg_expression; +template , class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +class basic_regex; + +typedef basic_regex, BOOST_DEFAULT_ALLOCATOR(char) > regex; +#ifndef BOOST_NO_WREGEX +typedef basic_regex, BOOST_DEFAULT_ALLOCATOR(wchar_t) > wregex; +#endif + +} // namespace boost + +#endif // BOOST_REGEX_NO_FWD + +#endif + + + diff --git a/include/boost/regex/v4/regex_grep.hpp b/include/boost/regex/v4/regex_grep.hpp new file mode 100644 index 00000000..a1b382dc --- /dev/null +++ b/include/boost/regex/v4/regex_grep.hpp @@ -0,0 +1,147 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_grep.hpp + * VERSION see + * DESCRIPTION: Provides regex_grep implementation. + */ + +#ifndef BOOST_REGEX_V4_REGEX_GREP_HPP +#define BOOST_REGEX_V4_REGEX_GREP_HPP + + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8037 +#endif + + +// +// regex_grep: +// find all non-overlapping matches within the sequence first last: +// +template +inline unsigned int regex_grep(Predicate foo, + BidiIterator first, + BidiIterator last, + const reg_expression& e, + match_flag_type flags = match_default) +{ + if(e.flags() & regex_constants::failbit) + return false; + typedef detail::rebind_allocator, Allocator> binder; + typedef typename binder::type match_allocator_type; + //typedef Allocator match_allocator_type; + + match_results m; + re_detail::perl_matcher matcher(first, last, m, e, flags); + unsigned int count = 0; + while(matcher.find()) + { + ++count; + if(0 == foo(m)) + return count; // caller doesn't want to go on + if(m[0].second == last) + return count; // we've reached the end, don't try and find an extra null match. + if(m.length() == 0) + { + // we found a NULL-match, now try to find + // a non-NULL one at the same position: + BidiIterator last_end(m[0].second); + if(last_end == last) + return count; + matcher.setf(match_not_null | match_continuous); + if(matcher.find()) + { + ++count; + last_end = m[0].second; + if(0 == foo(m)) + return count; + } + else + { + // reset match back to where it was: + m.set_second(last_end); + } + matcher.unsetf((match_not_null | match_continuous) & ~flags); + } + } + return count; +} + +// +// regex_grep convenience interfaces: +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +// +// this isn't really a partial specialisation, but template function +// overloading - if the compiler doesn't support partial specialisation +// then it really won't support this either: +template +inline unsigned int regex_grep(Predicate foo, const charT* str, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_grep(foo, str, str + traits::length(str), e, flags); +} + +template +inline unsigned int regex_grep(Predicate foo, const std::basic_string& s, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_grep(foo, s.begin(), s.end(), e, flags); +} +#else // partial specialisation +inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str, + const regex& e, + match_flag_type flags = match_default) +{ + return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags); +} +#ifndef BOOST_NO_WREGEX +inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str, + const wregex& e, + match_flag_type flags = match_default) +{ + return regex_grep(foo, str, str + wregex::traits_type::length(str), e, flags); +} +#endif +inline unsigned int regex_grep(bool (*foo)(const match_results&), const std::string& s, + const regex& e, + match_flag_type flags = match_default) +{ + return regex_grep(foo, s.begin(), s.end(), e, flags); +} +#if !defined(BOOST_NO_WREGEX) +inline unsigned int regex_grep(bool (*foo)(const match_results::const_iterator>&), + const std::basic_string& s, + const wregex& e, + match_flag_type flags = match_default) +{ + return regex_grep(foo, s.begin(), s.end(), e, flags); +} +#endif +#endif + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // BOOST_REGEX_V4_REGEX_GREP_HPP diff --git a/include/boost/regex/v4/regex_iterator.hpp b/include/boost/regex/v4/regex_iterator.hpp new file mode 100644 index 00000000..b19fb909 --- /dev/null +++ b/include/boost/regex/v4/regex_iterator.hpp @@ -0,0 +1,154 @@ +/* + * + * Copyright (c) 2003 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_iterator.hpp + * VERSION see + * DESCRIPTION: Provides regex_iterator implementation. + */ + +#ifndef BOOST_REGEX_V4_REGEX_ITERATOR_HPP +#define BOOST_REGEX_V4_REGEX_ITERATOR_HPP + +#include + +namespace boost{ + +template +class regex_iterator_implementation +{ + typedef basic_regex regex_type; + + match_results what; // current match + BidirectionalIterator base; // start of sequence + BidirectionalIterator end; // end of sequence + const regex_type* pre; // the expression + match_flag_type flags; // flags for matching + +public: + regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f) + : base(), end(last), pre(p), flags(f){} + bool init(BidirectionalIterator first) + { + base = first; + return regex_search(first, end, what, *pre, flags); + } + bool compare(const regex_iterator_implementation& that) + { + if(this == &that) return true; + return (pre == that.pre) && (end == that.end) && (flags == that.flags) && (what[0].first == that.what[0].first) && (what[0].second == that.what[0].second); + } + const match_results& get() + { return what; } + bool next() + { + if(what.prefix().first != what[0].second) + flags |= match_prev_avail; + BidirectionalIterator next_start = what[0].second; + match_flag_type f(flags); + if(!what.length()) + f |= regex_constants::match_not_initial_null; + bool result = regex_search(next_start, end, what, *pre, f); + if(result) + what.set_base(base); + return result; + } +}; + +template ::value_type, + class traits = regex_traits, + class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +class regex_iterator +{ +private: + typedef regex_iterator_implementation impl; + typedef shared_ptr pimpl; +public: + typedef basic_regex regex_type; + typedef match_results value_type; + typedef typename re_detail::regex_iterator_traits::difference_type + difference_type; + typedef const value_type* pointer; + typedef const value_type& reference; + typedef std::forward_iterator_tag iterator_category; + + regex_iterator(){} + regex_iterator(BidirectionalIterator a, BidirectionalIterator b, + const regex_type& re, + match_flag_type m = match_default) + : pdata(new impl(&re, b, m)) + { + if(!pdata->init(a)) + { + pdata.reset(); + } + } + regex_iterator(const regex_iterator& that) + : pdata(that.pdata) {} + regex_iterator& operator=(const regex_iterator& that) + { + pdata = that.pdata; + return *this; + } + bool operator==(const regex_iterator& that) + { + if((pdata.get() == 0) || (that.pdata.get() == 0)) + return pdata.get() == that.pdata.get(); + return pdata->compare(*(that.pdata.get())); + } + bool operator!=(const regex_iterator& that) + { return !(*this == that); } + const value_type& operator*() + { return pdata->get(); } + const value_type* operator->() + { return &(pdata->get()); } + regex_iterator& operator++() + { + cow(); + if(0 == pdata->next()) + { + pdata.reset(); + } + return *this; + } + regex_iterator operator++(int) + { + regex_iterator result(*this); + ++(*this); + return result; + } +private: + + pimpl pdata; + + void cow() + { + // copy-on-write + if(pdata.get() && !pdata.unique()) + { + pdata.reset(new impl(*(pdata.get()))); + } + } +}; + + +} // namespace boost + +#endif // BOOST_REGEX_V4_REGEX_ITERATOR_HPP diff --git a/include/boost/regex/v4/regex_kmp.hpp b/include/boost/regex/v4/regex_kmp.hpp new file mode 100644 index 00000000..3a5e7080 --- /dev/null +++ b/include/boost/regex/v4/regex_kmp.hpp @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_kmp.hpp + * VERSION see + * DESCRIPTION: Provides Knuth Morris Pratt search operations. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_KMP_HPP +#define BOOST_REGEX_KMP_HPP + +#ifdef BOOST_REGEX_CONFIG_HPP +#include +#endif + + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +template +struct kmp_info +{ + unsigned int size; + unsigned int len; + const charT* pstr; + int kmp_next[1]; +}; + +template +void kmp_free(kmp_info* pinfo, const Allocator& a) +{ + typedef typename boost::detail::rebind_allocator::type atype; + atype(a).deallocate(reinterpret_cast(pinfo), pinfo->size); +} + +template +kmp_info* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a) +{ + typedef typename boost::detail::rebind_allocator::type atype; + int i, j, m; + i = 0; + m = static_cast(boost::re_detail::distance(first, last)); + ++m; + unsigned int size = sizeof(kmp_info) + sizeof(int)*m + sizeof(charT)*m; + --m; + // + // allocate struct and fill it in: + // + kmp_info* pinfo = reinterpret_cast*>(atype(a).allocate(size)); + BOOST_REGEX_NOEH_ASSERT(pinfo) + pinfo->size = size; + pinfo->len = m; + charT* p = reinterpret_cast(reinterpret_cast(pinfo) + sizeof(kmp_info) + sizeof(int)*(m+1)); + pinfo->pstr = p; + while(first != last) + { + *p = translate(*first); + ++first; + ++p; + } + *p = 0; + // + // finally do regular kmp compile: + // + j = pinfo->kmp_next[0] = -1; + while (i < m) + { + while ((j > -1) && (pinfo->pstr[i] != pinfo->pstr[j])) + j = pinfo->kmp_next[j]; + ++i; + ++j; + if (pinfo->pstr[i] == pinfo->pstr[j]) + pinfo->kmp_next[i] = pinfo->kmp_next[j]; + else + pinfo->kmp_next[i] = j; + } + + return pinfo; +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + + } // namepsace re_detail +} // namespace boost + +#endif // BOOST_REGEX_KMP_HPP + + + diff --git a/include/boost/regex/v4/regex_match.hpp b/include/boost/regex/v4/regex_match.hpp new file mode 100644 index 00000000..4c4eef89 --- /dev/null +++ b/include/boost/regex/v4/regex_match.hpp @@ -0,0 +1,195 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_match.hpp + * VERSION see + * DESCRIPTION: Regular expression matching algorithms. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + + +#ifndef BOOST_REGEX_MATCH_HPP +#define BOOST_REGEX_MATCH_HPP + +#ifndef BOOST_REGEX_MAX_STATE_COUNT +# define BOOST_REGEX_MAX_STATE_COUNT 100000000 +#endif + +#include +#include + + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8026 -w-8027 +#endif + +// +// proc regex_match +// returns true if the specified regular expression matches +// the whole of the input. Fills in what matched in m. +// +template +bool regex_match(BidiIterator first, BidiIterator last, + match_results& m, + const reg_expression& e, + match_flag_type flags = match_default) +{ + re_detail::perl_matcher matcher(first, last, m, e, flags); + return matcher.match(); +} +template +bool regex_match(iterator first, iterator last, + const reg_expression& e, + match_flag_type flags = match_default) +{ + match_results m; + return regex_match(first, last, m, e, flags); +} +// +// query_match convenience interfaces: +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +// +// this isn't really a partial specialisation, but template function +// overloading - if the compiler doesn't support partial specialisation +// then it really won't support this either: +template +inline bool regex_match(const charT* str, + match_results& m, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_match(str, str + traits::length(str), m, e, flags); +} + +template +inline bool regex_match(const std::basic_string& s, + match_results::const_iterator, Allocator>& m, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_match(s.begin(), s.end(), m, e, flags); +} +template +inline bool regex_match(const charT* str, + const reg_expression& e, + match_flag_type flags = match_default) +{ + match_results m; + return regex_match(str, str + traits::length(str), m, e, flags); +} + +template +inline bool regex_match(const std::basic_string& s, + const reg_expression& e, + match_flag_type flags = match_default) +{ + typedef typename std::basic_string::const_iterator iterator; + match_results m; + return regex_match(s.begin(), s.end(), m, e, flags); +} +#else // partial ordering +inline bool regex_match(const char* str, + cmatch& m, + const regex& e, + match_flag_type flags = match_default) +{ + return regex_match(str, str + regex::traits_type::length(str), m, e, flags); +} +inline bool regex_match(const char* str, + const regex& e, + match_flag_type flags = match_default) +{ + match_results m; + return regex_match(str, str + regex::traits_type::length(str), m, e, flags); +} +#ifndef BOOST_NO_WREGEX +inline bool regex_match(const wchar_t* str, + wcmatch& m, + const wregex& e, + match_flag_type flags = match_default) +{ + return regex_match(str, str + wregex::traits_type::length(str), m, e, flags); +} +inline bool regex_match(const wchar_t* str, + const wregex& e, + match_flag_type flags = match_default) +{ + match_results m; + return regex_match(str, str + wregex::traits_type::length(str), m, e, flags); +} +#endif +inline bool regex_match(const std::string& s, + smatch& m, + const regex& e, + match_flag_type flags = match_default) +{ + return regex_match(s.begin(), s.end(), m, e, flags); +} +inline bool regex_match(const std::string& s, + const regex& e, + match_flag_type flags = match_default) +{ + match_results m; + return regex_match(s.begin(), s.end(), m, e, flags); +} +#if !defined(BOOST_NO_WREGEX) +inline bool regex_match(const std::basic_string& s, + match_results::const_iterator, wregex::allocator_type>& m, + const wregex& e, + match_flag_type flags = match_default) +{ + return regex_match(s.begin(), s.end(), m, e, flags); +} +inline bool regex_match(const std::basic_string& s, + const wregex& e, + match_flag_type flags = match_default) +{ + match_results::const_iterator, wregex::allocator_type> m; + return regex_match(s.begin(), s.end(), m, e, flags); +} +#endif + +#endif + + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // BOOST_REGEX_MATCH_HPP + + + + + + + + + + + + + + + + + diff --git a/include/boost/regex/v4/regex_merge.hpp b/include/boost/regex/v4/regex_merge.hpp new file mode 100644 index 00000000..f2286533 --- /dev/null +++ b/include/boost/regex/v4/regex_merge.hpp @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_format.hpp + * VERSION see + * DESCRIPTION: Provides formatting output routines for search and replace + * operations. Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_V4_REGEX_MERGE_HPP +#define BOOST_REGEX_V4_REGEX_MERGE_HPP + + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8037 +#endif + +template +inline OutputIterator regex_merge(OutputIterator out, + Iterator first, + Iterator last, + const reg_expression& e, + const charT* fmt, + match_flag_type flags = match_default) +{ + return regex_replace(out, first, last, e, fmt, flags); +} + +template +inline OutputIterator regex_merge(OutputIterator out, + Iterator first, + Iterator last, + const reg_expression& e, + const std::basic_string& fmt, + match_flag_type flags = match_default) +{ + return regex_merge(out, first, last, e, fmt.c_str(), flags); +} + +template +inline std::basic_string regex_merge(const std::basic_string& s, + const reg_expression& e, + const charT* fmt, + match_flag_type flags = match_default) +{ + return regex_replace(s, e, fmt, flags); +} + +template +inline std::basic_string regex_merge(const std::basic_string& s, + const reg_expression& e, + const std::basic_string& fmt, + match_flag_type flags = match_default) +{ + return regex_replace(s, e, fmt, flags); +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // BOOST_REGEX_V4_REGEX_MERGE_HPP + diff --git a/include/boost/regex/v4/regex_raw_buffer.hpp b/include/boost/regex/v4/regex_raw_buffer.hpp new file mode 100644 index 00000000..79ae72be --- /dev/null +++ b/include/boost/regex/v4/regex_raw_buffer.hpp @@ -0,0 +1,256 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_raw_buffer.hpp + * VERSION see + * DESCRIPTION: Raw character buffer for regex code. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_RAW_BUFFER_HPP +#define BOOST_REGEX_RAW_BUFFER_HPP + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +struct empty_padding{}; + +union padding +{ + void* p; + unsigned int i; +}; + +template +struct padding3 +{ + enum{ + padding_size = 8, + padding_mask = 7 + }; +}; + +template<> +struct padding3<2> +{ + enum{ + padding_size = 2, + padding_mask = 1 + }; +}; + +template<> +struct padding3<4> +{ + enum{ + padding_size = 4, + padding_mask = 3 + }; +}; + +template<> +struct padding3<8> +{ + enum{ + padding_size = 8, + padding_mask = 7 + }; +}; + +template<> +struct padding3<16> +{ + enum{ + padding_size = 16, + padding_mask = 15 + }; +}; + +enum{ + padding_size = padding3::padding_size, + padding_mask = padding3::padding_mask +}; + +// +// class raw_storage +// basically this is a simplified vector +// this is used by reg_expression for expression storage +// + +template +class raw_storage +{ +public: + typedef Allocator allocator_type; + typedef typename boost::detail::rebind_allocator::type alloc_inst_type; + typedef typename alloc_inst_type::size_type size_type; + typedef typename alloc_inst_type::pointer pointer; +private: + // + // empty member optimisation: + struct alloc_data : public alloc_inst_type + { + typename alloc_inst_type::pointer last; + alloc_data(const Allocator& a) : alloc_inst_type(a){} + } alloc_inst; + pointer start, end; +public: + + raw_storage(const Allocator& a = Allocator()); + raw_storage(size_type n, const Allocator& a = Allocator()); + + ~raw_storage() + { + alloc_inst.deallocate(start, (alloc_inst.last - start)); + } + + void BOOST_REGEX_CALL resize(size_type n); + + void* BOOST_REGEX_CALL extend(size_type n) + { + if(size_type(alloc_inst.last - end) < n) + resize(n + (end - start)); + register void* result = end; + end += n; + return result; + } + + void* BOOST_REGEX_CALL insert(size_type pos, size_type n); + + size_type BOOST_REGEX_CALL size() + { + return end - start; + } + + size_type BOOST_REGEX_CALL capacity() + { + return alloc_inst.last - start; + } + + void* BOOST_REGEX_CALL data()const + { + return start; + } + + size_type BOOST_REGEX_CALL index(void* ptr) + { + return reinterpret_cast(ptr) - reinterpret_cast(data()); + } + + void BOOST_REGEX_CALL clear() + { + end = start; + } + + void BOOST_REGEX_CALL align() + { + // move end up to a boundary: + end = reinterpret_cast(start) + (((reinterpret_cast(end) - reinterpret_cast(start)) + padding_mask) & ~padding_mask); + } + + Allocator BOOST_REGEX_CALL allocator()const; + void swap(raw_storage& that) + { + std::swap(start, that.start); + std::swap(end, that.end); + std::swap(alloc_inst.last, that.alloc_inst.last); + std::swap(static_cast(alloc_inst), static_cast(that.alloc_inst)); + } +}; + +template +raw_storage::raw_storage(const Allocator& a) + : alloc_inst(a) +{ + start = end = alloc_inst.allocate(1024); + BOOST_REGEX_NOEH_ASSERT(start) + alloc_inst.last = start + 1024; +} + +template +raw_storage::raw_storage(size_type n, const Allocator& a) + : alloc_inst(a) +{ + start = end = alloc_inst.allocate(n); + BOOST_REGEX_NOEH_ASSERT(start) + alloc_inst.last = start + n; +} + +template +Allocator BOOST_REGEX_CALL raw_storage::allocator()const +{ + return alloc_inst; +} + +template +void BOOST_REGEX_CALL raw_storage::resize(size_type n) +{ + register size_type newsize = (alloc_inst.last - start) * 2; + register size_type datasize = end - start; + if(newsize < n) + newsize = n; + // extend newsize to WORD/DWORD boundary: + newsize = (newsize + padding_mask) & ~(padding_mask); + + // allocate and copy data: + register unsigned char* ptr = alloc_inst.allocate(newsize); + BOOST_REGEX_NOEH_ASSERT(ptr) + std::memcpy(ptr, start, datasize); + + // get rid of old buffer: + alloc_inst.deallocate(start, (alloc_inst.last - start)); + + // and set up pointers: + start = ptr; + end = ptr + datasize; + alloc_inst.last = ptr + newsize; +} + +template +void* BOOST_REGEX_CALL raw_storage::insert(size_type pos, size_type n) +{ + jm_assert(pos <= size_type(end - start)); + if(size_type(alloc_inst.last - end) < n) + resize(n + (end - start)); + register void* result = start + pos; + std::memmove(start + pos + n, start + pos, (end - start) - pos); + end += n; + return result; +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace re_detail +} // namespace boost + +#endif + + + + + diff --git a/include/boost/regex/v4/regex_replace.hpp b/include/boost/regex/v4/regex_replace.hpp new file mode 100644 index 00000000..37383da2 --- /dev/null +++ b/include/boost/regex/v4/regex_replace.hpp @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_format.hpp + * VERSION see + * DESCRIPTION: Provides formatting output routines for search and replace + * operations. Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_V4_REGEX_REPLACE_HPP +#define BOOST_REGEX_V4_REGEX_REPLACE_HPP + + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8037 +#endif + +template +OutputIterator regex_replace(OutputIterator out, + Iterator first, + Iterator last, + const reg_expression& e, + const charT* fmt, + match_flag_type flags = match_default) +{ + Iterator l = first; + re_detail::merge_out_predicate oi(out, l, fmt, flags, e.get_traits()); + regex_grep(oi, first, last, e, flags); + return (flags & format_no_copy) ? out : re_detail::re_copy_out(out, l, last); +} + +template +inline OutputIterator regex_replace(OutputIterator out, + Iterator first, + Iterator last, + const reg_expression& e, + const std::basic_string& fmt, + match_flag_type flags = match_default) +{ + return regex_replace(out, first, last, e, fmt.c_str(), flags); +} + +template +std::basic_string regex_replace(const std::basic_string& s, + const reg_expression& e, + const charT* fmt, + match_flag_type flags = match_default) +{ + std::basic_string result; + re_detail::string_out_iterator > i(result); + regex_replace(i, s.begin(), s.end(), e, fmt, flags); + return result; +} + +template +std::basic_string regex_replace(const std::basic_string& s, + const reg_expression& e, + const std::basic_string& fmt, + match_flag_type flags = match_default) +{ + std::basic_string result; + re_detail::string_out_iterator > i(result); + regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags); + return result; +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // BOOST_REGEX_V4_REGEX_REPLACE_HPP + diff --git a/include/boost/regex/v4/regex_search.hpp b/include/boost/regex/v4/regex_search.hpp new file mode 100644 index 00000000..15100804 --- /dev/null +++ b/include/boost/regex/v4/regex_search.hpp @@ -0,0 +1,196 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_search.hpp + * VERSION see + * DESCRIPTION: Provides regex_search implementation. + */ + +#ifndef BOOST_REGEX_V4_REGEX_SEARCH_HPP +#define BOOST_REGEX_V4_REGEX_SEARCH_HPP + + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc -w-8037 +#endif + +template +bool regex_search(BidiIterator first, BidiIterator last, + match_results& m, + const reg_expression& e, + match_flag_type flags = match_default) +{ + if(e.flags() & regex_constants::failbit) + return false; + + re_detail::perl_matcher matcher(first, last, m, e, flags); + return matcher.find(); +} + +// +// regex_search convenience interfaces: +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +// +// this isn't really a partial specialisation, but template function +// overloading - if the compiler doesn't support partial specialisation +// then it really won't support this either: +template +inline bool regex_search(const charT* str, + match_results& m, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_search(str, str + traits::length(str), m, e, flags); +} + +template +inline bool regex_search(const std::basic_string& s, + match_results::const_iterator, Allocator>& m, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_search(s.begin(), s.end(), m, e, flags); +} +#else // partial specialisation +inline bool regex_search(const char* str, + cmatch& m, + const regex& e, + match_flag_type flags = match_default) +{ + return regex_search(str, str + regex::traits_type::length(str), m, e, flags); +} +#ifndef BOOST_NO_WREGEX +inline bool regex_search(const wchar_t* str, + wcmatch& m, + const wregex& e, + match_flag_type flags = match_default) +{ + return regex_search(str, str + wregex::traits_type::length(str), m, e, flags); +} +#endif +inline bool regex_search(const std::string& s, + smatch& m, + const regex& e, + match_flag_type flags = match_default) +{ + return regex_search(s.begin(), s.end(), m, e, flags); +} +#if !defined(BOOST_NO_WREGEX) +inline bool regex_search(const std::basic_string& s, + wsmatch& m, + const wregex& e, + match_flag_type flags = match_default) +{ + return regex_search(s.begin(), s.end(), m, e, flags); +} +#endif + +#endif + +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +template +bool regex_search(BidiIterator first, BidiIterator last, + const reg_expression& e, + match_flag_type flags = match_default) +{ + if(e.flags() & regex_constants::failbit) + return false; + + match_results m; + typedef typename match_results::allocator_type match_alloc_type; + re_detail::perl_matcher matcher(first, last, m, e, flags); + return matcher.find(); +} + +template +inline bool regex_search(const charT* str, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_search(str, str + traits::length(str), e, flags); +} + +template +inline bool regex_search(const std::basic_string& s, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_search(s.begin(), s.end(), e, flags); +} +#else // non-template function overloads +inline bool regex_search(const char* first, const char* last, + const regex& e, + match_flag_type flags = match_default) +{ + cmatch m; + return regex_search(first, last, m, e, flags); +} + +#ifndef BOOST_NO_WREGEX +inline bool regex_search(const wchar_t* first, const wchar_t* last, + const wregex& e, + match_flag_type flags = match_default) +{ + wcmatch m; + return regex_search(first, last, m, e, flags); +} +#endif +inline bool regex_search(const char* str, + const regex& e, + match_flag_type flags = match_default) +{ + cmatch m; + return regex_search(str, str + regex::traits_type::length(str), m, e, flags); +} +#ifndef BOOST_NO_WREGEX +inline bool regex_search(const wchar_t* str, + const wregex& e, + match_flag_type flags = match_default) +{ + wcmatch m; + return regex_search(str, str + wregex::traits_type::length(str), m, e, flags); +} +#endif +inline bool regex_search(const std::string& s, + const regex& e, + match_flag_type flags = match_default) +{ + smatch m; + return regex_search(s.begin(), s.end(), m, e, flags); +} +#if !defined(BOOST_NO_WREGEX) +inline bool regex_search(const std::basic_string& s, + const wregex& e, + match_flag_type flags = match_default) +{ + wsmatch m; + return regex_search(s.begin(), s.end(), m, e, flags); +} +#endif + +#endif + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // BOOST_REGEX_V4_REGEX_SEARCH_HPP + diff --git a/include/boost/regex/v4/regex_split.hpp b/include/boost/regex/v4/regex_split.hpp new file mode 100644 index 00000000..3c4d5d3f --- /dev/null +++ b/include/boost/regex/v4/regex_split.hpp @@ -0,0 +1,152 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_split.hpp + * VERSION see + * DESCRIPTION: Implements regex_split and associated functions. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_SPLIT_HPP +#define BOOST_REGEX_SPLIT_HPP + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +namespace re_detail{ + +template +const reg_expression& get_default_expression(charT) +{ + static const charT expression_text[] = { '\\', 's', '+', '\00', }; + static const reg_expression e(expression_text); + return e; +} + +template +class split_pred +{ + typedef std::basic_string string_type; + typedef typename string_type::const_iterator iterator_type; + iterator_type* p_last; + OutputIterator* p_out; + std::size_t* p_max; + std::size_t initial_max; +public: + split_pred(iterator_type* a, OutputIterator* b, std::size_t* c) + : p_last(a), p_out(b), p_max(c), initial_max(*c) {} + + bool operator()(const match_results& what); +}; + +template +bool split_pred::operator() + (const match_results& what) +{ + *p_last = what[0].second; + if(what.size() > 1) + { + // output sub-expressions only: + for(unsigned i = 1; i < what.size(); ++i) + { + *(*p_out) = static_cast(what[i]); + ++(*p_out); + if(0 == --*p_max) return false; + } + return *p_max != 0; + } + else + { + // output $` only if it's not-null or not at the start of the input: + const sub_match& sub = what[-1]; + if((sub.first != sub.second) || (*p_max != initial_max)) + { + *(*p_out) = static_cast(sub); + ++(*p_out); + return --*p_max; + } + } + // + // initial null, do nothing: + return true; +} + +} // namespace re_detail + +template +std::size_t regex_split(OutputIterator out, + std::basic_string& s, + const reg_expression& e, + match_flag_type flags, + std::size_t max_split) +{ + typedef typename std::basic_string::const_iterator ci_t; + typedef typename detail::rebind_allocator, Alloc2>::type match_allocator; + ci_t last = s.begin(); + std::size_t init_size = max_split; + re_detail::split_pred pred(&last, &out, &max_split); + ci_t i, j; + i = s.begin(); + j = s.end(); + regex_grep(pred, i, j, e, flags); + // + // if there is still input left, do a final push as long as max_split + // is not exhausted, and we're not splitting sub-expressions rather + // than whitespace: + if(max_split && (last != s.end()) && (e.mark_count() == 1)) + { + *out = std::basic_string((ci_t)last, (ci_t)s.end()); + ++out; + last = s.end(); + --max_split; + } + // + // delete from the string everything that has been processed so far: + s.erase(0, last - s.begin()); + // + // return the number of new records pushed: + return init_size - max_split; +} + +template +inline std::size_t regex_split(OutputIterator out, + std::basic_string& s, + const reg_expression& e, + match_flag_type flags = match_default) +{ + return regex_split(out, s, e, flags, UINT_MAX); +} + +template +inline std::size_t regex_split(OutputIterator out, + std::basic_string& s) +{ + return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX); +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif + diff --git a/include/boost/regex/v4/regex_stack.hpp b/include/boost/regex/v4/regex_stack.hpp new file mode 100644 index 00000000..2dfda0f9 --- /dev/null +++ b/include/boost/regex/v4/regex_stack.hpp @@ -0,0 +1,227 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_stack.hpp + * VERSION see + * DESCRIPTION: Implements customised internal regex stacks. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_STACK_HPP +#define BOOST_REGEX_STACK_HPP + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif +#ifndef BOOST_REGEX_RAW_BUFFER_HPP +#include +#endif + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +// +// class jstack +// simplified stack optimised for push/peek/pop +// operations, we could use std::stack> instead... +// +template +class jstack +{ +private: + typedef typename boost::detail::rebind_allocator::type allocator_type; + typedef typename boost::detail::rebind_allocator::type T_alloc_type; + typedef typename T_alloc_type::size_type size_type; + typedef T value_type; + struct node + { + node* next; + T* start; // first item + T* end; // last item + T* last; // end of storage + }; + + // + // empty base member optimisation: + struct data : public allocator_type + { + padding buf[(sizeof(T) * 16 + sizeof(padding) - 1) / sizeof(padding)]; + data(const Allocator& a) : allocator_type(a){} + }; + + data alloc_inst; + mutable node* m_stack; + mutable node* unused; + node base; + size_type block_size; + + void BOOST_REGEX_CALL pop_aux()const; + void BOOST_REGEX_CALL push_aux(); + +public: + jstack(size_type n = 64, const Allocator& a = Allocator()); + + ~jstack(); + + node* BOOST_REGEX_CALL get_node() + { + node* new_stack = reinterpret_cast(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size)); + BOOST_REGEX_NOEH_ASSERT(new_stack) + new_stack->last = reinterpret_cast(new_stack+1); + new_stack->start = new_stack->end = new_stack->last + block_size; + new_stack->next = 0; + return new_stack; + } + + bool BOOST_REGEX_CALL empty() + { + return (m_stack->start == m_stack->end) && (m_stack->next == 0); + } + + bool BOOST_REGEX_CALL good() + { + return (m_stack->start != m_stack->end) || (m_stack->next != 0); + } + + T& BOOST_REGEX_CALL peek() + { + if(m_stack->start == m_stack->end) + pop_aux(); + return *m_stack->end; + } + + const T& BOOST_REGEX_CALL peek()const + { + if(m_stack->start == m_stack->end) + pop_aux(); + return *m_stack->end; + } + + void BOOST_REGEX_CALL pop() + { + if(m_stack->start == m_stack->end) + pop_aux(); + ::boost::re_detail::pointer_destroy(m_stack->end); + ++(m_stack->end); + } + + void BOOST_REGEX_CALL pop(T& t) + { + if(m_stack->start == m_stack->end) + pop_aux(); + t = *m_stack->end; + ::boost::re_detail::pointer_destroy(m_stack->end); + ++(m_stack->end); + } + + void BOOST_REGEX_CALL push(const T& t) + { + if(m_stack->end == m_stack->last) + push_aux(); + --(m_stack->end); + pointer_construct(m_stack->end, t); + } + +}; + +template +jstack::jstack(size_type n, const Allocator& a) + : alloc_inst(a) +{ + unused = 0; + block_size = n; + m_stack = &base; + base.last = reinterpret_cast(alloc_inst.buf); + base.end = base.start = base.last + 16; + base.next = 0; +} + +template +void BOOST_REGEX_CALL jstack::push_aux() +{ + // make sure we have spare space on TOS: + register node* new_node; + if(unused) + { + new_node = unused; + unused = new_node->next; + new_node->next = m_stack; + m_stack = new_node; + } + else + { + new_node = get_node(); + new_node->next = m_stack; + m_stack = new_node; + } +} + +template +void BOOST_REGEX_CALL jstack::pop_aux()const +{ + // make sure that we have a valid item + // on TOS: + jm_assert(m_stack->next); + register node* p = m_stack; + m_stack = p->next; + p->next = unused; + unused = p; +} + +template +jstack::~jstack() +{ + node* condemned; + while(good()) + pop(); + while(unused) + { + condemned = unused; + unused = unused->next; + alloc_inst.deallocate(reinterpret_cast(condemned), sizeof(node) + sizeof(T) * block_size); + } + while(m_stack != &base) + { + condemned = m_stack; + m_stack = m_stack->next; + alloc_inst.deallocate(reinterpret_cast(condemned), sizeof(node) + sizeof(T) * block_size); + } +} + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace re_detail +} // namespace boost + +#endif + + + + + + + + + + diff --git a/include/boost/regex/v4/regex_synch.hpp b/include/boost/regex/v4/regex_synch.hpp new file mode 100644 index 00000000..c3e4a9f3 --- /dev/null +++ b/include/boost/regex/v4/regex_synch.hpp @@ -0,0 +1,213 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_synch.hpp + * VERSION see + * DESCRIPTION: Thread synchronisation for regex code. + * Note this is an internal header file included + * by regex.hpp, do not include on its own. + */ + +#ifndef BOOST_REGEX_SYNCH_HPP +#define BOOST_REGEX_SYNCH_HPP + +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +#if defined(BOOST_HAS_THREADS) +# if defined(BOOST_HAS_WINTHREADS) +# include +# elif defined(BOOST_HAS_BETHREADS) +# include +# include +# elif defined(BOOST_HAS_PTHREADS) +# include +# else +# error "Unknown threading API" +# endif +#endif + + +namespace boost{ + namespace re_detail{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +void BOOST_REGEX_CALL re_init_threads(); +void BOOST_REGEX_CALL re_free_threads(); + +#ifdef BOOST_HAS_THREADS + +# ifdef BOOST_HAS_BETHREADS + +typedef sem_id CRITICAL_SECTION; + +inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps) +{ + *ps = create_sem(1, "regex++"); + assert(*ps > 0); +} + +inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps) +{ + int t = delete_sem(*ps); + assert(t == B_NO_ERROR); +} + +inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps) +{ + status_t t = acquire_sem(*ps); + assert(t == B_NO_ERROR); +} + +inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps) +{ + status_t t = release_sem(*ps); + assert(t == B_NO_ERROR); +} + +# elif defined(BOOST_HAS_PTHREADS) + +typedef pthread_mutex_t CRITICAL_SECTION; + +inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps) +{ + pthread_mutex_init(ps, 0); +} + +inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps) +{ + pthread_mutex_destroy(ps); +} + +inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps) +{ + pthread_mutex_lock(ps); +} + +inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps) +{ + pthread_mutex_unlock(ps); +} + +# elif !defined(BOOST_HAS_WINTHREADS) +# error "Unknown threading API" +# endif + +template +class lock_guard +{ + typedef Lock lock_type; +public: + lock_guard(lock_type& m, bool aq = true) + : mut(m), owned(false){ acquire(aq); } + + ~lock_guard() + { acquire(false); } + + void BOOST_REGEX_CALL acquire(bool aq = true) + { + if(aq && !owned) + { + mut.acquire(true); + owned = true; + } + else if(!aq && owned) + { + mut.acquire(false); + owned = false; + } + } +private: + lock_type& mut; + bool owned; + // VC6 warning suppression: + lock_guard& operator=(const lock_guard&); +}; + + +class critical_section +{ +public: + critical_section() + { InitializeCriticalSection(&hmutex);} + + critical_section(const critical_section&) + { InitializeCriticalSection(&hmutex);} + + const critical_section& BOOST_REGEX_CALL operator=(const critical_section&) + {return *this;} + + ~critical_section() + {DeleteCriticalSection(&hmutex);} + +private: + + void BOOST_REGEX_CALL acquire(bool aq) + { if(aq) EnterCriticalSection(&hmutex); + else LeaveCriticalSection(&hmutex); + } + + CRITICAL_SECTION hmutex; + +public: + typedef lock_guard ro_guard; + typedef lock_guard rw_guard; + + friend class lock_guard; +}; + +inline bool BOOST_REGEX_CALL operator==(const critical_section&, const critical_section&) +{ + return false; +} + +inline bool BOOST_REGEX_CALL operator<(const critical_section&, const critical_section&) +{ + return true; +} + +typedef lock_guard cs_guard; + +BOOST_REGEX_DECL extern critical_section* p_re_lock; +BOOST_REGEX_DECL extern unsigned int re_lock_count; + +#define BOOST_REGEX_GUARD(inst) boost::re_detail::critical_section::rw_guard g(inst); + +#else // BOOST_HAS_THREADS + +#define BOOST_REGEX_GUARD(inst) + +#endif // BOOST_HAS_THREADS + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace re_detail +} // namespace boost + +#endif // sentry + + + + + + diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp new file mode 100644 index 00000000..6552143b --- /dev/null +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -0,0 +1,215 @@ +/* + * + * Copyright (c) 2003 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_token_iterator.hpp + * VERSION see + * DESCRIPTION: Provides regex_token_iterator implementation. + */ + +#ifndef BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP +#define BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP + +#include +#include + +namespace boost{ + +template +class regex_token_iterator_implementation +{ + typedef basic_regex regex_type; + typedef std::basic_string value_type; + + match_results what; // current match + BidirectionalIterator end; // end of search area + const regex_type* pre; // the expression + match_flag_type flags; // match flags + std::basic_string result; // the current string result + std::vector::size_type N; // the current sub-expression being enumerated + std::vector subs; // the sub-expressions to enumerate + +public: + regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, int sub, match_flag_type f) + : end(last), pre(p), flags(f){ subs.push_back(sub); } + regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector& v, match_flag_type f) + : end(last), pre(p), subs(v), flags(f){} +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + template + regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[N], match_flag_type f) + : end(last), pre(p), flags(f) + { + for(std::size_t i = 0; i < N; ++i) + subs.push_back(submatches[i]); + } +#endif + + bool init(BidirectionalIterator first) + { + if(regex_search(first, end, what, *pre, flags) == true) + { + N = 0; + result = ((subs[N] == -1) ? value_type(what.prefix().str()) : value_type(what[(int)subs[N]].str())); + return true; + } + else if((N == -1) && (first != end)) + { + result = value_type(first, end); + return true; + } + return false; + } + bool compare(const regex_token_iterator_implementation& that) + { + if(this == &that) return true; + return (pre == that.pre) + && (end == that.end) + && (flags == that.flags) + && (N == that.N) + && (what[0].first == that.what[0].first) + && (what[0].second == that.what[0].second); + } + const std::basic_string& get() + { return result; } + bool next() + { + if(N == -1) + return false; + if(N+1 < subs.size()) + { + ++N; + result =((subs[N] == -1) ? value_type(what.prefix().str()) : value_type(what[subs[N]].str())); + return true; + } + if(what.prefix().first != what[0].second) + flags |= match_prev_avail; + BidirectionalIterator last_end = what[0].second; + if(regex_search(what[0].second, end, what, *pre, ((what[0].first == what[0].second) ? flags | regex_constants::match_not_initial_null : flags))) + { + N =0; + result =((subs[N] == -1) ? value_type(what.prefix().str()) : value_type(what[subs[N]].str())); + return true; + } + else if((last_end != end) && (subs[0] == -1)) + { + N =-1; + result =value_type(last_end, end); + return true; + } + return false; + } +}; + +template ::value_type, + class traits = regex_traits, + class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +class regex_token_iterator +{ +private: + typedef regex_token_iterator_implementation impl; + typedef shared_ptr pimpl; +public: + typedef basic_regex regex_type; + typedef std::basic_string value_type; + typedef typename re_detail::regex_iterator_traits::difference_type + difference_type; + typedef const value_type* pointer; + typedef const value_type& reference; + typedef std::forward_iterator_tag iterator_category; + + regex_token_iterator(){} + regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + int submatch = 0, match_flag_type m = match_default) + : pdata(new impl(&re, b, submatch, m)) + { + if(!pdata->init(a)) + pdata.reset(); + } + regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + const std::vector& submatches, match_flag_type m = match_default) + : pdata(new impl(&re, b, submatches, m)) + { + if(!pdata->init(a)) + pdata.reset(); + } +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + template + regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + const int (&submatches)[N], match_flag_type m = match_default) + : pdata(new impl(&re, b, submatches, m)) + { + if(!pdata->init(a)) + pdata.reset(); + } +#endif + regex_token_iterator(const regex_token_iterator& that) + : pdata(that.pdata) {} + regex_token_iterator& operator=(const regex_token_iterator& that) + { + pdata = that.pdata; + return *this; + } + bool operator==(const regex_token_iterator& that) + { + if((pdata.get() == 0) || (that.pdata.get() == 0)) + return pdata.get() == that.pdata.get(); + return pdata->compare(*(that.pdata.get())); + } + bool operator!=(const regex_token_iterator& that) + { return !(*this == that); } + const value_type& operator*() + { return pdata->get(); } + const value_type* operator->() + { return &(pdata->get()); } + regex_token_iterator& operator++() + { + cow(); + if(0 == pdata->next()) + { + pdata.reset(); + } + return *this; + } + regex_token_iterator operator++(int) + { + regex_token_iterator result(*this); + ++(*this); + return result; + } +private: + + pimpl pdata; + + void cow() + { + // copy-on-write + if(pdata.get() && !pdata.unique()) + { + pdata.reset(new impl(*(pdata.get()))); + } + } +}; + + +} // namespace boost + +#endif // BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP + + diff --git a/include/boost/regex/v4/regex_traits.hpp b/include/boost/regex/v4/regex_traits.hpp new file mode 100644 index 00000000..bd438dc2 --- /dev/null +++ b/include/boost/regex/v4/regex_traits.hpp @@ -0,0 +1,822 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_traits.hpp + * VERSION see + * DESCRIPTION: Declares regular expression traits classes. + */ + +#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED +#define BOOST_REGEX_TRAITS_HPP_INCLUDED + +#ifndef BOOST_RE_CREGEX_HPP +#include +#endif +#ifndef BOOST_REGEX_CSTRING_HPP +#include +#endif + +namespace boost{ + +#ifdef __BORLANDC__ + #pragma option push -a8 -b -Vx -Ve -pc +#endif + +template +class c_regex_traits; + +namespace re_detail{ + +struct mss +{ + unsigned int id; + const char* what; +}; + +BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name); +BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id); +extern BOOST_REGEX_DECL const char *re_default_error_messages[]; + +#ifndef BOOST_NO_WREGEX +extern BOOST_REGEX_DECL wchar_t wide_lower_case_map[]; +extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[]; +BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t c); +#endif + + +struct BOOST_REGEX_DECL regex_traits_base +{ + enum char_syntax_type + { + syntax_char = 0, + syntax_open_bracket = 1, // ( + syntax_close_bracket = 2, // ) + syntax_dollar = 3, // $ + syntax_caret = 4, // ^ + syntax_dot = 5, // . + syntax_star = 6, // * + syntax_plus = 7, // + + syntax_question = 8, // ? + syntax_open_set = 9, // [ + syntax_close_set = 10, // ] + syntax_or = 11, // | + syntax_slash = 12, // + syntax_hash = 13, // # + syntax_dash = 14, // - + syntax_open_brace = 15, // { + syntax_close_brace = 16, // } + syntax_digit = 17, // 0-9 + syntax_b = 18, // for \b + syntax_B = 19, // for \B + syntax_left_word = 20, // for \< + syntax_right_word = 21, // for \> + syntax_w = 22, // for \w + syntax_W = 23, // for \W + syntax_start_buffer = 24, // for \` + syntax_end_buffer = 25, // for \' + syntax_newline = 26, // for newline alt + syntax_comma = 27, // for {x,y} + + syntax_a = 28, // for \a + syntax_f = 29, // for \f + syntax_n = 30, // for \n + syntax_r = 31, // for \r + syntax_t = 32, // for \t + syntax_v = 33, // for \v + syntax_x = 34, // for \xdd + syntax_c = 35, // for \cx + syntax_colon = 36, // for [:...:] + syntax_equal = 37, // for [=...=] + + // perl ops: + syntax_e = 38, // for \e + syntax_l = 39, // for \l + syntax_L = 40, // for \L + syntax_u = 41, // for \u + syntax_U = 42, // for \U + syntax_s = 43, // for \s + syntax_S = 44, // for \S + syntax_d = 45, // for \d + syntax_D = 46, // for \D + syntax_E = 47, // for \Q\E + syntax_Q = 48, // for \Q\E + syntax_X = 49, // for \X + syntax_C = 50, // for \C + syntax_Z = 51, // for \Z + syntax_G = 52, // for \G + + // new extentions: + syntax_not = 53, // for (?!...) + + syntax_max = 54 + }; +#ifdef __BORLANDC__ +private: + char dummy_member; +#endif +}; + +struct BOOST_REGEX_DECL c_traits_base : public regex_traits_base +{ +public: + enum{ + char_class_none = 0, + char_class_alpha = 0x0001, + char_class_cntrl = 0x0002, + char_class_digit = 0x0004, + char_class_lower = 0x0008, + char_class_punct = 0x0010, + char_class_space = 0x0020, + char_class_upper = 0x0040, + char_class_xdigit = 0x0080, + char_class_blank = 0x0100, + char_class_underscore = 0x4000, + char_class_unicode = 0x8000, + + char_class_alnum = char_class_alpha | char_class_digit, + char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore, + char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank, + char_class_word = char_class_alpha | char_class_digit | char_class_underscore + }; + static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s); +protected: +#if defined(__MWERKS__) && __MWERKS__ <= 0x6000 + friend class c_regex_traits; + friend class c_regex_traits; +#endif + + static char regex_message_catalogue[BOOST_REGEX_MAX_PATH]; + enum syntax_map_size + { + map_size = UCHAR_MAX + 1 + }; + + static unsigned char syntax_map[map_size]; + static unsigned short class_map[map_size]; + static char lower_case_map[map_size]; + + static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p); + static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p); + static void BOOST_REGEX_CALL do_update_ctype(); + static void BOOST_REGEX_CALL do_update_collate(); +public: + static std::string BOOST_REGEX_CALL error_string(unsigned id); + static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; } +}; + +} // namespace re_detail + + +template<> +class BOOST_REGEX_DECL c_regex_traits : public re_detail::c_traits_base +{ + typedef re_detail::c_traits_base base_type; +public: + typedef char char_type; + typedef unsigned char uchar_type; + typedef unsigned int size_type; + typedef std::string string_type; + typedef int locale_type; + + static std::size_t BOOST_REGEX_CALL length(const char_type* p) + { + return std::strlen(p); + } + static unsigned int BOOST_REGEX_CALL syntax_type(size_type c) + { + return syntax_map[c]; + } + static char BOOST_REGEX_CALL translate(char c, bool icase) + { + return icase ? lower_case_map[(size_type)(uchar_type)c] : c; + } + static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in); + + static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in); + + static bool BOOST_REGEX_CALL is_separator(char c) + { + return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r')); + } + + static bool BOOST_REGEX_CALL is_combining(char) + { + return false; + } + + static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f) + { + return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f); + } + + static int BOOST_REGEX_CALL toi(char c); + static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix); + + static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last) + { + std::string s(first, last); + return do_lookup_class(s.c_str()); + } + + static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last) + { + std::string s(first, last); + return do_lookup_collate(buf, s.c_str()); + } + + static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; } + locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); } + void swap(c_regex_traits&){} + + c_regex_traits() + { + init(); + } + ~c_regex_traits() + { + m_free(); + } + struct sentry + { + sentry(const c_regex_traits&) + { c_regex_traits::update(); } + operator void*() { return this; } + }; + static void BOOST_REGEX_CALL update(); +private: + static void BOOST_REGEX_CALL init(); + static void BOOST_REGEX_CALL m_free(); + static c_regex_traits i; + + static unsigned sort_type; + static char sort_delim; +}; + +#ifndef BOOST_NO_WREGEX +template<> +class BOOST_REGEX_DECL c_regex_traits : public re_detail::c_traits_base +{ + typedef re_detail::c_traits_base base_type; +public: + typedef wchar_t char_type; + typedef unsigned short uchar_type; + typedef unsigned int size_type; + typedef std::basic_string string_type; + typedef int locale_type; + static std::size_t BOOST_REGEX_CALL length(const char_type* p) + { + return std::wcslen(p); + } + static unsigned int BOOST_REGEX_CALL syntax_type(size_type c); + static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase) + { + return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c; + } + + static void BOOST_REGEX_CALL transform(std::basic_string& out, const std::basic_string& in); + + static void BOOST_REGEX_CALL transform_primary(std::basic_string& out, const std::basic_string& in); + + static bool BOOST_REGEX_CALL is_separator(wchar_t c) + { + return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029)); + } + + static bool BOOST_REGEX_CALL is_combining(wchar_t c) + { return re_detail::is_combining(c); } + + static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f) + { + return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f)); + } + + static int BOOST_REGEX_CALL toi(wchar_t c); + static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix); + + static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last); + + static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string& s, const wchar_t* first, const wchar_t* last); + + static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; } + locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); } + void swap(c_regex_traits&){} + c_regex_traits() + { init(); } + ~c_regex_traits() + { m_free(); } + struct sentry + { + sentry(const c_regex_traits&) + { c_regex_traits::update(); } + operator void*() { return this; } + }; + static void BOOST_REGEX_CALL update(); + static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2); + static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2); +private: + static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f); + static void BOOST_REGEX_CALL m_free(); + static void BOOST_REGEX_CALL init(); + static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string& out, const wchar_t* first, const wchar_t* last); + static c_regex_traits init_; + + static unsigned sort_type; + static wchar_t sort_delim; +}; +#endif + +#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32) + +namespace re_detail{ + +struct BOOST_REGEX_DECL w32_traits_base : public regex_traits_base +{ + enum{ + char_class_none = 0, + char_class_alnum = C1_ALPHA | C1_DIGIT, + char_class_alpha = C1_ALPHA, + char_class_cntrl = C1_CNTRL, + char_class_digit = C1_DIGIT, + char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA, + char_class_lower = C1_LOWER, + char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA, + char_class_punct = C1_PUNCT, + char_class_space = C1_SPACE, + char_class_upper = C1_UPPER, + char_class_xdigit = C1_XDIGIT, + char_class_blank = C1_BLANK, + char_class_underscore = 0x4000, + char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore, + char_class_unicode = 0x8000, + char_class_win = 0x01FF + }; + + +public: + static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s); +protected: + static char regex_message_catalogue[BOOST_REGEX_MAX_PATH]; + enum syntax_map_size + { + map_size = UCHAR_MAX + 1 + }; + + static unsigned char syntax_map[map_size]; + static unsigned short class_map[map_size]; + static char lower_case_map[map_size]; + + static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p); + static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p); + static void BOOST_REGEX_CALL do_free(); + static void BOOST_REGEX_CALL do_init(); +public: + static std::string BOOST_REGEX_CALL error_string(unsigned id); + static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; } +}; + + +} // namespace re_detail + +template +class w32_regex_traits; + +template<> +class BOOST_REGEX_DECL w32_regex_traits : public re_detail::w32_traits_base +{ + typedef re_detail::w32_traits_base base_type; +public: + typedef char char_type; + typedef unsigned char uchar_type; + typedef unsigned int size_type; + typedef std::string string_type; + typedef int locale_type; + + static std::size_t BOOST_REGEX_CALL length(const char_type* p) + { + return std::strlen(p); + } + static unsigned int BOOST_REGEX_CALL syntax_type(size_type c) + { + return syntax_map[c]; + } + static char BOOST_REGEX_CALL translate(char c, bool icase) + { + return icase ? lower_case_map[(size_type)(uchar_type)c] : c; + } + static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in); + + static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in); + + static bool BOOST_REGEX_CALL is_separator(char c) + { + return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r')); + } + + static bool BOOST_REGEX_CALL is_combining(char) + { + return false; + } + + static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f) + { + return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f); + } + + static int BOOST_REGEX_CALL toi(char c); + static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix); + + static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last) + { + std::string s(first, last); + return do_lookup_class(s.c_str()); + } + + static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last) + { + std::string s(first, last); + return do_lookup_collate(buf, s.c_str()); + } + + static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; } + locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); } + + struct sentry + { + sentry(const w32_regex_traits&) + { w32_regex_traits::update(); } + ~sentry(){} + operator void*() { return this; } + }; + static void BOOST_REGEX_CALL update(); + void swap(w32_regex_traits&){} + w32_regex_traits(); + ~w32_regex_traits(); +private: + static w32_regex_traits i; +}; + +#ifndef BOOST_NO_WREGEX +template<> +class BOOST_REGEX_DECL w32_regex_traits : public re_detail::w32_traits_base +{ + typedef re_detail::w32_traits_base base_type; +public: + typedef wchar_t char_type; + typedef unsigned short uchar_type; + typedef unsigned int size_type; + typedef std::basic_string string_type; + typedef int locale_type; + static std::size_t BOOST_REGEX_CALL length(const char_type* p) + { + return std::wcslen(p); + } + static unsigned int BOOST_REGEX_CALL syntax_type(size_type c); + static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase) + { + return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c; + } + + static void BOOST_REGEX_CALL transform(std::basic_string& out, const std::basic_string& in); + + static void BOOST_REGEX_CALL transform_primary(std::basic_string& out, const std::basic_string& in); + + static bool BOOST_REGEX_CALL is_separator(wchar_t c) + { + return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029)); + } + + static bool BOOST_REGEX_CALL is_combining(wchar_t c) + { return re_detail::is_combining(c); } + + static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f) + { + return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f)); + } + + static int BOOST_REGEX_CALL toi(wchar_t c); + static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix); + + static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last); + + static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string& s, const wchar_t* first, const wchar_t* last); + + static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; } + locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); } + + struct sentry + { + sentry(const w32_regex_traits&) + { w32_regex_traits::update(); } + ~sentry(){} + operator void*() { return this; } + }; + static void BOOST_REGEX_CALL update(); + void swap(w32_regex_traits&){} + w32_regex_traits(); + ~w32_regex_traits(); + static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2); + static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2); + +private: + static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f); + static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string& out, const wchar_t* first, const wchar_t* last); + static w32_regex_traits init_; + static wchar_t BOOST_REGEX_CALL wtolower(wchar_t c); + static unsigned short wide_unicode_classes[]; +}; +#endif // Wide strings +#endif // Win32 + +#if !defined(BOOST_NO_STD_LOCALE) + +} // namspace boost + +#ifdef __BORLANDC__ + #pragma option pop +#endif +#include +#ifdef __BORLANDC__ + #pragma option push -a4 -b -Ve -pc +#endif + +namespace boost{ + +namespace re_detail +{ + +template +struct message_data; + +template <> +struct message_data; + +template <> +struct message_data; + +struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base +{ + enum char_class_type + { + char_class_none = 0, + char_class_alnum = std::ctype_base::alnum, + char_class_alpha = std::ctype_base::alpha, + char_class_cntrl = std::ctype_base::cntrl, + char_class_digit = std::ctype_base::digit, + char_class_graph = std::ctype_base::graph, + char_class_lower = std::ctype_base::lower, + char_class_print = std::ctype_base::print, + char_class_punct = std::ctype_base::punct, + char_class_space = std::ctype_base::space, + char_class_upper = std::ctype_base::upper, + char_class_xdigit = std::ctype_base::xdigit, + char_class_blank = 1<<12, + char_class_underscore = 1<<13, + char_class_word = std::ctype_base::alnum | char_class_underscore, + char_class_unicode = 1<<14, + char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl + | char_class_digit | char_class_graph | char_class_lower + | char_class_print | char_class_punct | char_class_space + | char_class_upper | char_class_xdigit + }; + + static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s); +protected: + static char regex_message_cat[BOOST_REGEX_MAX_PATH]; +}; + +} // namespace re_detail + +template +class cpp_regex_traits; + +template<> +class BOOST_REGEX_DECL cpp_regex_traits : public re_detail::cpp_regex_traits_base +{ + typedef re_detail::cpp_regex_traits_base base_type; +private: + re_detail::message_data* pmd; + const unsigned char* psyntax; + char* lower_map; + const std::ctype* pctype; + const std::collate* pcollate; + std::locale locale_inst; + unsigned sort_type; + char sort_delim; + + cpp_regex_traits(const cpp_regex_traits&); + cpp_regex_traits& operator=(const cpp_regex_traits&); + +public: + typedef char char_type; + typedef unsigned char uchar_type; + typedef unsigned int size_type; + typedef std::string string_type; + typedef std::locale locale_type; + + cpp_regex_traits(); + ~cpp_regex_traits(); + + static std::size_t BOOST_REGEX_CALL length(const char_type* p) + { + return std::strlen(p); + } + unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const + { + return psyntax[c]; + } + char BOOST_REGEX_CALL translate(char c, bool icase)const + { + return icase ? lower_map[(size_type)(uchar_type)c] : c; + } + void BOOST_REGEX_CALL transform(std::string& out, const std::string& in)const + { + out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str(); + } + + void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in)const; + + static bool BOOST_REGEX_CALL is_separator(char c) + { + return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r')); + } + + static bool BOOST_REGEX_CALL is_combining(char) + { + return false; + } + + bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)const + { + if(pctype->is((std::ctype::mask)(f & char_class_all_base), c)) + return true; + if((f & char_class_underscore) && (c == '_')) + return true; + if((f & char_class_blank) && ((c == ' ') || (c == '\t'))) + return true; + return false; + } + + int BOOST_REGEX_CALL toi(char c)const; + int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix)const; + + boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)const; + bool BOOST_REGEX_CALL lookup_collatename(std::string& s, const char* first, const char* last)const; + + std::string BOOST_REGEX_CALL error_string(unsigned id)const; + locale_type BOOST_REGEX_CALL imbue(locale_type l); + locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; } + void swap(cpp_regex_traits&); + + struct sentry + { + sentry(const cpp_regex_traits&){} + operator void*() { return this; } + }; +}; + +#if !defined(BOOST_NO_WREGEX) && !defined(BOOST_NO_STD_WSTREAMBUF) +template<> +class BOOST_REGEX_DECL cpp_regex_traits : public re_detail::cpp_regex_traits_base +{ + typedef re_detail::cpp_regex_traits_base base_type; +public: + typedef wchar_t char_type; + typedef unsigned short uchar_type; + typedef unsigned int size_type; + typedef std::basic_string string_type; + typedef std::locale locale_type; + +private: + re_detail::message_data* pmd; + const unsigned char* psyntax; + wchar_t* lower_map; + const std::ctype* pctype; + const std::collate* pcollate; + const std::codecvt* pcdv; + std::locale locale_inst; + unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const; + unsigned sort_type; + wchar_t sort_delim; + + cpp_regex_traits(const cpp_regex_traits&); + cpp_regex_traits& operator=(const cpp_regex_traits&); + +public: + + static std::size_t BOOST_REGEX_CALL length(const char_type* p) + { + return std::wcslen(p); + } + unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const + { + return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c); + } + wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)const + { + return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c; + } + void BOOST_REGEX_CALL transform(std::basic_string& out, const std::basic_string& in)const + { + out = pcollate->transform(in.c_str(), in.c_str() + in.size()); + } + + void BOOST_REGEX_CALL transform_primary(std::basic_string& out, const std::basic_string& in)const; + + static bool BOOST_REGEX_CALL is_separator(wchar_t c) + { + return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029)); + } + + static bool BOOST_REGEX_CALL is_combining(wchar_t c) + { return re_detail::is_combining(c); } + + bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)const + { + if(pctype->is((std::ctype::mask)(f & char_class_all_base), c)) + return true; + if((f & char_class_underscore) && (c == '_')) + return true; + if((f & char_class_blank) && ((c == ' ') || (c == '\t'))) + return true; + if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255)) + return true; + return false; + } + + int BOOST_REGEX_CALL toi(wchar_t c)const; + int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const; + + boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const; + bool BOOST_REGEX_CALL lookup_collatename(std::basic_string& s, const wchar_t* first, const wchar_t* last)const; + + std::string BOOST_REGEX_CALL error_string(unsigned id)const; + void swap(cpp_regex_traits&); + cpp_regex_traits(); + ~cpp_regex_traits(); + locale_type BOOST_REGEX_CALL imbue(locale_type l); + locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; } + std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const; + + struct sentry + { + sentry(const cpp_regex_traits&){} + operator void*() { return this; } + }; +}; +#endif // BOOST_NO_WREGEX + +#endif // BOOST_NO_STD_LOCALE + +#ifdef BOOST_REGEX_USE_WIN32_LOCALE + +template +class regex_traits : public w32_regex_traits +{ +}; + +#elif defined(BOOST_REGEX_USE_C_LOCALE) + +template +class regex_traits : public c_regex_traits +{ +}; + +#elif defined(BOOST_REGEX_USE_CPP_LOCALE) + +template +class regex_traits : public cpp_regex_traits +{ +}; + +#else +#error No default localisation model defined +#endif + +#ifdef __BORLANDC__ + #pragma option pop +#endif + +} // namespace boost + +#endif // include + + + + + + + diff --git a/include/boost/regex/v4/states.hpp b/include/boost/regex/v4/states.hpp new file mode 100644 index 00000000..ec1d276f --- /dev/null +++ b/include/boost/regex/v4/states.hpp @@ -0,0 +1,233 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE states.cpp + * VERSION see + * DESCRIPTION: Declares internal state machine structures. + */ + +#ifndef BOOST_REGEX_V4_STATES_HPP +#define BOOST_REGEX_V4_STATES_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ +namespace re_detail{ + +/*** mask_type ******************************************************* +Whenever we have a choice of two alternatives, we use an array of bytes +to indicate which of the two alternatives it is possible to take for any +given input character. If mask_take is set, then we can take the next +state, and if mask_skip is set then we can take the alternative. +***********************************************************************/ +enum mask_type +{ + mask_take = 1, + mask_skip = 2, + mask_any = mask_skip | mask_take, + mask_all = mask_any +}; + +/*** helpers ********************************************************** +These helpers let us use function overload resolution to detect whether +we have narrow or wide character strings: +***********************************************************************/ +struct _narrow_type{}; +struct _wide_type{}; +template struct is_byte; +template<> struct is_byte { typedef _narrow_type width_type; }; +template<> struct is_byte{ typedef _narrow_type width_type; }; +template<> struct is_byte { typedef _narrow_type width_type; }; +template struct is_byte { typedef _wide_type width_type; }; + +/*** enum syntax_element_type ****************************************** +Every record in the state machine falls into one of the following types: +***********************************************************************/ +enum syntax_element_type +{ + // start of a marked sub-expression, or perl-style (?...) extension + syntax_element_startmark = 0, + // end of a marked sub-expression, or perl-style (?...) extension + syntax_element_endmark = syntax_element_startmark + 1, + // any sequence of literal characters + syntax_element_literal = syntax_element_endmark + 1, + // start of line assertion: ^ + syntax_element_start_line = syntax_element_literal + 1, + // end of line assertion $ + syntax_element_end_line = syntax_element_start_line + 1, + // match any character: . + syntax_element_wild = syntax_element_end_line + 1, + // end of expression: we have a match when we get here + syntax_element_match = syntax_element_wild + 1, + // perl style word boundary: \b + syntax_element_word_boundary = syntax_element_match + 1, + // perl style within word boundary: \B + syntax_element_within_word = syntax_element_word_boundary + 1, + // start of word assertion: \< + syntax_element_word_start = syntax_element_within_word + 1, + // end of word assertion: \> + syntax_element_word_end = syntax_element_word_start + 1, + // start of buffer assertion: \` + syntax_element_buffer_start = syntax_element_word_end + 1, + // end of buffer assertion: \' + syntax_element_buffer_end = syntax_element_buffer_start + 1, + // backreference to previously matched sub-expression + syntax_element_backref = syntax_element_buffer_end + 1, + // either a wide character set [..] or one with multicharacter collating elements: + syntax_element_long_set = syntax_element_backref + 1, + // narrow character set: [...] + syntax_element_set = syntax_element_long_set + 1, + // jump to a new state in the machine: + syntax_element_jump = syntax_element_set + 1, + // choose between two production states: + syntax_element_alt = syntax_element_jump + 1, + // a repeat + syntax_element_rep = syntax_element_alt + 1, + // match a combining character sequence + syntax_element_combining = syntax_element_rep + 1, + // perl style soft buffer end: \z + syntax_element_soft_buffer_end = syntax_element_combining + 1, + // perl style continuation: \G + syntax_element_restart_continue = syntax_element_soft_buffer_end + 1, + // single character repeats: + syntax_element_dot_rep = syntax_element_restart_continue + 1, + syntax_element_char_rep = syntax_element_dot_rep + 1, + syntax_element_short_set_rep = syntax_element_char_rep + 1, + syntax_element_long_set_rep = syntax_element_short_set_rep + 1 +}; + +#ifdef BOOST_REGEX_DEBUG +// dwa 09/26/00 - This is needed to suppress warnings about an ambiguous conversion +std::ostream& operator<<(std::ostream&, syntax_element_type); +#endif + +struct re_syntax_base; + +/*** union offset_type ************************************************ +Points to another state in the machine. During machine construction +we use integral offsets, but these are converted to pointers before +execution of the machine. +***********************************************************************/ +union offset_type +{ + re_syntax_base* p; + std::size_t i; +}; + +/*** struct re_syntax_base ******************************************** +Base class for all states in the machine. +***********************************************************************/ +struct re_syntax_base +{ + syntax_element_type type; // what kind of state this is + offset_type next; // next state in the machine + unsigned int can_be_null; // true if we match a NULL string +}; + +/*** struct re_brace ************************************************** +Base class for all states in the machine. +***********************************************************************/ +struct re_brace : public re_syntax_base +{ + // The index to match, can be zero (don't mark the sub-expression) + // or negative (for perl style (?...) extentions): + int index; +}; + +/*** struct re_literal ************************************************ +A string of literals, following this structure will be an +array of characters: charT[length] +***********************************************************************/ +struct re_literal : public re_syntax_base +{ + unsigned int length; +}; + +/*** struct re_set_long *********************************************** +A wide character set of characters, following this structure will be +an array of type charT: +First csingles null-terminated strings +Then 2 * cranges NULL terminated strings +Then cequivalents NULL terminated strings +***********************************************************************/ +struct re_set_long : public re_syntax_base +{ + unsigned int csingles, cranges, cequivalents; + boost::uint_fast32_t cclasses; + bool isnot; + bool singleton; +}; + +/*** struct re_set **************************************************** +A set of narrow-characters, matches any of _map which is none-zero +***********************************************************************/ +struct re_set : public re_syntax_base +{ + unsigned char _map[256]; +}; + +/*** struct re_jump *************************************************** +Jump to a new location in the machine (not next). +***********************************************************************/ +struct re_jump : public re_syntax_base +{ + offset_type alt; // location to jump to + unsigned char _map[256]; // which characters can take the jump +}; + +/*** struct re_repeat ************************************************* +Repeat a section of the machine +***********************************************************************/ +struct re_repeat : public re_jump +{ + unsigned min, max; // min and max allowable repeats + int id; // Unique identifier for this repeat + bool leading; // True if this repeat is at the start of the machine (lets us optimize some searches) + bool greedy; // True if this is a greedy repeat +}; + +/*** enum re_jump_size_type ******************************************* +Provides compiled size of re_jump structure (allowing for trailing alignment). +We provide this so we know how manybytes to insert when constructing the machine +(The value of padding_mask is defined in regex_raw_buffer.hpp). +***********************************************************************/ +enum re_jump_size_type +{ + re_jump_size = (sizeof(re_jump) + padding_mask) & ~(padding_mask), + re_repeater_size = (sizeof(re_repeat) + padding_mask) & ~(padding_mask) +}; + +/*** proc re_is_set_member ********************************************* +Forward declaration: we'll need this one later... +***********************************************************************/ +template +iterator BOOST_REGEX_CALL re_is_set_member(iterator next, + iterator last, + const re_set_long* set_, + const reg_expression& e); + +} // namespace re_detail + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp new file mode 100644 index 00000000..b74eb224 --- /dev/null +++ b/include/boost/regex/v4/sub_match.hpp @@ -0,0 +1,337 @@ +/* + * + * Copyright (c) 1998-2002 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE sub_match.cpp + * VERSION see + * DESCRIPTION: Declares template class sub_match. + */ + +#ifndef BOOST_REGEX_V4_SUB_MATCH_HPP +#define BOOST_REGEX_V4_SUB_MATCH_HPP + +#ifdef __BORLANDC__ +# pragma option push -a8 -b -Vx -Ve -pc -w-8027 +#endif + +namespace boost{ + +template +struct sub_match : public std::pair +{ + typedef typename re_detail::regex_iterator_traits::value_type value_type; +#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + typedef std::ptrdiff_t difference_type; +#else + typedef typename re_detail::regex_iterator_traits::difference_type difference_type; +#endif + typedef BidiIterator iterator_type; + + bool matched; + + sub_match() : std::pair(), matched(false) {} + sub_match(BidiIterator i) : std::pair(i, i), matched(false) {} + + operator std::basic_string ()const + { + return str(); + } + difference_type BOOST_REGEX_CALL length()const + { + difference_type n = boost::re_detail::distance((BidiIterator)first, (BidiIterator)second); + return n; + } + std::basic_string str()const + { + std::basic_string result; + std::size_t len = boost::re_detail::distance((BidiIterator)first, (BidiIterator)second); + result.reserve(len); + BidiIterator i = first; + while(i != second) + { + result.append(1, *i); + ++i; + } + return result; + } + int compare(const sub_match& s)const + { + if(matched != s.matched) + return static_cast(matched) - static_cast(s.matched); + return str().compare(s.str()); + } + + bool operator==(const sub_match& that)const + { return compare(that) == 0; } + bool BOOST_REGEX_CALL operator !=(const sub_match& that)const + { return compare(that) != 0; } + bool operator<(const sub_match& that)const + { return compare(that) < 0; } + bool operator>(const sub_match& that)const + { return compare(that) > 0; } + bool operator<=(const sub_match& that)const + { return compare(that) <= 0; } + bool operator>=(const sub_match& that)const + { return compare(that) >= 0; } + +#ifdef BOOST_OLD_REGEX_H + // + // the following are deprecated, do not use!! + // + operator int()const; + operator unsigned int()const; + operator short()const + { + return (short)(int)(*this); + } + operator unsigned short()const + { + return (unsigned short)(unsigned int)(*this); + } +#endif +}; + +// comparison to std::basic_string<> part 1: +template +bool operator == (const std::basic_string::value_type, traits, Allocator>& s, + const sub_match& m) +{ return s.compare(m.str()) == 0; } +template +bool operator != (const std::basic_string::value_type, traits, Allocator>& s, + const sub_match& m) +{ return s.compare(m.str()) != 0; } +template +bool operator < (const std::basic_string::value_type, traits, Allocator>& s, + const sub_match& m) +{ return s.compare(m.str()) < 0; } +template +bool operator <= (const std::basic_string::value_type, traits, Allocator>& s, + const sub_match& m) +{ return s.compare(m.str()) <= 0; } +template +bool operator >= (const std::basic_string::value_type, traits, Allocator>& s, + const sub_match& m) +{ return s.compare(m.str()) >= 0; } +template +bool operator > (const std::basic_string::value_type, traits, Allocator>& s, + const sub_match& m) +{ return s.compare(m.str()) > 0; } +// comparison to std::basic_string<> part 2: +template +bool operator == (const sub_match& m, + const std::basic_string::value_type, traits, Allocator>& s) +{ return m.str().compare(s) == 0; } +template +bool operator != (const sub_match& m, + const std::basic_string::value_type, traits, Allocator>& s) +{ return m.str().compare(s) != 0; } +template +bool operator < (const sub_match& m, + const std::basic_string::value_type, traits, Allocator>& s) +{ return m.str().compare(s) < 0; } +template +bool operator > (const sub_match& m, + const std::basic_string::value_type, traits, Allocator>& s) +{ return m.str().compare(s) > 0; } +template +bool operator <= (const sub_match& m, + const std::basic_string::value_type, traits, Allocator>& s) +{ return m.str().compare(s) <= 0; } +template +bool operator >= (const sub_match& m, + const std::basic_string::value_type, traits, Allocator>& s) +{ return m.str().compare(s) >= 0; } +// comparison to const charT* part 1: +template +bool operator == (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const* s) +{ return m.str().compare(s) == 0; } +template +bool operator != (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const* s) +{ return m.str().compare(s) != 0; } +template +bool operator > (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const* s) +{ return m.str().compare(s) > 0; } +template +bool operator < (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const* s) +{ return m.str().compare(s) < 0; } +template +bool operator >= (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const* s) +{ return m.str().compare(s) >= 0; } +template +bool operator <= (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const* s) +{ return m.str().compare(s) <= 0; } +// comparison to const charT* part 2: +template +bool operator == (typename re_detail::regex_iterator_traits::value_type const* s, + const sub_match& m) +{ return m.str().compare(s) == 0; } +template +bool operator != (typename re_detail::regex_iterator_traits::value_type const* s, + const sub_match& m) +{ return m.str().compare(s) != 0; } +template +bool operator < (typename re_detail::regex_iterator_traits::value_type const* s, + const sub_match& m) +{ return m.str().compare(s) > 0; } +template +bool operator > (typename re_detail::regex_iterator_traits::value_type const* s, + const sub_match& m) +{ return m.str().compare(s) < 0; } +template +bool operator <= (typename re_detail::regex_iterator_traits::value_type const* s, + const sub_match& m) +{ return m.str().compare(s) >= 0; } +template +bool operator >= (typename re_detail::regex_iterator_traits::value_type const* s, + const sub_match& m) +{ return m.str().compare(s) <= 0; } + +// comparison to const charT& part 1: +template +bool operator == (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const& s) +{ return m.str().compare(0, m.length(), &s, 1) == 0; } +template +bool operator != (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const& s) +{ return m.str().compare(0, m.length(), &s, 1) != 0; } +template +bool operator > (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const& s) +{ return m.str().compare(0, m.length(), &s, 1) > 0; } +template +bool operator < (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const& s) +{ return m.str().compare(0, m.length(), &s, 1) < 0; } +template +bool operator >= (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const& s) +{ return m.str().compare(0, m.length(), &s, 1) >= 0; } +template +bool operator <= (const sub_match& m, + typename re_detail::regex_iterator_traits::value_type const& s) +{ return m.str().compare(0, m.length(), &s, 1) <= 0; } +// comparison to const charT* part 2: +template +bool operator == (typename re_detail::regex_iterator_traits::value_type const& s, + const sub_match& m) +{ return m.str().compare(0, m.length(), &s, 1) == 0; } +template +bool operator != (typename re_detail::regex_iterator_traits::value_type const& s, + const sub_match& m) +{ return m.str().compare(0, m.length(), &s, 1) != 0; } +template +bool operator < (typename re_detail::regex_iterator_traits::value_type const& s, + const sub_match& m) +{ return m.str().compare(0, m.length(), &s, 1) > 0; } +template +bool operator > (typename re_detail::regex_iterator_traits::value_type const& s, + const sub_match& m) +{ return m.str().compare(0, m.length(), &s, 1) < 0; } +template +bool operator <= (typename re_detail::regex_iterator_traits::value_type const& s, + const sub_match& m) +{ return m.str().compare(0, m.length(), &s, 1) >= 0; } +template +bool operator >= (typename re_detail::regex_iterator_traits::value_type const& s, + const sub_match& m) +{ return m.str().compare(0, m.length(), &s, 1) <= 0; } + +#ifndef BOOST_NO_STD_LOCALE +template +std::basic_ostream& + operator << (std::basic_ostream& os, + const sub_match& s) +{ + return (os << s.str()); +} +#else +template +std::ostream& operator << (std::ostream& os, + const sub_match& s) +{ + return (os << s.str()); +} +#endif + +#ifdef BOOST_OLD_REGEX_H +namespace re_detail{ +template +int do_toi(BidiIterator i, BidiIterator j, char c, int radix) +{ + std::string s(i, j); + char* p; + int result = std::strtol(s.c_str(), &p, radix); + if(*p)raise_regex_exception("Bad sub-expression"); + return result; +} + +// +// helper: +template +int do_toi(I& i, I j, charT c) +{ + int result = 0; + while((i != j) && (isdigit(*i))) + { + result = result*10 + (*i - '0'); + ++i; + } + return result; +} +} + + +template +sub_match::operator int()const +{ + BidiIterator i = first; + BidiIterator j = second; + if(i == j)raise_regex_exception("Bad sub-expression"); + int neg = 1; + if((i != j) && (*i == '-')) + { + neg = -1; + ++i; + } + neg *= re_detail::do_toi(i, j, *i); + if(i != j)raise_regex_exception("Bad sub-expression"); + return neg; +} +template +sub_match::operator unsigned int()const +{ + BidiIterator i = first; + BidiIterator j = second; + if(i == j) + raise_regex_exception("Bad sub-expression"); + return re_detail::do_toi(i, j, *first); +} +#endif + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +#endif diff --git a/include/boost/regex_fwd.hpp b/include/boost/regex_fwd.hpp index 1e78c194..fde20180 100644 --- a/include/boost/regex_fwd.hpp +++ b/include/boost/regex_fwd.hpp @@ -24,7 +24,15 @@ #ifndef BOOST_REGEX_FWD_HPP #define BOOST_REGEX_FWD_HPP +#ifndef BOOST_REGEX_CONFIG_HPP +#include +#endif + +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #endif diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index 8de03a1e..8baa06b2 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -35,8 +35,13 @@ #include #include #include +#ifdef BOOST_REGEX_V3 #include #include +#else +#include +#include +#endif #include #include "primary_transform.hpp" @@ -1071,3 +1076,4 @@ std::size_t BOOST_REGEX_CALL c_regex_traits::strwiden(wchar_t *s1, std: + diff --git a/src/c_regex_traits_common.cpp b/src/c_regex_traits_common.cpp index feb21226..df2caabd 100644 --- a/src/c_regex_traits_common.cpp +++ b/src/c_regex_traits_common.cpp @@ -29,7 +29,11 @@ #include #include #include +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif namespace boost{ @@ -555,3 +559,4 @@ BOOST_REGEX_DECL wchar_t wide_lower_case_map[] = { } // namespace boost + diff --git a/src/cpp_regex_traits.cpp b/src/cpp_regex_traits.cpp index a4f8aede..cdb97a31 100644 --- a/src/cpp_regex_traits.cpp +++ b/src/cpp_regex_traits.cpp @@ -25,7 +25,7 @@ #include -#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF) +#if !defined(BOOST_NO_STD_LOCALE) # ifdef BOOST_MSVC # pragma warning(disable:4786 4702 4127 4244) @@ -254,8 +254,9 @@ message_data::message_data(const std::locale& l, const std::string& regex_ // STLport users as well (gcc3.1+STLport5), so enable the // workaround for all STLport users... // -#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +#if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && !defined(BOOST_MSVC) using namespace std; + using stlport::isspace; # define BOOST_REGEX_STD #else # define BOOST_REGEX_STD std:: @@ -347,6 +348,18 @@ cpp_regex_traits::cpp_regex_traits() sort_type = re_detail::find_sort_syntax(this, &(this->sort_delim)); } +void cpp_regex_traits::swap(cpp_regex_traits& that) +{ + std::swap(locale_inst, that.locale_inst); // this one goes first + std::swap(pmd, that.pmd); + std::swap(psyntax, that.psyntax); + std::swap(lower_map, that.lower_map); + std::swap(pctype, that.pctype); + std::swap(pcollate, that.pcollate); + std::swap(sort_type, that.sort_type); + std::swap(sort_delim, that.sort_delim); +} + cpp_regex_traits::~cpp_regex_traits() { delete pmd; @@ -464,7 +477,7 @@ cpp_regex_traits::locale_type BOOST_REGEX_CALL cpp_regex_traits::imb return old_l; } -#ifndef BOOST_NO_WREGEX +#if !defined(BOOST_NO_WREGEX) && !defined(BOOST_NO_STD_WSTREAMBUF) namespace re_detail{ @@ -870,6 +883,19 @@ std::size_t BOOST_REGEX_CALL cpp_regex_traits::strwiden(wchar_t *s1, st return ws.size()+1; } +void cpp_regex_traits::swap(cpp_regex_traits& that) +{ + std::swap(locale_inst, that.locale_inst); // this one must go first + std::swap(pmd, that.pmd); + std::swap(psyntax, that.psyntax); + std::swap(lower_map, that.lower_map); + std::swap(pctype, that.pctype); + std::swap(pcollate, that.pcollate); + std::swap(pcdv, that.pcdv); + std::swap(sort_type, that.sort_type); + std::swap(sort_delim, that.sort_delim); +} + #endif // BOOST_NO_WREGEX @@ -878,3 +904,4 @@ std::size_t BOOST_REGEX_CALL cpp_regex_traits::strwiden(wchar_t *s1, st #endif + diff --git a/src/cregex.cpp b/src/cregex.cpp index b7596707..9ccfadcb 100644 --- a/src/cregex.cpp +++ b/src/cregex.cpp @@ -28,7 +28,13 @@ #if !defined(BOOST_NO_STD_STRING) #include #include +#ifdef BOOST_REGEX_V3 #include +typedef unsigned match_flag_type; +#else +#include +typedef boost::match_flag_type match_flag_type; +#endif #include namespace boost{ @@ -79,11 +85,10 @@ public: regex e; cmatch m; #ifndef BOOST_REGEX_NO_FILEITER - match_results fm; + match_results fm; #endif type t; const char* pbase; - unsigned line; #ifndef BOOST_REGEX_NO_FILEITER mapfile::iterator fbase; #endif @@ -95,7 +100,7 @@ public: #ifndef BOOST_REGEX_NO_FILEITER fm(), #endif - t(type_copy), pbase(0), line(0), + t(type_copy), pbase(0), #ifndef BOOST_REGEX_NO_FILEITER fbase(), #endif @@ -114,7 +119,6 @@ void RegExData::update() if(m[i].matched) strings[i] = std::string(m[i].first, m[i].second); positions[i] = m[i].matched ? m[i].first - pbase : -1; } - line = m.line(); } #ifndef BOOST_REGEX_NO_FILEITER else @@ -124,7 +128,6 @@ void RegExData::update() if(fm[i].matched) strings[i] = to_string(fm[i].first, fm[i].second); positions[i] = fm[i].matched ? fm[i].first - fbase : -1; } - line = fm.line(); } #endif t = type_copy; @@ -135,7 +138,7 @@ void RegExData::clean() BOOST_RE_GUARD_STACK #ifndef BOOST_REGEX_NO_FILEITER fbase = mapfile::iterator(); - fm = match_results(); + fm = match_results(); #endif } @@ -190,7 +193,7 @@ RegEx& RegEx::operator=(const char* p) unsigned int RegEx::SetExpression(const char* p, bool icase) { BOOST_RE_GUARD_STACK - boost::uint_fast32_t f = icase ? regbase::normal | regbase::use_except | regbase::icase : regbase::normal | regbase::use_except; + boost::uint_fast32_t f = icase ? regex::normal | regex::use_except | regex::icase : regex::normal | regex::use_except; return pdata->e.set_expression(p, f); } @@ -209,7 +212,7 @@ std::string RegEx::Expression()const // // now matching operators: // -bool RegEx::Match(const char* p, unsigned int flags) +bool RegEx::Match(const char* p, match_flag_type flags) { BOOST_RE_GUARD_STACK pdata->t = re_detail::RegExData::type_pc; @@ -225,7 +228,7 @@ bool RegEx::Match(const char* p, unsigned int flags) return false; } -bool RegEx::Search(const char* p, unsigned int flags) +bool RegEx::Search(const char* p, match_flag_type flags) { BOOST_RE_GUARD_STACK pdata->t = re_detail::RegExData::type_pc; @@ -253,7 +256,7 @@ struct pred1 } }; } -unsigned int RegEx::Grep(GrepCallback cb, const char* p, unsigned int flags) +unsigned int RegEx::Grep(GrepCallback cb, const char* p, match_flag_type flags) { BOOST_RE_GUARD_STACK pdata->t = re_detail::RegExData::type_pc; @@ -283,7 +286,7 @@ private: }; } -unsigned int RegEx::Grep(std::vector& v, const char* p, unsigned int flags) +unsigned int RegEx::Grep(std::vector& v, const char* p, match_flag_type flags) { BOOST_RE_GUARD_STACK pdata->t = re_detail::RegExData::type_pc; @@ -313,7 +316,7 @@ private: pred3& operator=(const pred3&); }; } -unsigned int RegEx::Grep(std::vector& v, const char* p, unsigned int flags) +unsigned int RegEx::Grep(std::vector& v, const char* p, match_flag_type flags) { BOOST_RE_GUARD_STACK pdata->t = re_detail::RegExData::type_pc; @@ -335,7 +338,7 @@ struct pred4 const char* file; bool ok; pred4(GrepFileCallback c, RegEx* i, const char* f) : cb(c), pe(i), file(f), ok(true) {} - bool operator()(const match_results& m) + bool operator()(const match_results& m) { pe->pdata->t = RegExData::type_pf; pe->pdata->fm = m; @@ -391,7 +394,7 @@ void BuildFileList(std::list* pl, const char* files, bool recurse) } } -unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recurse, unsigned int flags) +unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recurse, match_flag_type flags) { BOOST_RE_GUARD_STACK unsigned int result = 0; @@ -419,7 +422,7 @@ unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recur } -unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recurse, unsigned int flags) +unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recurse, match_flag_type flags) { BOOST_RE_GUARD_STACK unsigned int result = 0; @@ -451,28 +454,28 @@ unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recu #endif std::string RegEx::Merge(const std::string& in, const std::string& fmt, - bool copy, unsigned int flags) + bool copy, match_flag_type flags) { std::string result; re_detail::string_out_iterator i(result); if(!copy) flags |= format_no_copy; - regex_merge(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags); + regex_replace(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags); return result; } std::string RegEx::Merge(const char* in, const char* fmt, - bool copy, unsigned int flags) + bool copy, match_flag_type flags) { std::string result; if(!copy) flags |= format_no_copy; re_detail::string_out_iterator i(result); - regex_merge(i, in, in + std::strlen(in), pdata->e, fmt, flags); + regex_replace(i, in, in + std::strlen(in), pdata->e, fmt, flags); return result; } std::size_t RegEx::Split(std::vector& v, std::string& s, - unsigned flags, + match_flag_type flags, unsigned max_count) { return regex_split(std::back_inserter(v), s, pdata->e, flags, max_count); @@ -505,25 +508,6 @@ std::size_t RegEx::Position(int i)const return RegEx::npos; } -unsigned int RegEx::Line()const -{ - BOOST_RE_GUARD_STACK - switch(pdata->t) - { - case re_detail::RegExData::type_pc: - return pdata->m[0].matched ? pdata->m.line() : RegEx::npos; -#ifndef BOOST_REGEX_NO_FILEITER - case re_detail::RegExData::type_pf: - return pdata->fm[0].matched ? pdata->fm.line() : RegEx::npos; -#endif - case re_detail::RegExData::type_copy: - { - return pdata->line; - } - } - return RegEx::npos; -} - unsigned int RegEx::Marks()const { BOOST_RE_GUARD_STACK @@ -656,3 +640,4 @@ basic_string::replace(char* f1, char* f2, const char* i1, con + diff --git a/src/fileiter.cpp b/src/fileiter.cpp index 0546ad85..042e2b98 100644 --- a/src/fileiter.cpp +++ b/src/fileiter.cpp @@ -25,7 +25,11 @@ #include #include +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #ifndef BOOST_REGEX_NO_FILEITER @@ -901,3 +905,4 @@ bool _fi_FindClose(_fi_find_handle dat) + diff --git a/src/posix_api.cpp b/src/posix_api.cpp index 37b6f344..4c2025c2 100644 --- a/src/posix_api.cpp +++ b/src/posix_api.cpp @@ -58,24 +58,31 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char #endif } // set default flags: - boost::uint_fast32_t flags = (f & REG_EXTENDED) ? regbase::extended : regbase::basic; - expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : 0; + boost::uint_fast32_t flags = (f & REG_EXTENDED) ? regex::extended : regex::basic; + expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default; // and translate those that are actually set: if(f & REG_NOCOLLATE) - flags |= regbase::nocollate; + { + flags |= regex::nocollate; + flags &= ~regex::collate; + } if(f & REG_NOSUB) expression->eflags |= match_any; if(f & REG_NOSPEC) - flags |= regbase::literal; + flags |= regex::literal; if(f & REG_ICASE) - flags |= regbase::icase; + flags |= regex::icase; if(f & REG_ESCAPE_IN_LISTS) - flags |= regbase::escape_in_lists; + flags |= regex::escape_in_lists; if(f & REG_NEWLINE_ALT) - flags |= regbase::newline_alt; + flags |= regex::newline_alt; +#ifndef BOOST_REGEX_V3 + if(f & REG_PERLEX) + flags |= regex::perlex; +#endif const char* p2; if(f & REG_PEND) @@ -165,7 +172,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA* expression, cons { BOOST_RE_GUARD_STACK bool result = false; - boost::uint_fast32_t flags = match_default | expression->eflags; + match_flag_type flags = match_default | expression->eflags; const char* end; const char* start; cmatch m; diff --git a/src/regex.cpp b/src/regex.cpp index 9975b17c..34d45b8a 100644 --- a/src/regex.cpp +++ b/src/regex.cpp @@ -23,12 +23,16 @@ #define BOOST_REGEX_SOURCE +#include #include +#include +#if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && defined(_MSC_VER) && (_MSC_VER >= 1300) +# include +#endif namespace boost{ - // // fix: these are declared out of line here to ensure // that dll builds contain the Virtual table for these @@ -43,6 +47,71 @@ regbase::regbase() regbase::regbase(const regbase& b) : _flags(b._flags){} + +namespace re_detail{ + +#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD + +BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page() +{ +#if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && defined(_MSC_VER) && (_MSC_VER >= 1300) + _resetstkoflw(); +#else + // + // We need to locate the current page being used by the stack, + // move to the page below it and then deallocate and protect + // that page. Note that ideally we would protect only the lowest + // stack page that has been allocated: in practice there + // seems to be no easy way to locate this page, in any case as + // long as the next page is protected, then Windows will figure + // the rest out for us... + // + SYSTEM_INFO si; + GetSystemInfo(&si); + MEMORY_BASIC_INFORMATION mi; + DWORD previous_protection_status; + // + // this is an address in our stack space: + // + LPBYTE page = (LPBYTE)&page; + // + // Get the current memory page in use: + // + VirtualQuery(page, &mi, sizeof(mi)); + // + // Go to the page one below this: + // + page = (LPBYTE)(mi.BaseAddress)-si.dwPageSize; + // + // Free and protect everything from the start of the + // allocation range, to the end of the page below the + // one in use: + // + if (!VirtualFree(mi.AllocationBase, (LPBYTE)page - (LPBYTE)mi.AllocationBase, MEM_DECOMMIT) + || !VirtualProtect(page, si.dwPageSize, PAGE_GUARD | PAGE_READWRITE, &previous_protection_status)) + { + throw std::bad_exception(); + } +#endif +} +#endif + +BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_regex_exception(const std::string& msg) +{ + bad_expression e(msg); + throw_exception(e); +} + +#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3) + +mem_block_cache block_cache = { 0, }; + +#endif + +} // namespace re_detail + + + } // namespace boost #if defined(BOOST_RE_USE_VCL) && defined(BOOST_REGEX_BUILD_DLL) @@ -58,3 +127,4 @@ int WINAPI DllEntryPoint(HINSTANCE , unsigned long , void*) + diff --git a/src/regex_debug.cpp b/src/regex_debug.cpp index b60bb25c..d9439098 100644 --- a/src/regex_debug.cpp +++ b/src/regex_debug.cpp @@ -31,7 +31,11 @@ #include #endif +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif #include #ifndef BOOST_RE_OLD_IOSTREAM @@ -217,3 +221,4 @@ debug_guard::~debug_guard() + diff --git a/src/regex_synch.cpp b/src/regex_synch.cpp index bdb9aa0d..93300cf5 100644 --- a/src/regex_synch.cpp +++ b/src/regex_synch.cpp @@ -24,7 +24,12 @@ #define BOOST_REGEX_SOURCE +#include +#ifdef BOOST_REGEX_V3 #include +#else +#include +#endif namespace boost{ namespace re_detail{ @@ -68,3 +73,5 @@ BOOST_REGEX_DECL unsigned int re_lock_count = 0; + + diff --git a/src/w32_regex_traits.cpp b/src/w32_regex_traits.cpp index e43b0437..bcd888d1 100644 --- a/src/w32_regex_traits.cpp +++ b/src/w32_regex_traits.cpp @@ -30,8 +30,13 @@ #include #if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32) #include +#ifdef BOOST_REGEX_V3 #include #include +#else +#include +#include +#endif #include @@ -1102,3 +1107,4 @@ unsigned short w32_regex_traits::wide_unicode_classes[] = { + diff --git a/src/wide_posix_api.cpp b/src/wide_posix_api.cpp index 02157484..841c92b2 100644 --- a/src/wide_posix_api.cpp +++ b/src/wide_posix_api.cpp @@ -66,24 +66,31 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha #endif } // set default flags: - boost::uint_fast32_t flags = (f & REG_EXTENDED) ? regbase::extended : regbase::basic; - expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : 0; + boost::uint_fast32_t flags = (f & REG_EXTENDED) ? wregex::extended : wregex::basic; + expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default; // and translate those that are actually set: if(f & REG_NOCOLLATE) - flags |= regbase::nocollate; + { + flags |= wregex::nocollate; + flags &= ~wregex::collate; + } if(f & REG_NOSUB) expression->eflags |= match_any; if(f & REG_NOSPEC) - flags |= regbase::literal; + flags |= wregex::literal; if(f & REG_ICASE) - flags |= regbase::icase; + flags |= wregex::icase; if(f & REG_ESCAPE_IN_LISTS) - flags |= regbase::escape_in_lists; + flags |= wregex::escape_in_lists; if(f & REG_NEWLINE_ALT) - flags |= regbase::newline_alt; + flags |= wregex::newline_alt; +#ifndef BOOST_REGEX_V3 + if(f & REG_PERLEX) + flags |= wregex::perlex; +#endif const wchar_t* p2; if(f & REG_PEND) @@ -173,7 +180,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, cons { BOOST_RE_GUARD_STACK bool result = false; - boost::uint_fast32_t flags = match_default | expression->eflags; + match_flag_type flags = match_default | expression->eflags; const wchar_t* end; const wchar_t* start; wcmatch m; diff --git a/test/Jamfile b/test/Jamfile index 7dc873a7..f1c809ea 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -58,6 +58,18 @@ test-suite regex c_compiler_checks/wide_posix_api_check.cpp ] + [ regex-test bad_expression_test + :