From a32d89c25b80f443d93a050a979e465f4d1dc39e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Sep 2011 14:35:19 +0200 Subject: Fix bug in aggregate generation for derived lists --- xsde/cxx/hybrid/parser-aggregate-header.cxx | 19 +++++++++++++++---- xsde/cxx/hybrid/serializer-aggregate-header.cxx | 19 +++++++++++++++---- xsde/cxx/hybrid/serializer-aggregate-source.cxx | 4 ++-- xsde/cxx/parser/driver-source.cxx | 21 ++++++++++++++++----- xsde/cxx/parser/type-processor.cxx | 2 ++ xsde/cxx/serializer/driver-source.cxx | 21 ++++++++++++++++----- xsde/cxx/serializer/type-processor.cxx | 4 ++++ 7 files changed, 70 insertions(+), 20 deletions(-) (limited to 'xsde/cxx') diff --git a/xsde/cxx/hybrid/parser-aggregate-header.cxx b/xsde/cxx/hybrid/parser-aggregate-header.cxx index 986db36..967f1db 100644 --- a/xsde/cxx/hybrid/parser-aggregate-header.cxx +++ b/xsde/cxx/hybrid/parser-aggregate-header.cxx @@ -23,10 +23,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) { } @@ -41,6 +43,15 @@ namespace CXX contains_compositor (c); } } + + virtual Void + traverse (SemanticGraph::List& l) + { + def_.dispatch (l.argumented ().type ()); + } + + private: + Traversal::NodeBase& def_; }; struct ParserDef: Traversal::Type, @@ -113,7 +124,7 @@ namespace CXX map_ (map), tid_map_ (tid_map), set_ (set), - base_ (c) + base_ (c, *this) { *this >> inherits_ >> base_ >> inherits_; diff --git a/xsde/cxx/hybrid/serializer-aggregate-header.cxx b/xsde/cxx/hybrid/serializer-aggregate-header.cxx index 07b24cd..cfcb203 100644 --- a/xsde/cxx/hybrid/serializer-aggregate-header.cxx +++ b/xsde/cxx/hybrid/serializer-aggregate-header.cxx @@ -24,10 +24,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) { } @@ -42,6 +44,15 @@ namespace CXX contains_compositor (c); } } + + virtual Void + traverse (SemanticGraph::List& l) + { + def_.dispatch (l.argumented ().type ()); + } + + private: + Traversal::NodeBase& def_; }; struct SerializerDef: Traversal::Type, @@ -114,7 +125,7 @@ namespace CXX map_ (map), tid_map_ (tid_map), set_ (set), - base_ (c) + base_ (c, *this) { *this >> inherits_ >> base_ >> inherits_; diff --git a/xsde/cxx/hybrid/serializer-aggregate-source.cxx b/xsde/cxx/hybrid/serializer-aggregate-source.cxx index 2a3deb0..e9edeea 100644 --- a/xsde/cxx/hybrid/serializer-aggregate-source.cxx +++ b/xsde/cxx/hybrid/serializer-aggregate-source.cxx @@ -205,8 +205,8 @@ namespace CXX }; struct SerializerConnect: Traversal::List, - Traversal::Complex, - Context + Traversal::Complex, + Context { SerializerConnect (Context& c, TypeInstanceMap& map, diff --git a/xsde/cxx/parser/driver-source.cxx b/xsde/cxx/parser/driver-source.cxx index 516b836..6c85cd1 100644 --- a/xsde/cxx/parser/driver-source.cxx +++ b/xsde/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) { } @@ -47,6 +49,15 @@ namespace CXX contains_compositor (c); } } + + virtual Void + traverse (SemanticGraph::List& l) + { + def_.dispatch (l.argumented ().type ()); + } + + private: + Traversal::NodeBase& def_; }; struct ParserDef: Traversal::Type, @@ -112,7 +123,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_; @@ -641,7 +652,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_; diff --git a/xsde/cxx/parser/type-processor.cxx b/xsde/cxx/parser/type-processor.cxx index 07fa413..8605241 100644 --- a/xsde/cxx/parser/type-processor.cxx +++ b/xsde/cxx/parser/type-processor.cxx @@ -201,6 +201,8 @@ namespace CXX { Complex::inherits (c); } + + // @@ What about list? }; // diff --git a/xsde/cxx/serializer/driver-source.cxx b/xsde/cxx/serializer/driver-source.cxx index 8ae20d8..9a46364 100644 --- a/xsde/cxx/serializer/driver-source.cxx +++ b/xsde/cxx/serializer/driver-source.cxx @@ -28,10 +28,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) { } @@ -46,6 +48,15 @@ namespace CXX contains_compositor (c); } } + + virtual Void + traverse (SemanticGraph::List& l) + { + def_.dispatch (l.argumented ().type ()); + } + + private: + Traversal::NodeBase& def_; }; struct SerializerDef: Traversal::Type, @@ -111,7 +122,7 @@ namespace CXX Context { SerializerDef (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_; @@ -640,7 +651,7 @@ namespace CXX Context { SerializerConnect (Context& c, TypeInstanceMap& map) - : Context (c), map_ (map), base_ (c) + : Context (c), map_ (map), base_ (c, *this) { *this >> inherits_ >> base_ >> inherits_; diff --git a/xsde/cxx/serializer/type-processor.cxx b/xsde/cxx/serializer/type-processor.cxx index 86a18aa..a07ff31 100644 --- a/xsde/cxx/serializer/type-processor.cxx +++ b/xsde/cxx/serializer/type-processor.cxx @@ -206,6 +206,8 @@ namespace CXX { Complex::names (c); } + + // @@ What about list? }; // @@ -225,6 +227,8 @@ namespace CXX Complex::inherits (c); } + // @@ What about list? + private: Serializer::Type& type_; Traversal::Inherits inherits_; -- cgit v1.1