Debian Codegraph @

upstream/opensuse-tumbleweed/man3/Pod::Simple::SimpleTree.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Pod::Simple::SimpleTree 3pm"
61 .TH Pod::Simple::SimpleTree 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Pod::Simple::SimpleTree \-\- parse Pod into a simple parse tree
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& % cat ptest.pod
72 \&
73 \& =head1 PIE
74 \&
75 \& I like B<pie>!
76 \&
77 \& % perl \-MPod::Simple::SimpleTree \-MData::Dumper \-e \e
78 \& "print Dumper(Pod::Simple::SimpleTree\->new\->parse_file(shift)\->root)" \e
79 \& ptest.pod
80 \&
81 \& $VAR1 = [
82 \& \*(AqDocument\*(Aq,
83 \& { \*(Aqstart_line\*(Aq => 1 },
84 \& [
85 \& \*(Aqhead1\*(Aq,
86 \& { \*(Aqstart_line\*(Aq => 1 },
87 \& \*(AqPIE\*(Aq
88 \& ],
89 \& [
90 \& \*(AqPara\*(Aq,
91 \& { \*(Aqstart_line\*(Aq => 3 },
92 \& \*(AqI like \*(Aq,
93 \& [
94 \& \*(AqB\*(Aq,
95 \& {},
96 \& \*(Aqpie\*(Aq
97 \& ],
98 \& \*(Aq!\*(Aq
99 \& ]
100 \& ];
101 .Ve
102 .SH DESCRIPTION
103 .IX Header "DESCRIPTION"
104 This class is of interest to people writing a Pod processor/formatter.
105 .PP
106 This class takes Pod and parses it, returning a parse tree made just
107 of arrayrefs, and hashrefs, and strings.
108 .PP
109 This is a subclass of Pod::Simple and inherits all its methods.
110 .PP
111 This class is inspired by XML::Parser\*(Aqs "Tree" parsing\-style, although
112 it doesn\*(Aqt use exactly the same LoL format.
113 .SH METHODS
114 .IX Header "METHODS"
115 At the end of the parse, call \f(CW\*(C`$parser\->root\*(C'\fR to get the
116 tree\*(Aqs top node.
117 .SH "Tree Contents"
118 .IX Header "Tree Contents"
119 Every element node in the parse tree is represented by an arrayref of
120 the form: \f(CW\*(C`[ \fR\f(CIelementname\fR\f(CW, \e%attributes, \fR\f(CI...subnodes...\fR\f(CW ]\*(C'\fR.
121 See the example tree dump in the Synopsis, above.
122 .PP
123 Every text node in the tree is represented by a simple (non\-ref)
124 string scalar. So you can test \f(CWref($node)\fR to see whether you have
125 an element node or just a text node.
126 .PP
127 The top node in the tree is \f(CW\*(C`[ \*(AqDocument\*(Aq, \e%attributes,
128 \&\fR\f(CI...subnodes...\fR\f(CW ]\*(C'\fR
129 .SH "SEE ALSO"
130 .IX Header "SEE ALSO"
131 Pod::Simple
132 .PP
133 perllol
134 .PP
135 The "Tree" subsubsection in XML::Parser
136 .SH SUPPORT
137 .IX Header "SUPPORT"
138 Questions or discussion about POD and Pod::Simple should be sent to the
139 pod\[email protected] mail list. Send an empty email to
140 pod\-people\[email protected] to subscribe.
141 .PP
142 This module is managed in an open GitHub repository,
143 <https://github.com/perl\-pod/pod\-simple/>. Feel free to fork and contribute, or
144 to clone <https://github.com/perl\-pod/pod\-simple.git> and send patches!
145 .PP
146 Patches against Pod::Simple are welcome. Please send bug reports to
147 <bug\-pod\[email protected]>.
148 .SH "COPYRIGHT AND DISCLAIMERS"
149 .IX Header "COPYRIGHT AND DISCLAIMERS"
150 Copyright (c) 2002 Sean M. Burke.
151 .PP
152 This library is free software; you can redistribute it and/or modify it
153 under the same terms as Perl itself.
154 .PP
155 This program is distributed in the hope that it will be useful, but
156 without any warranty; without even the implied warranty of
157 merchantability or fitness for a particular purpose.
158 .SH AUTHOR
159 .IX Header "AUTHOR"
160 Pod::Simple was created by Sean M. Burke <[email protected]>.
161 But don\*(Aqt bother him, he\*(Aqs retired.
162 .PP
163 Pod::Simple is maintained by:
164 .IP \(bu 4
165 Allison Randal \f(CW\*(C`[email protected]\*(C'\fR
166 .IP \(bu 4
167 Hans Dieter Pearcey \f(CW\*(C`[email protected]\*(C'\fR
168 .IP \(bu 4
169 David E. Wheeler \f(CW\*(C`[email protected]\*(C'\fR