aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-05-09 11:52:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-05-09 11:52:59 +0200
commit713324411804114f2699c6c127c659345d7359d5 (patch)
tree614357de1a6607d864faf5df5a4b7e085e08fc03
parent1061c7c0ac3e6e9f6de93a9d8c68ce5d7a40c7ed (diff)
Port to use regex from libcutl instead of libbackend-elements
-rw-r--r--build/import/libboost/regex/rules.make50
-rw-r--r--build/import/libboost/regex/stub.make36
-rw-r--r--xsde/cxx/elements.cxx22
-rw-r--r--xsde/cxx/elements.hxx8
-rw-r--r--xsde/cxx/hybrid/aggregate-include.hxx2
-rw-r--r--xsde/cxx/hybrid/elements.cxx8
-rw-r--r--xsde/cxx/hybrid/elements.hxx6
-rw-r--r--xsde/cxx/hybrid/generator.cxx77
-rw-r--r--xsde/cxx/hybrid/tree-forward.cxx2
-rw-r--r--xsde/cxx/parser/elements.cxx4
-rw-r--r--xsde/cxx/parser/elements.hxx4
-rw-r--r--xsde/cxx/parser/generator.cxx41
-rw-r--r--xsde/cxx/parser/parser-header.cxx2
-rw-r--r--xsde/cxx/parser/type-processor.cxx12
-rw-r--r--xsde/cxx/serializer/elements.cxx4
-rw-r--r--xsde/cxx/serializer/elements.hxx4
-rw-r--r--xsde/cxx/serializer/generator.cxx41
-rw-r--r--xsde/cxx/serializer/serializer-header.cxx2
-rw-r--r--xsde/cxx/serializer/type-processor.cxx17
-rw-r--r--xsde/makefile9
-rw-r--r--xsde/type-map/parser.cxx8
-rw-r--r--xsde/type-map/type-map.hxx29
-rw-r--r--xsde/xsde.cxx48
23 files changed, 182 insertions, 254 deletions
diff --git a/build/import/libboost/regex/rules.make b/build/import/libboost/regex/rules.make
deleted file mode 100644
index 3c85243..0000000
--- a/build/import/libboost/regex/rules.make
+++ /dev/null
@@ -1,50 +0,0 @@
-# file : build/import/libboost/regex/rules.make
-# author : Boris Kolpackov <boris@kolpackov.net>
-# copyright : Copyright (c) 2005-2011 Boris Kolpackov
-# license : GNU GPL v2; see accompanying LICENSE file
-
-$(dcf_root)/import/libboost/%: root := $(libboost_root)
-
-$(dcf_root)/import/libboost/regex/regex.l: \
- | $(dcf_root)/import/libboost/regex/.
-
-ifeq ($(libboost_type),archive)
-
-ifeq ($(libboost_system),y)
-$(dcf_root)/import/libboost/regex/regex.l: \
- $(libboost_root)/stage/lib/libboost_regex$(libboost_suffix).a \
- $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).a
-else
-$(dcf_root)/import/libboost/regex/regex.l: \
- $(libboost_root)/stage/lib/libboost_regex$(libboost_suffix).a
-endif
- @echo $^ >$@
-
-else
-
-ifeq ($(libboost_system),y)
-$(dcf_root)/import/libboost/regex/regex.l: \
- $(libboost_root)/stage/lib/libboost_regex$(libboost_suffix).so \
- $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).so
-else
-$(dcf_root)/import/libboost/regex/regex.l: \
- $(libboost_root)/stage/lib/libboost_regex$(libboost_suffix).so
-endif
- @echo $^ >$@
- @echo rpath:$(root)/stage/lib >>$@
-
-endif
-
-
-$(dcf_root)/import/libboost/regex/regex.l.cpp-options: \
- | $(dcf_root)/import/libboost/regex/.
- @echo include: -I$(root) >$@
-
-ifndef %foreign%
-
-disfigure::
- $(call message,rm $(dcf_root)/import/libboost/regex/regex.l,\
-rm -f $(dcf_root)/import/libboost/regex/regex.l)
- $(call message,,rm -f $(dcf_root)/import/libboost/regex/regex.l.cpp-options)
-
-endif
diff --git a/build/import/libboost/regex/stub.make b/build/import/libboost/regex/stub.make
deleted file mode 100644
index 9c02508..0000000
--- a/build/import/libboost/regex/stub.make
+++ /dev/null
@@ -1,36 +0,0 @@
-# file : build/import/libboost/regex/stub.make
-# author : Boris Kolpackov <boris@kolpackov.net>
-# copyright : Copyright (c) 2005-2011 Boris Kolpackov
-# license : GNU GPL v2; see accompanying LICENSE file
-
-$(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root))
-
-libboost_installed :=
-
-$(call -include,$(dcf_root)/import/libboost/configuration-dynamic.make)
-
-ifdef libboost_installed
-
-ifeq ($(libboost_installed),y)
-
-ifeq ($(libboost_system),y)
-$(call export,l: -lboost_regex$(libboost_suffix) -lboost_system$(libboost_suffix),cpp_options: )
-else
-$(call export,l: -lboost_regex$(libboost_suffix),cpp_options: )
-endif
-
-else
-
-$(call include-once,$(scf_root)/import/libboost/regex/rules.make,$(dcf_root))
-
-$(call export,\
- l: $(dcf_root)/import/libboost/regex/regex.l,\
- cpp-options: $(dcf_root)/import/libboost/regex/regex.l.cpp-options)
-
-endif
-
-else
-
-.NOTPARALLEL:
-
-endif
diff --git a/xsde/cxx/elements.cxx b/xsde/cxx/elements.cxx
index ba93854..cc41e08 100644
--- a/xsde/cxx/elements.cxx
+++ b/xsde/cxx/elements.cxx
@@ -5,8 +5,6 @@
#include <cxx/elements.hxx>
-#include <backend-elements/regex.hxx>
-
#include <cctype> // std::toupper
#include <sstream>
#include <iostream>
@@ -211,7 +209,7 @@ namespace CXX
for (Containers::Vector<NarrowString>::ConstIterator
i (nsr.begin ()), e (nsr.end ()); i != e; ++i)
{
- nsr_mapping_.push_back (Regex (*i));
+ nsr_mapping_.push_back (Regex (String (*i)));
}
// Custom direct mapping.
@@ -244,7 +242,7 @@ namespace CXX
for (Containers::Vector<NarrowString>::ConstIterator
i (ir.begin ()), e (ir.end ()); i != e; ++i)
{
- include_mapping_.push_back (Regex (*i));
+ include_mapping_.push_back (Regex (String (*i)));
}
// Reserved names.
@@ -345,12 +343,12 @@ namespace CXX
e != nsr_mapping.rend (); ++e)
{
if (trace_namespace_regex)
- wcerr << "try: '" << e->pattern () << "' : ";
+ wcerr << "try: '" << e->regex () << "' : ";
if (e->match (pair))
{
- tmp = e->merge (pair);
- tmp = colon.merge (tmp); // replace `/' with `::'
+ tmp = e->replace (pair);
+ tmp = colon.replace (tmp); // replace `/' with `::'
// Check the result.
//
@@ -381,7 +379,7 @@ namespace CXX
}
else
{
- tmp = colon.merge (n); // replace `/' with `::'
+ tmp = colon.replace (n); // replace `/' with `::'
if (!cxx_id_expr.match (tmp))
{
@@ -390,8 +388,8 @@ namespace CXX
if (urn_mapping.match (n))
{
Regex filter (L"#[.:-]#_#");
- tmp = urn_mapping.merge (n);
- tmp = filter.merge (tmp);
+ tmp = urn_mapping.replace (n);
+ tmp = filter.replace (tmp);
if (!cxx_id_expr.match (tmp))
throw NoNamespaceMapping (
@@ -1120,11 +1118,11 @@ namespace CXX
e != include_mapping.rend (); ++e)
{
if (trace_include_regex)
- wcerr << "try: '" << e->pattern () << "' : ";
+ wcerr << "try: '" << e->regex () << "' : ";
if (e->match (path))
{
- r = e->merge (path);
+ r = e->replace (path);
found = true;
if (trace_include_regex)
diff --git a/xsde/cxx/elements.hxx b/xsde/cxx/elements.hxx
index 2816fea..02b72eb 100644
--- a/xsde/cxx/elements.hxx
+++ b/xsde/cxx/elements.hxx
@@ -6,13 +6,13 @@
#ifndef CXX_ELEMENTS_HXX
#define CXX_ELEMENTS_HXX
+#include <cutl/re.hxx>
+
#include <cult/types.hxx>
#include <cult/containers/map.hxx>
#include <cult/containers/set.hxx>
#include <cult/containers/vector.hxx>
-#include <backend-elements/regex.hxx>
-
#include <xsd-frontend/semantic-graph.hxx>
#include <xsd-frontend/traversal.hxx>
@@ -135,8 +135,8 @@ namespace CXX
class Context
{
public:
- typedef BackendElements::Regex::Pattern<WideChar> RegexPat;
- typedef BackendElements::Regex::Expression<WideChar> Regex;
+ typedef cutl::re::wregex RegexPat;
+ typedef cutl::re::wregexsub Regex;
typedef Cult::Containers::Vector<Regex> RegexMapping;
typedef Cult::Containers::Map<String, String> MapMapping;
typedef Cult::Containers::Map<String, String> MappingCache;
diff --git a/xsde/cxx/hybrid/aggregate-include.hxx b/xsde/cxx/hybrid/aggregate-include.hxx
index 5567244..03a5198 100644
--- a/xsde/cxx/hybrid/aggregate-include.hxx
+++ b/xsde/cxx/hybrid/aggregate-include.hxx
@@ -166,7 +166,7 @@ namespace CXX
path_str = path.native_file_string ();
}
- String inc_path (hxx_expr->merge (path_str));
+ String inc_path (hxx_expr->replace (path_str));
os << "#include " << process_include_path (inc_path) << endl
<< endl;
}
diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx
index e94d10f..337e15f 100644
--- a/xsde/cxx/hybrid/elements.cxx
+++ b/xsde/cxx/hybrid/elements.cxx
@@ -630,26 +630,26 @@ namespace CXX
{
case forward:
{
- inc_path = (regex_ ? regex_ : ctx_.fwd_expr)->merge (path_str);
+ inc_path = (regex_ ? regex_ : ctx_.fwd_expr)->replace (path_str);
break;
}
case header:
case impl_header:
case source:
{
- inc_path = (regex_ ? regex_ : ctx_.hxx_expr)->merge (path_str);
+ inc_path = (regex_ ? regex_ : ctx_.hxx_expr)->replace (path_str);
break;
}
case inline_:
{
if (weak)
{
- inc_path = (regex_ ? regex_ : ctx_.hxx_expr)->merge (path_str);
+ inc_path = (regex_ ? regex_ : ctx_.hxx_expr)->replace (path_str);
ctx_.os << "#include " << ctx_.process_include_path (inc_path)
<< endl;
}
- inc_path = (regex_ ? regex_ : ctx_.ixx_expr)->merge (path_str);
+ inc_path = (regex_ ? regex_ : ctx_.ixx_expr)->replace (path_str);
break;
}
}
diff --git a/xsde/cxx/hybrid/elements.hxx b/xsde/cxx/hybrid/elements.hxx
index 804d178..45fe671 100644
--- a/xsde/cxx/hybrid/elements.hxx
+++ b/xsde/cxx/hybrid/elements.hxx
@@ -8,9 +8,9 @@
#include <sstream>
-#include <cult/containers/deque.hxx>
+#include <cutl/re.hxx>
-#include <backend-elements/regex.hxx>
+#include <cult/containers/deque.hxx>
#include <cxx/elements.hxx>
@@ -20,7 +20,7 @@ namespace CXX
{
namespace Hybrid
{
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
//
//
diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx
index e71d36a..4db77ea 100644
--- a/xsde/cxx/hybrid/generator.cxx
+++ b/xsde/cxx/hybrid/generator.cxx
@@ -8,6 +8,8 @@
#include <boost/filesystem/fstream.hpp>
+#include <cutl/re.hxx>
+
#include <cult/containers/set.hxx>
#include <cult/containers/vector.hxx>
@@ -15,7 +17,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/regex.hxx>
#include <backend-elements/indentation/clip.hxx>
#include <xsd-frontend/semantic-graph.hxx>
@@ -1356,7 +1357,7 @@ namespace CXX
if (!hxx_expr.match (name))
{
wcerr << "error: header expression '" <<
- hxx_expr.pattern () << "' does not match '" <<
+ hxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -1364,7 +1365,7 @@ namespace CXX
if (inline_ && !ixx_expr.match (name))
{
wcerr << "error: inline expression '" <<
- ixx_expr.pattern () << "' does not match '" <<
+ ixx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -1372,7 +1373,7 @@ namespace CXX
if (source && !cxx_expr.match (name))
{
wcerr << "error: source expression '" <<
- cxx_expr.pattern () << "' does not match '" <<
+ cxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -1380,15 +1381,15 @@ namespace CXX
if (forward && !fwd_expr.match (name))
{
wcerr << "error: forward expression '" <<
- fwd_expr.pattern () << "' does not match '" <<
+ fwd_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
- NarrowString hxx_name (hxx_expr.merge (name));
- NarrowString ixx_name (inline_ ? ixx_expr.merge (name) : NarrowString ());
- NarrowString cxx_name (source ? cxx_expr.merge (name) : NarrowString ());
- NarrowString fwd_name (forward ? fwd_expr.merge (name) : NarrowString ());
+ NarrowString hxx_name (hxx_expr.replace (name));
+ NarrowString ixx_name (inline_ ? ixx_expr.replace (name) : NarrowString ());
+ NarrowString cxx_name (source ? cxx_expr.replace (name) : NarrowString ());
+ NarrowString fwd_name (forward ? fwd_expr.replace (name) : NarrowString ());
Path hxx_path (hxx_name, boost::filesystem::native);
Path ixx_path (ixx_name, boost::filesystem::native);
@@ -1557,7 +1558,7 @@ namespace CXX
sloc_filter sloc (fwd);
- String guard (guard_expr.merge (guard_prefix + fwd_name));
+ String guard (guard_expr.replace (guard_prefix + fwd_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -1641,7 +1642,7 @@ namespace CXX
sloc_filter sloc (hxx);
- String guard (guard_expr.merge (guard_prefix + hxx_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -1854,7 +1855,7 @@ namespace CXX
// Guard
//
- String guard (guard_expr.merge (guard_prefix + ixx_name));
+ String guard (guard_expr.replace (guard_prefix + ixx_name));
guard = ctx.escape (guard); // make a c++ id
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -2037,18 +2038,18 @@ namespace CXX
throw Failed ();
}
- catch (BackendElements::Regex::Format<Char> const& e)
+ catch (cutl::re::format const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression ().c_str () << "': " <<
+ e.regex ().c_str () << "': " <<
e.description ().c_str () << endl;
throw Failed ();
}
- catch (BackendElements::Regex::Format<WideChar> const& e)
+ catch (cutl::re::wformat const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description ().c_str () << endl;
throw Failed ();
}
@@ -2064,7 +2065,7 @@ namespace CXX
AutoUnlinks& unlinks)
{
using std::ios_base;
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
try
{
@@ -2145,7 +2146,7 @@ namespace CXX
if (!hxx_expr.match (name))
{
wcerr << "error: parser implementation header expression '" <<
- hxx_expr.pattern () << "' does not match '" <<
+ hxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -2153,14 +2154,14 @@ namespace CXX
if (!cxx_expr.match (name))
{
wcerr << "error: parser implementation source expression '" <<
- cxx_expr.pattern () << "' does not match '" <<
+ cxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
- NarrowString hxx_skel_name (hxx_skel_expr.merge (name));
- NarrowString hxx_name (hxx_expr.merge (name));
- NarrowString cxx_name (cxx_expr.merge (name));
+ NarrowString hxx_skel_name (hxx_skel_expr.replace (name));
+ NarrowString hxx_name (hxx_expr.replace (name));
+ NarrowString cxx_name (cxx_expr.replace (name));
Path hxx_path (hxx_name, boost::filesystem::native);
Path cxx_path (cxx_name, boost::filesystem::native);
@@ -2277,7 +2278,7 @@ namespace CXX
sloc_filter sloc (hxx);
- String guard (guard_expr.merge (guard_prefix + hxx_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -2452,18 +2453,18 @@ namespace CXX
throw Failed ();
}
- catch (BackendElements::Regex::Format<Char> const& e)
+ catch (cutl::re::format const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression ().c_str () << "': " <<
+ e.regex ().c_str () << "': " <<
e.description ().c_str () << endl;
throw Failed ();
}
- catch (BackendElements::Regex::Format<WideChar> const& e)
+ catch (cutl::re::wformat const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description ().c_str () << endl;
throw Failed ();
}
@@ -2479,7 +2480,7 @@ namespace CXX
AutoUnlinks& unlinks)
{
using std::ios_base;
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
try
{
@@ -2559,7 +2560,7 @@ namespace CXX
if (!hxx_expr.match (name))
{
wcerr << "error: serializer implementation header expression '" <<
- hxx_expr.pattern () << "' does not match '" <<
+ hxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -2567,14 +2568,14 @@ namespace CXX
if (!cxx_expr.match (name))
{
wcerr << "error: serializer implementation source expression '" <<
- cxx_expr.pattern () << "' does not match '" <<
+ cxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
- NarrowString hxx_skel_name (hxx_skel_expr.merge (name));
- NarrowString hxx_name (hxx_expr.merge (name));
- NarrowString cxx_name (cxx_expr.merge (name));
+ NarrowString hxx_skel_name (hxx_skel_expr.replace (name));
+ NarrowString hxx_name (hxx_expr.replace (name));
+ NarrowString cxx_name (cxx_expr.replace (name));
Path hxx_path (hxx_name, boost::filesystem::native);
Path cxx_path (cxx_name, boost::filesystem::native);
@@ -2691,7 +2692,7 @@ namespace CXX
sloc_filter sloc (hxx);
- String guard (guard_expr.merge (guard_prefix + hxx_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -2874,18 +2875,18 @@ namespace CXX
throw Failed ();
}
- catch (BackendElements::Regex::Format<Char> const& e)
+ catch (cutl::re::format const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression ().c_str () << "': " <<
+ e.regex ().c_str () << "': " <<
e.description ().c_str () << endl;
throw Failed ();
}
- catch (BackendElements::Regex::Format<WideChar> const& e)
+ catch (cutl::re::wformat const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description ().c_str () << endl;
throw Failed ();
}
diff --git a/xsde/cxx/hybrid/tree-forward.cxx b/xsde/cxx/hybrid/tree-forward.cxx
index 08d7fac..b220847 100644
--- a/xsde/cxx/hybrid/tree-forward.cxx
+++ b/xsde/cxx/hybrid/tree-forward.cxx
@@ -730,7 +730,7 @@ namespace CXX
//
if (!generate_xml_schema && xml_schema)
{
- String name (ctx.hxx_expr->merge (xml_schema));
+ String name (ctx.hxx_expr->replace (xml_schema));
ctx.os << "#include " << ctx.process_include_path (name) << endl
<< endl;
diff --git a/xsde/cxx/parser/elements.cxx b/xsde/cxx/parser/elements.cxx
index 1e58262..bd5b09a 100644
--- a/xsde/cxx/parser/elements.cxx
+++ b/xsde/cxx/parser/elements.cxx
@@ -305,12 +305,12 @@ namespace CXX
case header:
case source:
{
- inc_path = ctx_.hxx_expr->merge (path_str);
+ inc_path = ctx_.hxx_expr->replace (path_str);
break;
}
case impl_header:
{
- inc_path = ctx_.hxx_impl_expr->merge (path_str);
+ inc_path = ctx_.hxx_impl_expr->replace (path_str);
break;
}
}
diff --git a/xsde/cxx/parser/elements.hxx b/xsde/cxx/parser/elements.hxx
index 020e51b..6ce5593 100644
--- a/xsde/cxx/parser/elements.hxx
+++ b/xsde/cxx/parser/elements.hxx
@@ -8,7 +8,7 @@
#include <sstream>
-#include <backend-elements/regex.hxx>
+#include <cutl/re.hxx>
#include <cxx/elements.hxx>
@@ -33,7 +33,7 @@ namespace CXX
class Context: public CXX::Context
{
public:
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
public:
Context (std::wostream&,
diff --git a/xsde/cxx/parser/generator.cxx b/xsde/cxx/parser/generator.cxx
index 22e1669..6c8f8c7 100644
--- a/xsde/cxx/parser/generator.cxx
+++ b/xsde/cxx/parser/generator.cxx
@@ -7,6 +7,8 @@
#include <boost/filesystem/fstream.hpp>
+#include <cutl/re.hxx>
+
#include <cult/containers/set.hxx>
#include <cult/containers/vector.hxx>
@@ -14,7 +16,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/regex.hxx>
#include <backend-elements/indentation/clip.hxx>
#include <xsd-frontend/semantic-graph.hxx>
@@ -632,7 +633,7 @@ namespace CXX
using std::ios_base;
namespace Indentation = BackendElements::Indentation;
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
try
{
@@ -885,7 +886,7 @@ namespace CXX
if (!hxx_expr.match (name))
{
wcerr << "error: header expression '" <<
- hxx_expr.pattern () << "' does not match '" <<
+ hxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -893,7 +894,7 @@ namespace CXX
if (inline_ && !ixx_expr.match (name))
{
wcerr << "error: inline expression '" <<
- ixx_expr.pattern () << "' does not match '" <<
+ ixx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -901,7 +902,7 @@ namespace CXX
if (source && !cxx_expr.match (name))
{
wcerr << "error: source expression '" <<
- cxx_expr.pattern () << "' does not match '" <<
+ cxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -911,7 +912,7 @@ namespace CXX
if (!hxx_impl_expr.match (name))
{
wcerr << "error: implementation header expression '" <<
- hxx_impl_expr.pattern () << "' does not match '" <<
+ hxx_impl_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -919,7 +920,7 @@ namespace CXX
if (!cxx_impl_expr.match (name))
{
wcerr << "error: implementation source expression '" <<
- cxx_impl_expr.pattern () << "' does not match '" <<
+ cxx_impl_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -927,15 +928,15 @@ namespace CXX
if (!cxx_driver_expr.match (name))
{
wcerr << "error: driver source expression '" <<
- cxx_driver_expr.pattern () << "' does not match '" <<
+ cxx_driver_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
}
- NarrowString hxx_name (hxx_expr.merge (name));
- NarrowString ixx_name (inline_ ? ixx_expr.merge (name) : NarrowString ());
- NarrowString cxx_name (source ? cxx_expr.merge (name) : NarrowString ());
+ NarrowString hxx_name (hxx_expr.replace (name));
+ NarrowString ixx_name (inline_ ? ixx_expr.replace (name) : NarrowString ());
+ NarrowString cxx_name (source ? cxx_expr.replace (name) : NarrowString ());
NarrowString hxx_impl_name;
NarrowString cxx_impl_name;
@@ -943,9 +944,9 @@ namespace CXX
if (impl || driver)
{
- hxx_impl_name = hxx_impl_expr.merge (name);
- cxx_impl_name = cxx_impl_expr.merge (name);
- cxx_driver_name = cxx_driver_expr.merge (name);
+ hxx_impl_name = hxx_impl_expr.replace (name);
+ cxx_impl_name = cxx_impl_expr.replace (name);
+ cxx_driver_name = cxx_driver_expr.replace (name);
}
Path hxx_path (hxx_name, boost::filesystem::native);
@@ -1215,7 +1216,7 @@ namespace CXX
sloc_filter sloc (hxx);
- String guard (guard_expr.merge (guard_prefix + hxx_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -1595,7 +1596,7 @@ namespace CXX
Context ctx (hxx_impl, schema, file_path, ops,
&hxx_expr, &ixx_expr, &hxx_impl_expr);
- String guard (guard_expr.merge (guard_prefix + hxx_impl_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_impl_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -1675,18 +1676,18 @@ namespace CXX
throw Failed ();
}
- catch (BackendElements::Regex::Format<Char> const& e)
+ catch (cutl::re::format const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression ().c_str () << "': " <<
+ e.regex ().c_str () << "': " <<
e.description ().c_str () << endl;
throw Failed ();
}
- catch (BackendElements::Regex::Format<WideChar> const& e)
+ catch (cutl::re::wformat const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description ().c_str () << endl;
throw Failed ();
}
diff --git a/xsde/cxx/parser/parser-header.cxx b/xsde/cxx/parser/parser-header.cxx
index 238b5e6..2cdc297 100644
--- a/xsde/cxx/parser/parser-header.cxx
+++ b/xsde/cxx/parser/parser-header.cxx
@@ -1750,7 +1750,7 @@ namespace CXX
if (extern_xml_schema)
{
- String name (ctx.hxx_expr->merge (extern_xml_schema));
+ String name (ctx.hxx_expr->replace (extern_xml_schema));
ctx.os << "#include " << ctx.process_include_path (name) << endl
<< endl;
diff --git a/xsde/cxx/parser/type-processor.cxx b/xsde/cxx/parser/type-processor.cxx
index 8605241..3e0abbe 100644
--- a/xsde/cxx/parser/type-processor.cxx
+++ b/xsde/cxx/parser/type-processor.cxx
@@ -105,8 +105,8 @@ namespace CXX
{
if (!n->xsd_name ().empty ())
{
- cxx_ns = n->xsd_name ().merge (
- n->cxx_name (), ns_name, true);
+ cxx_ns = n->xsd_name ().replace (
+ ns_name, n->cxx_name (), true);
}
else
cxx_ns = n->cxx_name ();
@@ -118,16 +118,16 @@ namespace CXX
//
String ret_type (cxx_ns);
- ret_type += t->xsd_name ().merge (
- t->cxx_ret_name (), t_name, true);
+ ret_type += t->xsd_name ().replace (
+ t_name, t->cxx_ret_name (), true);
String arg_type;
if (t->cxx_arg_name ())
{
arg_type = cxx_ns;
- arg_type += t->xsd_name ().merge (
- t->cxx_arg_name (), t_name, true);
+ arg_type += t->xsd_name ().replace (
+ t_name, t->cxx_arg_name (), true);
}
else
{
diff --git a/xsde/cxx/serializer/elements.cxx b/xsde/cxx/serializer/elements.cxx
index 76947ea..7802e5d 100644
--- a/xsde/cxx/serializer/elements.cxx
+++ b/xsde/cxx/serializer/elements.cxx
@@ -328,12 +328,12 @@ namespace CXX
case header:
case source:
{
- inc_path = ctx_.hxx_expr->merge (path_str);
+ inc_path = ctx_.hxx_expr->replace (path_str);
break;
}
case impl_header:
{
- inc_path = ctx_.hxx_impl_expr->merge (path_str);
+ inc_path = ctx_.hxx_impl_expr->replace (path_str);
break;
}
}
diff --git a/xsde/cxx/serializer/elements.hxx b/xsde/cxx/serializer/elements.hxx
index b61aa83..ada9371 100644
--- a/xsde/cxx/serializer/elements.hxx
+++ b/xsde/cxx/serializer/elements.hxx
@@ -8,7 +8,7 @@
#include <sstream>
-#include <backend-elements/regex.hxx>
+#include <cutl/re.hxx>
#include <cxx/elements.hxx>
@@ -33,7 +33,7 @@ namespace CXX
class Context: public CXX::Context
{
public:
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
public:
Context (std::wostream&,
diff --git a/xsde/cxx/serializer/generator.cxx b/xsde/cxx/serializer/generator.cxx
index 4b31497..167dae5 100644
--- a/xsde/cxx/serializer/generator.cxx
+++ b/xsde/cxx/serializer/generator.cxx
@@ -7,6 +7,8 @@
#include <boost/filesystem/fstream.hpp>
+#include <cutl/re.hxx>
+
#include <cult/containers/set.hxx>
#include <cult/containers/vector.hxx>
@@ -14,7 +16,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/regex.hxx>
#include <backend-elements/indentation/clip.hxx>
#include <xsd-frontend/semantic-graph.hxx>
@@ -625,7 +626,7 @@ namespace CXX
using std::ios_base;
namespace Indentation = BackendElements::Indentation;
- typedef BackendElements::Regex::Expression<Char> Regex;
+ typedef cutl::re::regexsub Regex;
try
{
@@ -871,7 +872,7 @@ namespace CXX
if (!hxx_expr.match (name))
{
wcerr << "error: header expression '" <<
- hxx_expr.pattern () << "' does not match '" <<
+ hxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -879,7 +880,7 @@ namespace CXX
if (inline_ && !ixx_expr.match (name))
{
wcerr << "error: inline expression '" <<
- ixx_expr.pattern () << "' does not match '" <<
+ ixx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -887,7 +888,7 @@ namespace CXX
if (source && !cxx_expr.match (name))
{
wcerr << "error: source expression '" <<
- cxx_expr.pattern () << "' does not match '" <<
+ cxx_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -897,7 +898,7 @@ namespace CXX
if (!hxx_impl_expr.match (name))
{
wcerr << "error: implementation header expression '" <<
- hxx_impl_expr.pattern () << "' does not match '" <<
+ hxx_impl_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -905,7 +906,7 @@ namespace CXX
if (!cxx_impl_expr.match (name))
{
wcerr << "error: implementation source expression '" <<
- cxx_impl_expr.pattern () << "' does not match '" <<
+ cxx_impl_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
@@ -913,15 +914,15 @@ namespace CXX
if (!cxx_driver_expr.match (name))
{
wcerr << "error: driver source expression '" <<
- cxx_driver_expr.pattern () << "' does not match '" <<
+ cxx_driver_expr.regex ().str ().c_str () << "' does not match '" <<
name.c_str () << "'" << endl;
throw Failed ();
}
}
- NarrowString hxx_name (hxx_expr.merge (name));
- NarrowString ixx_name (inline_ ? ixx_expr.merge (name) : NarrowString ());
- NarrowString cxx_name (source ? cxx_expr.merge (name) : NarrowString ());
+ NarrowString hxx_name (hxx_expr.replace (name));
+ NarrowString ixx_name (inline_ ? ixx_expr.replace (name) : NarrowString ());
+ NarrowString cxx_name (source ? cxx_expr.replace (name) : NarrowString ());
NarrowString hxx_impl_name;
NarrowString cxx_impl_name;
@@ -929,9 +930,9 @@ namespace CXX
if (impl || driver)
{
- hxx_impl_name = hxx_impl_expr.merge (name);
- cxx_impl_name = cxx_impl_expr.merge (name);
- cxx_driver_name = cxx_driver_expr.merge (name);
+ hxx_impl_name = hxx_impl_expr.replace (name);
+ cxx_impl_name = cxx_impl_expr.replace (name);
+ cxx_driver_name = cxx_driver_expr.replace (name);
}
Path hxx_path (hxx_name, boost::filesystem::native);
@@ -1202,7 +1203,7 @@ namespace CXX
sloc_filter sloc (hxx);
- String guard (guard_expr.merge (guard_prefix + hxx_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -1582,7 +1583,7 @@ namespace CXX
Context ctx (hxx_impl, schema, file_path, ops,
&hxx_expr, &ixx_expr, &hxx_impl_expr);
- String guard (guard_expr.merge (guard_prefix + hxx_impl_name));
+ String guard (guard_expr.replace (guard_prefix + hxx_impl_name));
guard = ctx.escape (guard); // Make it a C++ id.
std::transform (guard.begin (), guard.end(), guard.begin (), upcase);
@@ -1662,18 +1663,18 @@ namespace CXX
throw Failed ();
}
- catch (BackendElements::Regex::Format<Char> const& e)
+ catch (cutl::re::format const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression ().c_str () << "': " <<
+ e.regex ().c_str () << "': " <<
e.description ().c_str () << endl;
throw Failed ();
}
- catch (BackendElements::Regex::Format<WideChar> const& e)
+ catch (cutl::re::wformat const& e)
{
wcerr << "error: invalid regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description ().c_str () << endl;
throw Failed ();
}
diff --git a/xsde/cxx/serializer/serializer-header.cxx b/xsde/cxx/serializer/serializer-header.cxx
index ea07ca5..939a052 100644
--- a/xsde/cxx/serializer/serializer-header.cxx
+++ b/xsde/cxx/serializer/serializer-header.cxx
@@ -1906,7 +1906,7 @@ namespace CXX
if (extern_xml_schema)
{
- String name (ctx.hxx_expr->merge (extern_xml_schema));
+ String name (ctx.hxx_expr->replace (extern_xml_schema));
ctx.os << "#include " << ctx.process_include_path (name) << endl
<< endl;
diff --git a/xsde/cxx/serializer/type-processor.cxx b/xsde/cxx/serializer/type-processor.cxx
index a07ff31..3c3a025 100644
--- a/xsde/cxx/serializer/type-processor.cxx
+++ b/xsde/cxx/serializer/type-processor.cxx
@@ -74,11 +74,6 @@ namespace CXX
{
// Check if the namespace matches.
//
- //@@ Should probably store precompiled regex somewhere
- // instead of doing it every time.
- //
- boost::basic_regex<WideChar> ns_expr;
-
Boolean ns_match;
if (!n->xsd_name ().empty ())
@@ -110,8 +105,8 @@ namespace CXX
{
if (!n->xsd_name ().empty ())
{
- cxx_ns = n->xsd_name ().merge (
- n->cxx_name (), ns_name, true);
+ cxx_ns = n->xsd_name ().replace (
+ ns_name, n->cxx_name (), true);
}
else
cxx_ns = n->cxx_name ();
@@ -123,16 +118,16 @@ namespace CXX
//
String ret_type (cxx_ns);
- ret_type += t->xsd_name ().merge (
- t->cxx_ret_name (), t_name, true);
+ ret_type += t->xsd_name ().replace (
+ t_name, t->cxx_ret_name (), true);
String arg_type;
if (t->cxx_arg_name ())
{
arg_type = cxx_ns;
- arg_type += t->xsd_name ().merge (
- t->cxx_arg_name (), t_name, true);
+ arg_type += t->xsd_name ().replace (
+ t_name, t->cxx_arg_name (), true);
}
else
{
diff --git a/xsde/makefile b/xsde/makefile
index eaa97ff..e4ab12b 100644
--- a/xsde/makefile
+++ b/xsde/makefile
@@ -112,10 +112,6 @@ $(call import,\
l: be.l,cpp-options: be.l.cpp-options)
$(call import,\
- $(scf_root)/import/libboost/regex/stub.make,\
- l: re.l,cpp-options: re.l.cpp-options)
-
-$(call import,\
$(scf_root)/import/libboost/filesystem/stub.make,\
l: fs.l,cpp-options: fs.l.cpp-options)
@@ -125,7 +121,7 @@ $(call import,\
# Build.
#
-$(xsde): $(cxx_obj) $(xsd_fe.l) $(be.l) $(cult.l) $(cutl.l) $(fs.l) $(re.l)
+$(xsde): $(cxx_obj) $(xsd_fe.l) $(be.l) $(cult.l) $(cutl.l) $(fs.l)
$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base)
$(cxx_obj) $(cxx_od): \
@@ -133,8 +129,7 @@ $(cxx_obj) $(cxx_od): \
$(be.l.cpp-options) \
$(cult.l.cpp-options) \
$(cutl.l.cpp-options) \
- $(fs.l.cpp-options) \
- $(re.l.cpp-options)
+ $(fs.l.cpp-options)
$(call include-dep,$(cxx_od))
diff --git a/xsde/type-map/parser.cxx b/xsde/type-map/parser.cxx
index 929c3d3..16bb7ec 100644
--- a/xsde/type-map/parser.cxx
+++ b/xsde/type-map/parser.cxx
@@ -5,7 +5,7 @@
#include <iostream>
-#include <backend-elements/regex.hxx>
+#include <cutl/re.hxx>
#include <type-map/parser.hxx>
@@ -14,7 +14,7 @@ using std::endl;
namespace TypeMap
{
typedef Lexer::Token Token;
- typedef BackendElements::Regex::Format<WideChar> Format;
+ typedef cutl::re::wformat Format;
Parser::Parser (Lexer& lex, String const& path)
: lex_ (lex), path_ (path), e (std::wcerr)
@@ -99,7 +99,7 @@ namespace TypeMap
catch (Format const& ex)
{
e << path_ << ":" << t.line () << ": invalid namespace pattern: "
- << ex.description () << endl;
+ << ex.description ().c_str () << endl;
return false;
}
@@ -234,7 +234,7 @@ namespace TypeMap
catch (Format const& ex)
{
e << path_ << ":" << t.line () << ": invalid namespace pattern: "
- << ex.description () << endl;
+ << ex.description ().c_str () << endl;
return false;
}
diff --git a/xsde/type-map/type-map.hxx b/xsde/type-map/type-map.hxx
index 459b64a..3218c5e 100644
--- a/xsde/type-map/type-map.hxx
+++ b/xsde/type-map/type-map.hxx
@@ -6,20 +6,29 @@
#ifndef XSDE_TYPE_MAP_TYPE_MAP_HXX
#define XSDE_TYPE_MAP_TYPE_MAP_HXX
+#include <cutl/re.hxx>
+
#include <cult/types.hxx>
#include <cult/containers/vector.hxx>
-#include <backend-elements/regex.hxx>
-
namespace TypeMap
{
using namespace Cult::Types;
typedef WideString String;
- typedef BackendElements::Regex::Pattern<WideChar> Pattern;
+ typedef cutl::re::wregex Pattern;
class Type
{
public:
+ Type (String const& xsd_name,
+ String const& cxx_ret_name,
+ String const& cxx_arg_name)
+ : xsd_name_ (xsd_name),
+ cxx_ret_name_ (cxx_ret_name),
+ cxx_arg_name_ (cxx_arg_name)
+ {
+ }
+
Type (Pattern const& xsd_name,
String const& cxx_ret_name,
String const& cxx_arg_name)
@@ -56,6 +65,11 @@ namespace TypeMap
class Namespace
{
public:
+ Namespace (String const& xsd_name)
+ : xsd_name_ (xsd_name), has_cxx_name_ (false)
+ {
+ }
+
Namespace (Pattern const& xsd_name)
: xsd_name_ (xsd_name), has_cxx_name_ (false)
{
@@ -116,6 +130,14 @@ namespace TypeMap
}
Void
+ types_push_back (String const& xsd_type,
+ String const& cxx_ret_type,
+ String const& cxx_arg_type = L"")
+ {
+ types_.push_back (Type (xsd_type, cxx_ret_type, cxx_arg_type));
+ }
+
+ Void
types_push_back (Pattern const& xsd_type,
String const& cxx_ret_type,
String const& cxx_arg_type = L"")
@@ -157,4 +179,3 @@ namespace TypeMap
}
#endif // XSDE_TYPE_MAP_TYPE_MAP_HXX
-
diff --git a/xsde/xsde.cxx b/xsde/xsde.cxx
index 134d6d9..1220da9 100644
--- a/xsde/xsde.cxx
+++ b/xsde/xsde.cxx
@@ -4,8 +4,11 @@
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#include <iostream>
+
#include <boost/filesystem/fstream.hpp>
+#include <cutl/re.hxx>
+
#include <cult/types.hxx>
#include <cult/trace/log.hxx>
@@ -30,7 +33,6 @@
#include <usage.hxx>
#include <type-map/type-map.hxx>
-#include <backend-elements/regex.hxx>
#include <backend-elements/indentation/clip.hxx>
#include <cxx/parser/generator.hxx>
@@ -138,8 +140,8 @@ struct LocationTranslator: XSDFrontend::LocationTranslator
private:
typedef Cult::Containers::Map<NarrowString, NarrowString> Map;
- typedef BackendElements::Regex::Expression<Char> Regex;
- typedef BackendElements::Regex::Format<Char> RegexFormat;
+ typedef cutl::re::regexsub Regex;
+ typedef cutl::re::format RegexFormat;
typedef Cult::Containers::Vector<Regex> RegexVector;
typedef Cult::Containers::Map<NarrowString, NarrowString> Cache;
@@ -165,8 +167,8 @@ struct AnonymousNameTranslator: Transformations::AnonymousNameTranslator
WideString const& xpath);
private:
- typedef BackendElements::Regex::Expression<WideChar> Regex;
- typedef BackendElements::Regex::Format<WideChar> RegexFormat;
+ typedef cutl::re::wregexsub Regex;
+ typedef cutl::re::wformat RegexFormat;
typedef Cult::Containers::Vector<Regex> RegexVector;
RegexVector regex_;
@@ -192,15 +194,15 @@ struct SchemaPerTypeTranslator: Transformations::SchemaPerTypeTranslator
translate_schema (NarrowString const& file);
private:
- typedef BackendElements::Regex::Expression<WideChar> TypeRegex;
- typedef BackendElements::Regex::Format<WideChar> TypeRegexFormat;
+ typedef cutl::re::wregexsub TypeRegex;
+ typedef cutl::re::wformat TypeRegexFormat;
typedef Cult::Containers::Vector<TypeRegex> TypeRegexVector;
TypeRegexVector type_regex_;
Boolean type_trace_;
- typedef BackendElements::Regex::Expression<Char> SchemaRegex;
- typedef BackendElements::Regex::Format<Char> SchemaRegexFormat;
+ typedef cutl::re::regexsub SchemaRegex;
+ typedef cutl::re::format SchemaRegexFormat;
typedef Cult::Containers::Vector<SchemaRegex> SchemaRegexVector;
SchemaRegexVector schema_regex_;
@@ -1487,7 +1489,7 @@ LocationTranslator (NarrowStrings const& map,
catch (RegexFormat const& e)
{
wcerr << "error: invalid location regex: '" <<
- e.expression ().c_str () << "': " <<
+ e.regex ().c_str () << "': " <<
e.description ().c_str () << endl;
throw Failed ();
@@ -1524,11 +1526,11 @@ translate (NarrowString const& l)
i != regex_.rend (); ++i)
{
if (trace_)
- wcerr << "try: '" << i->pattern () << "' : ";
+ wcerr << "try: '" << i->regex ().str ().c_str () << "' : ";
if (i->match (l))
{
- NarrowString r (i->merge (l));
+ NarrowString r (i->replace (l));
if (trace_)
wcerr << "'" << r.c_str () << "' : +" << endl;
@@ -1558,12 +1560,12 @@ AnonymousNameTranslator (NarrowStrings const& regex, Boolean trace)
{
try
{
- regex_.push_back (Regex (*i));
+ regex_.push_back (Regex (WideString (*i)));
}
catch (RegexFormat const& e)
{
wcerr << "error: invalid anonymous type regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description () << endl;
throw Failed ();
}
@@ -1585,11 +1587,11 @@ translate (WideString const& file,
i != regex_.rend (); ++i)
{
if (trace_)
- wcerr << "try: '" << i->pattern () << "' : ";
+ wcerr << "try: '" << i->regex () << "' : ";
if (i->match (s))
{
- WideString r (i->merge (s));
+ WideString r (i->replace (s));
if (trace_)
wcerr << "'" << r << "' : +" << endl;
@@ -1621,12 +1623,12 @@ SchemaPerTypeTranslator (NarrowStrings const& type_regex,
{
try
{
- type_regex_.push_back (TypeRegex (*i));
+ type_regex_.push_back (TypeRegex (WideString (*i)));
}
catch (TypeRegexFormat const& e)
{
wcerr << "error: invalid type file regex: '" <<
- e.expression () << "': " << e.description () << endl;
+ e.regex () << "': " << e.description () << endl;
throw Failed ();
}
@@ -1642,7 +1644,7 @@ SchemaPerTypeTranslator (NarrowStrings const& type_regex,
catch (SchemaRegexFormat const& e)
{
wcerr << "error: invalid type file regex: '" <<
- e.expression ().c_str () << "': " << e.description ().c_str () << endl;
+ e.regex ().c_str () << "': " << e.description ().c_str () << endl;
throw Failed ();
}
@@ -1661,11 +1663,11 @@ translate_type (WideString const& ns, WideString const& name)
i != type_regex_.rend (); ++i)
{
if (type_trace_)
- wcerr << "try: '" << i->pattern () << "' : ";
+ wcerr << "try: '" << i->regex () << "' : ";
if (i->match (s))
{
- WideString r (i->merge (s));
+ WideString r (i->replace (s));
if (type_trace_)
wcerr << "'" << r << "' : +" << endl;
@@ -1692,11 +1694,11 @@ translate_schema (NarrowString const& file)
i != schema_regex_.rend (); ++i)
{
if (schema_trace_)
- wcerr << "try: '" << i->pattern () << "' : ";
+ wcerr << "try: '" << i->regex ().str ().c_str () << "' : ";
if (i->match (file))
{
- NarrowString r (i->merge (file));
+ NarrowString r (i->replace (file));
if (schema_trace_)
wcerr << "'" << r.c_str () << "' : +" << endl;