line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Package Definition |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Text::UberText::Node::Text; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Compiler Directives |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
12
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# Includes |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
4
|
use Text::UberText::Node; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
# Global Variables |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
5
|
use vars qw/@ISA $EscapeChar $VERSION /; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
295
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$VERSION=0.95; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Text within a block that can be replaced with other characters |
29
|
|
|
|
|
|
|
# An escape sequence within an UberText doc would look like this: |
30
|
|
|
|
|
|
|
# %pc; (percent sign) |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$EscapeChar={ |
33
|
|
|
|
|
|
|
"lb" => "[", |
34
|
|
|
|
|
|
|
"rb" => "]", |
35
|
|
|
|
|
|
|
"pc" => "%", |
36
|
|
|
|
|
|
|
"lp" => "(", |
37
|
|
|
|
|
|
|
"rp" => ")", |
38
|
|
|
|
|
|
|
"dq" => "\"", |
39
|
|
|
|
|
|
|
"sq" => "'", |
40
|
|
|
|
|
|
|
"co" => ":", |
41
|
|
|
|
|
|
|
"sc" => ";", |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# |
46
|
|
|
|
|
|
|
# Inheritance |
47
|
|
|
|
|
|
|
# |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
@ISA=("Text::UberText::Node"); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
# Methods |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new |
56
|
|
|
|
|
|
|
{ |
57
|
0
|
|
|
0
|
1
|
|
my ($class)=shift; |
58
|
0
|
|
|
|
|
|
my ($object); |
59
|
0
|
|
|
|
|
|
$object={}; |
60
|
0
|
|
|
|
|
|
bless ($object,$class); |
61
|
0
|
|
|
|
|
|
$object->_init(@_); |
62
|
0
|
|
|
|
|
|
return $object; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub process |
66
|
|
|
|
|
|
|
{ |
67
|
0
|
|
|
0
|
1
|
|
my ($self)=shift; |
68
|
0
|
|
|
|
|
|
$self->{output}=quickReplace($self->{input}); |
69
|
0
|
|
|
|
|
|
return; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub quickReplace |
73
|
|
|
|
|
|
|
{ |
74
|
0
|
|
|
0
|
1
|
|
my ($string)=shift; |
75
|
0
|
|
|
|
|
|
$string=~s/\%(\w\w);/$EscapeChar->{$1}/g; |
76
|
0
|
|
|
|
|
|
return $string; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# |
80
|
|
|
|
|
|
|
# Hidden Methods |
81
|
|
|
|
|
|
|
# |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# |
84
|
|
|
|
|
|
|
# Exit Block |
85
|
|
|
|
|
|
|
# |
86
|
|
|
|
|
|
|
1; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# |
89
|
|
|
|
|
|
|
# POD Documentation |
90
|
|
|
|
|
|
|
# |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 NAME |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Text::UberText::Node::Text - UberText Text Node |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DESCRIPTION |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
The Node::Text module handles processing an UberText text segment |
99
|
|
|
|
|
|
|
embedded within an UberText file. It is a subclass of the Text::UberText::Node |
100
|
|
|
|
|
|
|
class. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 ESCAPE SEQUENCES |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
UberText files cannot contain certain characters, as a result of which, they |
105
|
|
|
|
|
|
|
need to be specified with escape sequences. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Escape sequences start with a percent sign (%), and end with a semi-colon (;). Two |
108
|
|
|
|
|
|
|
alpabetic characters in the middle specify what character they intend to replace. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=over 4 |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item %pc; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Percent sign (%) |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item %dq; |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Double quote (") |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item %sq; |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Single quote (') |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item %co; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Colon (:) |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item %sc; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Semi-colon (;) |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item %lb; |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Left bracket ([) |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item %rb; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Right bracket (]) |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item %lp; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Left parenthesis (() |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item %rp; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Right parenthesis ()) |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=back |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 METHODS |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
The following methods are overriden from the Text::UberText::Node module to |
153
|
|
|
|
|
|
|
perform specific functions on passed input. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=over 4 |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item $node->process(); |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Generates the output, replacing all escape sequences. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item $node->quickReplace(); |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Performs the actual escape sequence replacement. |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item $node->run(); |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
The run method does nothing. All processing of the text is performed before |
168
|
|
|
|
|
|
|
the document tree is actually run. |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=back |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 AUTHOR |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Chris Josephes Ecpj1@visi.comE |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head1 SEE ALSO |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
L, |
179
|
|
|
|
|
|
|
L |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 COPYRIGHT |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Copyright 2002, Chris Josephes. All rights reserved. |
184
|
|
|
|
|
|
|
This module is free software. It may be used, redistributed, |
185
|
|
|
|
|
|
|
and/or modified under the same terms as Perl itself. |
186
|
|
|
|
|
|
|
~ |