| 1 | .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "Pod::InputObjects 3" |
| 132 | .TH Pod::InputObjects 3 "2001-09-21" "perl v5.8.8" "Perl Programmers Reference Guide" |
| 133 | .SH "NAME" |
| 134 | Pod::InputObjects \- objects representing POD input paragraphs, commands, etc. |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | .Vb 1 |
| 138 | \& use Pod::InputObjects; |
| 139 | .Ve |
| 140 | .SH "REQUIRES" |
| 141 | .IX Header "REQUIRES" |
| 142 | perl5.004, Carp |
| 143 | .SH "EXPORTS" |
| 144 | .IX Header "EXPORTS" |
| 145 | Nothing. |
| 146 | .SH "DESCRIPTION" |
| 147 | .IX Header "DESCRIPTION" |
| 148 | This module defines some basic input objects used by \fBPod::Parser\fR when |
| 149 | reading and parsing \s-1POD\s0 text from an input source. The following objects |
| 150 | are defined: |
| 151 | .IP "package \fBPod::Paragraph\fR" 4 |
| 152 | .IX Item "package Pod::Paragraph" |
| 153 | An object corresponding to a paragraph of \s-1POD\s0 input text. It may be a |
| 154 | plain paragraph, a verbatim paragraph, or a command paragraph (see |
| 155 | perlpod). |
| 156 | .IP "package \fBPod::InteriorSequence\fR" 4 |
| 157 | .IX Item "package Pod::InteriorSequence" |
| 158 | An object corresponding to an interior sequence command from the \s-1POD\s0 |
| 159 | input text (see perlpod). |
| 160 | .IP "package \fBPod::ParseTree\fR" 4 |
| 161 | .IX Item "package Pod::ParseTree" |
| 162 | An object corresponding to a tree of parsed \s-1POD\s0 text. Each \*(L"node\*(R" in |
| 163 | a parse-tree (or \fIptree\fR) is either a text-string or a reference to |
| 164 | a \fBPod::InteriorSequence\fR object. The nodes appear in the parse-tree |
| 165 | in the order in which they were parsed from left\-to\-right. |
| 166 | .PP |
| 167 | Each of these input objects are described in further detail in the |
| 168 | sections which follow. |
| 169 | .SH "\fBPod::Paragraph\fP" |
| 170 | .IX Header "Pod::Paragraph" |
| 171 | An object representing a paragraph of \s-1POD\s0 input text. |
| 172 | It has the following methods/attributes: |
| 173 | .Sh "Pod::Paragraph\->\fB\fP\f(BInew()\fP\fB\fP" |
| 174 | .IX Subsection "Pod::Paragraph->new()" |
| 175 | .Vb 10 |
| 176 | \& my $pod_para1 = Pod::Paragraph->new(-text => $text); |
| 177 | \& my $pod_para2 = Pod::Paragraph->new(-name => $cmd, |
| 178 | \& -text => $text); |
| 179 | \& my $pod_para3 = new Pod::Paragraph(-text => $text); |
| 180 | \& my $pod_para4 = new Pod::Paragraph(-name => $cmd, |
| 181 | \& -text => $text); |
| 182 | \& my $pod_para5 = Pod::Paragraph->new(-name => $cmd, |
| 183 | \& -text => $text, |
| 184 | \& -file => $filename, |
| 185 | \& -line => $line_number); |
| 186 | .Ve |
| 187 | .PP |
| 188 | This is a class method that constructs a \f(CW\*(C`Pod::Paragraph\*(C'\fR object and |
| 189 | returns a reference to the new paragraph object. It may be given one or |
| 190 | two keyword arguments. The \f(CW\*(C`\-text\*(C'\fR keyword indicates the corresponding |
| 191 | text of the \s-1POD\s0 paragraph. The \f(CW\*(C`\-name\*(C'\fR keyword indicates the name of |
| 192 | the corresponding \s-1POD\s0 command, such as \f(CW\*(C`head1\*(C'\fR or \f(CW\*(C`item\*(C'\fR (it should |
| 193 | \&\fInot\fR contain the \f(CW\*(C`=\*(C'\fR prefix); this is needed only if the \s-1POD\s0 |
| 194 | paragraph corresponds to a command paragraph. The \f(CW\*(C`\-file\*(C'\fR and \f(CW\*(C`\-line\*(C'\fR |
| 195 | keywords indicate the filename and line number corresponding to the |
| 196 | beginning of the paragraph |
| 197 | .Sh "$pod_para\->\fB\fP\f(BIcmd_name()\fP\fB\fP" |
| 198 | .IX Subsection "$pod_para->cmd_name()" |
| 199 | .Vb 1 |
| 200 | \& my $para_cmd = $pod_para->cmd_name(); |
| 201 | .Ve |
| 202 | .PP |
| 203 | If this paragraph is a command paragraph, then this method will return |
| 204 | the name of the command (\fIwithout\fR any leading \f(CW\*(C`=\*(C'\fR prefix). |
| 205 | .Sh "$pod_para\->\fB\fP\f(BItext()\fP\fB\fP" |
| 206 | .IX Subsection "$pod_para->text()" |
| 207 | .Vb 1 |
| 208 | \& my $para_text = $pod_para->text(); |
| 209 | .Ve |
| 210 | .PP |
| 211 | This method will return the corresponding text of the paragraph. |
| 212 | .Sh "$pod_para\->\fB\fP\f(BIraw_text()\fP\fB\fP" |
| 213 | .IX Subsection "$pod_para->raw_text()" |
| 214 | .Vb 1 |
| 215 | \& my $raw_pod_para = $pod_para->raw_text(); |
| 216 | .Ve |
| 217 | .PP |
| 218 | This method will return the \fIraw\fR text of the \s-1POD\s0 paragraph, exactly |
| 219 | as it appeared in the input. |
| 220 | .Sh "$pod_para\->\fB\fP\f(BIcmd_prefix()\fP\fB\fP" |
| 221 | .IX Subsection "$pod_para->cmd_prefix()" |
| 222 | .Vb 1 |
| 223 | \& my $prefix = $pod_para->cmd_prefix(); |
| 224 | .Ve |
| 225 | .PP |
| 226 | If this paragraph is a command paragraph, then this method will return |
| 227 | the prefix used to denote the command (which should be the string \*(L"=\*(R" |
| 228 | or \*(L"==\*(R"). |
| 229 | .Sh "$pod_para\->\fB\fP\f(BIcmd_separator()\fP\fB\fP" |
| 230 | .IX Subsection "$pod_para->cmd_separator()" |
| 231 | .Vb 1 |
| 232 | \& my $separator = $pod_para->cmd_separator(); |
| 233 | .Ve |
| 234 | .PP |
| 235 | If this paragraph is a command paragraph, then this method will return |
| 236 | the text used to separate the command name from the rest of the |
| 237 | paragraph (if any). |
| 238 | .Sh "$pod_para\->\fB\fP\f(BIparse_tree()\fP\fB\fP" |
| 239 | .IX Subsection "$pod_para->parse_tree()" |
| 240 | .Vb 3 |
| 241 | \& my $ptree = $pod_parser->parse_text( $pod_para->text() ); |
| 242 | \& $pod_para->parse_tree( $ptree ); |
| 243 | \& $ptree = $pod_para->parse_tree(); |
| 244 | .Ve |
| 245 | .PP |
| 246 | This method will get/set the corresponding parse-tree of the paragraph's text. |
| 247 | .Sh "$pod_para\->\fB\fP\f(BIfile_line()\fP\fB\fP" |
| 248 | .IX Subsection "$pod_para->file_line()" |
| 249 | .Vb 2 |
| 250 | \& my ($filename, $line_number) = $pod_para->file_line(); |
| 251 | \& my $position = $pod_para->file_line(); |
| 252 | .Ve |
| 253 | .PP |
| 254 | Returns the current filename and line number for the paragraph |
| 255 | object. If called in a list context, it returns a list of two |
| 256 | elements: first the filename, then the line number. If called in |
| 257 | a scalar context, it returns a string containing the filename, followed |
| 258 | by a colon (':'), followed by the line number. |
| 259 | .SH "\fBPod::InteriorSequence\fP" |
| 260 | .IX Header "Pod::InteriorSequence" |
| 261 | An object representing a \s-1POD\s0 interior sequence command. |
| 262 | It has the following methods/attributes: |
| 263 | .Sh "Pod::InteriorSequence\->\fB\fP\f(BInew()\fP\fB\fP" |
| 264 | .IX Subsection "Pod::InteriorSequence->new()" |
| 265 | .Vb 8 |
| 266 | \& my $pod_seq1 = Pod::InteriorSequence->new(-name => $cmd |
| 267 | \& -ldelim => $delimiter); |
| 268 | \& my $pod_seq2 = new Pod::InteriorSequence(-name => $cmd, |
| 269 | \& -ldelim => $delimiter); |
| 270 | \& my $pod_seq3 = new Pod::InteriorSequence(-name => $cmd, |
| 271 | \& -ldelim => $delimiter, |
| 272 | \& -file => $filename, |
| 273 | \& -line => $line_number); |
| 274 | .Ve |
| 275 | .PP |
| 276 | .Vb 2 |
| 277 | \& my $pod_seq4 = new Pod::InteriorSequence(-name => $cmd, $ptree); |
| 278 | \& my $pod_seq5 = new Pod::InteriorSequence($cmd, $ptree); |
| 279 | .Ve |
| 280 | .PP |
| 281 | This is a class method that constructs a \f(CW\*(C`Pod::InteriorSequence\*(C'\fR object |
| 282 | and returns a reference to the new interior sequence object. It should |
| 283 | be given two keyword arguments. The \f(CW\*(C`\-ldelim\*(C'\fR keyword indicates the |
| 284 | corresponding left-delimiter of the interior sequence (e.g. '<'). |
| 285 | The \f(CW\*(C`\-name\*(C'\fR keyword indicates the name of the corresponding interior |
| 286 | sequence command, such as \f(CW\*(C`I\*(C'\fR or \f(CW\*(C`B\*(C'\fR or \f(CW\*(C`C\*(C'\fR. The \f(CW\*(C`\-file\*(C'\fR and |
| 287 | \&\f(CW\*(C`\-line\*(C'\fR keywords indicate the filename and line number corresponding |
| 288 | to the beginning of the interior sequence. If the \f(CW$ptree\fR argument is |
| 289 | given, it must be the last argument, and it must be either string, or |
| 290 | else an array-ref suitable for passing to \fBPod::ParseTree::new\fR (or |
| 291 | it may be a reference to a Pod::ParseTree object). |
| 292 | .Sh "$pod_seq\->\fB\fP\f(BIcmd_name()\fP\fB\fP" |
| 293 | .IX Subsection "$pod_seq->cmd_name()" |
| 294 | .Vb 1 |
| 295 | \& my $seq_cmd = $pod_seq->cmd_name(); |
| 296 | .Ve |
| 297 | .PP |
| 298 | The name of the interior sequence command. |
| 299 | .Sh "$pod_seq\->\fB\fP\f(BIprepend()\fP\fB\fP" |
| 300 | .IX Subsection "$pod_seq->prepend()" |
| 301 | .Vb 2 |
| 302 | \& $pod_seq->prepend($text); |
| 303 | \& $pod_seq1->prepend($pod_seq2); |
| 304 | .Ve |
| 305 | .PP |
| 306 | Prepends the given string or parse-tree or sequence object to the parse-tree |
| 307 | of this interior sequence. |
| 308 | .Sh "$pod_seq\->\fB\fP\f(BIappend()\fP\fB\fP" |
| 309 | .IX Subsection "$pod_seq->append()" |
| 310 | .Vb 2 |
| 311 | \& $pod_seq->append($text); |
| 312 | \& $pod_seq1->append($pod_seq2); |
| 313 | .Ve |
| 314 | .PP |
| 315 | Appends the given string or parse-tree or sequence object to the parse-tree |
| 316 | of this interior sequence. |
| 317 | .Sh "$pod_seq\->\fB\fP\f(BInested()\fP\fB\fP" |
| 318 | .IX Subsection "$pod_seq->nested()" |
| 319 | .Vb 1 |
| 320 | \& $outer_seq = $pod_seq->nested || print "not nested"; |
| 321 | .Ve |
| 322 | .PP |
| 323 | If this interior sequence is nested inside of another interior |
| 324 | sequence, then the outer/parent sequence that contains it is |
| 325 | returned. Otherwise \f(CW\*(C`undef\*(C'\fR is returned. |
| 326 | .Sh "$pod_seq\->\fB\fP\f(BIraw_text()\fP\fB\fP" |
| 327 | .IX Subsection "$pod_seq->raw_text()" |
| 328 | .Vb 1 |
| 329 | \& my $seq_raw_text = $pod_seq->raw_text(); |
| 330 | .Ve |
| 331 | .PP |
| 332 | This method will return the \fIraw\fR text of the \s-1POD\s0 interior sequence, |
| 333 | exactly as it appeared in the input. |
| 334 | .Sh "$pod_seq\->\fB\fP\f(BIleft_delimiter()\fP\fB\fP" |
| 335 | .IX Subsection "$pod_seq->left_delimiter()" |
| 336 | .Vb 1 |
| 337 | \& my $ldelim = $pod_seq->left_delimiter(); |
| 338 | .Ve |
| 339 | .PP |
| 340 | The leftmost delimiter beginning the argument text to the interior |
| 341 | sequence (should be \*(L"<\*(R"). |
| 342 | .Sh "$pod_seq\->\fB\fP\f(BIright_delimiter()\fP\fB\fP" |
| 343 | .IX Subsection "$pod_seq->right_delimiter()" |
| 344 | The rightmost delimiter beginning the argument text to the interior |
| 345 | sequence (should be \*(L">\*(R"). |
| 346 | .Sh "$pod_seq\->\fB\fP\f(BIparse_tree()\fP\fB\fP" |
| 347 | .IX Subsection "$pod_seq->parse_tree()" |
| 348 | .Vb 3 |
| 349 | \& my $ptree = $pod_parser->parse_text($paragraph_text); |
| 350 | \& $pod_seq->parse_tree( $ptree ); |
| 351 | \& $ptree = $pod_seq->parse_tree(); |
| 352 | .Ve |
| 353 | .PP |
| 354 | This method will get/set the corresponding parse-tree of the interior |
| 355 | sequence's text. |
| 356 | .Sh "$pod_seq\->\fB\fP\f(BIfile_line()\fP\fB\fP" |
| 357 | .IX Subsection "$pod_seq->file_line()" |
| 358 | .Vb 2 |
| 359 | \& my ($filename, $line_number) = $pod_seq->file_line(); |
| 360 | \& my $position = $pod_seq->file_line(); |
| 361 | .Ve |
| 362 | .PP |
| 363 | Returns the current filename and line number for the interior sequence |
| 364 | object. If called in a list context, it returns a list of two |
| 365 | elements: first the filename, then the line number. If called in |
| 366 | a scalar context, it returns a string containing the filename, followed |
| 367 | by a colon (':'), followed by the line number. |
| 368 | .Sh "Pod::InteriorSequence::\fB\s-1\fP\f(BIDESTROY\s0()\fP\fB\fP" |
| 369 | .IX Subsection "Pod::InteriorSequence::DESTROY()" |
| 370 | This method performs any necessary cleanup for the interior\-sequence. |
| 371 | If you override this method then it is \fBimperative\fR that you invoke |
| 372 | the parent method from within your own method, otherwise |
| 373 | \&\fIinterior-sequence storage will not be reclaimed upon destruction!\fR |
| 374 | .SH "\fBPod::ParseTree\fP" |
| 375 | .IX Header "Pod::ParseTree" |
| 376 | This object corresponds to a tree of parsed \s-1POD\s0 text. As \s-1POD\s0 text is |
| 377 | scanned from left to right, it is parsed into an ordered list of |
| 378 | text-strings and \fBPod::InteriorSequence\fR objects (in order of |
| 379 | appearance). A \fBPod::ParseTree\fR object corresponds to this list of |
| 380 | strings and sequences. Each interior sequence in the parse-tree may |
| 381 | itself contain a parse-tree (since interior sequences may be nested). |
| 382 | .Sh "Pod::ParseTree\->\fB\fP\f(BInew()\fP\fB\fP" |
| 383 | .IX Subsection "Pod::ParseTree->new()" |
| 384 | .Vb 4 |
| 385 | \& my $ptree1 = Pod::ParseTree->new; |
| 386 | \& my $ptree2 = new Pod::ParseTree; |
| 387 | \& my $ptree4 = Pod::ParseTree->new($array_ref); |
| 388 | \& my $ptree3 = new Pod::ParseTree($array_ref); |
| 389 | .Ve |
| 390 | .PP |
| 391 | This is a class method that constructs a \f(CW\*(C`Pod::Parse_tree\*(C'\fR object and |
| 392 | returns a reference to the new parse\-tree. If a single-argument is given, |
| 393 | it must be a reference to an array, and is used to initialize the root |
| 394 | (top) of the parse tree. |
| 395 | .Sh "$ptree\->\fB\fP\f(BItop()\fP\fB\fP" |
| 396 | .IX Subsection "$ptree->top()" |
| 397 | .Vb 3 |
| 398 | \& my $top_node = $ptree->top(); |
| 399 | \& $ptree->top( $top_node ); |
| 400 | \& $ptree->top( @children ); |
| 401 | .Ve |
| 402 | .PP |
| 403 | This method gets/sets the top node of the parse\-tree. If no arguments are |
| 404 | given, it returns the topmost node in the tree (the root), which is also |
| 405 | a \fBPod::ParseTree\fR. If it is given a single argument that is a reference, |
| 406 | then the reference is assumed to a parse-tree and becomes the new top node. |
| 407 | Otherwise, if arguments are given, they are treated as the new list of |
| 408 | children for the top node. |
| 409 | .Sh "$ptree\->\fB\fP\f(BIchildren()\fP\fB\fP" |
| 410 | .IX Subsection "$ptree->children()" |
| 411 | This method gets/sets the children of the top node in the parse\-tree. |
| 412 | If no arguments are given, it returns the list (array) of children |
| 413 | (each of which should be either a string or a \fBPod::InteriorSequence\fR. |
| 414 | Otherwise, if arguments are given, they are treated as the new list of |
| 415 | children for the top node. |
| 416 | .Sh "$ptree\->\fB\fP\f(BIprepend()\fP\fB\fP" |
| 417 | .IX Subsection "$ptree->prepend()" |
| 418 | This method prepends the given text or parse-tree to the current parse\-tree. |
| 419 | If the first item on the parse-tree is text and the argument is also text, |
| 420 | then the text is prepended to the first item (not added as a separate string). |
| 421 | Otherwise the argument is added as a new string or parse-tree \fIbefore\fR |
| 422 | the current one. |
| 423 | .Sh "$ptree\->\fB\fP\f(BIappend()\fP\fB\fP" |
| 424 | .IX Subsection "$ptree->append()" |
| 425 | This method appends the given text or parse-tree to the current parse\-tree. |
| 426 | If the last item on the parse-tree is text and the argument is also text, |
| 427 | then the text is appended to the last item (not added as a separate string). |
| 428 | Otherwise the argument is added as a new string or parse-tree \fIafter\fR |
| 429 | the current one. |
| 430 | .Sh "$ptree\->\fB\fP\f(BIraw_text()\fP\fB\fP" |
| 431 | .IX Subsection "$ptree->raw_text()" |
| 432 | .Vb 1 |
| 433 | \& my $ptree_raw_text = $ptree->raw_text(); |
| 434 | .Ve |
| 435 | .PP |
| 436 | This method will return the \fIraw\fR text of the \s-1POD\s0 parse-tree |
| 437 | exactly as it appeared in the input. |
| 438 | .Sh "Pod::ParseTree::\fB\s-1\fP\f(BIDESTROY\s0()\fP\fB\fP" |
| 439 | .IX Subsection "Pod::ParseTree::DESTROY()" |
| 440 | This method performs any necessary cleanup for the parse\-tree. |
| 441 | If you override this method then it is \fBimperative\fR |
| 442 | that you invoke the parent method from within your own method, |
| 443 | otherwise \fIparse-tree storage will not be reclaimed upon destruction!\fR |
| 444 | .SH "SEE ALSO" |
| 445 | .IX Header "SEE ALSO" |
| 446 | See Pod::Parser, Pod::Select |
| 447 | .SH "AUTHOR" |
| 448 | .IX Header "AUTHOR" |
| 449 | Please report bugs using <http://rt.cpan.org>. |
| 450 | .PP |
| 451 | Brad Appleton <bradapp@enteract.com> |