aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-13 14:51:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-13 14:51:03 +0200
commitc7c32255956fc8c82200cd01e08951a336e48d98 (patch)
tree8b207e8bb52f876a35ca779f30d725ff46ba3587 /xsde/cxx
parent49d8e39f9a42ff1963c5df0f6e9ed903d66f2eb0 (diff)
Cast skeletons with dynamic instead of static_cast in mixin mode
In this mode parser skeletons use virtual inheritance.
Diffstat (limited to 'xsde/cxx')
-rw-r--r--xsde/cxx/parser/element-validation-source.cxx6
-rw-r--r--xsde/cxx/parser/parser-source.cxx3
2 files changed, 5 insertions, 4 deletions
diff --git a/xsde/cxx/parser/element-validation-source.cxx b/xsde/cxx/parser/element-validation-source.cxx
index 92eb73c..1ea9cab 100644
--- a/xsde/cxx/parser/element-validation-source.cxx
+++ b/xsde/cxx/parser/element-validation-source.cxx
@@ -388,7 +388,7 @@ namespace CXX
String const& name (ename (*e));
String fq_type (fq_name (type));
- String def_parser, map, inst;
+ String def_parser, map, inst, cast;
if (poly)
{
@@ -401,7 +401,7 @@ namespace CXX
if (poly)
{
- String cast (mixin ? L"dynamic_cast" : L"static_cast");
+ cast = mixin ? L"dynamic_cast" : L"static_cast";
os << fq_type << "* p = 0;"
<< endl
@@ -459,7 +459,7 @@ namespace CXX
if (poly)
os << fq_type << "* p =" << endl
- << "static_cast< " << fq_type << "* > (ctx.nested_parser ());"
+ << cast << "< " << fq_type << "* > (ctx.nested_parser ());"
<< endl;
os << "if (" << inst << " != 0)"
diff --git a/xsde/cxx/parser/parser-source.cxx b/xsde/cxx/parser/parser-source.cxx
index 47e4867..68a2338 100644
--- a/xsde/cxx/parser/parser-source.cxx
+++ b/xsde/cxx/parser/parser-source.cxx
@@ -639,10 +639,11 @@ namespace CXX
if (poly)
{
String fq_type (fq_name (e.type ()));
+ String cast (mixin ? L"dynamic_cast" : L"static_cast");
inst = "p";
os << fq_type << "* p =" << endl
- << "static_cast< " << fq_type << "* > (" <<
+ << cast << "< " << fq_type << "* > (" <<
"this->_context ().nested_parser ());"
<< endl;
}