summaryrefslogtreecommitdiff
path: root/cli/traversal
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-05-10 17:54:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-05-10 17:54:18 +0200
commit443293aaf09eca7c3b88d621d056c4effee2c248 (patch)
treea35c7b2354295b5b73462c0806e04e2deef58171 /cli/traversal
parent4f9022f24c4591391637121c7274d9855b37bd93 (diff)
Implement option class inheritance
For now multiple, non-virtual inheritance is supported. An option class can now also be declared abstract using the class c = 0 {...}; syntax. New option, --exclude-base, controls whether base class information is present in usage and documentation.
Diffstat (limited to 'cli/traversal')
-rw-r--r--cli/traversal/class.cxx23
-rw-r--r--cli/traversal/class.hxx15
2 files changed, 38 insertions, 0 deletions
diff --git a/cli/traversal/class.cxx b/cli/traversal/class.cxx
index 8262e5d..3f178b6 100644
--- a/cli/traversal/class.cxx
+++ b/cli/traversal/class.cxx
@@ -7,15 +7,38 @@
namespace traversal
{
+ // inherits
+ //
+ void inherits::
+ traverse (type& i)
+ {
+ dispatch (i.base ());
+ }
+
+ // class_
+ //
void class_::
traverse (type& c)
{
pre (c);
+ inherits (c);
names (c);
post (c);
}
void class_::
+ inherits (type& c)
+ {
+ inherits (c, *this);
+ }
+
+ void class_::
+ inherits (type& c, edge_dispatcher& d)
+ {
+ iterate_and_dispatch (c.inherits_begin (), c.inherits_end (), d);
+ }
+
+ void class_::
pre (type&)
{
}
diff --git a/cli/traversal/class.hxx b/cli/traversal/class.hxx
index ef4433e..37f5f64 100644
--- a/cli/traversal/class.hxx
+++ b/cli/traversal/class.hxx
@@ -11,6 +11,15 @@
namespace traversal
{
+ struct inherits: edge<semantics::inherits>
+ {
+ inherits () {}
+ inherits (node_dispatcher& n) {node_traverser (n);}
+
+ virtual void
+ traverse (type&);
+ };
+
struct class_: scope_template<semantics::class_>
{
virtual void
@@ -20,6 +29,12 @@ namespace traversal
pre (type&);
virtual void
+ inherits (type&);
+
+ virtual void
+ inherits (type&, edge_dispatcher&);
+
+ virtual void
post (type&);
};
}