| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# |
|
2
|
|
|
|
|
|
|
# Package Definition |
|
3
|
|
|
|
|
|
|
# |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Text::UberText::Node; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# |
|
8
|
|
|
|
|
|
|
# Compiler Directives |
|
9
|
|
|
|
|
|
|
# |
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
29
|
|
|
12
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# |
|
15
|
|
|
|
|
|
|
# Global Variables |
|
16
|
|
|
|
|
|
|
# |
|
17
|
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
97
|
use vars qw/$VERSION /; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
787
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$VERSION=0.95; |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# |
|
23
|
|
|
|
|
|
|
# Methods |
|
24
|
|
|
|
|
|
|
# |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new |
|
27
|
|
|
|
|
|
|
{ |
|
28
|
0
|
|
|
0
|
1
|
|
my ($class)=shift; |
|
29
|
0
|
|
|
|
|
|
my ($object); |
|
30
|
0
|
|
|
|
|
|
$object={}; |
|
31
|
0
|
|
|
|
|
|
bless ($object,$class); |
|
32
|
0
|
|
|
|
|
|
$object->_init(@_); |
|
33
|
0
|
|
|
|
|
|
return $object; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# |
|
37
|
|
|
|
|
|
|
# Hidden Methods |
|
38
|
|
|
|
|
|
|
# |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _init |
|
41
|
|
|
|
|
|
|
{ |
|
42
|
0
|
|
|
0
|
|
|
my ($self)=shift; |
|
43
|
0
|
|
|
|
|
|
my ($x,$text,$line,$tree); |
|
44
|
0
|
|
|
|
|
|
while (@_) |
|
45
|
|
|
|
|
|
|
{ |
|
46
|
0
|
|
|
|
|
|
($x)=shift; |
|
47
|
0
|
0
|
|
|
|
|
if ($x eq "-text") |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
{ |
|
49
|
0
|
|
|
|
|
|
$text=shift; |
|
50
|
|
|
|
|
|
|
} elsif ($x eq "-line") |
|
51
|
|
|
|
|
|
|
{ |
|
52
|
0
|
|
|
|
|
|
$line=shift; |
|
53
|
0
|
|
|
|
|
|
$self->lineNumber($line); |
|
54
|
|
|
|
|
|
|
} elsif ($x eq "-tree") |
|
55
|
|
|
|
|
|
|
{ |
|
56
|
0
|
|
|
|
|
|
$tree=shift; |
|
57
|
0
|
|
|
|
|
|
$self->tree($tree); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
} |
|
60
|
0
|
0
|
|
|
|
|
if ($text) |
|
61
|
|
|
|
|
|
|
{ |
|
62
|
0
|
|
|
|
|
|
$self->input($text); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
0
|
|
|
|
|
|
return; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub input |
|
68
|
|
|
|
|
|
|
{ |
|
69
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
70
|
0
|
0
|
|
|
|
|
if (@_) |
|
71
|
|
|
|
|
|
|
{ |
|
72
|
0
|
|
|
|
|
|
$self->{input}=shift; |
|
73
|
0
|
|
|
|
|
|
$self->process(); |
|
74
|
|
|
|
|
|
|
} |
|
75
|
0
|
|
|
|
|
|
return $self->{input}; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub output |
|
79
|
|
|
|
|
|
|
{ |
|
80
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
81
|
0
|
|
|
|
|
|
return $self->{output}; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub index |
|
85
|
|
|
|
|
|
|
{ |
|
86
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
87
|
0
|
0
|
|
|
|
|
if (@_) |
|
88
|
|
|
|
|
|
|
{ |
|
89
|
0
|
|
|
|
|
|
$self->{index}=shift; |
|
90
|
|
|
|
|
|
|
} |
|
91
|
0
|
|
|
|
|
|
return $self->{index}; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub parent |
|
95
|
|
|
|
|
|
|
{ |
|
96
|
0
|
|
|
0
|
0
|
|
my ($self)=shift; |
|
97
|
0
|
0
|
|
|
|
|
if (@_) |
|
98
|
|
|
|
|
|
|
{ |
|
99
|
0
|
|
|
|
|
|
$self->{parent}=shift; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
0
|
|
|
|
|
|
return $self->{parent}; |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub lineNumber |
|
105
|
|
|
|
|
|
|
{ |
|
106
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
107
|
0
|
0
|
|
|
|
|
if (@_) |
|
108
|
|
|
|
|
|
|
{ |
|
109
|
0
|
|
|
|
|
|
$self->{linenum}=shift; |
|
110
|
|
|
|
|
|
|
} |
|
111
|
0
|
|
|
|
|
|
return $self->{linenum}; |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub class |
|
115
|
|
|
|
|
|
|
{ |
|
116
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
117
|
0
|
|
|
|
|
|
my ($class)=ref($self); |
|
118
|
0
|
|
|
|
|
|
my (@c); |
|
119
|
0
|
|
|
|
|
|
(@c)=split(/::/,$class); |
|
120
|
0
|
|
|
|
|
|
($class)=pop(@c); |
|
121
|
0
|
|
|
|
|
|
return $class; |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub process |
|
125
|
|
|
|
|
|
|
{ |
|
126
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
127
|
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
return; |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub inserted |
|
132
|
|
|
|
|
|
|
{ |
|
133
|
0
|
|
|
0
|
0
|
|
my ($self)=shift; |
|
134
|
|
|
|
|
|
|
# $self->process(); |
|
135
|
0
|
|
|
|
|
|
return; |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub info |
|
139
|
|
|
|
|
|
|
{ |
|
140
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
141
|
|
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
return; |
|
143
|
|
|
|
|
|
|
} |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub run |
|
146
|
|
|
|
|
|
|
{ |
|
147
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
148
|
|
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
|
return; |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub tree |
|
153
|
|
|
|
|
|
|
{ |
|
154
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
|
155
|
0
|
0
|
|
|
|
|
if (@_) |
|
156
|
|
|
|
|
|
|
{ |
|
157
|
0
|
|
|
|
|
|
$self->{tree}=shift; |
|
158
|
|
|
|
|
|
|
} |
|
159
|
0
|
|
|
|
|
|
return $self->{tree}; |
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# |
|
163
|
|
|
|
|
|
|
# Exit Block |
|
164
|
|
|
|
|
|
|
# |
|
165
|
|
|
|
|
|
|
1; |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
# |
|
168
|
|
|
|
|
|
|
# POD Documentation |
|
169
|
|
|
|
|
|
|
# |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head1 NAME |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Text::UberText::Node - Superclass Node Object |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Text::UberText::Node is a super-class for the L and |
|
178
|
|
|
|
|
|
|
L classes. The methods listed below are |
|
179
|
|
|
|
|
|
|
implemented in both subclasses. The POD documentation for both classes only |
|
180
|
|
|
|
|
|
|
lists methods that are unique to the particular module, or methods that have |
|
181
|
|
|
|
|
|
|
different bahavior from the methods listed below. |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head1 COMMON METHODS |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=over 4 |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=item $node=Text::UberText::Node->new(); |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Creates a new node object. |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item $node->input($string); |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Text string to be processed by the node. |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=item $text=$node->output(); |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Output generated after the node has been processed and run |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=item $node->process(); |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Parsing and examination of the node input, completed before it is |
|
202
|
|
|
|
|
|
|
actually run. |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=item $node->run(); |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
Process external commands using data from the node object. |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item $node->info(); |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
Returns information on the data within the node |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=item $node->tree(); |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
Returns the $tree object that created the node. |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=item $node->index(); |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Returns the tree index pointer for the node. |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=item $node->class(); |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
Returns the lest segment of the Perl class for the node. For example, if |
|
223
|
|
|
|
|
|
|
the actual class is "Text::UberText::Node::Command:, "Command" is returned. |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=item $node->lineNumber(); |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Returns the line number of the source input that the node text started on. |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=back |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head1 AUTHOR |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
Chris Josephes Ecpj1@visi.comE |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
L, |
|
238
|
|
|
|
|
|
|
L |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
Copyright 2002, Chris Josephes. All rights reserved. |
|
243
|
|
|
|
|
|
|
This module is free software. It may be used, redistributed, |
|
244
|
|
|
|
|
|
|
and/or modified under the same terms as Perl itself. |
|
245
|
|
|
|
|
|
|
~ |