4 |
use neb::Tree::Node; |
use neb::Tree::Node; |
5 |
use neb::Tree::Container; |
use neb::Tree::Container; |
6 |
|
|
7 |
our @ISA = ('neb::Tree::Node'); |
our @ISA = ('neb::Tree::Container'); |
8 |
our $DEBUG; |
our $DEBUG; |
9 |
|
|
10 |
sub init |
sub init |
12 |
my $self = shift; |
my $self = shift; |
13 |
$self->name(@_); |
$self->name(@_); |
14 |
$self->{ATTRS} = {}; |
$self->{ATTRS} = {}; |
|
$self->{CONTAINER} = new neb::Tree::Container; |
|
|
$self->{CONTAINER}->parent($self); |
|
|
|
|
15 |
$DEBUG = $main::DEBUG; |
$DEBUG = $main::DEBUG; |
16 |
} |
} |
17 |
|
|
45 |
return %{$self->{ATTRS}}; |
return %{$self->{ATTRS}}; |
46 |
} |
} |
47 |
|
|
|
sub add_content |
|
|
{ |
|
|
my $self = shift; |
|
|
$self->container->add_content(@_); |
|
|
} |
|
|
|
|
|
sub container |
|
|
{ |
|
|
my $self = shift; |
|
|
|
|
|
return $self->{CONTAINER}; |
|
|
} |
|
|
|
|
48 |
sub canonical |
sub canonical |
49 |
{ |
{ |
50 |
my $self = shift; |
my $self = shift; |
51 |
my %h = $self->attributes; |
my %h = $self->attributes; |
52 |
return $self->canonical_start . $self->container->canonical . $self->canonical_end; |
return $self->canonical_start . $self->canonical_middle . $self->canonical_end; |
53 |
} |
} |
54 |
|
|
55 |
my $attr_sorter = sub { |
my $attr_sorter = sub { |
74 |
map(" $_='\Q$h{$_}\E'", sort $attr_sorter keys %h), '>'); |
map(" $_='\Q$h{$_}\E'", sort $attr_sorter keys %h), '>'); |
75 |
} |
} |
76 |
|
|
77 |
|
sub canonical_middle |
78 |
|
{ |
79 |
|
my $self = shift; |
80 |
|
return $self->SUPER::canonical; |
81 |
|
} |
82 |
|
|
83 |
sub canonical_end |
sub canonical_end |
84 |
{ |
{ |
85 |
my $self = shift; |
my $self = shift; |
129 |
sub code |
sub code |
130 |
{ |
{ |
131 |
my $self = shift; |
my $self = shift; |
132 |
return $self->code_start . $self->container->code . $self->code_end; |
return $self->code_start . $self->SUPER::code . $self->code_end; |
133 |
} |
} |
134 |
|
|
135 |
1; |
1; |