Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / man / man3 / Pod::InputObjects.3
CommitLineData
920dae64
AT
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"
134Pod::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"
142perl5.004, Carp
143.SH "EXPORTS"
144.IX Header "EXPORTS"
145Nothing.
146.SH "DESCRIPTION"
147.IX Header "DESCRIPTION"
148This module defines some basic input objects used by \fBPod::Parser\fR when
149reading and parsing \s-1POD\s0 text from an input source. The following objects
150are defined:
151.IP "package \fBPod::Paragraph\fR" 4
152.IX Item "package Pod::Paragraph"
153An object corresponding to a paragraph of \s-1POD\s0 input text. It may be a
154plain paragraph, a verbatim paragraph, or a command paragraph (see
155perlpod).
156.IP "package \fBPod::InteriorSequence\fR" 4
157.IX Item "package Pod::InteriorSequence"
158An object corresponding to an interior sequence command from the \s-1POD\s0
159input text (see perlpod).
160.IP "package \fBPod::ParseTree\fR" 4
161.IX Item "package Pod::ParseTree"
162An object corresponding to a tree of parsed \s-1POD\s0 text. Each \*(L"node\*(R" in
163a parse-tree (or \fIptree\fR) is either a text-string or a reference to
164a \fBPod::InteriorSequence\fR object. The nodes appear in the parse-tree
165in the order in which they were parsed from left\-to\-right.
166.PP
167Each of these input objects are described in further detail in the
168sections which follow.
169.SH "\fBPod::Paragraph\fP"
170.IX Header "Pod::Paragraph"
171An object representing a paragraph of \s-1POD\s0 input text.
172It 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
188This is a class method that constructs a \f(CW\*(C`Pod::Paragraph\*(C'\fR object and
189returns a reference to the new paragraph object. It may be given one or
190two keyword arguments. The \f(CW\*(C`\-text\*(C'\fR keyword indicates the corresponding
191text of the \s-1POD\s0 paragraph. The \f(CW\*(C`\-name\*(C'\fR keyword indicates the name of
192the 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
194paragraph corresponds to a command paragraph. The \f(CW\*(C`\-file\*(C'\fR and \f(CW\*(C`\-line\*(C'\fR
195keywords indicate the filename and line number corresponding to the
196beginning 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
203If this paragraph is a command paragraph, then this method will return
204the 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
211This 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
218This method will return the \fIraw\fR text of the \s-1POD\s0 paragraph, exactly
219as 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
226If this paragraph is a command paragraph, then this method will return
227the prefix used to denote the command (which should be the string \*(L"=\*(R"
228or \*(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
235If this paragraph is a command paragraph, then this method will return
236the text used to separate the command name from the rest of the
237paragraph (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
246This 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
254Returns the current filename and line number for the paragraph
255object. If called in a list context, it returns a list of two
256elements: first the filename, then the line number. If called in
257a scalar context, it returns a string containing the filename, followed
258by a colon (':'), followed by the line number.
259.SH "\fBPod::InteriorSequence\fP"
260.IX Header "Pod::InteriorSequence"
261An object representing a \s-1POD\s0 interior sequence command.
262It 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
281This is a class method that constructs a \f(CW\*(C`Pod::InteriorSequence\*(C'\fR object
282and returns a reference to the new interior sequence object. It should
283be given two keyword arguments. The \f(CW\*(C`\-ldelim\*(C'\fR keyword indicates the
284corresponding left-delimiter of the interior sequence (e.g. '<').
285The \f(CW\*(C`\-name\*(C'\fR keyword indicates the name of the corresponding interior
286sequence 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
288to the beginning of the interior sequence. If the \f(CW$ptree\fR argument is
289given, it must be the last argument, and it must be either string, or
290else an array-ref suitable for passing to \fBPod::ParseTree::new\fR (or
291it 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
298The 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
306Prepends the given string or parse-tree or sequence object to the parse-tree
307of 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
315Appends the given string or parse-tree or sequence object to the parse-tree
316of 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
323If this interior sequence is nested inside of another interior
324sequence, then the outer/parent sequence that contains it is
325returned. 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
332This method will return the \fIraw\fR text of the \s-1POD\s0 interior sequence,
333exactly 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
340The leftmost delimiter beginning the argument text to the interior
341sequence (should be \*(L"<\*(R").
342.Sh "$pod_seq\->\fB\fP\f(BIright_delimiter()\fP\fB\fP"
343.IX Subsection "$pod_seq->right_delimiter()"
344The rightmost delimiter beginning the argument text to the interior
345sequence (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
354This method will get/set the corresponding parse-tree of the interior
355sequence'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
363Returns the current filename and line number for the interior sequence
364object. If called in a list context, it returns a list of two
365elements: first the filename, then the line number. If called in
366a scalar context, it returns a string containing the filename, followed
367by 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()"
370This method performs any necessary cleanup for the interior\-sequence.
371If you override this method then it is \fBimperative\fR that you invoke
372the 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"
376This object corresponds to a tree of parsed \s-1POD\s0 text. As \s-1POD\s0 text is
377scanned from left to right, it is parsed into an ordered list of
378text-strings and \fBPod::InteriorSequence\fR objects (in order of
379appearance). A \fBPod::ParseTree\fR object corresponds to this list of
380strings and sequences. Each interior sequence in the parse-tree may
381itself 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
391This is a class method that constructs a \f(CW\*(C`Pod::Parse_tree\*(C'\fR object and
392returns a reference to the new parse\-tree. If a single-argument is given,
393it 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
403This method gets/sets the top node of the parse\-tree. If no arguments are
404given, it returns the topmost node in the tree (the root), which is also
405a \fBPod::ParseTree\fR. If it is given a single argument that is a reference,
406then the reference is assumed to a parse-tree and becomes the new top node.
407Otherwise, if arguments are given, they are treated as the new list of
408children for the top node.
409.Sh "$ptree\->\fB\fP\f(BIchildren()\fP\fB\fP"
410.IX Subsection "$ptree->children()"
411This method gets/sets the children of the top node in the parse\-tree.
412If 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.
414Otherwise, if arguments are given, they are treated as the new list of
415children for the top node.
416.Sh "$ptree\->\fB\fP\f(BIprepend()\fP\fB\fP"
417.IX Subsection "$ptree->prepend()"
418This method prepends the given text or parse-tree to the current parse\-tree.
419If the first item on the parse-tree is text and the argument is also text,
420then the text is prepended to the first item (not added as a separate string).
421Otherwise the argument is added as a new string or parse-tree \fIbefore\fR
422the current one.
423.Sh "$ptree\->\fB\fP\f(BIappend()\fP\fB\fP"
424.IX Subsection "$ptree->append()"
425This method appends the given text or parse-tree to the current parse\-tree.
426If the last item on the parse-tree is text and the argument is also text,
427then the text is appended to the last item (not added as a separate string).
428Otherwise the argument is added as a new string or parse-tree \fIafter\fR
429the 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
436This method will return the \fIraw\fR text of the \s-1POD\s0 parse-tree
437exactly 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()"
440This method performs any necessary cleanup for the parse\-tree.
441If you override this method then it is \fBimperative\fR
442that you invoke the parent method from within your own method,
443otherwise \fIparse-tree storage will not be reclaimed upon destruction!\fR
444.SH "SEE ALSO"
445.IX Header "SEE ALSO"
446See Pod::Parser, Pod::Select
447.SH "AUTHOR"
448.IX Header "AUTHOR"
449Please report bugs using <http://rt.cpan.org>.
450.PP
451Brad Appleton <bradapp@enteract.com>