File Coverage

blib/lib/SGML/Grove.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             #
2             # Copyright (C) 1997 Ken MacLeod
3             # See the file COPYING for distribution terms.
4             #
5             # $Id: Grove.pm,v 1.1 1998/01/18 00:21:13 ken Exp $
6             #
7              
8             package SGML::Grove;
9              
10 1     1   4162 use SGML::Element;
  0            
  0            
11             use SGML::SData;
12             use SGML::PI;
13             use SGML::Notation;
14             use SGML::Entity;
15             use SGML::ExtEntity;
16             use SGML::SubDocEntity;
17              
18             use strict;
19             use vars qw($VERSION @ISA);
20             use Class::Visitor;
21              
22             visitor_class 'SGML::Grove', 'Class::Visitor::Base',
23             [
24             'errors' => '@', # [0]
25             'entities' => '%', # [1]
26             'notations' => '%', # [2]
27             'contents' => '@', # [3]
28             ];
29              
30             package SGML::Grove;
31              
32             $VERSION = '2.03';
33              
34             sub root {
35             my $self = shift;
36              
37             return $self->contents->[0];
38             }
39              
40             # synonomous to `accept'
41             sub accept_gi {
42             my $self = shift;
43             my $visitor = shift;
44              
45             $visitor->visit_SGML_Grove ($self, @_);
46             }
47              
48             sub children_accept_gi {
49             my $self = shift;
50              
51             $self->root->accept_gi (@_);
52             }
53              
54             1;
55             __END__