aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-07-30 10:18:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-07-30 10:18:53 +0200
commit5005d4d4bd444eed25e3d60bef6ced160a84bb5b (patch)
tree99d73f8d5d65d5e421390d4bf5240873e300dc40
parentd3f5ac5a3a504a08d91da884edbc28b3e5204429 (diff)
Support for abstract complex types
-rw-r--r--xsd-frontend/parser.cxx11
-rw-r--r--xsd-frontend/semantic-graph/complex.cxx9
-rw-r--r--xsd-frontend/semantic-graph/complex.hxx9
3 files changed, 23 insertions, 6 deletions
diff --git a/xsd-frontend/parser.cxx b/xsd-frontend/parser.cxx
index 6b582ab..6a37475 100644
--- a/xsd-frontend/parser.cxx
+++ b/xsd-frontend/parser.cxx
@@ -3148,7 +3148,10 @@ namespace XSDFrontend
pop_scope ();
else
{
- Complex& node (s_->new_node<Complex> (file (), t.line (), t.column ()));
+ // Really a simple type so not abstract/mixed checks.
+ //
+ Complex& node (s_->new_node<Complex> (
+ file (), t.line (), t.column (), false));
if (base_type)
restricts = &s_->new_edge<Restricts> (node, *base_type);
@@ -3202,7 +3205,11 @@ namespace XSDFrontend
{
Type* r (0);
- Complex& node (s_->new_node<Complex> (file (), t.line (), t.column ()));
+ String abs_s (trim (t["abstract"]));
+ bool abs (abs_s == L"true" || abs_s == L"1");
+
+ Complex& node (s_->new_node<Complex> (
+ file (), t.line (), t.column (), abs));
if (String m = trim (t["mixed"]))
node.mixed_p (m == L"true" || m == L"1");
diff --git a/xsd-frontend/semantic-graph/complex.cxx b/xsd-frontend/semantic-graph/complex.cxx
index 8433a0e..5ac1d6f 100644
--- a/xsd-frontend/semantic-graph/complex.cxx
+++ b/xsd-frontend/semantic-graph/complex.cxx
@@ -12,14 +12,17 @@ namespace XSDFrontend
{
Complex::
Complex ()
- : mixed_ (false), contains_compositor_ (0)
+ : abstract_ (false), mixed_ (false), contains_compositor_ (0)
{
}
Complex::
- Complex (Path const& file, unsigned long line, unsigned long column)
+ Complex (Path const& file,
+ unsigned long line,
+ unsigned long column,
+ bool abstract)
: Node (file, line, column),
- mixed_ (false), contains_compositor_ (0)
+ abstract_ (abstract), mixed_ (false), contains_compositor_ (0)
{
}
diff --git a/xsd-frontend/semantic-graph/complex.hxx b/xsd-frontend/semantic-graph/complex.hxx
index ac47810..c04de74 100644
--- a/xsd-frontend/semantic-graph/complex.hxx
+++ b/xsd-frontend/semantic-graph/complex.hxx
@@ -16,6 +16,9 @@ namespace XSDFrontend
{
public:
bool
+ abstract_p () const {return abstract_;}
+
+ bool
mixed_p () const
{
if (mixed_)
@@ -55,7 +58,10 @@ namespace XSDFrontend
}
public:
- Complex (Path const& file, unsigned long line, unsigned long column);
+ Complex (Path const& file,
+ unsigned long line,
+ unsigned long column,
+ bool abstract);
void
add_edge_left (ContainsCompositor& e)
@@ -78,6 +84,7 @@ namespace XSDFrontend
Complex (); // For virtual inheritance (Enumeration).
private:
+ bool abstract_;
bool mixed_;
ContainsCompositor* contains_compositor_;
};