summaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/name-processor.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-12-14 17:32:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-12-14 17:32:14 +0200
commitaf83df9be50a9383d0c54fb24b8e486a658a2a02 (patch)
tree5d937c9015c6438a60122743c7fb72ec30de32be /xsd/cxx/tree/name-processor.cxx
parentc12b36470adb57100f1d5f22e3ddd6fc163f6ab4 (diff)
New default/fixed value initialization code
Now the default/fixed values are parsed by the compiler at compile time instead of the standard parsing code at runtime.
Diffstat (limited to 'xsd/cxx/tree/name-processor.cxx')
-rw-r--r--xsd/cxx/tree/name-processor.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/xsd/cxx/tree/name-processor.cxx b/xsd/cxx/tree/name-processor.cxx
index e15b072..e0636cd 100644
--- a/xsd/cxx/tree/name-processor.cxx
+++ b/xsd/cxx/tree/name-processor.cxx
@@ -3,16 +3,17 @@
// copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-#include <cxx/tree/name-processor.hxx>
-
-#include <backend-elements/regex.hxx>
+#include <sstream>
+#include <iostream>
#include <cult/containers/set.hxx>
#include <cult/containers/map.hxx>
#include <cult/containers/vector.hxx>
-#include <sstream>
-#include <iostream>
+#include <backend-elements/regex.hxx>
+
+#include <cxx/tree/default-value.hxx>
+#include <cxx/tree/name-processor.hxx>
namespace CXX
{
@@ -817,9 +818,18 @@ namespace CXX
m.context ().set ( "default-value", find_name (an, name_set_));
- m.context ().set (
- "default-value-member",
- find_name (b + L"_default_value_", name_set_));
+ Boolean lit (false);
+ {
+ IsLiteralValue test (lit);
+ test.dispatch (m.type ());
+ }
+
+ if (!lit)
+ {
+ m.context ().set (
+ "default-value-member",
+ find_name (b + L"_default_value_", name_set_));
+ }
}
}
}