aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/default-value.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/cxx/tree/default-value.hxx')
-rw-r--r--xsd/cxx/tree/default-value.hxx44
1 files changed, 35 insertions, 9 deletions
diff --git a/xsd/cxx/tree/default-value.hxx b/xsd/cxx/tree/default-value.hxx
index 7e9867a..c80132e 100644
--- a/xsd/cxx/tree/default-value.hxx
+++ b/xsd/cxx/tree/default-value.hxx
@@ -124,18 +124,29 @@ namespace CXX
Traversal::Inherits inherits_;
};
- // Some initialization (e.g., list) need a function body.
+ // Some initialization (e.g., list) need a function body while others
+ // (e.g., *binary) require extra data.
//
- struct IsSimpleInit: Traversal::List,
- Traversal::Complex,
+ struct InitKind: Traversal::List,
+ Traversal::Complex,
+
+ Traversal::Fundamental::Base64Binary,
+ Traversal::Fundamental::HexBinary,
- Traversal::Fundamental::NameTokens,
- Traversal::Fundamental::IdRefs,
- Traversal::Fundamental::Entities
+ Traversal::Fundamental::NameTokens,
+ Traversal::Fundamental::IdRefs,
+ Traversal::Fundamental::Entities
{
- // Should be true initially.
+ enum Kind
+ {
+ simple,
+ data,
+ function
+ };
+
+ // Should be simple initially.
//
- IsSimpleInit (Boolean& r);
+ InitKind (Kind& r);
virtual Void
traverse (SemanticGraph::List&);
@@ -144,6 +155,12 @@ namespace CXX
traverse (SemanticGraph::Complex&);
virtual Void
+ traverse (SemanticGraph::Fundamental::Base64Binary&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::HexBinary&);
+
+ virtual Void
traverse (SemanticGraph::Fundamental::NameTokens&);
virtual Void
@@ -153,7 +170,7 @@ namespace CXX
traverse (SemanticGraph::Fundamental::Entities&);
private:
- Boolean& r_;
+ Kind& r_;
Traversal::Inherits inherits_;
};
@@ -201,6 +218,13 @@ namespace CXX
InitValue (Context&);
Void
+ data (String const& data)
+ {
+ data_ = data;
+ dispatch_count_ = 0;
+ }
+
+ Void
dispatch (SemanticGraph::Node& type, String const& value);
virtual Void
@@ -318,6 +342,8 @@ namespace CXX
private:
String value_;
+ String data_;
+ Size dispatch_count_;
MemberTypeName type_name_;
LiteralValue literal_value_;
};