/[papo]/papo/neb/neb/Tree/Tag.pm
ViewVC logotype

Diff of /papo/neb/neb/Tree/Tag.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jlenton, Wed Apr 9 19:59:22 2003 UTC revision 1.5 by jlenton, Wed Apr 9 23:52:49 2003 UTC
# Line 1  Line 1 
1  package neb::Tree::Tag;  package neb::Tree::Tag;
2  use strict;  use strict;
3    use English;
4  use Carp;  use Carp;
5  use neb::Tree::Node;  use neb::Tree::Node;
6  use neb::Tree::Container;  use neb::Tree::Container;
# Line 10  our $DEBUG; Line 11  our $DEBUG;
11  sub init  sub init
12  {  {
13      my $self = shift;      my $self = shift;
14      $self->name(@_);      my $name = shift;
15    
16        $self->name($name);
17      $self->{ATTRS} = {};      $self->{ATTRS} = {};
18        $self->SUPER::init(@_);
19      $DEBUG = $main::DEBUG;      $DEBUG = $main::DEBUG;
20  }  }
21    
# Line 25  sub name Line 29  sub name
29      return $self->{NAME};      return $self->{NAME};
30  }  }
31    
32    sub url
33    {
34        my $self = shift;
35    
36        return $self->location . '::' . $self->name;
37    }
38    
39  sub attribute  sub attribute
40  {  {
41      my $self = shift;      my $self = shift;
# Line 83  sub canonical_middle Line 94  sub canonical_middle
94  sub canonical_end  sub canonical_end
95  {  {
96      my $self = shift;      my $self = shift;
97      return '</' . $self->name . ($self->attribute('name') ? " " . $self->attribute('name') : '' ) . '>';      return '</' . $self->name . '>';
98  }  }
99    
100    
# Line 108  sub code_start Line 119  sub code_start
119          }          }
120      }      }
121                                                        
122      $code .= ">\"; \# Tag::code_start\n";      $code .= ">\";";
123        $code .= "\# Tag::code_start\n" if ($DEBUG);
124    
125      return $code;      return $code;
126  }  }
127    
128  sub code_end  sub code_middle
129  {  {
130      my $self = shift;      my $self = shift;
131    
132      my $code = '';      return $self->SUPER::code;
133    }
134    
135      $code .= "# Tag::code_end:\n\t" if ($DEBUG);  sub code_end
136    {
137        my $self = shift;
138        my $code = '';
139    
140        $code .= "# Tag::code_end\n\t" if ($DEBUG);
141      $code .= sprintf ("\$OUTPUT .= \"%s\";\n", $self->canonical_end);      $code .= sprintf ("\$OUTPUT .= \"%s\";\n", $self->canonical_end);
142    
143      return $code;      return $code;
# Line 129  sub code_end Line 146  sub code_end
146  sub code  sub code
147  {  {
148      my $self = shift;      my $self = shift;
149      return $self->code_start . $self->SUPER::code . $self->code_end;  
150        return $self->code_start . $self->code_middle . $self->code_end;
151  }      }    
152    
153  1;  1;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26