aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-04-15 11:11:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-04-15 11:11:51 +0200
commit8b5538ed49925aaf9fa22e961bd632bed8458184 (patch)
tree3b7be22e7a09c92d9996265e5f0de2cf37294727
parente02660308f271b843226618485e56cf3f3aa22f2 (diff)
Rename annotated() to annotated_p(), add claer_*() to Arguments
-rw-r--r--tests/dump/driver.cxx26
-rw-r--r--xsd-frontend/parser.cxx16
-rw-r--r--xsd-frontend/semantic-graph/elements.hxx30
-rw-r--r--xsd-frontend/transformations/restriction.cxx2
4 files changed, 50 insertions, 24 deletions
diff --git a/tests/dump/driver.cxx b/tests/dump/driver.cxx
index ccfe5aa..973a30a 100644
--- a/tests/dump/driver.cxx
+++ b/tests/dump/driver.cxx
@@ -50,7 +50,7 @@ namespace
virtual Void
traverse (Type& l)
{
- if (l.annotated ())
+ if (l.annotated_p ())
wcout << ind << "<" << l.annotation ().documentation () << ">"
<< endl;
@@ -80,7 +80,7 @@ namespace
virtual Void
traverse (Type& u)
{
- if (u.annotated ())
+ if (u.annotated_p ())
wcout << ind << "<" << u.annotation ().documentation () << ">"
<< endl;
@@ -116,7 +116,7 @@ namespace
virtual Void
traverse (Type& e)
{
- if (e.annotated ())
+ if (e.annotated_p ())
wcout << ind << "<" << e.annotation ().documentation () << ">"
<< endl;
@@ -129,7 +129,7 @@ namespace
virtual Void
traverse (Type& e)
{
- if (e.annotated ())
+ if (e.annotated_p ())
wcout << ind << "<" << e.annotation ().documentation () << ">"
<< endl;
@@ -233,7 +233,7 @@ namespace
virtual Void
traverse (Type& a)
{
- if (a.annotated ())
+ if (a.annotated_p ())
wcout << ind << "<" << a.annotation ().documentation () << ">"
<< endl;
@@ -268,7 +268,7 @@ namespace
virtual Void
traverse (Type& a)
{
- if (a.annotated ())
+ if (a.annotated_p ())
wcout << ind << "<" << a.annotation ().documentation () << ">"
<< endl;
@@ -311,7 +311,7 @@ namespace
virtual Void
traverse (Type& e)
{
- if (e.annotated ())
+ if (e.annotated_p ())
wcout << ind << "<" << e.annotation ().documentation () << ">"
<< endl;
@@ -340,7 +340,7 @@ namespace
virtual Void
traverse (Type& a)
{
- if (a.annotated ())
+ if (a.annotated_p ())
wcout << ind << "<" << a.annotation ().documentation () << ">"
<< endl;
@@ -363,7 +363,7 @@ namespace
c.context ().set ("seen", true);
- if (c.annotated ())
+ if (c.annotated_p ())
wcout << ind << "<" << c.annotation ().documentation () << ">"
<< endl;
@@ -391,7 +391,7 @@ namespace
virtual Void
traverse (Type& a)
{
- if (a.annotated ())
+ if (a.annotated_p ())
wcout << ind << "<" << a.annotation ().documentation () << ">"
<< endl;
@@ -425,7 +425,7 @@ namespace
virtual Void
traverse (Type& e)
{
- if (e.annotated ())
+ if (e.annotated_p ())
wcout << ind << "<" << e.annotation ().documentation () << ">"
<< endl;
@@ -519,7 +519,7 @@ namespace
s.context ().set ("seen", true);
- if (s.annotated ())
+ if (s.annotated_p ())
wcout << ind << "<" << s.annotation ().documentation () << ">" << endl;
wcout << ind << type << " " << u.path () << endl;
@@ -698,7 +698,7 @@ main (Int argc, Char* argv[])
//
//
- if (tu->annotated ())
+ if (tu->annotated_p ())
wcout << ind << "<" << tu->annotation ().documentation () << ">"
<< endl;
diff --git a/xsd-frontend/parser.cxx b/xsd-frontend/parser.cxx
index b9c76d2..49ab9c0 100644
--- a/xsd-frontend/parser.cxx
+++ b/xsd-frontend/parser.cxx
@@ -495,7 +495,7 @@ namespace XSDFrontend
// Transfer annotation if we haven't already gotten it.
//
- if (!m.annotated () && ref.annotated ())
+ if (!m.annotated_p () && ref.annotated_p ())
s_.new_edge<Annotates> (ref.annotation (), m);
// Type info.
@@ -994,7 +994,7 @@ namespace XSDFrontend
// Copy annotation.
//
- if (c.annotated ())
+ if (c.annotated_p ())
s_.new_edge<Annotates> (c.annotation (), copy);
for (Compositor::ContainsIterator i (c.contains_begin ());
@@ -1033,7 +1033,7 @@ namespace XSDFrontend
// Transfer annotation.
//
- if (a.annotated ())
+ if (a.annotated_p ())
s_.new_edge<Annotates> (a.annotation (), ac);
// Any has no name so we have to come up with a fake one in
@@ -1097,7 +1097,7 @@ namespace XSDFrontend
// Transfer annotation.
//
- if (e.annotated ())
+ if (e.annotated_p ())
s_.new_edge<Annotates> (e.annotation (), copy);
// Belongs edge.
@@ -1171,7 +1171,7 @@ namespace XSDFrontend
// Transfer annotation.
//
- if (p->annotated ())
+ if (p->annotated_p ())
s_.new_edge<Annotates> (p->annotation (), a);
// Belongs edge.
@@ -1195,7 +1195,7 @@ namespace XSDFrontend
// Transfer annotation.
//
- if (p->annotated ())
+ if (p->annotated_p ())
s_.new_edge<Annotates> (p->annotation (), any);
// AnyAttribute has no name so we have to come up with a fake
@@ -3901,7 +3901,7 @@ namespace XSDFrontend
// Transfer annotation if the ref declaration hasn't defined its own.
//
- if (!node.annotated () && prot.annotated ())
+ if (!node.annotated_p () && prot.annotated_p ())
s_->new_edge<Annotates> (prot.annotation (), node);
// Set type information.
@@ -4231,7 +4231,7 @@ namespace XSDFrontend
// Transfer annotation if the ref declaration hasn't defined its own.
//
- if (!node.annotated () && prot.annotated ())
+ if (!node.annotated_p () && prot.annotated_p ())
s_->new_edge<Annotates> (prot.annotation (), node);
// Set type.
diff --git a/xsd-frontend/semantic-graph/elements.hxx b/xsd-frontend/semantic-graph/elements.hxx
index dd397f2..ec425f6 100644
--- a/xsd-frontend/semantic-graph/elements.hxx
+++ b/xsd-frontend/semantic-graph/elements.hxx
@@ -195,11 +195,17 @@ namespace XSDFrontend
public:
Boolean
- annotated () const
+ annotated_p () const
{
return annotates_ != 0;
}
+ Annotates&
+ annotated () const
+ {
+ return *annotates_;
+ }
+
Annotation&
annotation ();
@@ -269,11 +275,17 @@ namespace XSDFrontend
public:
Boolean
- annotated () const
+ annotated_p () const
{
return annotates_ != 0;
}
+ Annotates&
+ annotated () const
+ {
+ return *annotates_;
+ }
+
Annotation&
annotation ();
@@ -1186,11 +1198,25 @@ namespace XSDFrontend
}
void
+ clear_left_node (Type& n)
+ {
+ assert (type_ == &n);
+ type_ = 0;
+ }
+
+ void
set_right_node (Specialization& s)
{
specialization_ = &s;
}
+ void
+ clear_right_node (Specialization& s)
+ {
+ assert (specialization_ == &s);
+ specialization_ = 0;
+ }
+
private:
Type* type_;
Specialization* specialization_;
diff --git a/xsd-frontend/transformations/restriction.cxx b/xsd-frontend/transformations/restriction.cxx
index 2fc3c7a..a7f224b 100644
--- a/xsd-frontend/transformations/restriction.cxx
+++ b/xsd-frontend/transformations/restriction.cxx
@@ -356,7 +356,7 @@ namespace XSDFrontend
// Transfer annotation.
//
- if (prot->annotated ())
+ if (prot->annotated_p ())
schema_.new_edge<Annotates> (prot->annotation (), *a);
}