aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-12 11:26:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-12 11:26:08 +0200
commit51231f66aee0bbbd14d361d9e8e0009e99d57974 (patch)
tree00bf887154f994e6156108c4e79b747007af8efa /xsde/cxx
parent9553149aa6b6561c49981adf2848607a43765054 (diff)
Finish {min,max}{Exclusive,Inclusive} facets support
New test: hybrid/facets.
Diffstat (limited to 'xsde/cxx')
-rw-r--r--xsde/cxx/elements.cxx409
-rw-r--r--xsde/cxx/elements.hxx161
-rw-r--r--xsde/cxx/hybrid/default-value.cxx505
-rw-r--r--xsde/cxx/hybrid/default-value.hxx145
-rw-r--r--xsde/cxx/hybrid/elements.cxx1
-rw-r--r--xsde/cxx/hybrid/parser-name-processor.cxx1
-rw-r--r--xsde/cxx/hybrid/serializer-name-processor.cxx1
-rw-r--r--xsde/cxx/hybrid/tree-name-processor.cxx1
-rw-r--r--xsde/cxx/hybrid/tree-source.cxx2
-rw-r--r--xsde/cxx/hybrid/tree-type-map.cxx1
-rw-r--r--xsde/cxx/parser/elements.cxx21
-rw-r--r--xsde/cxx/parser/name-processor.cxx1
-rw-r--r--xsde/cxx/parser/parser-inline.cxx34
-rw-r--r--xsde/cxx/serializer/elements.cxx21
-rw-r--r--xsde/cxx/serializer/name-processor.cxx1
-rw-r--r--xsde/cxx/serializer/serializer-inline.cxx34
16 files changed, 709 insertions, 630 deletions
diff --git a/xsde/cxx/elements.cxx b/xsde/cxx/elements.cxx
index 3da9392..7fe8b3f 100644
--- a/xsde/cxx/elements.cxx
+++ b/xsde/cxx/elements.cxx
@@ -126,6 +126,7 @@ namespace CXX
Boolean trace_include_regex_,
Boolean inline_,
Boolean custom_allocator,
+ Boolean ll,
Containers::Vector<NarrowString> const& reserved_name)
: os (o),
schema_root (root),
@@ -141,6 +142,7 @@ namespace CXX
inst_exp (inst_exp_),
inl (inl_),
custom_alloc (custom_allocator),
+ long_long (ll),
ns_mapping_cache (ns_mapping_cache_),
schema_path_ (path),
xs_ns_ (0),
@@ -1223,4 +1225,411 @@ namespace CXX
if (st_)
st_->leave ();
}
+
+
+ //
+ // LiteralValue
+ //
+
+ Void LiteralValue::
+ normalize (String& s)
+ {
+ Size n (s.size ());
+
+ for (Size i (0); i < n; ++i)
+ {
+ WideChar& c (s[i]);
+
+ if (c == 0x0D || // carriage return
+ c == 0x09 || // tab
+ c == 0x0A)
+ c = 0x20;
+ }
+ }
+
+ Void LiteralValue::
+ collapse (String& s)
+ {
+ Size n (s.size ()), j (0);
+ Boolean subs (false), trim (true);
+
+ for (Size i (0); i < n; ++i)
+ {
+ WideChar c (s[i]);
+
+ if (c == 0x20 || c == 0x09 || c == 0x0A)
+ subs = true;
+ else
+ {
+ if (subs)
+ {
+ subs = false;
+
+ if (!trim)
+ s[j++] = 0x20;
+ }
+
+ if (trim)
+ trim = false;
+
+ s[j++] = c;
+ }
+ }
+
+ s.resize (j);
+ }
+
+ Void LiteralValue::
+ strip_zeros (String& s)
+ {
+ Size n (s.size ()), i (0);
+
+ if (n > 0 && (s[i] == '-' || s[i] == '+'))
+ i++;
+
+ Size j (i);
+
+ Boolean strip (true);
+
+ for (; i < n; ++i)
+ {
+ WideChar c (s[i]);
+
+ if (c == '0')
+ {
+ if (!strip)
+ s[j++] = c;
+ }
+ else
+ {
+ s[j++] = c;
+
+ if (strip)
+ strip = false;
+ }
+ }
+
+ if (strip && j < n)
+ s[j++] = '0'; // There was nothing except zeros so add one back.
+
+ s.resize (j);
+ }
+
+ Void LiteralValue::
+ make_float (String& s)
+ {
+ if (s.find ('.') == String::npos &&
+ s.find ('e') == String::npos &&
+ s.find ('E') == String::npos)
+ s += L".0";
+ }
+
+ LiteralValue::
+ LiteralValue (Context& c, Boolean str)
+ : Context (c), str_ (str)
+ {
+ }
+
+ String LiteralValue::
+ dispatch (SemanticGraph::Node& type, String const& value)
+ {
+ literal_.clear ();
+ value_ = value;
+ Traversal::NodeBase::dispatch (type);
+ return literal_;
+ }
+
+ // Boolean.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Boolean&)
+ {
+ collapse (value_);
+ literal_ = (value_ == L"true" || value_ == L"1") ? "true" : "false";
+ }
+
+ // Integral types.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Byte&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_;
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::UnsignedByte&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"U";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Short&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_;
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::UnsignedShort&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"U";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Int&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_;
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::UnsignedInt&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"U";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Long&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_;
+ literal_ += long_long ? L"LL" : L"L";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::UnsignedLong&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_;
+ literal_ += long_long ? L"ULL" : L"UL";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Integer&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"L";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::NonPositiveInteger&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"L";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::NonNegativeInteger&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"UL";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::PositiveInteger&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"UL";
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::NegativeInteger&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ literal_ = value_ + L"L";
+ }
+
+ // Floats.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Float&)
+ {
+ collapse (value_);
+
+ if (value_ == L"NaN")
+ {
+ literal_ = "static_cast< float > (strtod (\"NAN\", 0))";
+ }
+ else if (value_ == L"INF")
+ {
+ literal_ = "static_cast< float > (strtod (\"INF\", 0))";
+ }
+ else if (value_ == L"-INF")
+ {
+ literal_ = "static_cast< float > (strtod (\"-INF\", 0))";
+ }
+ else
+ {
+ strip_zeros (value_);
+ make_float (value_);
+ literal_ = value_ + L"F";
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Double&)
+ {
+ collapse (value_);
+
+ if (value_ == L"NaN")
+ {
+ literal_ = "strtod (\"NAN\", 0)";
+ }
+ else if (value_ == L"INF")
+ {
+ literal_ = "strtod (\"INF\", 0)";
+ }
+ else if (value_ == L"-INF")
+ {
+ literal_ = "strtod (\"-INF\", 0)";
+ }
+ else
+ {
+ strip_zeros (value_);
+ make_float (value_);
+ literal_ = value_;
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Decimal&)
+ {
+ collapse (value_);
+ strip_zeros (value_);
+ make_float (value_);
+ literal_ = value_;
+ }
+
+ // Strings.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::String&)
+ {
+ if (str_)
+ literal_ = strlit (value_);
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::NormalizedString&)
+ {
+ if (str_)
+ {
+ normalize (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Token&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::NameToken&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Name&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::NCName&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Language&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+
+ // ID/IDREF.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Id&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::IdRef&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ // URI.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::AnyURI&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
+
+ // Entity.
+ //
+ Void LiteralValue::
+ traverse (SemanticGraph::Fundamental::Entity&)
+ {
+ if (str_)
+ {
+ collapse (value_);
+ literal_ = strlit (value_);
+ }
+ }
}
diff --git a/xsde/cxx/elements.hxx b/xsde/cxx/elements.hxx
index 098bd84..c9f79f2 100644
--- a/xsde/cxx/elements.hxx
+++ b/xsde/cxx/elements.hxx
@@ -160,6 +160,7 @@ namespace CXX
Boolean trace_include_regex_,
Boolean inline_,
Boolean custom_allocator,
+ Boolean long_long,
Containers::Vector<NarrowString> const& reserved_name);
protected:
@@ -178,6 +179,7 @@ namespace CXX
inst_exp (c.inst_exp),
inl (c.inl),
custom_alloc (c.custom_alloc),
+ long_long (c.long_long),
ns_mapping_cache (c.ns_mapping_cache),
xs_ns_ (c.xs_ns_),
cxx_id_expr (c.cxx_id_expr),
@@ -207,6 +209,7 @@ namespace CXX
inst_exp (c.inst_exp),
inl (c.inl),
custom_alloc (c.custom_alloc),
+ long_long (c.long_long),
ns_mapping_cache (c.ns_mapping_cache),
xs_ns_ (c.xs_ns_),
cxx_id_expr (c.cxx_id_expr),
@@ -342,6 +345,7 @@ namespace CXX
String& inl;
Boolean custom_alloc;
+ Boolean long_long;
public:
MappingCache& ns_mapping_cache;
@@ -612,6 +616,163 @@ namespace CXX
fundamental_template (t);
}
};
+
+ struct LiteralValue: Traversal::Fundamental::Byte,
+ Traversal::Fundamental::UnsignedByte,
+ Traversal::Fundamental::Short,
+ Traversal::Fundamental::UnsignedShort,
+ Traversal::Fundamental::Int,
+ Traversal::Fundamental::UnsignedInt,
+ Traversal::Fundamental::Long,
+ Traversal::Fundamental::UnsignedLong,
+ Traversal::Fundamental::Integer,
+ Traversal::Fundamental::NonPositiveInteger,
+ Traversal::Fundamental::NonNegativeInteger,
+ Traversal::Fundamental::PositiveInteger,
+ Traversal::Fundamental::NegativeInteger,
+
+ Traversal::Fundamental::Boolean,
+
+ Traversal::Fundamental::Float,
+ Traversal::Fundamental::Double,
+ Traversal::Fundamental::Decimal,
+
+ Traversal::Fundamental::String,
+ Traversal::Fundamental::NormalizedString,
+ Traversal::Fundamental::Token,
+ Traversal::Fundamental::Name,
+ Traversal::Fundamental::NameToken,
+ Traversal::Fundamental::NCName,
+ Traversal::Fundamental::Language,
+
+ Traversal::Fundamental::Id,
+ Traversal::Fundamental::IdRef,
+ Traversal::Fundamental::AnyURI,
+ Traversal::Fundamental::Entity,
+
+ Context
+ {
+ LiteralValue (Context&, Boolean str);
+
+ String
+ dispatch (SemanticGraph::Node& type, String const& value);
+
+ // Boolean.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Boolean&);
+
+ // Integral types.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Byte&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::UnsignedByte&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Short&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::UnsignedShort&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Int&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::UnsignedInt&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Long&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::UnsignedLong&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Integer&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::NonPositiveInteger&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::NonNegativeInteger&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::PositiveInteger&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::NegativeInteger&);
+
+ // Floats.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Float&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Double&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Decimal&);
+
+ // Strings.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::String&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::NormalizedString&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Token&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::NameToken&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Name&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::NCName&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Language&);
+
+ // ID/IDREF.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Id&);
+
+ virtual Void
+ traverse (SemanticGraph::Fundamental::IdRef&);
+
+ // URI.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::AnyURI&);
+
+ // Entity.
+ //
+ virtual Void
+ traverse (SemanticGraph::Fundamental::Entity&);
+
+ public:
+ static Void
+ normalize (String&);
+
+ static Void
+ collapse (String&);
+
+ static Void
+ strip_zeros (String&);
+
+ static Void
+ make_float (String&);
+
+ private:
+ Boolean str_;
+ String value_;
+ String literal_;
+ };
}
#endif // CXX_TREE_ELEMENTS_HXX
diff --git a/xsde/cxx/hybrid/default-value.cxx b/xsde/cxx/hybrid/default-value.cxx
index 4375e1f..d63c636 100644
--- a/xsde/cxx/hybrid/default-value.cxx
+++ b/xsde/cxx/hybrid/default-value.cxx
@@ -9,421 +9,6 @@ namespace CXX
{
namespace Hybrid
{
- namespace
- {
- Void
- normalize (String& s)
- {
- Size n (s.size ());
-
- for (Size i (0); i < n; ++i)
- {
- WideChar& c (s[i]);
-
- if (c == 0x0D || // carriage return
- c == 0x09 || // tab
- c == 0x0A)
- c = 0x20;
- }
- }
-
- Void
- collapse (String& s)
- {
- Size n (s.size ()), j (0);
- Boolean subs (false), trim (true);
-
- for (Size i (0); i < n; ++i)
- {
- WideChar c (s[i]);
-
- if (c == 0x20 || c == 0x09 || c == 0x0A)
- subs = true;
- else
- {
- if (subs)
- {
- subs = false;
-
- if (!trim)
- s[j++] = 0x20;
- }
-
- if (trim)
- trim = false;
-
- s[j++] = c;
- }
- }
-
- s.resize (j);
- }
-
- Void
- strip_zeros (String& s)
- {
- Size n (s.size ()), i (0);
-
- if (n > 0 && (s[i] == '-' || s[i] == '+'))
- i++;
-
- Size j (i);
-
- Boolean strip (true);
-
- for (; i < n; ++i)
- {
- WideChar c (s[i]);
-
- if (c == '0')
- {
- if (!strip)
- s[j++] = c;
- }
- else
- {
- s[j++] = c;
-
- if (strip)
- strip = false;
- }
- }
-
- if (strip && j < n)
- s[j++] = '0'; // There was nothing except zeros so add one back.
-
- s.resize (j);
- }
-
- Void
- make_float (String& s)
- {
- if (s.find ('.') == String::npos &&
- s.find ('e') == String::npos &&
- s.find ('E') == String::npos)
- s += L".0";
- }
-
- }
-
- //
- // LiteralValue
- //
- LiteralValue::
- LiteralValue (Context& c)
- : Context (c), str_ (!stl)
- {
- }
-
- LiteralValue::
- LiteralValue (Context& c, Boolean str)
- : Context (c), str_ (str)
- {
- }
-
- String LiteralValue::
- dispatch (SemanticGraph::Node& type, String const& value)
- {
- literal_.clear ();
- value_ = value;
- Traversal::NodeBase::dispatch (type);
- return literal_;
- }
-
- // Boolean.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Boolean&)
- {
- collapse (value_);
- literal_ = (value_ == L"true" || value_ == L"1") ? "true" : "false";
- }
-
- // Integral types.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Byte&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_;
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::UnsignedByte&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"U";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Short&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_;
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::UnsignedShort&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"U";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Int&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_;
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::UnsignedInt&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"U";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Long&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_;
- literal_ += options.value<CLI::no_long_long> () ? L"L" : L"LL";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::UnsignedLong&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_;
- literal_ += options.value<CLI::no_long_long> () ? L"UL" : L"ULL";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Integer&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"L";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::NonPositiveInteger&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"L";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::NonNegativeInteger&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"UL";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::PositiveInteger&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"UL";
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::NegativeInteger&)
- {
- collapse (value_);
- strip_zeros (value_);
- literal_ = value_ + L"L";
- }
-
- // Floats.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Float&)
- {
- collapse (value_);
-
- if (value_ == L"NaN")
- {
- literal_ = "static_cast< float > (strtod (\"NAN\", 0))";
- }
- else if (value_ == L"INF")
- {
- literal_ = "static_cast< float > (strtod (\"INF\", 0))";
- }
- else if (value_ == L"-INF")
- {
- literal_ = "static_cast< float > (strtod (\"-INF\", 0))";
- }
- else
- {
- strip_zeros (value_);
- make_float (value_);
- literal_ = value_ + L"F";
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Double&)
- {
- collapse (value_);
-
- if (value_ == L"NaN")
- {
- literal_ = "strtod (\"NAN\", 0)";
- }
- else if (value_ == L"INF")
- {
- literal_ = "strtod (\"INF\", 0)";
- }
- else if (value_ == L"-INF")
- {
- literal_ = "strtod (\"-INF\", 0)";
- }
- else
- {
- strip_zeros (value_);
- make_float (value_);
- literal_ = value_;
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Decimal&)
- {
- collapse (value_);
- strip_zeros (value_);
- make_float (value_);
- literal_ = value_;
- }
-
- // Strings.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::String&)
- {
- if (str_)
- literal_ = strlit (value_);
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::NormalizedString&)
- {
- if (str_)
- {
- normalize (value_);
- literal_ = strlit (value_);
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Token&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::NameToken&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Name&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::NCName&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Language&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
-
- // ID/IDREF.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Id&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::IdRef&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- // URI.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::AnyURI&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
- // Entity.
- //
- Void LiteralValue::
- traverse (SemanticGraph::Fundamental::Entity&)
- {
- if (str_)
- {
- collapse (value_);
- literal_ = strlit (value_);
- }
- }
-
//
// InitValue
//
@@ -435,7 +20,7 @@ namespace CXX
var_ (c, TypeName::var),
var_value_ (c, TypeName::var_value),
literal_value_ (c, true),
- literal_value_list_ (c)
+ literal_value_list_ (c, !stl)
{
}
@@ -452,7 +37,7 @@ namespace CXX
SemanticGraph::Type& t (l.argumented ().type ());
Boolean fl (fixed_length (t));
- collapse (value_);
+ LiteralValue::collapse (value_);
if (!value_)
return;
@@ -710,7 +295,7 @@ namespace CXX
if (p != String::npos)
value_ = String (value_, p + 1, value_.size () - p - 1);
- collapse (value_);
+ LiteralValue::collapse (value_);
String prefix, name;
p = value_.find (':');
@@ -776,7 +361,7 @@ namespace CXX
Void InitValue::
traverse (SemanticGraph::Fundamental::Base64Binary&)
{
- collapse (value_);
+ LiteralValue::collapse (value_);
if (value_)
os << "#error base64Binary default values are not yet supported"
@@ -786,7 +371,7 @@ namespace CXX
Void InitValue::
traverse (SemanticGraph::Fundamental::HexBinary&)
{
- collapse (value_);
+ LiteralValue::collapse (value_);
if (value_)
os << "#error hexBinary default values are not yet supported"
@@ -801,7 +386,7 @@ namespace CXX
{
// date := [-]CCYY[N]*-MM-DD[Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
Size b (0);
Size e (value_.find ('-', value_[0] == '-' ? 5 : 4));
@@ -813,9 +398,9 @@ namespace CXX
b += 3;
String day (value_, b, 2);
- strip_zeros (year);
- strip_zeros (month);
- strip_zeros (day);
+ LiteralValue::strip_zeros (year);
+ LiteralValue::strip_zeros (month);
+ LiteralValue::strip_zeros (day);
os << member_ << "year (" << year << ");"
<< member_ << "month (" << month << ");"
@@ -829,7 +414,7 @@ namespace CXX
{
// date_time := [-]CCYY[N]*-MM-DDTHH:MM:SS[.S+][Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
Size b (0);
Size e (value_.find ('-', value_[0] == '-' ? 5 : 4));
@@ -859,13 +444,13 @@ namespace CXX
String seconds (value_, b, e - b);
- strip_zeros (year);
- strip_zeros (month);
- strip_zeros (day);
- strip_zeros (hours);
- strip_zeros (minutes);
- strip_zeros (seconds);
- make_float (seconds);
+ LiteralValue::strip_zeros (year);
+ LiteralValue::strip_zeros (month);
+ LiteralValue::strip_zeros (day);
+ LiteralValue::strip_zeros (hours);
+ LiteralValue::strip_zeros (minutes);
+ LiteralValue::strip_zeros (seconds);
+ LiteralValue::make_float (seconds);
os << member_ << "year (" << year << ");"
<< member_ << "month (" << month << ");"
@@ -900,7 +485,7 @@ namespace CXX
{
// duration := [-]P[nY][nM][nD][TnHnMn[.n+]S]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
Size b (1), e, n (value_.size ());
@@ -915,7 +500,7 @@ namespace CXX
if (e < n && value_[e] == 'Y')
{
String v (value_, b, e - b);
- strip_zeros (v);
+ LiteralValue::strip_zeros (v);
os << member_ << "years (" << v << ");";
b = e + 1;
@@ -925,7 +510,7 @@ namespace CXX
if (e < n && value_[e] == 'M')
{
String v (value_, b, e - b);
- strip_zeros (v);
+ LiteralValue::strip_zeros (v);
os << member_ << "months (" << v << ");";
b = e + 1;
@@ -935,7 +520,7 @@ namespace CXX
if (e < n && value_[e] == 'D')
{
String v (value_, b, e - b);
- strip_zeros (v);
+ LiteralValue::strip_zeros (v);
os << member_ << "days (" << v << ");";
b = e + 1;
@@ -951,7 +536,7 @@ namespace CXX
if (e < n && value_[e] == 'H')
{
String v (value_, b, e - b);
- strip_zeros (v);
+ LiteralValue::strip_zeros (v);
os << member_ << "hours (" << v << ");";
b = e + 1;
@@ -961,7 +546,7 @@ namespace CXX
if (e < n && value_[e] == 'M')
{
String v (value_, b, e - b);
- strip_zeros (v);
+ LiteralValue::strip_zeros (v);
os << member_ << "minutes (" << v << ");";
b = e + 1;
@@ -971,8 +556,8 @@ namespace CXX
if (e < n && value_[e] == 'S')
{
String v (value_, b, e - b);
- strip_zeros (v);
- make_float (v);
+ LiteralValue::strip_zeros (v);
+ LiteralValue::make_float (v);
os << member_ << "seconds (" << v << ");";
b = e + 1;
@@ -985,10 +570,10 @@ namespace CXX
{
// gday := ---DD[Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
String day (value_, 3, 2);
- strip_zeros (day);
+ LiteralValue::strip_zeros (day);
os << member_ << "day (" << day << ");";
@@ -1000,10 +585,10 @@ namespace CXX
{
// gmonth := --MM[Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
String month (value_, 2, 2);
- strip_zeros (month);
+ LiteralValue::strip_zeros (month);
os << member_ << "month (" << month << ");";
@@ -1015,13 +600,13 @@ namespace CXX
{
// gmonth_day := --MM-DD[Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
String month (value_, 2, 2);
String day (value_, 5, 2);
- strip_zeros (month);
- strip_zeros (day);
+ LiteralValue::strip_zeros (month);
+ LiteralValue::strip_zeros (day);
os << member_ << "month (" << month << ");";
os << member_ << "day (" << day << ");";
@@ -1034,7 +619,7 @@ namespace CXX
{
// gyear := [-]CCYY[N]*[Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
Size pos (value_[0] == '-' ? 5 : 4);
for (; pos < value_.size (); ++pos)
@@ -1046,7 +631,7 @@ namespace CXX
}
String year (value_, 0, pos);
- strip_zeros (year);
+ LiteralValue::strip_zeros (year);
os << member_ << "year (" << year << ");";
@@ -1058,15 +643,15 @@ namespace CXX
{
// gyear_month := [-]CCYY[N]*-MM[Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
Size pos (value_.find ('-', value_[0] == '-' ? 5 : 4));
String year (value_, 0, pos);
String month (value_, pos + 1, 2);
- strip_zeros (year);
- strip_zeros (month);
+ LiteralValue::strip_zeros (year);
+ LiteralValue::strip_zeros (month);
os << member_ << "year (" << year << ");";
os << member_ << "month (" << month << ");";
@@ -1079,7 +664,7 @@ namespace CXX
{
// time := HH:MM:SS[.S+][Z|(+|-)HH:MM]
//
- collapse (value_);
+ LiteralValue::collapse (value_);
String hours (value_, 0, 2);
String minutes (value_, 3, 2);
@@ -1095,10 +680,10 @@ namespace CXX
String seconds (value_, 6, e - 6);
- strip_zeros (hours);
- strip_zeros (minutes);
- strip_zeros (seconds);
- make_float (seconds);
+ LiteralValue::strip_zeros (hours);
+ LiteralValue::strip_zeros (minutes);
+ LiteralValue::strip_zeros (seconds);
+ LiteralValue::make_float (seconds);
os << member_ << "hours (" << hours << ");"
<< member_ << "minutes (" << minutes << ");"
@@ -1132,8 +717,8 @@ namespace CXX
h.append (value_, pos + 1, 2);
m.append (value_, pos + 4, 2);
- strip_zeros (h);
- strip_zeros (m);
+ LiteralValue::strip_zeros (h);
+ LiteralValue::strip_zeros (m);
}
os << member_ << "zone_hours (" << h << ");"
@@ -1195,7 +780,7 @@ namespace CXX
Void InitValue::
string_sequence_type ()
{
- collapse (value_);
+ LiteralValue::collapse (value_);
if (!value_)
return;
diff --git a/xsde/cxx/hybrid/default-value.hxx b/xsde/cxx/hybrid/default-value.hxx
index 5d8b698..aef9049 100644
--- a/xsde/cxx/hybrid/default-value.hxx
+++ b/xsde/cxx/hybrid/default-value.hxx
@@ -15,151 +15,6 @@ namespace CXX
{
namespace Hybrid
{
- struct LiteralValue: Traversal::Fundamental::Byte,
- Traversal::Fundamental::UnsignedByte,
- Traversal::Fundamental::Short,
- Traversal::Fundamental::UnsignedShort,
- Traversal::Fundamental::Int,
- Traversal::Fundamental::UnsignedInt,
- Traversal::Fundamental::Long,
- Traversal::Fundamental::UnsignedLong,
- Traversal::Fundamental::Integer,
- Traversal::Fundamental::NonPositiveInteger,
- Traversal::Fundamental::NonNegativeInteger,
- Traversal::Fundamental::PositiveInteger,
- Traversal::Fundamental::NegativeInteger,
-
- Traversal::Fundamental::Boolean,
-
- Traversal::Fundamental::Float,
- Traversal::Fundamental::Double,
- Traversal::Fundamental::Decimal,
-
- Traversal::Fundamental::String,
- Traversal::Fundamental::NormalizedString,
- Traversal::Fundamental::Token,
- Traversal::Fundamental::Name,
- Traversal::Fundamental::NameToken,
- Traversal::Fundamental::NCName,
- Traversal::Fundamental::Language,
-
- Traversal::Fundamental::Id,
- Traversal::Fundamental::IdRef,
- Traversal::Fundamental::AnyURI,
- Traversal::Fundamental::Entity,
-
- Context
- {
- LiteralValue (Context&);
- LiteralValue (Context&, Boolean str);
-
- String
- dispatch (SemanticGraph::Node& type, String const& value);
-
- // Boolean.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::Boolean&);
-
- // Integral types.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::Byte&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::UnsignedByte&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Short&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::UnsignedShort&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Int&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::UnsignedInt&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Long&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::UnsignedLong&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Integer&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::NonPositiveInteger&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::NonNegativeInteger&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::PositiveInteger&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::NegativeInteger&);
-
- // Floats.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::Float&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Double&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Decimal&);
-
- // Strings.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::String&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::NormalizedString&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Token&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::NameToken&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Name&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::NCName&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::Language&);
-
- // ID/IDREF.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::Id&);
-
- virtual Void
- traverse (SemanticGraph::Fundamental::IdRef&);
-
- // URI.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::AnyURI&);
-
- // Entity.
- //
- virtual Void
- traverse (SemanticGraph::Fundamental::Entity&);
-
- private:
- Boolean str_;
- String value_;
- String literal_;
- };
-
struct InitValue: Traversal::List,
Traversal::Union,
Traversal::Complex,
diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx
index b8c109a..4d5a481 100644
--- a/xsde/cxx/hybrid/elements.cxx
+++ b/xsde/cxx/hybrid/elements.cxx
@@ -33,6 +33,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
options (ops),
exceptions (!ops.value<CLI::no_exceptions> ()),
diff --git a/xsde/cxx/hybrid/parser-name-processor.cxx b/xsde/cxx/hybrid/parser-name-processor.cxx
index 3dce6fe..b55e9b8 100644
--- a/xsde/cxx/hybrid/parser-name-processor.cxx
+++ b/xsde/cxx/hybrid/parser-name-processor.cxx
@@ -48,6 +48,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
impl_suffix_ (ops.value<CLI::pimpl_type_suffix> ()),
aggr_suffix_ (ops.value<CLI::paggr_type_suffix> ()),
diff --git a/xsde/cxx/hybrid/serializer-name-processor.cxx b/xsde/cxx/hybrid/serializer-name-processor.cxx
index 41f8885..784a2af 100644
--- a/xsde/cxx/hybrid/serializer-name-processor.cxx
+++ b/xsde/cxx/hybrid/serializer-name-processor.cxx
@@ -47,6 +47,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
impl_suffix_ (ops.value<CLI::simpl_type_suffix> ()),
aggr_suffix_ (ops.value<CLI::saggr_type_suffix> ()),
diff --git a/xsde/cxx/hybrid/tree-name-processor.cxx b/xsde/cxx/hybrid/tree-name-processor.cxx
index 8fa6aa6..bde0fb7 100644
--- a/xsde/cxx/hybrid/tree-name-processor.cxx
+++ b/xsde/cxx/hybrid/tree-name-processor.cxx
@@ -50,6 +50,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
stl (!ops.value<CLI::no_stl> ()),
detach (ops.value<CLI::generate_detach> ()),
diff --git a/xsde/cxx/hybrid/tree-source.cxx b/xsde/cxx/hybrid/tree-source.cxx
index 33995c5..78af09e 100644
--- a/xsde/cxx/hybrid/tree-source.cxx
+++ b/xsde/cxx/hybrid/tree-source.cxx
@@ -642,7 +642,7 @@ namespace CXX
: Context (c),
var_ (c, TypeName::var_value),
ro_ret_ (c, TypeName::ro_ret),
- literal_value_ (c),
+ literal_value_ (c, !stl),
init_value_ (c)
{
}
diff --git a/xsde/cxx/hybrid/tree-type-map.cxx b/xsde/cxx/hybrid/tree-type-map.cxx
index cf36ce2..c745f05 100644
--- a/xsde/cxx/hybrid/tree-type-map.cxx
+++ b/xsde/cxx/hybrid/tree-type-map.cxx
@@ -41,6 +41,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ())
{
}
diff --git a/xsde/cxx/parser/elements.cxx b/xsde/cxx/parser/elements.cxx
index 25e2032..b5d0d57 100644
--- a/xsde/cxx/parser/elements.cxx
+++ b/xsde/cxx/parser/elements.cxx
@@ -33,6 +33,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
options (ops),
xml_parser (xml_parser_),
@@ -223,10 +224,22 @@ namespace CXX
}
}
- if (ub.is_a<SemanticGraph::Fundamental::Short> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedInt> ())
+ if (ub.is_a<SemanticGraph::Fundamental::Byte> () ||
+ ub.is_a<SemanticGraph::Fundamental::Short> () ||
+ ub.is_a<SemanticGraph::Fundamental::Int> () ||
+ ub.is_a<SemanticGraph::Fundamental::Long> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedInt> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedLong> () ||
+ ub.is_a<SemanticGraph::Fundamental::Integer> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonPositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonNegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::PositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::Float> () ||
+ ub.is_a<SemanticGraph::Fundamental::Double> () ||
+ ub.is_a<SemanticGraph::Fundamental::Decimal> ())
{
if (validation)
{
diff --git a/xsde/cxx/parser/name-processor.cxx b/xsde/cxx/parser/name-processor.cxx
index 42b2863..ccbfa66 100644
--- a/xsde/cxx/parser/name-processor.cxx
+++ b/xsde/cxx/parser/name-processor.cxx
@@ -46,6 +46,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
skel_suffix_ (ops.value<CLI::skel_type_suffix> ()),
impl_suffix_ (ops.value<CLI::impl_type_suffix> ()),
diff --git a/xsde/cxx/parser/parser-inline.cxx b/xsde/cxx/parser/parser-inline.cxx
index d20a3e7..5ebf014 100644
--- a/xsde/cxx/parser/parser-inline.cxx
+++ b/xsde/cxx/parser/parser-inline.cxx
@@ -67,11 +67,25 @@ namespace CXX
}
}
- if (ub.is_a<SemanticGraph::Fundamental::Short> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedInt> ())
+ if (ub.is_a<SemanticGraph::Fundamental::Byte> () ||
+ ub.is_a<SemanticGraph::Fundamental::Short> () ||
+ ub.is_a<SemanticGraph::Fundamental::Int> () ||
+ ub.is_a<SemanticGraph::Fundamental::Long> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedInt> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedLong> () ||
+ ub.is_a<SemanticGraph::Fundamental::Integer> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonPositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonNegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::PositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::Float> () ||
+ ub.is_a<SemanticGraph::Fundamental::Double> () ||
+ ub.is_a<SemanticGraph::Fundamental::Decimal> ())
{
+ LiteralValue lv (ctx, false);
+
for (Restricts::FacetIterator i (r.facet_begin ());
i != r.facet_end (); ++i)
{
@@ -80,19 +94,23 @@ namespace CXX
if (i->first == L"minInclusive")
{
- os << "this->_min_facet (" << i->second << ", true);";
+ os << "this->_min_facet (" << lv.dispatch (ub, i->second) <<
+ ", true);";
}
else if (i->first == L"minExclusive")
{
- os << "this->_min_facet (" << i->second << ", false);";
+ os << "this->_min_facet (" << lv.dispatch (ub, i->second) <<
+ ", false);";
}
else if (i->first == L"maxInclusive")
{
- os << "this->_max_facet (" << i->second << ", true);";
+ os << "this->_max_facet (" << lv.dispatch (ub, i->second) <<
+ ", true);";
}
else if (i->first == L"maxExclusive")
{
- os << "this->_max_facet (" << i->second << ", false);";
+ os << "this->_max_facet (" << lv.dispatch (ub, i->second) <<
+ ", false);";
}
}
}
diff --git a/xsde/cxx/serializer/elements.cxx b/xsde/cxx/serializer/elements.cxx
index e598f8f..eb03361 100644
--- a/xsde/cxx/serializer/elements.cxx
+++ b/xsde/cxx/serializer/elements.cxx
@@ -33,6 +33,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
options (ops),
xml_serializer (xml_serializer_),
@@ -240,10 +241,22 @@ namespace CXX
}
}
- if (ub.is_a<SemanticGraph::Fundamental::Short> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedInt> ())
+ if (ub.is_a<SemanticGraph::Fundamental::Byte> () ||
+ ub.is_a<SemanticGraph::Fundamental::Short> () ||
+ ub.is_a<SemanticGraph::Fundamental::Int> () ||
+ ub.is_a<SemanticGraph::Fundamental::Long> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedInt> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedLong> () ||
+ ub.is_a<SemanticGraph::Fundamental::Integer> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonPositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonNegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::PositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::Float> () ||
+ ub.is_a<SemanticGraph::Fundamental::Double> () ||
+ ub.is_a<SemanticGraph::Fundamental::Decimal> ())
{
if (validation)
{
diff --git a/xsde/cxx/serializer/name-processor.cxx b/xsde/cxx/serializer/name-processor.cxx
index f7f63a2..e64d149 100644
--- a/xsde/cxx/serializer/name-processor.cxx
+++ b/xsde/cxx/serializer/name-processor.cxx
@@ -46,6 +46,7 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::custom_allocator> (),
+ !ops.value<CLI::no_long_long> (),
ops.value<CLI::reserved_name> ()),
skel_suffix_ (ops.value<CLI::skel_type_suffix> ()),
impl_suffix_ (ops.value<CLI::impl_type_suffix> ()),
diff --git a/xsde/cxx/serializer/serializer-inline.cxx b/xsde/cxx/serializer/serializer-inline.cxx
index 4bebc9c..998f0f1 100644
--- a/xsde/cxx/serializer/serializer-inline.cxx
+++ b/xsde/cxx/serializer/serializer-inline.cxx
@@ -52,11 +52,25 @@ namespace CXX
}
}
- if (ub.is_a<SemanticGraph::Fundamental::Short> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
- ub.is_a<SemanticGraph::Fundamental::UnsignedInt> ())
+ if (ub.is_a<SemanticGraph::Fundamental::Byte> () ||
+ ub.is_a<SemanticGraph::Fundamental::Short> () ||
+ ub.is_a<SemanticGraph::Fundamental::Int> () ||
+ ub.is_a<SemanticGraph::Fundamental::Long> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedInt> () ||
+ ub.is_a<SemanticGraph::Fundamental::UnsignedLong> () ||
+ ub.is_a<SemanticGraph::Fundamental::Integer> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonPositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NonNegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::PositiveInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::NegativeInteger> () ||
+ ub.is_a<SemanticGraph::Fundamental::Float> () ||
+ ub.is_a<SemanticGraph::Fundamental::Double> () ||
+ ub.is_a<SemanticGraph::Fundamental::Decimal> ())
{
+ LiteralValue lv (ctx, false);
+
for (Restricts::FacetIterator i (r.facet_begin ());
i != r.facet_end (); ++i)
{
@@ -65,19 +79,23 @@ namespace CXX
if (i->first == L"minInclusive")
{
- os << "this->_min_facet (" << i->second << ", true);";
+ os << "this->_min_facet (" << lv.dispatch (ub, i->second) <<
+ ", true);";
}
else if (i->first == L"minExclusive")
{
- os << "this->_min_facet (" << i->second << ", false);";
+ os << "this->_min_facet (" << lv.dispatch (ub, i->second) <<
+ ", false);";
}
else if (i->first == L"maxInclusive")
{
- os << "this->_max_facet (" << i->second << ", true);";
+ os << "this->_max_facet (" << lv.dispatch (ub, i->second) <<
+ ", true);";
}
else if (i->first == L"maxExclusive")
{
- os << "this->_max_facet (" << i->second << ", false);";
+ os << "this->_max_facet (" << lv.dispatch (ub, i->second) <<
+ ", false);";
}
}
}