aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx/parser/recursive/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-27 19:55:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-27 19:55:14 +0200
commit14b909b25dec8e68f7bcb35e89ce503c5f12967c (patch)
treeb6ed37a611d99eb5e3110a4a048e55b4ca447e47 /tests/cxx/parser/recursive/driver.cxx
parent686b15bcd3d9045fdb4679970b0f39466125abf8 (diff)
Reimplement state stack not to move elements
Add another recursive parsing test that forces second allocation in the stack.
Diffstat (limited to 'tests/cxx/parser/recursive/driver.cxx')
-rw-r--r--tests/cxx/parser/recursive/driver.cxx88
1 files changed, 87 insertions, 1 deletions
diff --git a/tests/cxx/parser/recursive/driver.cxx b/tests/cxx/parser/recursive/driver.cxx
index f961d76..bcbbd2e 100644
--- a/tests/cxx/parser/recursive/driver.cxx
+++ b/tests/cxx/parser/recursive/driver.cxx
@@ -91,6 +91,78 @@ struct indir_pimpl: indir_type_pskel
}
};
+struct a_pimpl: a_pskel
+{
+ virtual void
+ pre ()
+ {
+ cout << "a::pre" << endl;
+ }
+
+ virtual void
+ a ()
+ {
+ cout << "a::a" << endl;
+ }
+
+ virtual void
+ b ()
+ {
+ cout << "a::b" << endl;
+ }
+
+#ifdef XSDE_STL
+ virtual void
+ name (string const& n)
+ {
+ cout << "a::name: " << n << endl;
+ }
+#else
+ virtual void
+ name (char* n)
+ {
+ cout << "a::name: " << n << endl;
+ delete[] n;
+ }
+#endif
+
+ virtual void
+ post_a ()
+ {
+ cout << "a::post" << endl;
+ }
+};
+
+struct b_pimpl: b_pskel
+{
+ virtual void
+ pre ()
+ {
+ cout << "b::pre" << endl;
+ }
+
+#ifdef XSDE_STL
+ virtual void
+ name (string const& n)
+ {
+ cout << "b::name: " << n << endl;
+ }
+#else
+ virtual void
+ name (char* n)
+ {
+ cout << "b::name: " << n << endl;
+ delete[] n;
+ }
+#endif
+
+ virtual void
+ post_b ()
+ {
+ cout << "b::post" << endl;
+ }
+};
+
struct test_pimpl: test_type_pskel
{
virtual void
@@ -105,6 +177,12 @@ struct test_pimpl: test_type_pskel
cout << "test::sub" << endl;
}
+ virtual void
+ a ()
+ {
+ cout << "test::a" << endl;
+ }
+
#ifdef XSDE_STL
virtual void
name (string const& n)
@@ -143,11 +221,19 @@ main (int argc, char* argv[])
sub_pimpl sub_p;
indir_pimpl indir_p;
+
+ a_pimpl a_p;
+ b_pimpl b_p;
+
test_pimpl test_p;
sub_p.parsers (string_p, sub_p, indir_p, sub_p);
indir_p.parsers (string_p, sub_p);
- test_p.parsers (string_p, sub_p);
+
+ a_p.parsers (string_p, a_p, b_p);
+ b_p.parsers (string_p);
+
+ test_p.parsers (string_p, sub_p, a_p);
xml_schema::document_pimpl doc_p (test_p, "test");