ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/BuildFile.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildSystem/BuildFile.pm (file contents):
Revision 1.26 by sashby, Fri Dec 10 13:41:37 2004 UTC vs.
Revision 1.33 by muzaffar, Fri Jan 14 17:36:42 2011 UTC

# Line 12 | Line 12
12   package BuildSystem::BuildFile;
13   require 5.004;
14   use Exporter;
15 use BuildSystem::TagUtils;
16 use BuildSystem::BuildDataUtils;
15   use ActiveDoc::SimpleDoc;
16  
17 < @ISA=qw(Exporter BuildSystem::BuildDataUtils);
17 > @ISA=qw(Exporter);
18   @EXPORT_OK=qw( );
21
19   #
20   sub new()
21     ###############################################################
# Line 33 | Line 30 | sub new()
30     {
31     my $proto=shift;
32     my $class=ref($proto) || $proto;
33 <   my $self={};
37 <  
33 >   $self={};
34     bless $self,$class;
39
35     $self->{DEPENDENCIES} = {};
36     $self->{content} = {};
37 +   $self->{scramdoc}=ActiveDoc::SimpleDoc->new();
38 +   $self->{scramdoc}->newparse("builder",__PACKAGE__,'Subs',shift);
39     return $self;
40     }
41  
42 < sub _initparser()
42 > sub parse()
43     {
44     my $self=shift;
45 +   my ($filename)=@_;
46 +   my $fhead='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><doc type="BuildSystem::BuildFile" version="1.0">';
47 +   my $ftail='</doc>';
48 +   $self->{scramdoc}->filetoparse($filename);
49 +   $self->{scramdoc}->parse("builder",$fhead,$ftail);
50 +   # We're done with the SimpleDoc object so delete it:
51 +   delete $self->{scramdoc};
52 +   }
53  
54 <   $self->{simpledoc}=ActiveDoc::SimpleDoc->new();
55 <   $self->{simpledoc}->newparse("builder");
56 <   $self->{simpledoc}->addignoretags("builder");
57 <
58 <   # For blank lines do nothing:
59 <   $self->{simpledoc}->addtag("builder","none",
60 <                              "", $self,
61 <                              "", $self,
62 <                              "", $self);
63 <  
64 <   # Define the tags to be used in this class:
60 <   $self->{simpledoc}->addtag("builder","classpath",
61 <                              \&BuildSystem::TagUtils::classpathtagOpen, $self,
62 <                              "", $self,
63 <                              "", $self);
64 <
65 <   $self->{simpledoc}->addtag("builder","productstore",
66 <                              \&BuildSystem::TagUtils::productstoretagOpen, $self,
67 <                              "", $self,
68 <                              "", $self);
69 <
70 <   $self->{simpledoc}->addtag("builder","architecture",
71 <                              \&BuildSystem::TagUtils::archtagOpen, $self,
72 <                              "", $self,
73 <                              \&BuildSystem::TagUtils::archtagClose, $self);
74 <
75 <   $self->{simpledoc}->addtag("builder","include_path",
76 <                              \&BuildSystem::TagUtils::includetagOpen, $self,
77 <                              "", $self,
78 <                              "", $self);
79 <  
80 <   $self->{simpledoc}->addtag("builder","define_group",
81 <                              \&BuildSystem::TagUtils::groupdeftagOpen, $self,
82 <                              "", $self,
83 <                              \&BuildSystem::TagUtils::groupdeftagClose, $self);
84 <  
85 <   $self->{simpledoc}->addtag("builder","group",
86 <                              \&BuildSystem::TagUtils::grouptagOpen, $self,
87 <                              "", $self,
88 <                              "", $self);
89 <  
90 <   $self->{simpledoc}->addtag("builder","lib",
91 <                              \&BuildSystem::TagUtils::libtagOpen, $self,
92 <                              "", $self,
93 <                              "", $self);
94 <
95 <   $self->{simpledoc}->addtag("builder","export",
96 <                              \&BuildSystem::TagUtils::exporttagOpen, $self,
97 <                              "", $self,
98 <                              \&BuildSystem::TagUtils::exporttagClose, $self);
99 <
100 <   $self->{simpledoc}->addtag("builder","use",
101 <                              \&BuildSystem::TagUtils::usetagOpen, $self,
102 <                              "", $self,
103 <                              "", $self);
104 <  
105 <   $self->{simpledoc}->addtag("builder","libtype",
106 <                              \&BuildSystem::TagUtils::libtypetagOpen, $self,
107 <                              "", $self,
108 <                              "", $self);
109 <  
110 <   $self->{simpledoc}->addtag("builder","makefile",
111 <                              \&BuildSystem::TagUtils::makefiletagOpen, $self,
112 <                              \&BuildSystem::TagUtils::makefiletagContent, $self,
113 <                              \&BuildSystem::TagUtils::makefiletagClose, $self);
114 <
115 <   $self->{simpledoc}->addtag("builder","flags",
116 <                              \&BuildSystem::TagUtils::flagstagOpen, $self,
117 <                              "", $self,
118 <                              "", $self);
119 <  
120 <   $self->{simpledoc}->addtag("builder","bin",
121 <                              \&BuildSystem::TagUtils::binarytagOpen, $self,
122 <                              "", $self,
123 <                              \&BuildSystem::TagUtils::binarytagClose, $self);
124 <  
125 <   $self->{simpledoc}->addtag("builder","module",
126 <                              \&BuildSystem::TagUtils::moduletagOpen, $self,
127 <                              "", $self,
128 <                              \&BuildSystem::TagUtils::moduletagClose, $self);
129 <  
130 <   $self->{simpledoc}->addtag("builder","application",
131 <                              \&BuildSystem::TagUtils::applicationtagOpen, $self,
132 <                              "", $self,
133 <                              \&BuildSystem::TagUtils::applicationtagClose, $self);
134 <
135 <   $self->{simpledoc}->addtag("builder","library",
136 <                              \&BuildSystem::TagUtils::librarytagOpen, $self,
137 <                              "", $self,
138 <                              \&BuildSystem::TagUtils::librarytagClose, $self);
139 <
140 < #    $self->{simpledoc}->addtag("builder"," ",
141 < #                             \&BuildSystem::TagUtils::  ,$self,
142 < #                             \&BuildSystem::TagUtils::  ,$self,
143 < #                             \&BuildSystem::TagUtils::  ,$self);
144 <
145 <   return $self->{simpledoc};
54 > sub classpath()
55 >   {
56 >   my ($object,$name,%attributes)=@_;
57 >   # The getter part:
58 >   if (ref($object) eq __PACKAGE__)
59 >      {
60 >      return $self->{content}->{CLASSPATH};
61 >      }
62 >  
63 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{CLASSPATH}}, $attributes{'path'})
64 >      : push(@{$self->{content}->{CLASSPATH}}, $attributes{'path'});
65     }
66  
67 < sub parse()
67 > sub productstore()
68 >   {
69 >   my ($object,$name,%attributes)=@_;
70 >   # The getter part:
71 >   if (ref($object) eq __PACKAGE__)
72 >      {
73 >      # Return an array of ProductStore hashes:
74 >      return $self->{content}->{PRODUCTSTORE};
75 >      }
76 >  
77 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{PRODUCTSTORE}}, \%attributes)
78 >      : push(@{$self->{content}->{PRODUCTSTORE}}, \%attributes) ;
79 >   }
80 >
81 > sub include()
82     {
83     my $self=shift;
84 <   my ($filename)=@_;
84 >   # Return an array of required includes:
85 >   return $self->{content}->{INCLUDE};
86 >   }
87  
88 <   $self->{simpledoc}=$self->_initparser();
89 <   $self->{simpledoc}->filetoparse($filename);
90 <   $self->{simpledoc}->parse("builder");
91 <  
92 <   # We're done with the SimpleDoc object so delete it:
93 <   delete $self->{simpledoc};
88 > sub include_path()
89 >   {
90 >   my ($object,$name,%attributes)=@_;
91 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{INCLUDE}}, $attributes{'path'})
92 >      : push(@{$self->{content}->{INCLUDE}}, $attributes{'path'});
93 >   }
94 >
95 > sub use()
96 >   {
97 >   my $object=shift;
98 >   # The getter part:
99 >   if (ref($object) eq __PACKAGE__)
100 >      {
101 >      # Add or return uses (package deps):
102 >      @_ ? push(@{$self->{content}->{USE}},@_)
103 >         : @{$self->{content}->{USE}};
104 >      }
105 >   else
106 >      {
107 >      my ($name,%attributes)=@_;
108 >      $self->{DEPENDENCIES}->{$attributes{'name'}} = 1;
109 >      $self->{nested} == 1 ? push(@{$self->{tagcontent}->{USE}}, $attributes{'name'})
110 >         : push(@{$self->{content}->{USE}}, $attributes{'name'});
111 >      }
112 >   }
113 >
114 > sub architecture()
115 >   {
116 >   my ($object,$name,%attributes)=@_;
117 >   $self->pushlevel(\%attributes); # Set nested to 1;
118 >   }
119 >
120 > sub architecture_()
121 >   {
122 >   $self->{content}->{ARCH}->{$self->{id}->{'name'}}=$self->{tagcontent};
123 >   $self->poplevel();
124 >   }
125 >
126 > sub export()
127 >   {
128 >   $self->pushlevel(); # Set nested to 1;
129 >   }
130 >
131 > sub export_()
132 >   {
133 >   $self->{content}->{EXPORT} = $self->{tagcontent};
134 >   $self->poplevel();
135 >   }
136 >
137 > sub lib()
138 >   {
139 >   my ($object,$name,%attributes)=@_;
140 >   # The getter part:
141 >   if (ref($object) eq __PACKAGE__)
142 >      {
143 >      # Return an array of required libs:
144 >      return $self->{content}->{LIB};      
145 >      }
146 >  
147 >   my $libname;
148 >  
149 >   if (exists($attributes{'position'}))
150 >      {
151 >      if ($attributes{'position'} eq 'first')
152 >         {
153 >         $libname = "F:".$attributes{'name'};
154 >         }
155 >      else
156 >         {
157 >         # There was a position entry but it didn't make sense:
158 >         $libname = $attributes{'name'};
159 >         }
160 >      }
161 >   else
162 >      {
163 >      $libname = $attributes{'name'};
164 >      }
165 >   # We have a libname, add it to the list:
166 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{LIB}}, $libname)
167 >      : push(@{$self->{content}->{LIB}}, $libname);
168 >   }
169 >
170 > sub libtype()
171 >   {
172 >   my ($object,$name,%attributes)=@_;
173 >   # The getter part:
174 >   if (ref($object) eq __PACKAGE__)
175 >      {
176 >      # Return an array of required libs:
177 >      return $self->{content}->{LIBTYPE};      
178 >      }
179 >
180 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{LIBTYPE}}, $attributes{'type'})
181 >      : push(@{$self->{content}->{LIBTYPE}}, $attributes{'type'});
182     }
183  
184 < sub _initbranchparser()
184 > sub skip()
185 >   {
186 >   my ($object,$name,%attributes)=@_;
187 >   $self->{nested} == 1 ? $self->{tagcontent}->{SKIPPEDDIRS} = [ 1 ]
188 >      : $self->{content}->{SKIPPEDDIRS} = [ 1 ];
189 >   }
190 >
191 > sub skip_message()
192 >   {
193 >   my ($object,$name,@message) = @_;
194 >   # Save any message text between <skip> tags:
195 >   if ($#message > -1)
196 >      {
197 >      $self->{nested} == 1 ? push(@{$self->{tagcontent}->{SKIPPEDDIRS}}, [ @message ])
198 >         : push(@{$self->{content}->{SKIPPEDDIRS}}, [ @message ]);
199 >      }
200 >   }
201 >
202 > sub skip_()
203 >   {
204 >   my ($object,$name)=@_;
205 >   }
206 >
207 > sub makefile()
208 >   {
209 >   my ($object,$name,%attributes)=@_;
210 >   # The getter part:
211 >   if (ref($object) eq __PACKAGE__)
212 >      {
213 >      return $self->{content}->{MAKEFILE};
214 >      }
215 >   }
216 >
217 > sub makefile_()
218 >   {
219 >   my ($object,$name,$cdata)=@_;
220 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{MAKEFILE}}, join("\n",@$cdata))
221 >      : push(@{$self->{content}->{MAKEFILE}}, join("\n",@$cdata));
222 >   }
223 >
224 > sub flags()
225 >   {
226 >   my ($object,$name,%attributes)=@_;
227 >   # The getter part:
228 >   if (ref($object) eq __PACKAGE__)
229 >      {
230 >      # Return an array of ProductStore hashes:
231 >      return $self->{content}->{FLAGS};
232 >      }
233 >  
234 >   # Extract the flag name and its value:
235 >   my ($flagname,$flagvaluestring) = each %attributes;
236 >   $flagname =~ tr/[a-z]/[A-Z]/; # Keep flag name uppercase
237 >   chomp($flagvaluestring);
238 >   my @flagvalues = ( $flagvaluestring );
239 >   # Is current tag within another tag block?
240 >   if ($self->{nested} == 1)
241 >      {
242 >      # Check to see if the current flag name is already stored in the hash. If so,
243 >      # just add the new values to the array of flag values:
244 >      if (exists ($self->{tagcontent}->{FLAGS}->{$flagname}))
245 >         {
246 >         push(@{$self->{tagcontent}->{FLAGS}->{$flagname}},@flagvalues);
247 >         }
248 >      else
249 >         {
250 >         $self->{tagcontent}->{FLAGS}->{$flagname} = [ @flagvalues ];
251 >         }
252 >      }
253 >   else
254 >      {
255 >      if (exists ($self->{content}->{FLAGS}->{$flagname}))
256 >         {
257 >         push(@{$self->{content}->{FLAGS}->{$flagname}},@flagvalues);
258 >         }
259 >      else
260 >         {
261 >         $self->{content}->{FLAGS}->{$flagname} = [ @flagvalues ];
262 >         }
263 >      }
264 >   }
265 >
266 > sub allflags()
267     {
268     my $self=shift;
269 +   # Return hash data for flags:
270 +   return $self->{content}->{FLAGS};
271 +   }
272  
273 <   $self->{simpledoc}=ActiveDoc::SimpleDoc->new();
274 <   $self->{simpledoc}->newparse("branchbuilder");
275 <   $self->{simpledoc}->addignoretags("branchbuilder");
276 <
277 <   # For blank lines do nothing:
278 <   $self->{simpledoc}->addtag("branchbuilder","none",
279 <                              "", $self,
280 <                              "", $self,
281 <                              "", $self);
282 <  
283 <   # Define the tags to be used in this class:
284 <   $self->{simpledoc}->addtag("branchbuilder","productstore",
285 <                              \&BuildSystem::TagUtils::productstoretagOpen, $self,
286 <                              "", $self,
287 <                              "", $self);
288 <  
289 <   $self->{simpledoc}->addtag("branchbuilder","architecture",
290 <                              \&BuildSystem::TagUtils::archtagOpen, $self,
291 <                              "", $self,
292 <                              \&BuildSystem::TagUtils::archtagClose, $self);
293 <
294 <   $self->{simpledoc}->addtag("branchbuilder","include_path",
295 <                              \&BuildSystem::TagUtils::includetagOpen, $self,
296 <                              "", $self,
297 <                              "", $self);
298 <  
299 <   $self->{simpledoc}->addtag("branchbuilder","export",
300 <                              \&BuildSystem::TagUtils::exporttagOpen, $self,
301 <                              "", $self,
302 <                              \&BuildSystem::TagUtils::exporttagClose, $self);
303 <
304 <   $self->{simpledoc}->addtag("branchbuilder","define_group",
305 <                              \&BuildSystem::TagUtils::groupdeftagOpen, $self,
306 <                              "", $self,
307 <                              \&BuildSystem::TagUtils::groupdeftagClose, $self);
308 <  
309 <   $self->{simpledoc}->addtag("branchbuilder","group",
310 <                              \&BuildSystem::TagUtils::grouptagOpen, $self,
311 <                              "", $self,
312 <                              "", $self);
313 <  
314 <   $self->{simpledoc}->addtag("branchbuilder","lib",
315 <                              \&BuildSystem::TagUtils::libtagOpen, $self,
316 <                              "", $self,
317 <                              "", $self);
318 <
319 <   $self->{simpledoc}->addtag("branchbuilder","use",
320 <                              \&BuildSystem::TagUtils::usetagOpen, $self,
321 <                              "", $self,
322 <                              "", $self);
323 <  
324 <   $self->{simpledoc}->addtag("branchbuilder","libtype",
325 <                              \&BuildSystem::TagUtils::libtypetagOpen, $self,
326 <                              "", $self,
327 <                              "", $self);
328 <  
329 <   $self->{simpledoc}->addtag("branchbuilder","makefile",
330 <                              \&BuildSystem::TagUtils::makefiletagOpen, $self,
331 <                              \&BuildSystem::TagUtils::makefiletagContent, $self,
332 <                              \&BuildSystem::TagUtils::makefiletagClose, $self);
333 <
334 <   $self->{simpledoc}->addtag("branchbuilder","flags",
335 <                              \&BuildSystem::TagUtils::flagstagOpen, $self,
336 <                              "", $self,
229 <                              "", $self);
230 <  
231 <   $self->{simpledoc}->addtag("branchbuilder","bin",
232 <                              \&BuildSystem::TagUtils::binarytagOpen, $self,
233 <                              "", $self,
234 <                              \&BuildSystem::TagUtils::binarytagClose, $self);
235 <  
236 <   $self->{simpledoc}->addtag("branchbuilder","module",
237 <                              \&BuildSystem::TagUtils::moduletagOpen, $self,
238 <                              "", $self,
239 <                              \&BuildSystem::TagUtils::moduletagClose, $self);
240 <  
241 <   $self->{simpledoc}->addtag("branchbuilder","application",
242 <                              \&BuildSystem::TagUtils::applicationtagOpen, $self,
243 <                              "", $self,
244 <                              \&BuildSystem::TagUtils::applicationtagClose, $self);
245 <
246 <   $self->{simpledoc}->addtag("branchbuilder","library",
247 <                              \&BuildSystem::TagUtils::librarytagOpen, $self,
248 <                              "", $self,
249 <                              \&BuildSystem::TagUtils::librarytagClose, $self);
250 <  
251 <   return $self->{simpledoc};
252 <   }
253 <
254 < sub parsebranchfiles()
255 <   {
256 <   my $self=shift;
257 <   my ($filenames)=@_; # array ref
258 <   # List of buildfiles:
259 <   $self->{localpaths}=$filenames;
260 <   $self->{simpledoc}=$self->_initbranchparser();
261 <   # We iterate over an array of files to be read in turn: all
262 <   # build data will be stored in the same BuildFile object:
263 <   $self->{simpledoc}->parsefilelist("branchbuilder",$filenames);
264 <   # We're done with the SimpleDoc object so delete it:
265 <   delete $self->{simpledoc};
273 > sub archspecific()
274 >   {
275 >   my $self=shift;
276 >  
277 >   # Check to see if there is arch-dependent data. If so, return it:
278 >   if ((my $nkeys=keys %{$self->{content}->{ARCH}}) > 0)
279 >      {
280 >      while (my ($k,$v) = each %{$self->{content}->{ARCH}})
281 >         {
282 >         if ( $ENV{SCRAM_ARCH} =~ /$k.*/ )
283 >            {
284 >            return $self->{content}->{ARCH}->{$k};
285 >            }
286 >         }
287 >      }
288 >   return "";
289 >   }
290 >
291 > sub bin()
292 >   {
293 >   my ($object,$name,%attributes) = @_;
294 >   $self->pushlevel(\%attributes);# Set nested to 1;
295 >   }
296 >
297 > sub bin_()
298 >   {
299 >   # Need unique name for the binary (always use name of product). Either use "name"
300 >   # given, or use "file" value minus the ending:
301 >   if (exists ($self->{id}->{'name'}))
302 >      {
303 >      $name = $self->{id}->{'name'};
304 >      }
305 >   else
306 >      {
307 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
308 >      }
309 >
310 >   # Store the data:
311 >   $self->productcollector($name,'bin','BIN');
312 >   $self->poplevel();
313 >   }
314 >
315 > sub library()
316 >   {
317 >   my ($object,$name,%attributes) = @_;
318 >   $self->pushlevel(\%attributes);# Set nested to 1;
319 >   }
320 >
321 > sub library_()
322 >   {
323 >   # Need unique name for the library (always use name of product). Either use "name"
324 >   # given, or use "file" value minus the ending:
325 >   if (exists ($self->{id}->{'name'}))
326 >      {
327 >      $name = $self->{id}->{'name'};
328 >      }
329 >   else
330 >      {
331 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
332 >      }
333 >
334 >   # Store the data:
335 >   $self->productcollector($name,'lib','LIBRARY');
336 >   $self->poplevel();
337     }
338  
339   sub productcollector()
# Line 275 | Line 346 | sub productcollector()
346     # Store the name:
347     $product->name($name);
348     $product->type($typeshort);
349 <   # Store the files:
350 <   $product->_files($self->{id}->{'file'},$self->{localpaths});
349 >   # Store the files. Take the BuildFile path as the initial path for
350 >   # expanding source file globs:
351 >   $product->_files($self->{id}->{'file'},[ $self->{scramdoc}->filetoparse() ]);
352     # Store the data content:
353     $product->_data($self->{tagcontent});
354     # And store in a hash (all build products in same place):
# Line 311 | Line 383 | sub dependencies()
383     return \%DEPS;
384     }
385  
386 < #
387 < # All data access methods are inherited from BuildDataUtils.
388 < #
386 > sub skippeddirs()
387 >   {
388 >   my $self=shift;
389 >   my ($here)=@_;
390 >   my $skipped;
391 >
392 >   if ($self->{content}->{SKIPPEDDIRS}->[0] == 1)
393 >      {
394 >      $skipped = [ @{$self->{content}->{SKIPPEDDIRS}} ];
395 >      delete $self->{content}->{SKIPPEDDIRS};
396 >      }
397 >  
398 >   delete $self->{content}->{SKIPPEDDIRS};
399 >   return $skipped;
400 >   }
401 >
402 > sub hasexport()
403 >   {
404 >   my $self=shift;
405 >   # Check to see if there is a valid export block:
406 >   my $nkeys = $self->exporteddatatypes();
407 >   $nkeys > 0 ? return 1 : return 0;
408 >   }
409 >
410 > sub has()
411 >   {
412 >   my $self=shift;
413 >   my ($datatype)=@_;  
414 >   (exists ($self->{content}->{$datatype})) ? return 1 : return 0;
415 >   }
416 >
417 > sub exported()
418 >   {
419 >   my $self=shift;
420 >   # Return a hash. Keys are type of data provided:
421 >   return ($self->{content}->{EXPORT});
422 >   }
423 >
424 > sub exporteddatatypes()
425 >   {
426 >   my $self=shift;
427 >   # Return exported data types:
428 >   return keys %{$self->{content}->{EXPORT}};
429 >   }
430 >
431 > sub buildproducts()
432 >   {
433 >   my $self=shift;
434 >   # Returns hash of build products and their data:
435 >   return $self->{content}->{BUILDPRODUCTS};
436 >   }
437 >
438 > sub values()
439 >   {
440 >   my $self=shift;
441 >   my ($type)=@_;
442 >   # Get a list of values from known types
443 >   return $self->{content}->{BUILDPRODUCTS}->{$type};
444 >   }
445 >
446 > sub basic_tags()
447 >   {
448 >   my $self=shift;
449 >   my $datatags=[];
450 >   my $buildtags=[ qw(BIN LIBRARY BUILDPRODUCTS) ];
451 >   my $skiptags=[ qw(ARCH EXPORT USE CLASSPATH) ];
452 >   my $otherskiptags=[ qw( SKIPPEDDIRS ) ];
453 >   my @all_skip_tags;
454 >  
455 >   push(@all_skip_tags,@$skiptags,@$buildtags,@$otherskiptags);
456 >
457 >   foreach my $t (keys %{$self->{content}})
458 >      {
459 >      push(@$datatags,$t),if (! grep($t eq $_, @all_skip_tags));
460 >      }
461 >   return @{$datatags};
462 >   }
463 >
464 > sub clean()
465 >   {
466 >   my $self=shift;
467 >   my (@tags) = @_;
468 >
469 >   # Delete some useless entries:
470 >   delete $self->{simpledoc};
471 >   delete $self->{id};
472 >   delete $self->{tagcontent};
473 >   delete $self->{nested};
474 >
475 >   delete $self->{DEPENDENCIES};
476 >  
477 >   map
478 >      {
479 >      delete $self->{content}->{$_} if (exists($self->{content}->{$_}));
480 >      } @tags;
481 >  
482 >   return $self;
483 >   }
484 >
485 > sub AUTOLOAD()
486 >   {
487 >   my ($xmlparser,$name,%attributes)=@_;
488 >   return if $AUTOLOAD =~ /::DESTROY$/;
489 >   my $name=$AUTOLOAD;
490 >   $name =~ s/.*://;
491 >   }
492 >
493   1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines