aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-09-14 14:36:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-09-14 14:36:25 +0200
commit843baffae450aa8ea3d91b3f888940224d56e211 (patch)
treeaafdc0a5d1c86285fa0edb3d8a91ed4df5752e88 /xsd/cxx
parent48374dd6056032ae9b3dfd8408634dcec5f298ec (diff)
Fix bug in aggregate generation for derived lists
Diffstat (limited to 'xsd/cxx')
-rw-r--r--xsd/cxx/parser/driver-source.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/xsd/cxx/parser/driver-source.cxx b/xsd/cxx/parser/driver-source.cxx
index b04bbf1..483e728 100644
--- a/xsd/cxx/parser/driver-source.cxx
+++ b/xsd/cxx/parser/driver-source.cxx
@@ -29,10 +29,12 @@ namespace CXX
// For base types we only want member's types, but not the
// base itself.
//
- struct BaseType: Traversal::Complex, Context
+ struct BaseType: Traversal::Complex,
+ Traversal::List,
+ Context
{
- BaseType (Context& c)
- : Context (c)
+ BaseType (Context& c, Traversal::NodeBase& def)
+ : Context (c), def_ (def)
{
}
@@ -44,6 +46,15 @@ namespace CXX
if (!restriction_p (c))
names (c);
}
+
+ virtual Void
+ traverse (SemanticGraph::List& l)
+ {
+ def_.dispatch (l.argumented ().type ());
+ }
+
+ private:
+ Traversal::NodeBase& def_;
};
struct ParserDef: Traversal::Type,
@@ -109,7 +120,7 @@ namespace CXX
Context
{
ParserDef (Context& c, TypeInstanceMap& map, InstanceSet& set)
- : Context (c), map_ (map), set_ (set), base_ (c)
+ : Context (c), map_ (map), set_ (set), base_ (c, *this)
{
*this >> inherits_ >> base_ >> inherits_;
@@ -564,7 +575,7 @@ namespace CXX
Context
{
ParserConnect (Context& c, TypeInstanceMap& map)
- : Context (c), map_ (map), base_ (c)
+ : Context (c), map_ (map), base_ (c, *this)
{
*this >> inherits_ >> base_ >> inherits_;