summaryrefslogtreecommitdiffstats
path: root/kalyptus/kdocAstUtil.pm
diff options
context:
space:
mode:
Diffstat (limited to 'kalyptus/kdocAstUtil.pm')
-rw-r--r--kalyptus/kdocAstUtil.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/kalyptus/kdocAstUtil.pm b/kalyptus/kdocAstUtil.pm
index 9c8c0dd..8c24430 100644
--- a/kalyptus/kdocAstUtil.pm
+++ b/kalyptus/kdocAstUtil.pm
@@ -442,6 +442,33 @@ sub inheritedBy
}
}
+=head2 inheritsAsVirtual
+
+ Parameters: (selfNode) classNode
+
+ Tells if C<classNode> is a virtual ancestor of C<selfNode>
+ e.g: $self->kdocAstUtil::inheritsAsVirtual($other)
+
+=cut
+
+sub inheritsAsVirtual
+{
+ my ( $self, $node ) = @_;
+
+ return 0 unless exists $self->{InList};
+
+ for my $in( @{ $self->{InList} } )
+ {
+ return 1 if
+ inheritName($in) eq $node->{astNodeName} and
+ $in->{Type} =~ /virtual/;
+ return 1 if $in->{Node} &&
+ $in->{Node}->kdocAstUtil::inheritsAsVirtual( $node );
+ }
+ return 0
+}
+
+
=head2 hasLocalInheritor
Parameter: node