aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-11 17:18:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-11 17:18:30 +0200
commit49d8e39f9a42ff1963c5df0f6e9ed903d66f2eb0 (patch)
tree17cb3577baa07e30720788e059399f7c07c22a37 /examples
parentbcf2ac66e6c21d75f4e76b8e0bc2e3c6d64886b8 (diff)
Fix recursive polymorphic parsing in C++/Parser
New test: cxx/parser/polyrecur.
Diffstat (limited to 'examples')
-rw-r--r--examples/cxx/hybrid/custom/wildcard/envelope-pimpl.cxx6
-rw-r--r--examples/cxx/hybrid/wildcard/envelope-pimpl.cxx6
-rw-r--r--examples/cxx/parser/wildcard/driver.cxx16
3 files changed, 6 insertions, 22 deletions
diff --git a/examples/cxx/hybrid/custom/wildcard/envelope-pimpl.cxx b/examples/cxx/hybrid/custom/wildcard/envelope-pimpl.cxx
index eee573f..d88edf9 100644
--- a/examples/cxx/hybrid/custom/wildcard/envelope-pimpl.cxx
+++ b/examples/cxx/hybrid/custom/wildcard/envelope-pimpl.cxx
@@ -50,7 +50,7 @@ namespace email
//
xml_schema::parser_context& ctx = _context ();
p->pre ();
- p->_pre_impl (ctx);
+ ctx.nested_parser (p);
}
}
}
@@ -64,10 +64,6 @@ namespace email
{
if (ns == "http://www.codesynthesis.com/email")
{
- // Note that we don't call _post_impl() (corresponding to
- // _pre_impl()) here. It is called automatically by the
- // infrastructure.
- //
envelope* env = envelope_base_pimpl_state_.envelope_;
if (name == "text")
diff --git a/examples/cxx/hybrid/wildcard/envelope-pimpl.cxx b/examples/cxx/hybrid/wildcard/envelope-pimpl.cxx
index 16bd2e5..bb5827c 100644
--- a/examples/cxx/hybrid/wildcard/envelope-pimpl.cxx
+++ b/examples/cxx/hybrid/wildcard/envelope-pimpl.cxx
@@ -61,7 +61,7 @@ namespace email
//
xml_schema::parser_context& ctx = _context ();
p->pre ();
- p->_pre_impl (ctx);
+ ctx.nested_parser (p);
}
}
}
@@ -75,10 +75,6 @@ namespace email
{
if (ns == "http://www.codesynthesis.com/email")
{
- // Note that we don't call _post_impl() (corresponding to
- // _pre_impl()) here. It is called automatically by the
- // infrastructure.
- //
envelope* env = envelope_base_pimpl_state_.envelope_;
if (name == "text")
diff --git a/examples/cxx/parser/wildcard/driver.cxx b/examples/cxx/parser/wildcard/driver.cxx
index aed2560..7ed7aa6 100644
--- a/examples/cxx/parser/wildcard/driver.cxx
+++ b/examples/cxx/parser/wildcard/driver.cxx
@@ -104,7 +104,7 @@ namespace email
#ifndef XSDE_POLYMORPHIC
_start_any_element (const ro_string& ns, const ro_string& name)
#else
- _start_any_element (const ro_string& ns,
+ _start_any_element (const ro_string& ns,
const ro_string& name,
const char*)
#endif
@@ -147,7 +147,9 @@ namespace email
return;
}
#endif
- p->_pre_impl (ctx);
+ // Indicate transition to the nested parser.
+ //
+ ctx.nested_parser (p);
}
}
@@ -167,11 +169,6 @@ namespace email
{
if (name == "text")
{
- // Note that we don't call _post_impl() (corresponding to
- // _pre_impl()) here. It is called automatically by the
- // infrastructure.
- //
-
string text (string_p_.post_string ());
#ifndef XSDE_EXCEPTIONS
@@ -188,11 +185,6 @@ namespace email
}
else if (name == "binary")
{
- // Note that we don't call _post_impl() (corresponding to
- // _pre_impl()) here. It is called automatically by the
- // infrastructure.
- //
-
binary_p_.post_binary ();
#ifndef XSDE_EXCEPTIONS