| blib/lib/CORBA/HTML/CommentVisitor.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 6 | 294 | 2.0 |
| branch | 0 | 82 | 0.0 |
| condition | 0 | 21 | 0.0 |
| subroutine | 2 | 34 | 5.8 |
| pod | 0 | 23 | 0.0 |
| total | 8 | 454 | 1.7 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | |||||||
| 2 | # | ||||||
| 3 | # Interface Definition Language (OMG IDL CORBA v3.0) | ||||||
| 4 | # | ||||||
| 5 | |||||||
| 6 | package CORBA::HTML::CommentVisitor; | ||||||
| 7 | |||||||
| 8 | 1 | 1 | 7 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 46 | ||||||
| 9 | 1 | 1 | 6 | use warnings; | |||
| 1 | 2 | ||||||
| 1 | 5910 | ||||||
| 10 | |||||||
| 11 | our $VERSION = '2.60'; | ||||||
| 12 | |||||||
| 13 | sub new { | ||||||
| 14 | 0 | 0 | 0 | my $proto = shift; | |||
| 15 | 0 | 0 | my $class = ref($proto) || $proto; | ||||
| 16 | 0 | my $self = {}; | |||||
| 17 | 0 | bless $self, $class; | |||||
| 18 | 0 | $self->{parent} = shift; | |||||
| 19 | 0 | return $self; | |||||
| 20 | } | ||||||
| 21 | |||||||
| 22 | sub _get_defn { | ||||||
| 23 | 0 | 0 | my $self = shift; | ||||
| 24 | 0 | my ($defn) = @_; | |||||
| 25 | 0 | 0 | if (ref $defn) { | ||||
| 26 | 0 | return $defn; | |||||
| 27 | } | ||||||
| 28 | else { | ||||||
| 29 | 0 | return $self->{parent}->{symbtab}->Lookup($defn); | |||||
| 30 | } | ||||||
| 31 | } | ||||||
| 32 | |||||||
| 33 | sub _get_name { | ||||||
| 34 | 0 | 0 | my $self = shift; | ||||
| 35 | 0 | my ($node) = @_; | |||||
| 36 | 0 | return $node->visit($self->{parent}->{html_name},$self->{parent}->{scope}); | |||||
| 37 | } | ||||||
| 38 | |||||||
| 39 | sub _extract_doc { | ||||||
| 40 | 0 | 0 | my $self = shift; | ||||
| 41 | 0 | my ($node) = @_; | |||||
| 42 | 0 | my $doc = undef; | |||||
| 43 | 0 | my @tags = (); | |||||
| 44 | 0 | 0 | unless ($node->isa('Parameter')) { | ||||
| 45 | 0 | $self->{scope} = $node->{full}; | |||||
| 46 | 0 | $self->{scope} =~ s/::[0-9A-Z_a-z]+$//; | |||||
| 47 | } | ||||||
| 48 | 0 | 0 | if (exists $node->{doc}) { | ||||
| 49 | 0 | my @lines = split /\n/, $node->{doc}; | |||||
| 50 | 0 | foreach (@lines) { | |||||
| 51 | 0 | 0 | if (/^\s*@\s*([\s0-9A-Z_a-z]+):\s*(.*)/) { | ||||
| 0 | |||||||
| 52 | 0 | my $tag = $1; | |||||
| 53 | 0 | my $value = $2; | |||||
| 54 | 0 | $tag =~ s/\s*$//; | |||||
| 55 | 0 | push @tags, [$tag, $value]; | |||||
| 56 | } | ||||||
| 57 | elsif (/^\s*@\s*([A-Z_a-z][0-9A-Z_a-z]*)\s+(.*)/) { | ||||||
| 58 | 0 | push @tags, [$1, $2]; | |||||
| 59 | } | ||||||
| 60 | else { | ||||||
| 61 | 0 | $doc .= $_; | |||||
| 62 | 0 | $doc .= "\n"; | |||||
| 63 | } | ||||||
| 64 | } | ||||||
| 65 | } | ||||||
| 66 | # adds tag from pragma | ||||||
| 67 | 0 | 0 | if (exists $node->{id}) { | ||||
| 68 | 0 | push @tags, ['Repository ID', $node->{id}]; | |||||
| 69 | } | ||||||
| 70 | else { | ||||||
| 71 | 0 | 0 | if (exists $node->{version}) { | ||||
| 72 | 0 | push @tags, ['version', $node->{version}]; | |||||
| 73 | } | ||||||
| 74 | } | ||||||
| 75 | 0 | return ($doc, \@tags); | |||||
| 76 | } | ||||||
| 77 | |||||||
| 78 | sub _lookup { | ||||||
| 79 | 0 | 0 | my $self = shift; | ||||
| 80 | 0 | my ($name) = @_; | |||||
| 81 | 0 | my $defn; | |||||
| 82 | # print "_lookup: '$name'\n"; | ||||||
| 83 | 0 | 0 | if ($name =~ /^::/) { | ||||
| 0 | |||||||
| 84 | # global name | ||||||
| 85 | 0 | return $self->{parent}->{parser}->YYData->{symbtab}->___Lookup($name); | |||||
| 86 | } | ||||||
| 87 | elsif ($name =~ /^[0-9A-Z_a-z]+$/) { | ||||||
| 88 | # identifier alone | ||||||
| 89 | 0 | my $scope = $self->{scope}; | |||||
| 90 | 0 | while (1) { | |||||
| 91 | # Section 3.15.3 Special Scoping Rules for Type Names | ||||||
| 92 | 0 | my $g_name = $scope . '::' . $name; | |||||
| 93 | 0 | $defn = $self->{parent}->{parser}->YYData->{symbtab}->__Lookup($scope, $g_name, $name); | |||||
| 94 | 0 | 0 | 0 | last if (defined $defn || $scope eq q{}); | |||
| 95 | 0 | $scope =~ s/::[0-9A-Z_a-z]+$//; | |||||
| 96 | }; | ||||||
| 97 | 0 | return $defn; | |||||
| 98 | } | ||||||
| 99 | else { | ||||||
| 100 | # qualified name | ||||||
| 101 | 0 | my @list = split /::/, $name; | |||||
| 102 | 0 | 0 | return undef unless (scalar @list > 1); | ||||
| 103 | 0 | my $idf = pop @list; | |||||
| 104 | 0 | my $scoped_name = $name; | |||||
| 105 | 0 | $scoped_name =~ s/(::[0-9A-Z_a-z]+$)//; | |||||
| 106 | # print "qualified name : '$scoped_name' '$idf'\n"; | ||||||
| 107 | 0 | my $scope = $self->_lookup($scoped_name); # recursive | |||||
| 108 | 0 | 0 | if (defined $scope) { | ||||
| 109 | 0 | $defn = $self->{parent}->{parser}->YYData->{symbtab}->___Lookup($scope->{full} . '::' . $idf); | |||||
| 110 | } | ||||||
| 111 | 0 | return $defn; | |||||
| 112 | } | ||||||
| 113 | } | ||||||
| 114 | |||||||
| 115 | sub _process_text { | ||||||
| 116 | 0 | 0 | my $self = shift; | ||||
| 117 | 0 | my ($text) = @_; | |||||
| 118 | |||||||
| 119 | # keep track of leading and trailing white-space | ||||||
| 120 | 0 | 0 | my $lead = ($text =~ s/\A(\s+)//s ? $1 : q{}); | ||||
| 121 | 0 | 0 | my $trail = ($text =~ s/(\s+)\Z//s ? $1 : q{}); | ||||
| 122 | |||||||
| 123 | # split at space/non-space boundaries | ||||||
| 124 | 0 | my @words = split( /(?<=\s)(?=\S)|(?<=\S)(?=\s)/, $text ); | |||||
| 125 | |||||||
| 126 | # process each word individually | ||||||
| 127 | 0 | foreach my $word (@words) { | |||||
| 128 | # skip space runs | ||||||
| 129 | 0 | 0 | next if $word =~ /^\s*$/; | ||||
| 130 | 0 | 0 | if ($word =~ /^[\w:]+$/) { | ||||
| 0 | |||||||
| 0 | |||||||
| 131 | # looks like a IDL identifier | ||||||
| 132 | 0 | my $node = $self->_lookup($word); | |||||
| 133 | 0 | 0 | 0 | if ( defined $node | |||
| 0 | |||||||
| 134 | and exists $node->{file_html} | ||||||
| 135 | and $word =~ /$node->{idf}/ ) { | ||||||
| 136 | 0 | 0 | my $anchor = $node->{html_name} || $node->{idf}; | ||||
| 137 | 0 | $word = "" . $word . ""; | |||||
| 138 | } | ||||||
| 139 | } | ||||||
| 140 | elsif ($word =~ /^\w+:\/\/\w/) { | ||||||
| 141 | # looks like a URL | ||||||
| 142 | # Don't relativize it: leave it as the author intended | ||||||
| 143 | 0 | $word = "" . $word . ""; | |||||
| 144 | } | ||||||
| 145 | elsif ($word =~ /^[\w.-]+\@[\w.-]+/) { | ||||||
| 146 | # looks like an e-mail address | ||||||
| 147 | 0 | $word = "" . $word . ""; | |||||
| 148 | } | ||||||
| 149 | } | ||||||
| 150 | |||||||
| 151 | # put everything back together | ||||||
| 152 | 0 | return $lead . join(q{}, @words) . $trail; | |||||
| 153 | } | ||||||
| 154 | |||||||
| 155 | sub _format_doc_bloc { | ||||||
| 156 | 0 | 0 | my $self = shift; | ||||
| 157 | 0 | my ($doc, $FH) = @_; | |||||
| 158 | 0 | 0 | if (defined $doc) { | ||||
| 159 | 0 | $doc = $self->_process_text($doc); | |||||
| 160 | 0 | print $FH " ",$doc," \n"; |
|||||
| 161 | } | ||||||
| 162 | } | ||||||
| 163 | |||||||
| 164 | sub _format_doc_line { | ||||||
| 165 | 0 | 0 | my $self = shift; | ||||
| 166 | 0 | my ($node, $doc, $FH) = @_; | |||||
| 167 | 0 | my $anchor = q{}; | |||||
| 168 | 0 | 0 | unless ($node->isa('Parameter')) { | ||||
| 169 | 0 | $anchor = "\n"; | |||||
| 170 | } | ||||||
| 171 | 0 | 0 | if (defined $doc) { | ||||
| 172 | 0 | $doc = $self->_process_text($doc); | |||||
| 173 | 0 | print $FH " |
|||||
| 174 | } | ||||||
| 175 | else { | ||||||
| 176 | 0 | print $FH " |
|||||
| 177 | } | ||||||
| 178 | } | ||||||
| 179 | |||||||
| 180 | sub _format_tags { | ||||||
| 181 | 0 | 0 | my $self = shift; | ||||
| 182 | 0 | my ($tags, $FH, $javadoc) = @_; | |||||
| 183 | 0 | 0 | print $FH " \n" if (scalar(@{$tags})); |
||||
| 0 | |||||||
| 184 | 0 | foreach (@{$tags}) { | |||||
| 0 | |||||||
| 185 | 0 | my $entry = ${$_}[0]; | |||||
| 0 | |||||||
| 186 | 0 | my $doc = ${$_}[1]; | |||||
| 0 | |||||||
| 187 | 0 | 0 | 0 | next if (defined $javadoc and lc($entry) eq "param"); | |||
| 188 | 0 | $doc = $self->_process_text($doc); | |||||
| 189 | 0 | print $FH " ",$entry," : ",$doc,"\n"; | |||||
| 190 | 0 | print $FH " \n"; |
|||||
| 191 | } | ||||||
| 192 | 0 | 0 | print $FH " \n" if (scalar(@{$tags})); | ||||
| 0 | |||||||
| 193 | } | ||||||
| 194 | |||||||
| 195 | # | ||||||
| 196 | # 3.6 Module Declaration | ||||||
| 197 | # | ||||||
| 198 | |||||||
| 199 | sub visitModules { | ||||||
| 200 | 0 | 0 | 0 | my $self = shift; | |||
| 201 | 0 | my ($node, $FH) = @_; | |||||
| 202 | 0 | foreach (@{$node->{list_decl}}) { | |||||
| 0 | |||||||
| 203 | 0 | my ($doc, $tags) = $self->_extract_doc($_); | |||||
| 204 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 205 | 0 | $self->_format_tags($tags, $FH); | |||||
| 206 | } | ||||||
| 207 | } | ||||||
| 208 | |||||||
| 209 | # | ||||||
| 210 | # 3.8 Interface Declaration | ||||||
| 211 | # | ||||||
| 212 | |||||||
| 213 | sub visitBaseInterface { | ||||||
| 214 | 0 | 0 | 0 | my $self = shift; | |||
| 215 | 0 | my ($node, $FH) = @_; | |||||
| 216 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 217 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 218 | 0 | $self->_format_tags($tags, $FH); | |||||
| 219 | } | ||||||
| 220 | |||||||
| 221 | # | ||||||
| 222 | # 3.9 Value Declaration | ||||||
| 223 | # | ||||||
| 224 | # 3.9.1 Regular Value Type | ||||||
| 225 | # | ||||||
| 226 | |||||||
| 227 | sub visitStateMember { | ||||||
| 228 | 0 | 0 | 0 | my $self = shift; | |||
| 229 | 0 | my ($node, $FH) = @_; | |||||
| 230 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 231 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 232 | 0 | $self->_format_tags($tags, $FH); | |||||
| 233 | } | ||||||
| 234 | |||||||
| 235 | sub visitInitializer { | ||||||
| 236 | 0 | 0 | 0 | shift->visitOperation(@_); | |||
| 237 | } | ||||||
| 238 | |||||||
| 239 | # | ||||||
| 240 | # 3.10 Constant Declaration | ||||||
| 241 | # | ||||||
| 242 | |||||||
| 243 | sub visitConstant { | ||||||
| 244 | 0 | 0 | 0 | my $self = shift; | |||
| 245 | 0 | my ($node, $FH) = @_; | |||||
| 246 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 247 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 248 | 0 | $self->_format_tags($tags, $FH); | |||||
| 249 | } | ||||||
| 250 | |||||||
| 251 | # | ||||||
| 252 | # 3.11 Type Declaration | ||||||
| 253 | # | ||||||
| 254 | |||||||
| 255 | sub visitTypeDeclarator { | ||||||
| 256 | 0 | 0 | 0 | my $self = shift; | |||
| 257 | 0 | my ($node, $FH) = @_; | |||||
| 258 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 259 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 260 | 0 | $self->_format_tags($tags, $FH); | |||||
| 261 | } | ||||||
| 262 | |||||||
| 263 | sub visitNativeType { | ||||||
| 264 | 0 | 0 | 0 | my $self = shift; | |||
| 265 | 0 | my ($node, $FH) = @_; | |||||
| 266 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 267 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 268 | 0 | $self->_format_tags($tags, $FH); | |||||
| 269 | } | ||||||
| 270 | |||||||
| 271 | # 3.11.2 Constructed Types | ||||||
| 272 | # | ||||||
| 273 | # 3.11.2.1 Structures | ||||||
| 274 | # | ||||||
| 275 | |||||||
| 276 | sub visitStructType { | ||||||
| 277 | 0 | 0 | 0 | my $self = shift; | |||
| 278 | 0 | my ($node, $FH) = @_; | |||||
| 279 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 280 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 281 | 0 | my $doc_member = 0; | |||||
| 282 | 0 | foreach (@{$node->{list_member}}) { | |||||
| 0 | |||||||
| 283 | 0 | 0 | $doc_member ++ | ||||
| 284 | if (exists $self->_get_defn($_)->{doc}); | ||||||
| 285 | } | ||||||
| 286 | 0 | 0 | if ($doc_member) { | ||||
| 287 | # print $FH " \n"; |
||||||
| 288 | 0 | print $FH "
|
|||||
| 289 | 0 | foreach (@{$node->{list_member}}) { | |||||
| 0 | |||||||
| 290 | 0 | $self->_get_defn($_)->visit($self, $FH); # member | |||||
| 291 | } | ||||||
| 292 | 0 | print $FH " \n"; | |||||
| 293 | } | ||||||
| 294 | 0 | $self->_format_tags($tags, $FH); | |||||
| 295 | } | ||||||
| 296 | |||||||
| 297 | sub visitMember { | ||||||
| 298 | 0 | 0 | 0 | my $self = shift; | |||
| 299 | 0 | my ($node, $FH) = @_; | |||||
| 300 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 301 | 0 | $self->_format_doc_line($node, $doc, $FH); | |||||
| 302 | } | ||||||
| 303 | |||||||
| 304 | # 3.11.2.2 Discriminated Unions | ||||||
| 305 | # | ||||||
| 306 | |||||||
| 307 | sub visitUnionType { | ||||||
| 308 | 0 | 0 | 0 | my $self = shift; | |||
| 309 | 0 | my ($node, $FH) = @_; | |||||
| 310 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 311 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 312 | 0 | my $doc_member = 0; | |||||
| 313 | 0 | foreach (@{$node->{list_expr}}) { | |||||
| 0 | |||||||
| 314 | 0 | 0 | $doc_member ++ | ||||
| 315 | if (exists $self->_get_defn($_->{element}->{value})->{doc}); | ||||||
| 316 | } | ||||||
| 317 | 0 | 0 | if ($doc_member) { | ||||
| 318 | # print $FH " \n"; |
||||||
| 319 | 0 | print $FH "
|
|||||
| 320 | 0 | foreach (@{$node->{list_expr}}) { | |||||
| 0 | |||||||
| 321 | 0 | $self->_get_defn($_->{element}->{value})->visit($self, $FH); # member | |||||
| 322 | } | ||||||
| 323 | 0 | print $FH " \n"; | |||||
| 324 | } | ||||||
| 325 | 0 | $self->_format_tags($tags, $FH); | |||||
| 326 | } | ||||||
| 327 | |||||||
| 328 | # 3.11.2.4 Enumerations | ||||||
| 329 | # | ||||||
| 330 | |||||||
| 331 | sub visitEnumType { | ||||||
| 332 | 0 | 0 | 0 | my $self = shift; | |||
| 333 | 0 | my ($node, $FH) = @_; | |||||
| 334 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 335 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 336 | 0 | my $doc_member = 0; | |||||
| 337 | 0 | foreach (@{$node->{list_expr}}) { | |||||
| 0 | |||||||
| 338 | 0 | 0 | $doc_member ++ | ||||
| 339 | if (exists $_->{doc}); | ||||||
| 340 | } | ||||||
| 341 | 0 | 0 | if ($doc_member) { | ||||
| 342 | # print $FH " \n"; |
||||||
| 343 | 0 | print $FH "
|
|||||
| 344 | 0 | foreach (@{$node->{list_expr}}) { | |||||
| 0 | |||||||
| 345 | 0 | $_->visit($self, $FH); # enum | |||||
| 346 | } | ||||||
| 347 | 0 | print $FH " \n"; | |||||
| 348 | } | ||||||
| 349 | 0 | $self->_format_tags($tags, $FH); | |||||
| 350 | } | ||||||
| 351 | |||||||
| 352 | sub visitEnum { | ||||||
| 353 | 0 | 0 | 0 | my $self = shift; | |||
| 354 | 0 | my ($node, $FH) = @_; | |||||
| 355 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 356 | 0 | $self->_format_doc_line($node, $doc, $FH); | |||||
| 357 | } | ||||||
| 358 | |||||||
| 359 | # | ||||||
| 360 | # 3.12 Exception Declaration | ||||||
| 361 | # | ||||||
| 362 | |||||||
| 363 | sub visitException { | ||||||
| 364 | 0 | 0 | 0 | shift->visitStructType(@_); | |||
| 365 | } | ||||||
| 366 | |||||||
| 367 | # | ||||||
| 368 | # 3.13 Operation Declaration | ||||||
| 369 | # | ||||||
| 370 | |||||||
| 371 | sub visitOperation { | ||||||
| 372 | 0 | 0 | 0 | my $self = shift; | |||
| 373 | 0 | my ($node, $FH) = @_; | |||||
| 374 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 375 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 376 | 0 | 0 | if (scalar(@{$node->{list_in}}) + scalar(@{$node->{list_inout}}) + scalar(@{$node->{list_out}})) { | ||||
| 0 | |||||||
| 0 | |||||||
| 0 | |||||||
| 377 | # print $FH " \n"; |
||||||
| 378 | 0 | print $FH "
|
|||||
| 379 | 0 | 0 | if (scalar(@{$node->{list_in}})) { | ||||
| 0 | |||||||
| 380 | 0 | 0 | if (scalar(@{$node->{list_in}}) > 1) { | ||||
| 0 | |||||||
| 381 | 0 | print $FH " |
|||||
| 382 | } | ||||||
| 383 | else { | ||||||
| 384 | 0 | print $FH " |
|||||
| 385 | } | ||||||
| 386 | 0 | print $FH "
|
|||||
| 387 | 0 | foreach (@{$node->{list_in}}) { | |||||
| 0 | |||||||
| 388 | 0 | $self->_parameter($node, $_, $FH); | |||||
| 389 | } | ||||||
| 390 | 0 | print $FH " \n"; | |||||
| 391 | 0 | print $FH " \n"; | |||||
| 392 | } | ||||||
| 393 | 0 | 0 | if (scalar(@{$node->{list_inout}})) { | ||||
| 0 | |||||||
| 394 | 0 | 0 | if (scalar(@{$node->{list_inout}}) > 1) { | ||||
| 0 | |||||||
| 395 | 0 | print $FH " |
|||||
| 396 | } | ||||||
| 397 | else { | ||||||
| 398 | 0 | print $FH " |
|||||
| 399 | } | ||||||
| 400 | 0 | print $FH "
|
|||||
| 401 | 0 | foreach (@{$node->{list_inout}}) { | |||||
| 0 | |||||||
| 402 | 0 | $self->_parameter($node, $_, $FH); | |||||
| 403 | } | ||||||
| 404 | 0 | print $FH " \n"; | |||||
| 405 | 0 | print $FH " \n"; | |||||
| 406 | } | ||||||
| 407 | 0 | 0 | if (scalar(@{$node->{list_out}})) { | ||||
| 0 | |||||||
| 408 | 0 | 0 | if (scalar(@{$node->{list_out}}) > 1) { | ||||
| 0 | |||||||
| 409 | 0 | print $FH " |
|||||
| 410 | } | ||||||
| 411 | else { | ||||||
| 412 | 0 | print $FH " |
|||||
| 413 | } | ||||||
| 414 | 0 | print $FH "
|
|||||
| 415 | 0 | foreach (@{$node->{list_out}}) { | |||||
| 0 | |||||||
| 416 | 0 | $self->_parameter($node, $_, $FH); | |||||
| 417 | } | ||||||
| 418 | 0 | print $FH " \n"; | |||||
| 419 | 0 | print $FH " \n"; | |||||
| 420 | } | ||||||
| 421 | 0 | print $FH " \n"; | |||||
| 422 | } | ||||||
| 423 | 0 | $self->_format_tags($tags, $FH, 1); | |||||
| 424 | } | ||||||
| 425 | |||||||
| 426 | sub _parameter { | ||||||
| 427 | 0 | 0 | my $self = shift; | ||||
| 428 | 0 | my ($parent, $node, $FH) = @_; | |||||
| 429 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 430 | 0 | 0 | unless (defined $doc) { | ||||
| 431 | 0 | ($doc, $tags) = $self->_extract_doc($parent); | |||||
| 432 | 0 | foreach (@{$tags}) { | |||||
| 0 | |||||||
| 433 | 0 | my $entry = ${$_}[0]; | |||||
| 0 | |||||||
| 434 | 0 | my $javadoc = ${$_}[1]; | |||||
| 0 | |||||||
| 435 | 0 | 0 | 0 | if (lc($entry) eq 'param' and $javadoc =~ /^$node->{idf}/) { | |||
| 436 | 0 | $doc = $javadoc; | |||||
| 437 | 0 | $doc =~ s/^$node->{idf}//; | |||||
| 438 | 0 | last; | |||||
| 439 | } | ||||||
| 440 | } | ||||||
| 441 | } | ||||||
| 442 | 0 | 0 | if (defined $doc) { | ||||
| 443 | 0 | $doc = $self->_process_text($doc); | |||||
| 444 | 0 | print $FH " |
|||||
| 445 | } | ||||||
| 446 | else { | ||||||
| 447 | 0 | print $FH " |
|||||
| 448 | } | ||||||
| 449 | } | ||||||
| 450 | |||||||
| 451 | # | ||||||
| 452 | # 3.14 Attribute Declaration | ||||||
| 453 | # | ||||||
| 454 | |||||||
| 455 | sub visitAttribute { | ||||||
| 456 | 0 | 0 | 0 | my $self = shift; | |||
| 457 | 0 | my ($node, $FH) = @_; | |||||
| 458 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 459 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 460 | 0 | $self->_format_tags($tags, $FH); | |||||
| 461 | } | ||||||
| 462 | |||||||
| 463 | # | ||||||
| 464 | # 3.17 Component Declaration | ||||||
| 465 | # | ||||||
| 466 | |||||||
| 467 | sub visitProvides { | ||||||
| 468 | 0 | 0 | 0 | my $self = shift; | |||
| 469 | 0 | my ($node, $FH) = @_; | |||||
| 470 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 471 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 472 | 0 | $self->_format_tags($tags, $FH); | |||||
| 473 | } | ||||||
| 474 | |||||||
| 475 | sub visitUses { | ||||||
| 476 | 0 | 0 | 0 | my $self = shift; | |||
| 477 | 0 | my ($node, $FH) = @_; | |||||
| 478 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 479 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 480 | 0 | $self->_format_tags($tags, $FH); | |||||
| 481 | } | ||||||
| 482 | |||||||
| 483 | sub visitPublishes { | ||||||
| 484 | 0 | 0 | 0 | my $self = shift; | |||
| 485 | 0 | my ($node, $FH) = @_; | |||||
| 486 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 487 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 488 | 0 | $self->_format_tags($tags, $FH); | |||||
| 489 | } | ||||||
| 490 | |||||||
| 491 | sub visitEmits { | ||||||
| 492 | 0 | 0 | 0 | my $self = shift; | |||
| 493 | 0 | my ($node, $FH) = @_; | |||||
| 494 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 495 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 496 | 0 | $self->_format_tags($tags, $FH); | |||||
| 497 | } | ||||||
| 498 | |||||||
| 499 | sub visitConsumes { | ||||||
| 500 | 0 | 0 | 0 | my $self = shift; | |||
| 501 | 0 | my ($node, $FH) = @_; | |||||
| 502 | 0 | my ($doc, $tags) = $self->_extract_doc($node); | |||||
| 503 | 0 | $self->_format_doc_bloc($doc, $FH); | |||||
| 504 | 0 | $self->_format_tags($tags, $FH); | |||||
| 505 | } | ||||||
| 506 | |||||||
| 507 | # | ||||||
| 508 | # 3.18 Home Declaration | ||||||
| 509 | # | ||||||
| 510 | |||||||
| 511 | sub visitFactory { | ||||||
| 512 | 0 | 0 | 0 | shift->visitOperation(@_); | |||
| 513 | } | ||||||
| 514 | |||||||
| 515 | sub visitFinder { | ||||||
| 516 | 0 | 0 | 0 | shift->visitOperation(@_); | |||
| 517 | } | ||||||
| 518 | |||||||
| 519 | 1; | ||||||
| 520 |