| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
|
3
|
1
|
|
|
1
|
|
56114
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
4
|
1
|
|
|
1
|
|
3
|
use utf8; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
21
|
|
|
5
|
1
|
|
|
1
|
|
460
|
use Regexp::Grammars; |
|
|
1
|
|
|
|
|
11
|
|
|
|
1
|
|
|
|
|
4
|
|
|
6
|
1
|
|
|
1
|
|
1010
|
|
|
|
1
|
|
|
|
|
22919
|
|
|
|
1
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '5.046'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my ($class) = @_; |
|
10
|
|
|
|
|
|
|
return bless {}, $class; |
|
11
|
0
|
|
|
0
|
0
|
|
} |
|
12
|
0
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $groupTable = {}; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ($class) = @_; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $code = 'use strict; |
|
18
|
0
|
|
|
0
|
|
|
use warnings; |
|
19
|
|
|
|
|
|
|
use utf8; |
|
20
|
0
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Lang::HL::Export; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use strict; |
|
24
|
|
|
|
|
|
|
no warnings; |
|
25
|
|
|
|
|
|
|
use utf8; |
|
26
|
|
|
|
|
|
|
use feature qw(signatures); |
|
27
|
|
|
|
|
|
|
no warnings "experimental::signatures"; |
|
28
|
|
|
|
|
|
|
no warnings "experimental::smartmatch"; |
|
29
|
|
|
|
|
|
|
use Hash::Merge; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
require Exporter; |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
|
34
|
|
|
|
|
|
|
our @EXPORT = qw( |
|
35
|
|
|
|
|
|
|
arrayElement |
|
36
|
|
|
|
|
|
|
arrayLength |
|
37
|
|
|
|
|
|
|
arrayMerge |
|
38
|
|
|
|
|
|
|
arraySort |
|
39
|
|
|
|
|
|
|
arrayPop |
|
40
|
|
|
|
|
|
|
arrayPush |
|
41
|
|
|
|
|
|
|
arrayShift |
|
42
|
|
|
|
|
|
|
arrayUnshift |
|
43
|
|
|
|
|
|
|
arraySort |
|
44
|
|
|
|
|
|
|
arrayJoin |
|
45
|
|
|
|
|
|
|
arrayReverse |
|
46
|
|
|
|
|
|
|
arrayDelete |
|
47
|
|
|
|
|
|
|
hashKeys |
|
48
|
|
|
|
|
|
|
hashElement |
|
49
|
|
|
|
|
|
|
hashMerge |
|
50
|
|
|
|
|
|
|
hashDelete |
|
51
|
|
|
|
|
|
|
stringConcat |
|
52
|
|
|
|
|
|
|
readFile |
|
53
|
|
|
|
|
|
|
writeFile |
|
54
|
|
|
|
|
|
|
not |
|
55
|
|
|
|
|
|
|
); |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub not($boolOperand) { |
|
58
|
|
|
|
|
|
|
my $not = ! $boolOperand; |
|
59
|
|
|
|
|
|
|
return $not; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub arrayElement($array, $element) { |
|
63
|
|
|
|
|
|
|
if( $element ~~ @{$array} ) { |
|
64
|
|
|
|
|
|
|
return 1; |
|
65
|
|
|
|
|
|
|
} else { |
|
66
|
|
|
|
|
|
|
return 0; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub arrayDelete($array, $element) { |
|
71
|
|
|
|
|
|
|
delete($array->[$element]); |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub hashDelete($hash, $element) { |
|
75
|
|
|
|
|
|
|
delete($hash->{$element}); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub arrayReverse($array) { |
|
79
|
|
|
|
|
|
|
my @reversedArray = reverse(@{$array}); |
|
80
|
|
|
|
|
|
|
return \@reversedArray; |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub arrayJoin($separator, $array) { |
|
84
|
|
|
|
|
|
|
my @array = @{$array}; |
|
85
|
|
|
|
|
|
|
return join($separator, $array); |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub arraySort($array) { |
|
89
|
|
|
|
|
|
|
my @array = @{$array}; |
|
90
|
|
|
|
|
|
|
my @sortedArray = sort(@array); |
|
91
|
|
|
|
|
|
|
return \@sortedArray; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub arrayUnshift($array, $element) { |
|
95
|
|
|
|
|
|
|
unshift(@{$array}, $element); |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub arrayShift($array) { |
|
99
|
|
|
|
|
|
|
return shift(@{$array}); |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub arrayPush($array, $element) { |
|
103
|
|
|
|
|
|
|
push(@{$array}, $element); |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub arrayPop($array) { |
|
107
|
|
|
|
|
|
|
return pop(@{$array}); |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub stringConcat($textOne, $textTwo) { |
|
111
|
|
|
|
|
|
|
return $textOne . $textTwo; |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub arrayLength($array) { |
|
115
|
|
|
|
|
|
|
my @newArray = @{$array}; |
|
116
|
|
|
|
|
|
|
return $#newArray; |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub arrayMerge($arrayOne, $arrayTwo) { |
|
120
|
|
|
|
|
|
|
my @newArray = ( @{$arrayOne}, @{$arrayTwo} ); |
|
121
|
|
|
|
|
|
|
return \@newArray; |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub hashElement($hash, $element) { |
|
125
|
|
|
|
|
|
|
my %hashMap = %{$hash}; |
|
126
|
|
|
|
|
|
|
if( exists $hashMap{$element} ) { |
|
127
|
|
|
|
|
|
|
return 1; |
|
128
|
|
|
|
|
|
|
} else { |
|
129
|
|
|
|
|
|
|
return 0; |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
} |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub hashKeys($hash) { |
|
134
|
|
|
|
|
|
|
my @keys = keys(%{$hash}); |
|
135
|
|
|
|
|
|
|
return \@keys; |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub hashMerge($hashOne, $hashTwo) { |
|
139
|
|
|
|
|
|
|
my $mergedHash = merge($hashOne, $hashTwo); |
|
140
|
|
|
|
|
|
|
return $mergedHash; |
|
141
|
|
|
|
|
|
|
} |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub readFile($fileName) { |
|
144
|
|
|
|
|
|
|
my $fileContent; |
|
145
|
|
|
|
|
|
|
open(my $fh, "<:encoding(UTF-8)", $fileName) or die "Cannot open the $fileName file"; |
|
146
|
|
|
|
|
|
|
{ |
|
147
|
|
|
|
|
|
|
local $/; |
|
148
|
|
|
|
|
|
|
$fileContent = <$fh>; |
|
149
|
|
|
|
|
|
|
} |
|
150
|
|
|
|
|
|
|
close($fh); |
|
151
|
|
|
|
|
|
|
return $fileContent; |
|
152
|
|
|
|
|
|
|
} |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub writeFile($fileName, $fileContent) { |
|
155
|
|
|
|
|
|
|
open(my $fh, ">:encoding(UTF-8)", $fileName) or die "Cannot open the $fileName file"; |
|
156
|
|
|
|
|
|
|
print $fh $fileContent; |
|
157
|
|
|
|
|
|
|
close($fh); |
|
158
|
|
|
|
|
|
|
} |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
1;'; |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
for my $element ( @{ $class->{Class}} ) { |
|
163
|
|
|
|
|
|
|
$code .= $element->X(); |
|
164
|
|
|
|
|
|
|
} |
|
165
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
$code .= 'my $object = Main->new(); $object->main();'; |
|
167
|
|
|
|
|
|
|
return $code; |
|
168
|
|
|
|
|
|
|
} |
|
169
|
0
|
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
my ($class) = @_; |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
my $className = $class->{ClassName}->X(); |
|
173
|
|
|
|
|
|
|
my $classBlock = $class->{ClassBlock}->X($className); |
|
174
|
0
|
|
|
0
|
|
|
|
|
175
|
|
|
|
|
|
|
my $classCode = ' |
|
176
|
0
|
|
|
|
|
|
package ' . $className . '; |
|
177
|
0
|
|
|
|
|
|
use strict; |
|
178
|
|
|
|
|
|
|
use warnings; |
|
179
|
0
|
|
|
|
|
|
use utf8; |
|
180
|
|
|
|
|
|
|
use Lang::HL::Export; |
|
181
|
|
|
|
|
|
|
use feature qw(signatures); |
|
182
|
|
|
|
|
|
|
no warnings "experimental::signatures"; |
|
183
|
|
|
|
|
|
|
use Data::Printer; |
|
184
|
|
|
|
|
|
|
use Try::Tiny; |
|
185
|
|
|
|
|
|
|
'; |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
$classCode .= $classBlock . "\n1;"; |
|
188
|
|
|
|
|
|
|
return $classCode; |
|
189
|
|
|
|
|
|
|
} |
|
190
|
|
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
|
my ($class) = @_; |
|
192
|
0
|
|
|
|
|
|
my $className = $class->{''}; |
|
193
|
|
|
|
|
|
|
return $className; |
|
194
|
|
|
|
|
|
|
} |
|
195
|
|
|
|
|
|
|
|
|
196
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
197
|
0
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
|
my $classBlock = ' |
|
199
|
|
|
|
|
|
|
sub new($class) { |
|
200
|
|
|
|
|
|
|
my $hashRef = { "' . $className . '" => {} }; |
|
201
|
|
|
|
|
|
|
return bless $hashRef, $class; |
|
202
|
0
|
|
|
0
|
|
|
} |
|
203
|
|
|
|
|
|
|
'; |
|
204
|
0
|
|
|
|
|
|
my $classGroups = $class->{ClassGroups}->X($className); |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
$classBlock .= $classGroups; |
|
207
|
|
|
|
|
|
|
return $classBlock; |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
|
|
210
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
211
|
|
|
|
|
|
|
|
|
212
|
0
|
|
|
|
|
|
my @classGroups; |
|
213
|
0
|
|
|
|
|
|
for my $element ( @{$class->{Group}} ) { |
|
214
|
|
|
|
|
|
|
push @classGroups, $element->X($className); |
|
215
|
|
|
|
|
|
|
} |
|
216
|
|
|
|
|
|
|
|
|
217
|
0
|
|
|
0
|
|
|
my $classGroups = join("", @classGroups); |
|
218
|
|
|
|
|
|
|
return $classGroups; |
|
219
|
0
|
|
|
|
|
|
} |
|
220
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
221
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
return ( $class->{Comment} |
|
224
|
0
|
|
|
|
|
|
|| $class->{Parent} |
|
225
|
0
|
|
|
|
|
|
|| $class->{Packages} |
|
226
|
|
|
|
|
|
|
|| $class->{ImplementFunction} |
|
227
|
|
|
|
|
|
|
|| $class->{EmbedBlock} |
|
228
|
|
|
|
|
|
|
|| $class->{Function} |
|
229
|
0
|
|
|
0
|
|
|
|| $class->{NonSyntaxClass} )->X($className); |
|
230
|
|
|
|
|
|
|
} |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
235
|
|
|
|
|
|
|
my $functionParamList = $class->{FunctionParamList}->X($className); |
|
236
|
|
|
|
|
|
|
|
|
237
|
0
|
|
0
|
|
|
|
my $multiLineComment = ""; |
|
238
|
|
|
|
|
|
|
if(exists $class->{MultiLineComment}) { |
|
239
|
|
|
|
|
|
|
my $multiLineComment = $class->{MultiLineComment}->X($className); |
|
240
|
|
|
|
|
|
|
} |
|
241
|
0
|
|
|
0
|
|
|
|
|
242
|
|
|
|
|
|
|
my $dieMessage = "function " . $functionName . " in class " . $className . " is not defined \n"; |
|
243
|
0
|
|
|
|
|
|
my $implementFunction = "sub " . $functionName . $functionParamList . "{\n" . $multiLineComment . "\n die(" . $dieMessage . ");}\n"; |
|
244
|
0
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
return $implementFunction; |
|
246
|
0
|
|
|
|
|
|
} |
|
247
|
0
|
0
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
my $mlComment = $class->{MLComment}->X($className); |
|
251
|
0
|
|
|
|
|
|
return $mlComment; |
|
252
|
0
|
|
|
|
|
|
} |
|
253
|
|
|
|
|
|
|
|
|
254
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
255
|
|
|
|
|
|
|
my $mlComment = $class->{''}; |
|
256
|
|
|
|
|
|
|
return $mlComment; |
|
257
|
|
|
|
|
|
|
} |
|
258
|
0
|
|
|
0
|
|
|
|
|
259
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
260
|
0
|
|
|
|
|
|
my $nonSyntax = $class->{''}; |
|
261
|
0
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
my @nonSyntax = split(" ", $nonSyntax); |
|
263
|
|
|
|
|
|
|
$nonSyntax = $nonSyntax[0]; |
|
264
|
|
|
|
|
|
|
|
|
265
|
0
|
|
|
0
|
|
|
print "SyntaxError", "\n"; |
|
266
|
0
|
|
|
|
|
|
print "===========", "\n"; |
|
267
|
0
|
|
|
|
|
|
print "ClassName: ", $className, "\n"; |
|
268
|
|
|
|
|
|
|
die "Error: $nonSyntax \n"; |
|
269
|
|
|
|
|
|
|
} |
|
270
|
|
|
|
|
|
|
|
|
271
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
272
|
0
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
my @packageList = ($class->{PackageList})->X($className); |
|
274
|
0
|
|
|
|
|
|
my $packages = join("\n", @packageList); |
|
275
|
0
|
|
|
|
|
|
return $packages; |
|
276
|
|
|
|
|
|
|
} |
|
277
|
0
|
|
|
|
|
|
|
|
278
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
279
|
0
|
|
|
|
|
|
|
|
280
|
0
|
|
|
|
|
|
my @packageList; |
|
281
|
|
|
|
|
|
|
for my $element ( @{$class->{Package}} ) { |
|
282
|
|
|
|
|
|
|
push @packageList, $element->X($className); |
|
283
|
|
|
|
|
|
|
} |
|
284
|
0
|
|
|
0
|
|
|
|
|
285
|
|
|
|
|
|
|
return @packageList; |
|
286
|
0
|
|
|
|
|
|
} |
|
287
|
0
|
|
|
|
|
|
|
|
288
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
return ( $class->{PackageWithConstructor} |
|
291
|
|
|
|
|
|
|
|| $class->{PackageWithoutConstructor} )->X($className); |
|
292
|
0
|
|
|
0
|
|
|
} |
|
293
|
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
295
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
296
|
0
|
|
|
|
|
|
my $object = $class->{Object}->X($className); |
|
297
|
|
|
|
|
|
|
my $packageName = $class->{PackageName}->X($className); |
|
298
|
|
|
|
|
|
|
my $constructor = $class->{Constructor}->X($className); |
|
299
|
0
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
if(exists $class->{ObjectParameters}) { |
|
301
|
|
|
|
|
|
|
my $objectParameters = $class->{ObjectParameters}->X($className); |
|
302
|
|
|
|
|
|
|
my $parameters; |
|
303
|
0
|
|
|
0
|
|
|
|
|
304
|
|
|
|
|
|
|
if(ref($objectParameters)) { |
|
305
|
|
|
|
|
|
|
$parameters = join(",", @{$objectParameters}); |
|
306
|
0
|
|
0
|
|
|
|
} else { |
|
307
|
|
|
|
|
|
|
$parameters = $objectParameters; |
|
308
|
|
|
|
|
|
|
} |
|
309
|
|
|
|
|
|
|
|
|
310
|
0
|
|
|
0
|
|
|
my $packageWithConstructor = "use " . $packageName . ";\n" |
|
311
|
|
|
|
|
|
|
. "my \$" . $object . " = " . $packageName . "->" |
|
312
|
0
|
|
|
|
|
|
. $constructor . "(" . $parameters . ");\n"; |
|
313
|
0
|
|
|
|
|
|
return $packageWithConstructor; |
|
314
|
0
|
|
|
|
|
|
} |
|
315
|
|
|
|
|
|
|
|
|
316
|
0
|
0
|
|
|
|
|
my $packageWithConstructor = "use " . $packageName . ";\n" |
|
317
|
0
|
|
|
|
|
|
. "my \$" . $object . " = " . $packageName |
|
318
|
0
|
|
|
|
|
|
. "->" . $constructor . "();\n"; |
|
319
|
|
|
|
|
|
|
return $packageWithConstructor; |
|
320
|
0
|
0
|
|
|
|
|
} |
|
321
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
323
|
0
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
return ( $class->{PackageParams} |
|
325
|
|
|
|
|
|
|
|| $class->{Parameters} )->X($className); |
|
326
|
0
|
|
|
|
|
|
} |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
329
|
0
|
|
|
|
|
|
my @keyValuePairs; |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
my $keyValuePairs = ""; |
|
332
|
0
|
|
|
|
|
|
for my $element ( @{ $class->{KeyValue}} ) { |
|
333
|
|
|
|
|
|
|
@keyValuePairs = (); |
|
334
|
|
|
|
|
|
|
push @keyValuePairs, $element->X($className); |
|
335
|
0
|
|
|
|
|
|
$keyValuePairs .= $keyValuePairs[0] . " => " . $keyValuePairs[1] . ", "; |
|
336
|
|
|
|
|
|
|
} |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
return $keyValuePairs; |
|
339
|
0
|
|
|
0
|
|
|
} |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
342
|
0
|
|
0
|
|
|
|
|
|
343
|
|
|
|
|
|
|
my @packageDir; |
|
344
|
|
|
|
|
|
|
for my $element ( @{ $class->{PackageDir}} ) { |
|
345
|
|
|
|
|
|
|
push @packageDir, $element->X($className); |
|
346
|
0
|
|
|
0
|
|
|
} |
|
347
|
0
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
my $packageName = join("::", @packageDir); |
|
349
|
0
|
|
|
|
|
|
return $packageName; |
|
350
|
0
|
|
|
|
|
|
} |
|
|
0
|
|
|
|
|
|
|
|
351
|
0
|
|
|
|
|
|
|
|
352
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
353
|
0
|
|
|
|
|
|
my $packageName = $class->{PackageName}->X($className); |
|
354
|
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
if(exists $class->{QW}) { |
|
356
|
0
|
|
|
|
|
|
my $qw = $class->{QW}->X($className); |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
my $packageWithoutConstructor = "use " . $packageName . $qw . ";\n"; |
|
359
|
|
|
|
|
|
|
return $packageWithoutConstructor; |
|
360
|
0
|
|
|
0
|
|
|
} |
|
361
|
|
|
|
|
|
|
|
|
362
|
0
|
|
|
|
|
|
my $packageWithoutConstructor = "use " . $packageName . ";\n"; |
|
363
|
0
|
|
|
|
|
|
return $packageWithoutConstructor; |
|
|
0
|
|
|
|
|
|
|
|
364
|
0
|
|
|
|
|
|
} |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
367
|
0
|
|
|
|
|
|
|
|
368
|
0
|
|
|
|
|
|
my @functionList = $class->{FunctionList}->X($className); |
|
369
|
|
|
|
|
|
|
my $qw = " qw("; |
|
370
|
|
|
|
|
|
|
my $funcitonList = join(" ", @functionList); |
|
371
|
|
|
|
|
|
|
$qw .= $funcitonList . ")"; |
|
372
|
0
|
|
|
0
|
|
|
} |
|
373
|
0
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
375
|
0
|
0
|
|
|
|
|
|
|
376
|
0
|
|
|
|
|
|
my @functionList; |
|
377
|
|
|
|
|
|
|
for my $element ( @{ $class->{FunctionName}} ) { |
|
378
|
0
|
|
|
|
|
|
push @functionList, $element->X($className); |
|
379
|
0
|
|
|
|
|
|
} |
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
return @functionList; |
|
382
|
0
|
|
|
|
|
|
} |
|
383
|
0
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
my $constructor = $class->{''}; |
|
387
|
0
|
|
|
0
|
|
|
return $constructor; |
|
388
|
|
|
|
|
|
|
} |
|
389
|
0
|
|
|
|
|
|
|
|
390
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
391
|
0
|
|
|
|
|
|
|
|
392
|
0
|
|
|
|
|
|
my $object = $class->{''}; |
|
393
|
|
|
|
|
|
|
return $object; |
|
394
|
|
|
|
|
|
|
} |
|
395
|
|
|
|
|
|
|
|
|
396
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
397
|
|
|
|
|
|
|
|
|
398
|
0
|
|
|
|
|
|
my $packageDir = $class->{''}; |
|
399
|
0
|
|
|
|
|
|
return $packageDir; |
|
|
0
|
|
|
|
|
|
|
|
400
|
0
|
|
|
|
|
|
} |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
403
|
0
|
|
|
|
|
|
my $parent = 'our @ISA = qw('; |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
my $classNames = $class->{ClassNames}->X($className); |
|
406
|
|
|
|
|
|
|
$parent .= $classNames . ");\n"; |
|
407
|
0
|
|
|
0
|
|
|
} |
|
408
|
|
|
|
|
|
|
|
|
409
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
410
|
0
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
my @classNames; |
|
412
|
|
|
|
|
|
|
for my $element ( @{$class->{ClassName}} ) { |
|
413
|
|
|
|
|
|
|
push @classNames, $element->X($className); |
|
414
|
0
|
|
|
0
|
|
|
} |
|
415
|
|
|
|
|
|
|
|
|
416
|
0
|
|
|
|
|
|
my $classNames = join(" ", @classNames); |
|
417
|
0
|
|
|
|
|
|
return $classNames; |
|
418
|
|
|
|
|
|
|
} |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
421
|
0
|
|
|
0
|
|
|
my $comment = $class->{LineComment}->X($className); |
|
422
|
|
|
|
|
|
|
$comment = "\n" . "# " . $comment . "\n"; |
|
423
|
0
|
|
|
|
|
|
return $comment; |
|
424
|
0
|
|
|
|
|
|
} |
|
425
|
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
427
|
|
|
|
|
|
|
return $class->{''}; |
|
428
|
0
|
|
|
0
|
|
|
} |
|
429
|
0
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
431
|
0
|
|
|
|
|
|
|
|
432
|
0
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
433
|
|
|
|
|
|
|
my $functionParamList = $class->{FunctionParamList}->X($className); |
|
434
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className, $functionName); |
|
435
|
|
|
|
|
|
|
|
|
436
|
0
|
|
|
0
|
|
|
my $function = "\n sub " . $functionName . $functionParamList . $codeBlock; |
|
437
|
|
|
|
|
|
|
return $function; |
|
438
|
0
|
|
|
|
|
|
} |
|
439
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
440
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
441
|
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
my $functionName = $class->{''}; |
|
443
|
0
|
|
|
|
|
|
return $functionName; |
|
444
|
0
|
|
|
|
|
|
} |
|
445
|
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
447
|
|
|
|
|
|
|
|
|
448
|
0
|
|
|
0
|
|
|
my @params = ( $class->{EmptyParamList} |
|
449
|
0
|
|
|
|
|
|
|| $class->{FunctionParams} )->X($className); |
|
450
|
0
|
|
|
|
|
|
|
|
451
|
0
|
|
|
|
|
|
my $functionParamList; |
|
452
|
|
|
|
|
|
|
$functionParamList = '( $class, '; |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
if($#params >= 0) { |
|
455
|
0
|
|
|
0
|
|
|
foreach my $param (@params) { |
|
456
|
0
|
|
|
|
|
|
if( $param eq "" ) {} else { |
|
457
|
|
|
|
|
|
|
$functionParamList .= "\$" . $param . ","; |
|
458
|
|
|
|
|
|
|
} |
|
459
|
|
|
|
|
|
|
} |
|
460
|
0
|
|
|
0
|
|
|
if( substr($functionParamList, -1) eq "," ) { |
|
461
|
|
|
|
|
|
|
chop($functionParamList); |
|
462
|
0
|
|
|
|
|
|
} |
|
463
|
0
|
|
|
|
|
|
} |
|
464
|
0
|
|
|
|
|
|
else { |
|
465
|
|
|
|
|
|
|
chop($functionParamList); |
|
466
|
0
|
|
|
|
|
|
} |
|
467
|
0
|
|
|
|
|
|
$functionParamList .= ")"; |
|
468
|
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
return $functionParamList; |
|
470
|
|
|
|
|
|
|
} |
|
471
|
0
|
|
|
0
|
|
|
|
|
472
|
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
|
473
|
0
|
|
|
|
|
|
my $blocks = $class->{Blocks}->X($className, $functionName); |
|
474
|
0
|
|
|
|
|
|
my $codeBlock = "{\n" . $blocks . "\n}"; |
|
475
|
|
|
|
|
|
|
return $codeBlock; |
|
476
|
|
|
|
|
|
|
} |
|
477
|
|
|
|
|
|
|
|
|
478
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
479
|
|
|
|
|
|
|
return $class->{''}; |
|
480
|
|
|
|
|
|
|
} |
|
481
|
0
|
|
0
|
|
|
|
|
|
482
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
483
|
0
|
|
|
|
|
|
my @functionParams; |
|
484
|
0
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
for my $element ( @{ $class->{Arg}} ) { |
|
486
|
0
|
0
|
|
|
|
|
push @functionParams, $element->X($className); |
|
487
|
0
|
|
|
|
|
|
} |
|
488
|
0
|
0
|
|
|
|
|
|
|
489
|
0
|
|
|
|
|
|
return @functionParams; |
|
490
|
|
|
|
|
|
|
} |
|
491
|
|
|
|
|
|
|
|
|
492
|
0
|
0
|
|
|
|
|
my ($class, $className) = @_; |
|
493
|
0
|
|
|
|
|
|
return $class->{''}; |
|
494
|
|
|
|
|
|
|
} |
|
495
|
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
|
497
|
0
|
|
|
|
|
|
my @blocks; |
|
498
|
|
|
|
|
|
|
|
|
499
|
0
|
|
|
|
|
|
for my $element ( @{$class->{Block}} ) { |
|
500
|
|
|
|
|
|
|
push @blocks, $element->X($className, $functionName); |
|
501
|
0
|
|
|
|
|
|
} |
|
502
|
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
my $blocks = join("\n", @blocks); |
|
504
|
|
|
|
|
|
|
return $blocks; |
|
505
|
0
|
|
|
0
|
|
|
} |
|
506
|
0
|
|
|
|
|
|
|
|
507
|
0
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
|
508
|
0
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
my $block = ( $class->{IfElse} |
|
510
|
|
|
|
|
|
|
|| $class->{While} |
|
511
|
|
|
|
|
|
|
|| $class->{ForEach} |
|
512
|
0
|
|
|
0
|
|
|
|| $class->{ArrayEach} |
|
513
|
0
|
|
|
|
|
|
|| $class->{HashEach} |
|
514
|
|
|
|
|
|
|
|| $class->{For} |
|
515
|
|
|
|
|
|
|
|| $class->{RegexMatch} |
|
516
|
|
|
|
|
|
|
|| $class->{TryCatch} |
|
517
|
0
|
|
|
0
|
|
|
|| $class->{EmbedBlock} |
|
518
|
0
|
|
|
|
|
|
|| $class->{Comment} |
|
519
|
|
|
|
|
|
|
|| $class->{Statement} |
|
520
|
0
|
|
|
|
|
|
|| $class->{Packages} |
|
|
0
|
|
|
|
|
|
|
|
521
|
0
|
|
|
|
|
|
|| $class->{NonSyntaxFunction} )->X($className, $functionName); |
|
522
|
|
|
|
|
|
|
return $block; |
|
523
|
|
|
|
|
|
|
} |
|
524
|
0
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
526
|
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
my $pattern = $class->{Pattern}->X($className); |
|
528
|
0
|
|
|
0
|
|
|
my $matchString = $class->{MatchString}->X($className); |
|
529
|
0
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
530
|
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
my $regexMatch = "if(" . $matchString . " =~ " . $pattern . ")" . $codeBlock; |
|
532
|
|
|
|
|
|
|
return $regexMatch; |
|
533
|
0
|
|
|
0
|
|
|
} |
|
534
|
0
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
536
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
537
|
0
|
|
|
|
|
|
my $pattern = $class->{VariableName}->X($className); |
|
538
|
|
|
|
|
|
|
return $pattern; |
|
539
|
|
|
|
|
|
|
} |
|
540
|
0
|
|
|
|
|
|
|
|
541
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
542
|
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
my $matchString = $class->{VariableName}->X($className); |
|
544
|
|
|
|
|
|
|
return $matchString; |
|
545
|
0
|
|
|
0
|
|
|
} |
|
546
|
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
548
|
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
550
|
|
|
|
|
|
|
if(exists $class->{CatchBlock}) { |
|
551
|
|
|
|
|
|
|
my $catchBlock = $class->{CatchBlock}->X($className); |
|
552
|
|
|
|
|
|
|
my $tryCatch = "try " . $codeBlock . $catchBlock . ";"; |
|
553
|
|
|
|
|
|
|
return $tryCatch; |
|
554
|
|
|
|
|
|
|
} else { |
|
555
|
|
|
|
|
|
|
my $tryCatch = "try {\n " . $codeBlock . "\n}"; |
|
556
|
|
|
|
|
|
|
return $tryCatch; |
|
557
|
|
|
|
|
|
|
} |
|
558
|
|
|
|
|
|
|
} |
|
559
|
0
|
|
0
|
|
|
|
|
|
560
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
561
|
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
563
|
|
|
|
|
|
|
my @codeBlock = split(" ", $codeBlock); |
|
564
|
0
|
|
|
0
|
|
|
shift(@codeBlock); |
|
565
|
|
|
|
|
|
|
my $catchBlock = " catch {\n my \$error = \$_;\n " . join(" ", @codeBlock); |
|
566
|
0
|
|
|
|
|
|
|
|
567
|
0
|
|
|
|
|
|
return $catchBlock; |
|
568
|
0
|
|
|
|
|
|
} |
|
569
|
|
|
|
|
|
|
|
|
570
|
0
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
|
571
|
0
|
|
|
|
|
|
my $nonSyntax = $class->{''}; |
|
572
|
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
my @nonSyntax = split(" ", $nonSyntax); |
|
574
|
|
|
|
|
|
|
$nonSyntax = $nonSyntax[0]; |
|
575
|
0
|
|
|
0
|
|
|
|
|
576
|
|
|
|
|
|
|
print "SyntaxError", "\n"; |
|
577
|
0
|
|
|
|
|
|
print "===========", "\n"; |
|
578
|
0
|
|
|
|
|
|
print "ClassName: ", $className, "\n"; |
|
579
|
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
if(defined $functionName) { |
|
581
|
|
|
|
|
|
|
print "FunctionName: ", $functionName, "\n"; |
|
582
|
0
|
|
|
0
|
|
|
} |
|
583
|
|
|
|
|
|
|
|
|
584
|
0
|
|
|
|
|
|
die "Error: $nonSyntax \n"; |
|
585
|
0
|
|
|
|
|
|
} |
|
586
|
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
588
|
|
|
|
|
|
|
|
|
589
|
0
|
|
|
0
|
|
|
my $embedBlock = $class->{EmbedCodeBlock}->X($className); |
|
590
|
|
|
|
|
|
|
return $embedBlock; |
|
591
|
0
|
|
|
|
|
|
} |
|
592
|
0
|
0
|
|
|
|
|
|
|
593
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
594
|
0
|
|
|
|
|
|
|
|
595
|
0
|
|
|
|
|
|
my $embedCode = $class->{EmbeddedCode}->X($className); |
|
596
|
|
|
|
|
|
|
return $embedCode; |
|
597
|
0
|
|
|
|
|
|
} |
|
598
|
0
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
600
|
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
my $embedCode = $class->{''}; |
|
602
|
|
|
|
|
|
|
return $embedCode; |
|
603
|
0
|
|
|
0
|
|
|
} |
|
604
|
|
|
|
|
|
|
|
|
605
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
606
|
0
|
|
|
|
|
|
|
|
607
|
0
|
|
|
|
|
|
my $boolExpression = $class->{BoolExpression}->X($className); |
|
608
|
0
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
609
|
|
|
|
|
|
|
|
|
610
|
0
|
|
|
|
|
|
my $while = "\n while ( " . $boolExpression . " ) " . $codeBlock; |
|
611
|
|
|
|
|
|
|
return $while; |
|
612
|
|
|
|
|
|
|
} |
|
613
|
|
|
|
|
|
|
|
|
614
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
615
|
0
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
my $forEachVariableName = $class->{VariableName}->X($className); |
|
617
|
0
|
|
|
|
|
|
my @forRange = $class->{ForRange}->X($className); |
|
618
|
0
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
619
|
|
|
|
|
|
|
|
|
620
|
0
|
|
|
|
|
|
my $forEach = "\n foreach my " . $forEachVariableName . " ( " . $forRange[0] |
|
621
|
0
|
|
|
|
|
|
. " ... " . $forRange[1] . " ) " . $codeBlock; |
|
622
|
0
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
return $forEach; |
|
624
|
0
|
0
|
|
|
|
|
} |
|
625
|
0
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
627
|
|
|
|
|
|
|
|
|
628
|
0
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
629
|
|
|
|
|
|
|
return $variableName; |
|
630
|
|
|
|
|
|
|
} |
|
631
|
|
|
|
|
|
|
|
|
632
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
633
|
|
|
|
|
|
|
|
|
634
|
0
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
635
|
0
|
|
|
|
|
|
my $arrayEachVariableName = $class->{ArrayEachVariableName}->X($className); |
|
636
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
637
|
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
my $arrayEach = "\n foreach my " . $arrayEachVariableName . "( \@{" . $variableName . "})" . $codeBlock; |
|
639
|
0
|
|
|
0
|
|
|
return $arrayEach; |
|
640
|
|
|
|
|
|
|
} |
|
641
|
0
|
|
|
|
|
|
|
|
642
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
643
|
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
645
|
|
|
|
|
|
|
return $variableName; |
|
646
|
0
|
|
|
0
|
|
|
} |
|
647
|
|
|
|
|
|
|
|
|
648
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
649
|
0
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
651
|
|
|
|
|
|
|
my $hashEachKey = $class->{HashEachKey}->X($className); |
|
652
|
|
|
|
|
|
|
my $hashEachValue = $class->{HashEachValue}->X($className); |
|
653
|
0
|
|
|
0
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
654
|
|
|
|
|
|
|
|
|
655
|
0
|
|
|
|
|
|
my $hashEach = "\n keys %{" . $variableName . "};\n while(my (" . $hashEachKey |
|
656
|
0
|
|
|
|
|
|
. ", " . $hashEachValue . ") = each %{ " . $variableName . " }) " . $codeBlock; |
|
657
|
|
|
|
|
|
|
|
|
658
|
0
|
|
|
|
|
|
return $hashEach; |
|
659
|
0
|
|
|
|
|
|
} |
|
660
|
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
662
|
|
|
|
|
|
|
|
|
663
|
0
|
|
|
0
|
|
|
my $hashEachKey = $class->{VariableName}->X($className); |
|
664
|
|
|
|
|
|
|
return $hashEachKey; |
|
665
|
0
|
|
|
|
|
|
} |
|
666
|
0
|
|
|
|
|
|
|
|
667
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
668
|
|
|
|
|
|
|
|
|
669
|
0
|
|
|
|
|
|
my $hashEachValue = $class->{VariableName}->X($className); |
|
670
|
|
|
|
|
|
|
return $hashEachValue; |
|
671
|
|
|
|
|
|
|
} |
|
672
|
0
|
|
|
|
|
|
|
|
673
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
674
|
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
676
|
0
|
|
|
0
|
|
|
my @forRange = $class->{ForRange}->X($className); |
|
677
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
678
|
0
|
|
|
|
|
|
|
|
679
|
0
|
|
|
|
|
|
my $for = "\n for my " . $variableName . " ( " . $forRange[0] |
|
680
|
|
|
|
|
|
|
. " ... " . $forRange[1] . " ) " . $codeBlock; |
|
681
|
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
return $for; |
|
683
|
0
|
|
|
0
|
|
|
} |
|
684
|
|
|
|
|
|
|
|
|
685
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
686
|
0
|
|
|
|
|
|
|
|
687
|
0
|
|
|
|
|
|
my $lowerRange = $class->{LowerRange}->X($className); |
|
688
|
|
|
|
|
|
|
my $upperRange = $class->{UpperRange}->X($className); |
|
689
|
0
|
|
|
|
|
|
|
|
690
|
0
|
|
|
|
|
|
my @forRange = ($lowerRange, $upperRange); |
|
691
|
|
|
|
|
|
|
return @forRange; |
|
692
|
|
|
|
|
|
|
} |
|
693
|
|
|
|
|
|
|
|
|
694
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
695
|
|
|
|
|
|
|
|
|
696
|
0
|
|
|
|
|
|
my $number = ( $class->{Number} |
|
697
|
0
|
|
|
|
|
|
|| $class->{VariableName} |
|
698
|
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
699
|
|
|
|
|
|
|
|| $class->{HashElement} |
|
700
|
|
|
|
|
|
|
|| $class->{ClassAccessor} |
|
701
|
0
|
|
|
0
|
|
|
|| $class->{ClassFunctionReturn} |
|
702
|
|
|
|
|
|
|
|| $class->{FunctionReturn} )->X($className); |
|
703
|
0
|
|
|
|
|
|
|
|
704
|
0
|
|
|
|
|
|
return $number; |
|
705
|
0
|
|
|
|
|
|
} |
|
706
|
0
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
708
|
0
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
my $number = ( $class->{Number} |
|
710
|
|
|
|
|
|
|
|| $class->{VariableName} |
|
711
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
712
|
|
|
|
|
|
|
|| $class->{HashElement} |
|
713
|
|
|
|
|
|
|
|| $class->{ClassAccessor} |
|
714
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
715
|
0
|
|
|
0
|
|
|
|| $class->{FunctionReturn} )->X($className); |
|
716
|
|
|
|
|
|
|
|
|
717
|
0
|
|
|
|
|
|
return $number; |
|
718
|
0
|
|
|
|
|
|
} |
|
719
|
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
721
|
|
|
|
|
|
|
my $if = $class->{If}->X($className); |
|
722
|
0
|
|
|
0
|
|
|
|
|
723
|
|
|
|
|
|
|
my $elsif; |
|
724
|
0
|
|
|
|
|
|
my $else; |
|
725
|
0
|
|
|
|
|
|
|
|
726
|
|
|
|
|
|
|
if( exists $class->{ElsIf} ) { |
|
727
|
|
|
|
|
|
|
$elsif = $class->{ElsIf}->X($className); |
|
728
|
|
|
|
|
|
|
} |
|
729
|
0
|
|
|
0
|
|
|
if( exists $class->{Else} ) { |
|
730
|
|
|
|
|
|
|
$else = $class->{Else}->X($className); |
|
731
|
0
|
|
|
|
|
|
} |
|
732
|
0
|
|
|
|
|
|
|
|
733
|
0
|
|
|
|
|
|
my $ifElseIf; |
|
734
|
|
|
|
|
|
|
if (defined $elsif) { |
|
735
|
0
|
|
|
|
|
|
$ifElseIf = $if . $elsif . $else; |
|
736
|
|
|
|
|
|
|
return $ifElseIf; |
|
737
|
|
|
|
|
|
|
} |
|
738
|
0
|
|
|
|
|
|
if (defined $else) { |
|
739
|
|
|
|
|
|
|
$ifElseIf = $if . $else; |
|
740
|
|
|
|
|
|
|
return $ifElseIf; |
|
741
|
|
|
|
|
|
|
} |
|
742
|
0
|
|
|
0
|
|
|
|
|
743
|
|
|
|
|
|
|
$ifElseIf = $if; |
|
744
|
0
|
|
|
|
|
|
return $ifElseIf; |
|
745
|
0
|
|
|
|
|
|
} |
|
746
|
|
|
|
|
|
|
|
|
747
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
748
|
0
|
|
|
|
|
|
my $if = $class->{If}->X($className); |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
my $elsif; |
|
751
|
|
|
|
|
|
|
my $else; |
|
752
|
0
|
|
|
0
|
|
|
|
|
753
|
|
|
|
|
|
|
if( exists $class->{ElsIf} ) { |
|
754
|
|
|
|
|
|
|
$elsif = $class->{ElsIf}->X($className); |
|
755
|
|
|
|
|
|
|
} |
|
756
|
|
|
|
|
|
|
if( exists $class->{Else} ) { |
|
757
|
|
|
|
|
|
|
$else = $class->{Else}->X($className); |
|
758
|
|
|
|
|
|
|
} |
|
759
|
|
|
|
|
|
|
|
|
760
|
0
|
|
0
|
|
|
|
my $ifElseIf; |
|
761
|
|
|
|
|
|
|
if (defined $elsif) { |
|
762
|
0
|
|
|
|
|
|
$ifElseIf = $if . $elsif . $else; |
|
763
|
|
|
|
|
|
|
return $ifElseIf; |
|
764
|
|
|
|
|
|
|
} |
|
765
|
|
|
|
|
|
|
if (defined $else) { |
|
766
|
0
|
|
|
0
|
|
|
$ifElseIf = $if . $else; |
|
767
|
|
|
|
|
|
|
return $ifElseIf; |
|
768
|
|
|
|
|
|
|
} |
|
769
|
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
$ifElseIf = $if; |
|
771
|
|
|
|
|
|
|
return $ifElseIf; |
|
772
|
|
|
|
|
|
|
} |
|
773
|
|
|
|
|
|
|
|
|
774
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
|
775
|
|
|
|
|
|
|
|
|
776
|
0
|
|
|
|
|
|
my $boolExpression = $class->{BoolExpression}->X($className); |
|
777
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
778
|
|
|
|
|
|
|
|
|
779
|
|
|
|
|
|
|
my $if = "\n if ( " . $boolExpression . " ) " . $codeBlock; |
|
780
|
0
|
|
|
0
|
|
|
return $if; |
|
781
|
0
|
|
|
|
|
|
} |
|
782
|
|
|
|
|
|
|
|
|
783
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
784
|
|
|
|
|
|
|
my @booleanExpressions; |
|
785
|
|
|
|
|
|
|
|
|
786
|
0
|
0
|
|
|
|
|
for my $element ( @{ $class->{BooleanExpression}} ) { |
|
787
|
0
|
|
|
|
|
|
push @booleanExpressions, $element->X($className); |
|
788
|
|
|
|
|
|
|
} |
|
789
|
0
|
0
|
|
|
|
|
|
|
790
|
0
|
|
|
|
|
|
my @boolOperators; |
|
791
|
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
for my $element (@{ $class->{BoolOperator} }) { |
|
793
|
0
|
|
|
|
|
|
push @boolOperators, $element->X($className); |
|
794
|
0
|
0
|
|
|
|
|
} |
|
795
|
0
|
|
|
|
|
|
|
|
796
|
0
|
|
|
|
|
|
my $boolExpression = $booleanExpressions[0]; |
|
797
|
|
|
|
|
|
|
for my $counter (1 .. $#booleanExpressions) { |
|
798
|
0
|
0
|
|
|
|
|
$boolExpression .= $boolOperators[$counter - 1] . " " . $booleanExpressions[$counter]; |
|
799
|
0
|
|
|
|
|
|
} |
|
800
|
0
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
return $boolExpression; |
|
802
|
|
|
|
|
|
|
} |
|
803
|
0
|
|
|
|
|
|
|
|
804
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
805
|
|
|
|
|
|
|
my $boolExpression; |
|
806
|
|
|
|
|
|
|
|
|
807
|
|
|
|
|
|
|
my $boolOperand = $class->{BoolOperands}->X($className); |
|
808
|
0
|
|
|
0
|
|
|
if( exists $class->{BoolOperatorExpression} ) { |
|
809
|
0
|
|
|
|
|
|
my @boolOperatorExpression = $class->{BoolOperatorExpression}->X($className); |
|
810
|
|
|
|
|
|
|
$boolExpression = $boolOperand . " " |
|
811
|
0
|
|
|
|
|
|
. $boolOperatorExpression[0] . " " . $boolOperatorExpression[1]; |
|
812
|
|
|
|
|
|
|
return $boolExpression; |
|
813
|
|
|
|
|
|
|
} |
|
814
|
0
|
0
|
|
|
|
|
|
|
815
|
0
|
|
|
|
|
|
$boolExpression = $boolOperand; |
|
816
|
|
|
|
|
|
|
return $boolExpression; |
|
817
|
0
|
0
|
|
|
|
|
} |
|
818
|
0
|
|
|
|
|
|
|
|
819
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
820
|
|
|
|
|
|
|
|
|
821
|
0
|
|
|
|
|
|
my $boolOperator = $class->{BoolOperator}->X($className); |
|
822
|
0
|
0
|
|
|
|
|
my $boolOperand = $class->{BoolOperands}->X($className); |
|
823
|
0
|
|
|
|
|
|
|
|
824
|
0
|
|
|
|
|
|
my @boolOperatorExpression = ($boolOperator, $boolOperand); |
|
825
|
|
|
|
|
|
|
return @boolOperatorExpression; |
|
826
|
0
|
0
|
|
|
|
|
} |
|
827
|
0
|
|
|
|
|
|
|
|
828
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
829
|
|
|
|
|
|
|
return ( $class->{GreaterThan} |
|
830
|
|
|
|
|
|
|
|| $class->{LessThan} |
|
831
|
0
|
|
|
|
|
|
|| $class->{Equals} |
|
832
|
0
|
|
|
|
|
|
|| $class->{GreaterThanEquals} |
|
833
|
|
|
|
|
|
|
|| $class->{LessThanEquals} |
|
834
|
|
|
|
|
|
|
|| $class->{StringEquals} |
|
835
|
|
|
|
|
|
|
|| $class->{StringNotEquals} |
|
836
|
0
|
|
|
0
|
|
|
|| $class->{NotEqulas} |
|
837
|
|
|
|
|
|
|
|| $class->{LogicalAnd} |
|
838
|
0
|
|
|
|
|
|
|| $class->{LogicalOr} |
|
839
|
0
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
840
|
|
|
|
|
|
|
} |
|
841
|
0
|
|
|
|
|
|
|
|
842
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
843
|
|
|
|
|
|
|
return ( $class->{RealNumber} |
|
844
|
|
|
|
|
|
|
|| $class->{String} |
|
845
|
|
|
|
|
|
|
|| $class->{ScalarVariable} |
|
846
|
0
|
|
|
0
|
|
|
|| $class->{ArrayElement} |
|
847
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
|
848
|
|
|
|
|
|
|
|| $class->{ClassAccessor} |
|
849
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
|
0
|
|
|
|
|
|
|
|
850
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
851
|
|
|
|
|
|
|
|| $class->{GroupAccess} |
|
852
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
853
|
0
|
|
|
|
|
|
} |
|
854
|
|
|
|
|
|
|
|
|
855
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
|
0
|
|
|
|
|
|
|
|
856
|
0
|
|
|
|
|
|
my @elsIfChain; |
|
857
|
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
for my $element ( @{$class->{ElsIfChain}} ) { |
|
859
|
0
|
|
|
|
|
|
push @elsIfChain, $element->X($className); |
|
860
|
0
|
|
|
|
|
|
} |
|
861
|
0
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
my $elsIfChain; |
|
863
|
|
|
|
|
|
|
foreach my $elsIf (@elsIfChain) { |
|
864
|
0
|
|
|
|
|
|
$elsIfChain .= $elsIf; |
|
865
|
|
|
|
|
|
|
} |
|
866
|
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
return $elsIfChain; |
|
868
|
0
|
|
|
0
|
|
|
} |
|
869
|
0
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
871
|
0
|
|
|
|
|
|
my $boolExpression = $class->{BoolExpression}->X($className); |
|
872
|
0
|
0
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
873
|
0
|
|
|
|
|
|
|
|
874
|
0
|
|
|
|
|
|
my $elsIf = "\n elsif ( " . $boolExpression . " ) " . $codeBlock; |
|
875
|
|
|
|
|
|
|
return $elsIf; |
|
876
|
0
|
|
|
|
|
|
} |
|
877
|
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
879
|
0
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
|
880
|
0
|
|
|
|
|
|
|
|
881
|
|
|
|
|
|
|
my $else = "\n else " . $codeBlock; |
|
882
|
|
|
|
|
|
|
return $else; |
|
883
|
|
|
|
|
|
|
} |
|
884
|
0
|
|
|
0
|
|
|
|
|
885
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
886
|
0
|
|
|
|
|
|
return ( $class->{VariableDeclaration} |
|
887
|
0
|
|
|
|
|
|
|| $class->{FunctionCall} |
|
888
|
|
|
|
|
|
|
|| $class->{Assignment} |
|
889
|
0
|
|
|
|
|
|
|| $class->{Regex} |
|
890
|
0
|
|
|
|
|
|
|| $class->{MakeGroup} |
|
891
|
|
|
|
|
|
|
|| $class->{ClassFunctionCall} |
|
892
|
|
|
|
|
|
|
|| $class->{FunctionReferenceCall} |
|
893
|
|
|
|
|
|
|
|| $class->{Return} |
|
894
|
0
|
|
|
0
|
|
|
|| $class->{Last} |
|
895
|
|
|
|
|
|
|
|| $class->{Next} |
|
896
|
|
|
|
|
|
|
|| $class->{ObjectCall} )->X($className); |
|
897
|
|
|
|
|
|
|
} |
|
898
|
|
|
|
|
|
|
|
|
899
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
900
|
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
902
|
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
my $parametersList = "\$class"; |
|
904
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
|
905
|
0
|
|
0
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
|
906
|
|
|
|
|
|
|
$parametersList = join(",", @parameters); |
|
907
|
|
|
|
|
|
|
} |
|
908
|
|
|
|
|
|
|
|
|
909
|
0
|
|
|
0
|
|
|
my $functionReferenceCall = "\&\$" . $functionName . "(" . $parametersList . ");"; |
|
910
|
|
|
|
|
|
|
return $functionReferenceCall; |
|
911
|
|
|
|
|
|
|
} |
|
912
|
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
914
|
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
my $regexVariable = $class->{RegexVariable}->X($className); |
|
916
|
|
|
|
|
|
|
my $regexp = $class->{Regexp}->X($className); |
|
917
|
|
|
|
|
|
|
my $modifiers = $class->{Modifiers}->X($className); |
|
918
|
|
|
|
|
|
|
|
|
919
|
0
|
|
0
|
|
|
|
my $regex = "my ". $regexVariable . " = qr{\n " . $regexp . "\n}" . $modifiers . ";"; |
|
920
|
|
|
|
|
|
|
return $regex; |
|
921
|
|
|
|
|
|
|
} |
|
922
|
|
|
|
|
|
|
|
|
923
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
924
|
0
|
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
my $regexVariable = $class->{VariableName}->X($className); |
|
926
|
0
|
|
|
|
|
|
return $regexVariable; |
|
|
0
|
|
|
|
|
|
|
|
927
|
0
|
|
|
|
|
|
} |
|
928
|
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
930
|
0
|
|
|
|
|
|
|
|
931
|
0
|
|
|
|
|
|
my $regex = $class->{Pre}->X($className); |
|
932
|
0
|
|
|
|
|
|
return $regex; |
|
933
|
|
|
|
|
|
|
} |
|
934
|
|
|
|
|
|
|
|
|
935
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
936
|
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
my $regex = $class->{''}; |
|
938
|
|
|
|
|
|
|
return $regex; |
|
939
|
0
|
|
|
0
|
|
|
} |
|
940
|
0
|
|
|
|
|
|
|
|
941
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
942
|
|
|
|
|
|
|
|
|
943
|
0
|
|
|
|
|
|
my $regexModifiers = $class->{RegexModifiers}->X($className); |
|
944
|
0
|
|
|
|
|
|
return $regexModifiers; |
|
945
|
|
|
|
|
|
|
} |
|
946
|
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
948
|
0
|
|
|
0
|
|
|
|
|
949
|
0
|
|
|
|
|
|
my $regexModifiers = $class->{''}; |
|
950
|
|
|
|
|
|
|
return $regexModifiers; |
|
951
|
0
|
|
|
|
|
|
} |
|
952
|
0
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
954
|
|
|
|
|
|
|
my $objectCall = ""; |
|
955
|
|
|
|
|
|
|
|
|
956
|
0
|
|
|
0
|
|
|
$objectCall .= $class->{ObjectFunctionCall}->X($className); |
|
957
|
|
|
|
|
|
|
$objectCall .= ";\n"; |
|
958
|
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
return $objectCall; |
|
960
|
|
|
|
|
|
|
} |
|
961
|
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
963
|
|
|
|
|
|
|
return ( $class->{ScalarDeclaration} |
|
964
|
|
|
|
|
|
|
|| $class->{ArrayDeclaration} |
|
965
|
|
|
|
|
|
|
|| $class->{HashDeclaration} |
|
966
|
|
|
|
|
|
|
|| $class->{GroupDeclaration} )->X($className); |
|
967
|
0
|
|
0
|
|
|
|
} |
|
968
|
|
|
|
|
|
|
|
|
969
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
970
|
|
|
|
|
|
|
|
|
971
|
0
|
|
|
0
|
|
|
my $groupName = $class->{GroupName}->X($className); |
|
972
|
|
|
|
|
|
|
my @groupElements = $class->{GroupBlock}->X($className); |
|
973
|
0
|
|
|
|
|
|
|
|
974
|
|
|
|
|
|
|
$groupTable->{$groupName} = {}; |
|
975
|
0
|
|
|
|
|
|
for my $element (@groupElements) { |
|
976
|
0
|
0
|
|
|
|
|
$groupTable->{$groupName}->{$element} = ""; |
|
977
|
0
|
|
|
|
|
|
} |
|
|
0
|
|
|
|
|
|
|
|
978
|
0
|
|
|
|
|
|
|
|
979
|
|
|
|
|
|
|
my $groupElementsList = ""; |
|
980
|
|
|
|
|
|
|
foreach my $groupElement (@groupElements) { |
|
981
|
0
|
|
|
|
|
|
$groupElementsList .= $groupElement . " => '', "; |
|
982
|
0
|
|
|
|
|
|
} |
|
983
|
|
|
|
|
|
|
|
|
984
|
|
|
|
|
|
|
# my $groupElementsList = join(" => '', ", @groupElements); |
|
985
|
|
|
|
|
|
|
my $groupDeclaration = "my " . $groupName . " = {" . $groupElementsList . "};\n"; |
|
986
|
0
|
|
|
0
|
|
|
|
|
987
|
|
|
|
|
|
|
return $groupDeclaration; |
|
988
|
0
|
|
|
|
|
|
} |
|
989
|
0
|
|
|
|
|
|
|
|
990
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
991
|
|
|
|
|
|
|
|
|
992
|
0
|
|
|
|
|
|
my $groupName = $class->{VariableName}->X($className); |
|
993
|
0
|
|
|
|
|
|
return $groupName; |
|
994
|
|
|
|
|
|
|
} |
|
995
|
|
|
|
|
|
|
|
|
996
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
997
|
0
|
|
|
0
|
|
|
|
|
998
|
|
|
|
|
|
|
my @groupElements = $class->{GroupElements}->X($className); |
|
999
|
0
|
|
|
|
|
|
return @groupElements; |
|
1000
|
0
|
|
|
|
|
|
} |
|
1001
|
|
|
|
|
|
|
|
|
1002
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1003
|
|
|
|
|
|
|
|
|
1004
|
0
|
|
|
0
|
|
|
my @groupElements; |
|
1005
|
|
|
|
|
|
|
for my $element ( @{ $class->{GroupElement} } ) { |
|
1006
|
0
|
|
|
|
|
|
push @groupElements, $element->X($className); |
|
1007
|
0
|
|
|
|
|
|
} |
|
1008
|
|
|
|
|
|
|
|
|
1009
|
|
|
|
|
|
|
return @groupElements; |
|
1010
|
|
|
|
|
|
|
} |
|
1011
|
0
|
|
|
0
|
|
|
|
|
1012
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1013
|
0
|
|
|
|
|
|
|
|
1014
|
0
|
|
|
|
|
|
my $variableName = $class->{''}; |
|
1015
|
|
|
|
|
|
|
return $variableName; |
|
1016
|
|
|
|
|
|
|
} |
|
1017
|
|
|
|
|
|
|
|
|
1018
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1019
|
|
|
|
|
|
|
|
|
1020
|
0
|
|
|
|
|
|
my $groupName = $class->{GroupName}->X($className); |
|
1021
|
0
|
|
|
|
|
|
my $groupNameObject = $class->{GroupNameObject}->X($className); |
|
1022
|
|
|
|
|
|
|
my @groupElements = keys %{ $groupTable->{$groupName} }; |
|
1023
|
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
# if(exists $groupTable->{groupNameObject}) {}; |
|
1025
|
0
|
|
|
0
|
|
|
|
|
1026
|
|
|
|
|
|
|
my $makeGroup = "my " . $groupNameObject . " = {'GroupName' => " . $groupName . "};\n" ; |
|
1027
|
0
|
|
|
|
|
|
for my $groupElement (@groupElements) { |
|
1028
|
0
|
|
|
|
|
|
$makeGroup .= $groupNameObject . "->{" . $groupElement . "} = '';\n"; |
|
1029
|
|
|
|
|
|
|
} |
|
1030
|
|
|
|
|
|
|
|
|
1031
|
|
|
|
|
|
|
return $makeGroup; |
|
1032
|
0
|
|
|
0
|
|
|
} |
|
1033
|
0
|
|
|
|
|
|
|
|
1034
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1035
|
0
|
|
|
|
|
|
|
|
1036
|
0
|
|
|
|
|
|
my $groupNameObject = $class->{VariableName}->X($className); |
|
1037
|
|
|
|
|
|
|
return $groupNameObject; |
|
1038
|
0
|
|
|
|
|
|
} |
|
1039
|
|
|
|
|
|
|
|
|
1040
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1041
|
|
|
|
|
|
|
|
|
1042
|
0
|
|
|
0
|
|
|
my $groupName = $class->{GroupName}->X($className); |
|
1043
|
|
|
|
|
|
|
my $groupReference = $groupTable->{$groupName}; |
|
1044
|
|
|
|
|
|
|
|
|
1045
|
|
|
|
|
|
|
return $groupReference; |
|
1046
|
0
|
|
0
|
|
|
|
} |
|
1047
|
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1049
|
|
|
|
|
|
|
|
|
1050
|
0
|
|
|
0
|
|
|
my $groupAccess = $class->{GroupAccess}->X($className); |
|
1051
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1052
|
0
|
|
|
|
|
|
|
|
1053
|
0
|
|
|
|
|
|
my $groupAssignment = "if(exists(" . $groupAccess . ")){\n"; |
|
1054
|
|
|
|
|
|
|
$groupAssignment .= $groupAccess . " = " . $rhs . ";\n"; |
|
1055
|
0
|
|
|
|
|
|
$groupAssignment .= "\n}\n"; |
|
1056
|
0
|
|
|
|
|
|
|
|
1057
|
0
|
|
|
|
|
|
return $groupAssignment; |
|
1058
|
|
|
|
|
|
|
} |
|
1059
|
|
|
|
|
|
|
|
|
1060
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1061
|
0
|
|
|
|
|
|
|
|
1062
|
0
|
|
|
|
|
|
my $groupName = $class->{GroupName}->X($className); |
|
1063
|
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
my @groupAccessElements; |
|
1065
|
|
|
|
|
|
|
for my $groupElement ( @{ $class->{GroupAccessElement} }) { |
|
1066
|
0
|
|
|
|
|
|
push @groupAccessElements, $groupElement->X($className); |
|
1067
|
|
|
|
|
|
|
} |
|
1068
|
0
|
|
|
|
|
|
|
|
1069
|
|
|
|
|
|
|
my $counter = 0; |
|
1070
|
|
|
|
|
|
|
my $groupAccess = $groupName; |
|
1071
|
|
|
|
|
|
|
|
|
1072
|
0
|
|
|
0
|
|
|
#if(exists $groupTable->{$groupName}->{$groupAccessElements[0]}) { |
|
1073
|
|
|
|
|
|
|
while( $counter <= $#groupAccessElements ) { |
|
1074
|
0
|
|
|
|
|
|
$groupAccess .= "->{" . $groupAccessElements[$counter] . "}"; |
|
1075
|
0
|
|
|
|
|
|
$counter = $counter + 1; |
|
1076
|
|
|
|
|
|
|
} |
|
1077
|
|
|
|
|
|
|
#} |
|
1078
|
|
|
|
|
|
|
|
|
1079
|
0
|
|
|
0
|
|
|
return $groupAccess; |
|
1080
|
|
|
|
|
|
|
} |
|
1081
|
0
|
|
|
|
|
|
|
|
1082
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1083
|
|
|
|
|
|
|
|
|
1084
|
|
|
|
|
|
|
my $groupElement = $class->{GroupElement}->X($className); |
|
1085
|
|
|
|
|
|
|
return $groupElement; |
|
1086
|
0
|
|
|
0
|
|
|
} |
|
1087
|
|
|
|
|
|
|
|
|
1088
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1089
|
0
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
|
0
|
|
|
|
|
|
|
|
1090
|
0
|
|
|
|
|
|
my $value = $class->{Value}->X($className); |
|
1091
|
|
|
|
|
|
|
|
|
1092
|
|
|
|
|
|
|
my $scalarDeclaration = "\n my " . $variableName |
|
1093
|
0
|
|
|
|
|
|
. " = " . $value . ";\n"; |
|
1094
|
|
|
|
|
|
|
return $scalarDeclaration; |
|
1095
|
|
|
|
|
|
|
} |
|
1096
|
|
|
|
|
|
|
|
|
1097
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1098
|
|
|
|
|
|
|
my $variableName = $class->{''}; |
|
1099
|
0
|
|
|
|
|
|
return "\$" . $variableName; |
|
1100
|
0
|
|
|
|
|
|
} |
|
1101
|
|
|
|
|
|
|
|
|
1102
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1103
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1104
|
0
|
|
|
0
|
|
|
return $rhs; |
|
1105
|
|
|
|
|
|
|
} |
|
1106
|
0
|
|
|
|
|
|
|
|
1107
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1108
|
0
|
|
|
|
|
|
my $number = $class->{''}; |
|
|
0
|
|
|
|
|
|
|
|
1109
|
|
|
|
|
|
|
return $number; |
|
1110
|
|
|
|
|
|
|
} |
|
1111
|
|
|
|
|
|
|
|
|
1112
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1113
|
0
|
|
|
|
|
|
my $realNumber = $class->{''}; |
|
1114
|
0
|
|
|
|
|
|
return $realNumber; |
|
1115
|
|
|
|
|
|
|
} |
|
1116
|
|
|
|
|
|
|
|
|
1117
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1118
|
|
|
|
|
|
|
my $stringValue = $class->{StringValue}->X($className); |
|
1119
|
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
my $string = "\"" . $stringValue . "\""; |
|
1121
|
0
|
|
|
0
|
|
|
} |
|
1122
|
|
|
|
|
|
|
|
|
1123
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1124
|
0
|
|
|
|
|
|
my $stringValue = $class->{''}; |
|
1125
|
|
|
|
|
|
|
return $stringValue; |
|
1126
|
|
|
|
|
|
|
} |
|
1127
|
|
|
|
|
|
|
|
|
1128
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1129
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
1130
|
0
|
|
|
|
|
|
my $arrayList = $class->{ArrayList}->X($className); |
|
1131
|
0
|
|
|
|
|
|
|
|
1132
|
|
|
|
|
|
|
my $arrayDeclaration = "\n my " . $variableName |
|
1133
|
0
|
|
|
|
|
|
. " = " . $arrayList . ";\n"; |
|
1134
|
|
|
|
|
|
|
|
|
1135
|
|
|
|
|
|
|
return $arrayDeclaration; |
|
1136
|
|
|
|
|
|
|
} |
|
1137
|
0
|
|
|
0
|
|
|
|
|
1138
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1139
|
0
|
|
|
|
|
|
my $arrayList = "["; |
|
1140
|
0
|
|
|
|
|
|
my @listElements = $class->{ListElements}->X($className); |
|
1141
|
|
|
|
|
|
|
|
|
1142
|
0
|
|
|
|
|
|
$arrayList .= join(",", @listElements); |
|
1143
|
0
|
|
|
|
|
|
|
|
1144
|
0
|
|
|
|
|
|
$arrayList .= "]"; |
|
1145
|
|
|
|
|
|
|
return $arrayList; |
|
1146
|
0
|
|
|
|
|
|
} |
|
1147
|
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1149
|
|
|
|
|
|
|
my @listElements; |
|
1150
|
0
|
|
|
0
|
|
|
|
|
1151
|
|
|
|
|
|
|
for my $element ( @{ $class->{ListElement}} ) { |
|
1152
|
0
|
|
|
|
|
|
push @listElements, $element->X($className); |
|
1153
|
|
|
|
|
|
|
} |
|
1154
|
0
|
|
|
|
|
|
|
|
1155
|
0
|
|
|
|
|
|
return @listElements; |
|
|
0
|
|
|
|
|
|
|
|
1156
|
0
|
|
|
|
|
|
} |
|
1157
|
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1159
|
0
|
|
|
|
|
|
return ( $class->{RealNumber} |
|
1160
|
0
|
|
|
|
|
|
|| $class->{String} |
|
1161
|
|
|
|
|
|
|
|| $class->{ArrayList} |
|
1162
|
|
|
|
|
|
|
|| $class->{HashRef} |
|
1163
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1164
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1165
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
1166
|
|
|
|
|
|
|
|| $class->{HashElement} |
|
1167
|
|
|
|
|
|
|
|| $class->{VariableName} |
|
1168
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
1169
|
0
|
|
|
|
|
|
} |
|
1170
|
|
|
|
|
|
|
|
|
1171
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1172
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
|
1173
|
0
|
|
|
0
|
|
|
my $hashRef = $class->{HashRef}->X($className); |
|
1174
|
|
|
|
|
|
|
|
|
1175
|
0
|
|
|
|
|
|
my $hashDeclaration = "\n my " . $variableName |
|
1176
|
0
|
|
|
|
|
|
. " = " . $hashRef . ";\n"; |
|
1177
|
|
|
|
|
|
|
} |
|
1178
|
|
|
|
|
|
|
|
|
1179
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1180
|
0
|
|
|
0
|
|
|
my $hashRef = "{"; |
|
1181
|
0
|
|
|
|
|
|
my $keyValuePairs = $class->{KeyValuePairs}->X($className); |
|
1182
|
0
|
|
|
|
|
|
$hashRef .= $keyValuePairs . "}"; |
|
1183
|
|
|
|
|
|
|
return $hashRef; |
|
1184
|
0
|
|
|
|
|
|
} |
|
1185
|
|
|
|
|
|
|
|
|
1186
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1187
|
|
|
|
|
|
|
my @keyValuePairs; |
|
1188
|
|
|
|
|
|
|
|
|
1189
|
|
|
|
|
|
|
my $keyValuePairs = ""; |
|
1190
|
0
|
|
|
0
|
|
|
for my $element ( @{ $class->{KeyValue}} ) { |
|
1191
|
0
|
|
|
|
|
|
@keyValuePairs = (); |
|
1192
|
0
|
|
|
|
|
|
push @keyValuePairs, $element->X($className); |
|
1193
|
|
|
|
|
|
|
$keyValuePairs .= $keyValuePairs[0] . " => " . $keyValuePairs[1] . ", "; |
|
1194
|
|
|
|
|
|
|
} |
|
1195
|
|
|
|
|
|
|
|
|
1196
|
0
|
|
|
0
|
|
|
return $keyValuePairs; |
|
1197
|
0
|
|
|
|
|
|
} |
|
1198
|
0
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1200
|
|
|
|
|
|
|
my $pairKey = $class->{PairKey}->X($className); |
|
1201
|
|
|
|
|
|
|
my $pairValue = $class->{PairValue}->X($className); |
|
1202
|
0
|
|
|
0
|
|
|
|
|
1203
|
0
|
|
|
|
|
|
my @keyValue = ($pairKey, $pairValue); |
|
1204
|
0
|
|
|
|
|
|
return @keyValue; |
|
1205
|
|
|
|
|
|
|
} |
|
1206
|
|
|
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1208
|
0
|
|
|
0
|
|
|
return ( $class->{Number} |
|
1209
|
0
|
|
|
|
|
|
|| $class->{String} |
|
1210
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1211
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1212
|
|
|
|
|
|
|
|| $class->{VariableName} |
|
1213
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
1214
|
0
|
|
|
0
|
|
|
} |
|
1215
|
0
|
|
|
|
|
|
|
|
1216
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1217
|
0
|
|
|
|
|
|
return ( $class->{RealNumber} |
|
1218
|
|
|
|
|
|
|
|| $class->{String} |
|
1219
|
|
|
|
|
|
|
|| $class->{ArrayList} |
|
1220
|
|
|
|
|
|
|
|| $class->{HashRef} |
|
1221
|
0
|
|
|
0
|
|
|
|| $class->{VariableName} |
|
1222
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
1223
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
|
1224
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1225
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1226
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
1227
|
0
|
|
|
0
|
|
|
} |
|
1228
|
0
|
|
|
|
|
|
|
|
1229
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1230
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
1231
|
0
|
|
|
|
|
|
|
|
1232
|
|
|
|
|
|
|
my $functionCall = $functionName . "(" ; |
|
1233
|
|
|
|
|
|
|
|
|
1234
|
0
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
|
1235
|
|
|
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
|
1236
|
|
|
|
|
|
|
$functionCall .= join(",", @parameters); |
|
1237
|
|
|
|
|
|
|
} |
|
1238
|
0
|
|
|
0
|
|
|
|
|
1239
|
0
|
|
|
|
|
|
$functionCall .= ");"; |
|
1240
|
0
|
|
|
|
|
|
return $functionCall; |
|
1241
|
|
|
|
|
|
|
} |
|
1242
|
0
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1244
|
0
|
|
|
|
|
|
my @parameters; |
|
1245
|
0
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
for my $element (@{ $class->{Param} }) { |
|
1247
|
|
|
|
|
|
|
push @parameters, $element->X($className); |
|
1248
|
|
|
|
|
|
|
} |
|
1249
|
0
|
|
|
0
|
|
|
|
|
1250
|
0
|
|
|
|
|
|
return \@parameters; |
|
1251
|
|
|
|
|
|
|
} |
|
1252
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1253
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1254
|
|
|
|
|
|
|
return ( $class->{RealNumber} |
|
1255
|
|
|
|
|
|
|
|| $class->{String} |
|
1256
|
0
|
|
|
|
|
|
|| $class->{VariableName} |
|
1257
|
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
1258
|
|
|
|
|
|
|
|| $class->{HashElement} |
|
1259
|
|
|
|
|
|
|
|| $class->{HashRef} |
|
1260
|
0
|
|
|
0
|
|
|
|| $class->{GroupAccess} |
|
1261
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1262
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1263
|
|
|
|
|
|
|
|| $class->{EmbedBlock} |
|
1264
|
|
|
|
|
|
|
|| $class->{FunctionReference} |
|
1265
|
|
|
|
|
|
|
|| $class->{GroupAccess} |
|
1266
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1267
|
|
|
|
|
|
|
|| $class->{Calc} |
|
1268
|
|
|
|
|
|
|
|| $class->{ParamChars} |
|
1269
|
|
|
|
|
|
|
|| $class->{ObjectFunctionCall} )->X($className); |
|
1270
|
0
|
|
0
|
|
|
|
} |
|
1271
|
|
|
|
|
|
|
|
|
1272
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1273
|
|
|
|
|
|
|
my $paramChars = $class->{''}; |
|
1274
|
0
|
|
|
0
|
|
|
return $paramChars; |
|
1275
|
0
|
|
|
|
|
|
} |
|
1276
|
0
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1278
|
0
|
|
|
|
|
|
return ( $class->{ScalarAssignment} |
|
1279
|
|
|
|
|
|
|
|| $class->{ArrayAssignment} |
|
1280
|
|
|
|
|
|
|
|| $class->{GroupAssignment} |
|
1281
|
|
|
|
|
|
|
|| $class->{HashAssignment} |
|
1282
|
|
|
|
|
|
|
|| $class->{AccessorAssignment} )->X($className); |
|
1283
|
0
|
|
|
0
|
|
|
} |
|
1284
|
0
|
|
|
|
|
|
|
|
1285
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1286
|
0
|
|
|
|
|
|
|
|
1287
|
0
|
|
|
|
|
|
my $variableName = $class->{HashKeyStringValue}->X($className); |
|
1288
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1289
|
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
my $accessorAssignment = '$class->{"' . $className . '"}->{"'. $variableName .'"} = ' . $rhs .';'; |
|
1291
|
0
|
|
|
0
|
|
|
return $accessorAssignment; |
|
1292
|
0
|
|
|
|
|
|
} |
|
1293
|
|
|
|
|
|
|
|
|
1294
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1295
|
0
|
|
|
|
|
|
my $lhs = $class->{ScalarVariable}->X($className); |
|
|
0
|
|
|
|
|
|
|
|
1296
|
0
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1297
|
0
|
|
|
|
|
|
|
|
1298
|
0
|
|
|
|
|
|
my $scalarAssignment = $lhs . " = " . $rhs . ";\n"; |
|
1299
|
|
|
|
|
|
|
return $scalarAssignment; |
|
1300
|
|
|
|
|
|
|
} |
|
1301
|
0
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1303
|
|
|
|
|
|
|
my $scalarVariable = $class->{ScalarVariable}->X($className); |
|
1304
|
|
|
|
|
|
|
|
|
1305
|
0
|
|
|
0
|
|
|
return $scalarVariable; |
|
1306
|
0
|
|
|
|
|
|
} |
|
1307
|
0
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1309
|
0
|
|
|
|
|
|
|
|
1310
|
0
|
|
|
|
|
|
my $scalarVariable = "\$"; |
|
1311
|
|
|
|
|
|
|
$scalarVariable .= $class->{''}; |
|
1312
|
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
return $scalarVariable; |
|
1314
|
0
|
|
|
0
|
|
|
} |
|
1315
|
|
|
|
|
|
|
|
|
1316
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1317
|
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
return ( $class->{RealNumber} |
|
1319
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1320
|
0
|
|
0
|
|
|
|
|| $class->{ArrayElement} |
|
1321
|
|
|
|
|
|
|
|| $class->{HashElement} |
|
1322
|
|
|
|
|
|
|
|| $class->{ScalarVariable} |
|
1323
|
|
|
|
|
|
|
|| $class->{Calc} |
|
1324
|
0
|
|
|
0
|
|
|
|| $class->{RegexMatchVariables} |
|
1325
|
|
|
|
|
|
|
|| $class->{ArrayList} |
|
1326
|
|
|
|
|
|
|
|| $class->{HashRef} |
|
1327
|
|
|
|
|
|
|
|| $class->{GroupReference} |
|
1328
|
|
|
|
|
|
|
|| $class->{GroupElement} |
|
1329
|
|
|
|
|
|
|
|| $class->{GroupAccess} |
|
1330
|
|
|
|
|
|
|
|| $class->{FunctionReference} |
|
1331
|
|
|
|
|
|
|
|| $class->{ClassAccessor} |
|
1332
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1333
|
|
|
|
|
|
|
|| $class->{String} |
|
1334
|
0
|
|
0
|
|
|
|
|| $class->{STDIN} |
|
1335
|
|
|
|
|
|
|
|| $class->{ObjectFunctionCall} |
|
1336
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
1337
|
|
|
|
|
|
|
} |
|
1338
|
0
|
|
|
0
|
|
|
|
|
1339
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1340
|
|
|
|
|
|
|
|
|
1341
|
0
|
|
|
|
|
|
my $matchVariable = $class->{MatchVariable}->X($className); |
|
1342
|
|
|
|
|
|
|
my $regexMatchVariables = ""; |
|
1343
|
0
|
0
|
|
|
|
|
|
|
1344
|
0
|
|
|
|
|
|
if( $matchVariable =~ /\d+/ ) { |
|
|
0
|
|
|
|
|
|
|
|
1345
|
0
|
|
|
|
|
|
$regexMatchVariables = "\$" . $matchVariable; |
|
1346
|
|
|
|
|
|
|
} |
|
1347
|
|
|
|
|
|
|
|
|
1348
|
0
|
|
|
|
|
|
if( $matchVariable eq "Match" ) { |
|
1349
|
0
|
|
|
|
|
|
$regexMatchVariables = "\$" . "\&"; |
|
1350
|
|
|
|
|
|
|
} |
|
1351
|
|
|
|
|
|
|
|
|
1352
|
|
|
|
|
|
|
if( $matchVariable eq "PREMATCH" ) { |
|
1353
|
0
|
|
|
0
|
|
|
$regexMatchVariables = "\$" . "\'"; |
|
1354
|
0
|
|
|
|
|
|
} |
|
1355
|
|
|
|
|
|
|
|
|
1356
|
0
|
|
|
|
|
|
if( $matchVariable eq "POSTMATCH" ) { |
|
|
0
|
|
|
|
|
|
|
|
1357
|
0
|
|
|
|
|
|
$regexMatchVariables = "\$" . "\`"; |
|
1358
|
|
|
|
|
|
|
} |
|
1359
|
|
|
|
|
|
|
|
|
1360
|
0
|
|
|
|
|
|
return $regexMatchVariables; |
|
1361
|
|
|
|
|
|
|
} |
|
1362
|
|
|
|
|
|
|
|
|
1363
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1364
|
0
|
|
|
0
|
|
|
|
|
1365
|
|
|
|
|
|
|
return ( $class->{Number} |
|
1366
|
|
|
|
|
|
|
|| $class->{MatchParts} )->X($className); |
|
1367
|
|
|
|
|
|
|
} |
|
1368
|
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1370
|
|
|
|
|
|
|
return $class->{''}; |
|
1371
|
|
|
|
|
|
|
} |
|
1372
|
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1374
|
|
|
|
|
|
|
|
|
1375
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
1376
|
|
|
|
|
|
|
my $functionReference = "\\&" . $functionName; |
|
1377
|
|
|
|
|
|
|
return $functionReference; |
|
1378
|
|
|
|
|
|
|
} |
|
1379
|
|
|
|
|
|
|
|
|
1380
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
|
1381
|
|
|
|
|
|
|
my $stdin = '<STDIN>'; |
|
1382
|
|
|
|
|
|
|
return $stdin; |
|
1383
|
|
|
|
|
|
|
} |
|
1384
|
0
|
|
|
0
|
|
|
|
|
1385
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1386
|
0
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
my $object = $class->{Object}->X($className); |
|
1388
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
1389
|
|
|
|
|
|
|
|
|
1390
|
0
|
|
|
0
|
|
|
my $objectFunctionCall; |
|
1391
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
|
1392
|
|
|
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
|
1393
|
|
|
|
|
|
|
my $parameters = join(",", @parameters); |
|
1394
|
|
|
|
|
|
|
$objectFunctionCall = "\$" . $object . "->" . $functionName . "(" . $parameters . ")"; |
|
1395
|
0
|
|
0
|
|
|
|
} else { |
|
1396
|
|
|
|
|
|
|
$objectFunctionCall = "\$" . $object . "->" . $functionName . "()"; |
|
1397
|
|
|
|
|
|
|
} |
|
1398
|
|
|
|
|
|
|
|
|
1399
|
0
|
|
|
0
|
|
|
return $objectFunctionCall; |
|
1400
|
|
|
|
|
|
|
} |
|
1401
|
0
|
|
|
|
|
|
|
|
1402
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1403
|
|
|
|
|
|
|
my $variableName = $class->{HashKeyStringValue}->X($className); |
|
1404
|
0
|
|
|
|
|
|
|
|
1405
|
0
|
|
|
|
|
|
my $classAccessor = '$class->{"' . $className . '"}->{"'. $variableName .'"}'; |
|
1406
|
|
|
|
|
|
|
return $classAccessor; |
|
1407
|
|
|
|
|
|
|
} |
|
1408
|
|
|
|
|
|
|
|
|
1409
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1410
|
0
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
1411
|
0
|
|
|
|
|
|
my @parameters; |
|
1412
|
|
|
|
|
|
|
my $parameters = ""; |
|
1413
|
0
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
|
1414
|
0
|
|
|
|
|
|
@parameters = @{$class->{Parameters}->X($className)}; |
|
1415
|
|
|
|
|
|
|
$parameters = join(",", @parameters); |
|
1416
|
|
|
|
|
|
|
} |
|
1417
|
|
|
|
|
|
|
|
|
1418
|
0
|
|
|
0
|
|
|
my $classFunctionReturn = '$class->' . $functionName . '('. $parameters .');'; |
|
1419
|
0
|
|
|
|
|
|
return $classFunctionReturn; |
|
1420
|
|
|
|
|
|
|
} |
|
1421
|
0
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1423
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
1424
|
|
|
|
|
|
|
my @parameters; |
|
1425
|
0
|
|
|
0
|
|
|
my $parameters = ""; |
|
1426
|
|
|
|
|
|
|
|
|
1427
|
0
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
|
1428
|
0
|
|
|
|
|
|
@parameters = @{$class->{Parameters}->X($className)}; |
|
1429
|
|
|
|
|
|
|
$parameters = join(",", @parameters); |
|
1430
|
0
|
|
|
|
|
|
} |
|
1431
|
|
|
|
|
|
|
|
|
1432
|
|
|
|
|
|
|
my $classFunctionReturn = '$class->' . $functionName . '('. $parameters .')'; |
|
1433
|
|
|
|
|
|
|
return $classFunctionReturn; |
|
1434
|
0
|
|
|
0
|
|
|
} |
|
1435
|
|
|
|
|
|
|
|
|
1436
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1437
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
|
1438
|
|
|
|
|
|
|
|
|
1439
|
|
|
|
|
|
|
my $functionReturn = $functionName . "(" ; |
|
1440
|
|
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
|
1442
|
|
|
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
|
1443
|
|
|
|
|
|
|
my $parameters = join(",", @parameters); |
|
1444
|
|
|
|
|
|
|
$functionReturn .= $parameters; |
|
1445
|
|
|
|
|
|
|
} |
|
1446
|
|
|
|
|
|
|
|
|
1447
|
|
|
|
|
|
|
$functionReturn .= ")"; |
|
1448
|
|
|
|
|
|
|
return $functionReturn; |
|
1449
|
|
|
|
|
|
|
} |
|
1450
|
|
|
|
|
|
|
|
|
1451
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1452
|
|
|
|
|
|
|
my $arrayName = $class->{ArrayName}->X($className); |
|
1453
|
|
|
|
|
|
|
my @accessList; |
|
1454
|
0
|
|
0
|
|
|
|
|
|
1455
|
|
|
|
|
|
|
for my $element (@{ $class->{ArrayAccess} }) { |
|
1456
|
|
|
|
|
|
|
push @accessList, $element->X($className); |
|
1457
|
|
|
|
|
|
|
} |
|
1458
|
0
|
|
|
0
|
|
|
|
|
1459
|
|
|
|
|
|
|
my $arrayElement = "\$" . $arrayName; |
|
1460
|
0
|
|
|
|
|
|
foreach my $element (@accessList) { |
|
1461
|
0
|
|
|
|
|
|
$arrayElement .= "->[" . $element . "]"; |
|
1462
|
|
|
|
|
|
|
} |
|
1463
|
0
|
0
|
|
|
|
|
|
|
1464
|
0
|
|
|
|
|
|
return $arrayElement; |
|
1465
|
|
|
|
|
|
|
} |
|
1466
|
|
|
|
|
|
|
|
|
1467
|
0
|
0
|
|
|
|
|
my ($class, $className) = @_; |
|
1468
|
0
|
|
|
|
|
|
my $number = $class->{ArrayKey}->X($className); |
|
1469
|
|
|
|
|
|
|
return $number; |
|
1470
|
|
|
|
|
|
|
} |
|
1471
|
0
|
0
|
|
|
|
|
|
|
1472
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1473
|
|
|
|
|
|
|
return ( $class->{Number} |
|
1474
|
|
|
|
|
|
|
|| $class->{ScalarVariable} |
|
1475
|
0
|
0
|
|
|
|
|
|| $class->{ArrayElement} |
|
1476
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
|
1477
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1478
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} )->X($className); |
|
1479
|
0
|
|
|
|
|
|
} |
|
1480
|
|
|
|
|
|
|
|
|
1481
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1482
|
|
|
|
|
|
|
my $arrayName = $class->{''}; |
|
1483
|
0
|
|
|
0
|
|
|
return $arrayName; |
|
1484
|
|
|
|
|
|
|
} |
|
1485
|
|
|
|
|
|
|
|
|
1486
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
|
1487
|
|
|
|
|
|
|
my $hashName = $class->{HashName}->X($className); |
|
1488
|
|
|
|
|
|
|
my @accessList; |
|
1489
|
|
|
|
|
|
|
|
|
1490
|
0
|
|
|
0
|
|
|
for my $element (@{ $class->{HashAccess} }) { |
|
1491
|
0
|
|
|
|
|
|
push @accessList, $element->X($className); |
|
1492
|
|
|
|
|
|
|
} |
|
1493
|
|
|
|
|
|
|
|
|
1494
|
|
|
|
|
|
|
my $hashElement = "\$" . $hashName; |
|
1495
|
0
|
|
|
0
|
|
|
foreach my $element (@accessList) { |
|
1496
|
|
|
|
|
|
|
$hashElement .= "->{" . $element . "}"; |
|
1497
|
0
|
|
|
|
|
|
} |
|
1498
|
0
|
|
|
|
|
|
|
|
1499
|
0
|
|
|
|
|
|
return $hashElement; |
|
1500
|
|
|
|
|
|
|
} |
|
1501
|
|
|
|
|
|
|
|
|
1502
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1503
|
0
|
|
|
0
|
|
|
my $hashKey = $class->{HashKey}->X($className); |
|
1504
|
0
|
|
|
|
|
|
return $hashKey; |
|
1505
|
0
|
|
|
|
|
|
} |
|
1506
|
|
|
|
|
|
|
|
|
1507
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1508
|
|
|
|
|
|
|
my $hashName = $class->{''}; |
|
1509
|
0
|
|
|
0
|
|
|
return $hashName; |
|
1510
|
|
|
|
|
|
|
} |
|
1511
|
0
|
|
|
|
|
|
|
|
1512
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1513
|
|
|
|
|
|
|
return ( $class->{String} |
|
1514
|
0
|
|
|
|
|
|
|| $class->{Number} |
|
1515
|
0
|
0
|
|
|
|
|
|| $class->{ScalarVariable} |
|
1516
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
|
0
|
|
|
|
|
|
|
|
1517
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
|
1518
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1519
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} )->X($className); |
|
1520
|
0
|
|
|
|
|
|
} |
|
1521
|
|
|
|
|
|
|
|
|
1522
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1523
|
0
|
|
|
|
|
|
|
|
1524
|
|
|
|
|
|
|
my $hashKeyStringValue = "\""; |
|
1525
|
|
|
|
|
|
|
$hashKeyStringValue .= $class->{HashKeyStringValue}->X($className); |
|
1526
|
|
|
|
|
|
|
$hashKeyStringValue .= "\""; |
|
1527
|
0
|
|
|
0
|
|
|
|
|
1528
|
0
|
|
|
|
|
|
return $hashKeyStringValue; |
|
1529
|
|
|
|
|
|
|
} |
|
1530
|
0
|
|
|
|
|
|
|
|
1531
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1532
|
|
|
|
|
|
|
my $hashKeyStringValue = $class->{''}; |
|
1533
|
|
|
|
|
|
|
return $hashKeyStringValue; |
|
1534
|
|
|
|
|
|
|
} |
|
1535
|
0
|
|
|
0
|
|
|
|
|
1536
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1537
|
0
|
|
|
|
|
|
my $hashKeyNumber = $class->{''}; |
|
1538
|
0
|
|
|
|
|
|
return $hashKeyNumber; |
|
1539
|
0
|
0
|
|
|
|
|
} |
|
1540
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1541
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1542
|
|
|
|
|
|
|
my $arrayElement = $class->{ArrayElement}->X($className); |
|
1543
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1544
|
0
|
|
|
|
|
|
|
|
1545
|
0
|
|
|
|
|
|
my $arrayAssignment = $arrayElement . " = " . $rhs . ";\n"; |
|
1546
|
|
|
|
|
|
|
return $arrayAssignment; |
|
1547
|
|
|
|
|
|
|
} |
|
1548
|
|
|
|
|
|
|
|
|
1549
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1550
|
0
|
|
|
|
|
|
my $hashElement = $class->{HashElement}->X($className); |
|
1551
|
0
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1552
|
0
|
|
|
|
|
|
|
|
1553
|
|
|
|
|
|
|
my $hashAssignment = $hashElement . " = " . $rhs . ";\n"; |
|
1554
|
0
|
0
|
|
|
|
|
return $hashAssignment; |
|
1555
|
0
|
|
|
|
|
|
} |
|
|
0
|
|
|
|
|
|
|
|
1556
|
0
|
|
|
|
|
|
|
|
1557
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1558
|
|
|
|
|
|
|
my $calcExpression = $class->{CalcExpression}->X($className); |
|
1559
|
0
|
|
|
|
|
|
return $calcExpression; |
|
1560
|
0
|
|
|
|
|
|
} |
|
1561
|
|
|
|
|
|
|
|
|
1562
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1563
|
|
|
|
|
|
|
my @calcOperands; |
|
1564
|
0
|
|
|
0
|
|
|
my @calcOperator; |
|
1565
|
0
|
|
|
|
|
|
|
|
1566
|
|
|
|
|
|
|
for my $element (@{ $class->{CalcOperands} }) { |
|
1567
|
0
|
|
|
|
|
|
push @calcOperands, $element->X($className); |
|
1568
|
|
|
|
|
|
|
} |
|
1569
|
0
|
0
|
|
|
|
|
|
|
1570
|
0
|
|
|
|
|
|
for my $element (@{ $class->{CalcOperator} }) { |
|
|
0
|
|
|
|
|
|
|
|
1571
|
0
|
|
|
|
|
|
push @calcOperator, $element->X($className); |
|
1572
|
0
|
|
|
|
|
|
} |
|
1573
|
|
|
|
|
|
|
|
|
1574
|
|
|
|
|
|
|
my $calcExpression = $calcOperands[0]; |
|
1575
|
0
|
|
|
|
|
|
for my $counter (1 .. $#calcOperands) { |
|
1576
|
0
|
|
|
|
|
|
$calcExpression .= $calcOperator[$counter - 1] . " " . $calcOperands[$counter]; |
|
1577
|
|
|
|
|
|
|
} |
|
1578
|
|
|
|
|
|
|
|
|
1579
|
|
|
|
|
|
|
return $calcExpression; |
|
1580
|
0
|
|
|
0
|
|
|
} |
|
1581
|
0
|
|
|
|
|
|
|
|
1582
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1583
|
|
|
|
|
|
|
return ( $class->{RealNumber} |
|
1584
|
0
|
|
|
|
|
|
|| $class->{ScalarVariable} |
|
|
0
|
|
|
|
|
|
|
|
1585
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
|
1586
|
|
|
|
|
|
|
|| $class->{HashElement} |
|
1587
|
|
|
|
|
|
|
|| $class->{ClassAccessor} |
|
1588
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
1589
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} |
|
1590
|
0
|
|
|
|
|
|
|| $class->{EmbedBlock} |
|
1591
|
|
|
|
|
|
|
|| $class->{ObjectFunctionCall} )->X($className); |
|
1592
|
|
|
|
|
|
|
} |
|
1593
|
0
|
|
|
|
|
|
|
|
1594
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1595
|
|
|
|
|
|
|
return ( $class->{Plus} |
|
1596
|
|
|
|
|
|
|
|| $class->{Minus} |
|
1597
|
0
|
|
|
0
|
|
|
|| $class->{Multiply} |
|
1598
|
0
|
|
|
|
|
|
|| $class->{Divide} |
|
1599
|
0
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
|
1600
|
|
|
|
|
|
|
} |
|
1601
|
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1603
|
0
|
|
|
0
|
|
|
if(exists $class->{RHS}) { |
|
1604
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
|
1605
|
|
|
|
|
|
|
my $return = "return " . $rhs . ";\n"; |
|
1606
|
|
|
|
|
|
|
return $return; |
|
1607
|
|
|
|
|
|
|
} else { |
|
1608
|
|
|
|
|
|
|
return "return;"; |
|
1609
|
0
|
|
0
|
|
|
|
} |
|
1610
|
|
|
|
|
|
|
} |
|
1611
|
|
|
|
|
|
|
|
|
1612
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1613
|
0
|
|
|
0
|
|
|
return "last;"; |
|
1614
|
0
|
|
|
|
|
|
} |
|
1615
|
0
|
|
|
|
|
|
|
|
1616
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1617
|
|
|
|
|
|
|
return "next;"; |
|
1618
|
|
|
|
|
|
|
} |
|
1619
|
0
|
|
|
0
|
|
|
|
|
1620
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1621
|
0
|
|
|
|
|
|
my $greaterThan = $class->{''}; |
|
1622
|
|
|
|
|
|
|
return $greaterThan; |
|
1623
|
0
|
|
|
|
|
|
} |
|
|
0
|
|
|
|
|
|
|
|
1624
|
0
|
|
|
|
|
|
|
|
1625
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1626
|
|
|
|
|
|
|
my $lessThan = $class->{''}; |
|
1627
|
0
|
|
|
|
|
|
return $lessThan; |
|
1628
|
0
|
|
|
|
|
|
} |
|
1629
|
0
|
|
|
|
|
|
|
|
1630
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1631
|
|
|
|
|
|
|
my $equals = $class->{''}; |
|
1632
|
0
|
|
|
|
|
|
return $equals; |
|
1633
|
|
|
|
|
|
|
} |
|
1634
|
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1636
|
0
|
|
|
0
|
|
|
my $plus = $class->{''}; |
|
1637
|
0
|
|
|
|
|
|
return $plus; |
|
1638
|
0
|
|
|
|
|
|
} |
|
1639
|
|
|
|
|
|
|
|
|
1640
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1641
|
|
|
|
|
|
|
my $minus = $class->{''}; |
|
1642
|
0
|
|
|
0
|
|
|
return $minus; |
|
1643
|
0
|
|
|
|
|
|
} |
|
1644
|
0
|
|
|
|
|
|
|
|
1645
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1646
|
|
|
|
|
|
|
my $multiply = $class->{''}; |
|
1647
|
|
|
|
|
|
|
return $multiply; |
|
1648
|
0
|
|
|
0
|
|
|
} |
|
1649
|
|
|
|
|
|
|
|
|
1650
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1651
|
|
|
|
|
|
|
my $divide = $class->{''}; |
|
1652
|
|
|
|
|
|
|
return $divide; |
|
1653
|
|
|
|
|
|
|
} |
|
1654
|
|
|
|
|
|
|
|
|
1655
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
|
1656
|
|
|
|
|
|
|
my $divide = $class->{''}; |
|
1657
|
|
|
|
|
|
|
return $divide; |
|
1658
|
|
|
|
|
|
|
} |
|
1659
|
0
|
|
|
0
|
|
|
|
|
1660
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1661
|
0
|
|
|
|
|
|
my $divide = $class->{''}; |
|
1662
|
0
|
|
|
|
|
|
return $divide; |
|
1663
|
0
|
|
|
|
|
|
} |
|
1664
|
|
|
|
|
|
|
|
|
1665
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1666
|
|
|
|
|
|
|
my $greaterThanEquals = $class->{''}; |
|
1667
|
|
|
|
|
|
|
return $greaterThanEquals; |
|
1668
|
|
|
|
|
|
|
} |
|
1669
|
0
|
|
|
0
|
|
|
|
|
1670
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1671
|
0
|
|
|
|
|
|
my $lessThanEquals = $class->{''}; |
|
1672
|
|
|
|
|
|
|
return $lessThanEquals; |
|
1673
|
|
|
|
|
|
|
} |
|
1674
|
|
|
|
|
|
|
|
|
1675
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1676
|
0
|
|
|
|
|
|
my $stringEquals = $class->{''}; |
|
1677
|
0
|
|
|
|
|
|
return $stringEquals; |
|
1678
|
|
|
|
|
|
|
} |
|
1679
|
|
|
|
|
|
|
|
|
1680
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1681
|
0
|
|
|
0
|
|
|
my $stringNotEquals = $class->{''}; |
|
1682
|
0
|
|
|
|
|
|
return $stringNotEquals; |
|
1683
|
0
|
|
|
|
|
|
} |
|
1684
|
|
|
|
|
|
|
|
|
1685
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1686
|
0
|
|
|
|
|
|
my $notEqulas = $class->{''}; |
|
1687
|
|
|
|
|
|
|
return $notEqulas; |
|
1688
|
|
|
|
|
|
|
} |
|
1689
|
|
|
|
|
|
|
|
|
1690
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1691
|
0
|
|
|
|
|
|
my $logicalAnd = $class->{''}; |
|
1692
|
0
|
|
|
|
|
|
return $logicalAnd; |
|
1693
|
|
|
|
|
|
|
} |
|
1694
|
0
|
|
|
|
|
|
|
|
1695
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1696
|
|
|
|
|
|
|
my $logicalOr = $class->{''}; |
|
1697
|
|
|
|
|
|
|
return $logicalOr; |
|
1698
|
|
|
|
|
|
|
} |
|
1699
|
0
|
|
|
0
|
|
|
|
|
1700
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1701
|
0
|
|
|
|
|
|
my $tokenImplement = $class->{''}; |
|
1702
|
|
|
|
|
|
|
return $tokenImplement; |
|
1703
|
|
|
|
|
|
|
} |
|
1704
|
|
|
|
|
|
|
|
|
1705
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
|
1706
|
0
|
|
|
|
|
|
my $tokenTry = $class->{''}; |
|
1707
|
|
|
|
|
|
|
return $tokenTry; |
|
1708
|
|
|
|
|
|
|
} |
|
1709
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1710
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1711
|
|
|
|
|
|
|
my $tokenCatch = $class->{''}; |
|
1712
|
|
|
|
|
|
|
return $tokenCatch; |
|
1713
|
0
|
|
|
|
|
|
} |
|
|
0
|
|
|
|
|
|
|
|
1714
|
0
|
|
|
|
|
|
|
|
1715
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1716
|
|
|
|
|
|
|
my $tokenError = $class->{''}; |
|
1717
|
0
|
|
|
|
|
|
return $tokenError; |
|
1718
|
0
|
|
|
|
|
|
} |
|
1719
|
0
|
|
|
|
|
|
|
|
1720
|
|
|
|
|
|
|
my ($class, $className) = @_; |
|
1721
|
|
|
|
|
|
|
my $eachSymbol = $class->{''}; |
|
1722
|
0
|
|
|
|
|
|
return $eachSymbol; |
|
1723
|
|
|
|
|
|
|
} |
|
1724
|
|
|
|
|
|
|
|
|
1725
|
|
|
|
|
|
|
|
|
1726
|
0
|
|
|
0
|
|
|
my $parser = qr { |
|
1727
|
|
|
|
|
|
|
<nocontext:> |
|
1728
|
|
|
|
|
|
|
# <debug: on> |
|
1729
|
|
|
|
|
|
|
|
|
1730
|
|
|
|
|
|
|
<Lang> |
|
1731
|
|
|
|
|
|
|
<objrule: PT::Lang> <[Class]>+ |
|
1732
|
|
|
|
|
|
|
|
|
1733
|
|
|
|
|
|
|
<objrule: PT::Class> <TokenClass> <ClassName> <ClassBlock> |
|
1734
|
|
|
|
|
|
|
<objrule: PT::ClassName> [a-zA-Z]+? |
|
1735
|
0
|
|
0
|
|
|
|
<objrule: PT::ClassBlock> <LBrace> <ClassGroups> <RBrace> |
|
1736
|
|
|
|
|
|
|
<objrule: PT::ClassGroups> <[Group]>+ |
|
1737
|
|
|
|
|
|
|
|
|
1738
|
|
|
|
|
|
|
<objrule: PT::Group> <ws: (\s++)*> <Comment> | <Parent> | <Packages> | <EmbedBlock> |
|
1739
|
0
|
|
|
0
|
|
|
| <ImplementFunction> | <Function> | <NonSyntaxClass> |
|
1740
|
|
|
|
|
|
|
|
|
1741
|
|
|
|
|
|
|
<objtoken: PT::NonSyntaxClass> \b.*\b |
|
1742
|
|
|
|
|
|
|
|
|
1743
|
|
|
|
|
|
|
<objrule: PT::ImplementFunction> <TokenImplement> <TokenFunction> <FunctionName> <LParen> <FunctionParamList> <RParen> <LBrace> <MultiLineComment>? <RBrace> |
|
1744
|
0
|
|
0
|
|
|
|
<objrule: PT::MultiLineComment> <MLCommentBegin> <MLComment> <MLCommentEnd> |
|
1745
|
|
|
|
|
|
|
<objtoken: PT::MLCommentBegin> \/\* |
|
1746
|
|
|
|
|
|
|
<objtoken: PT::MLCommentEnd> \*\/ |
|
1747
|
|
|
|
|
|
|
<objrule: PT::MLComment> (?<=\/\*)\s*.*?\s*(?=\*\/) |
|
1748
|
0
|
|
|
0
|
|
|
|
|
1749
|
0
|
0
|
|
|
|
|
<objrule: PT::Comment> [#] <LineComment> @ |
|
1750
|
0
|
|
|
|
|
|
<objtoken: PT::LineComment> .*? |
|
1751
|
0
|
|
|
|
|
|
|
|
1752
|
0
|
|
|
|
|
|
<objrule: PT::Parent> <TokenParent> <LParen> <ClassNames> <RParen> <SemiColon> |
|
1753
|
|
|
|
|
|
|
<objrule: PT::ClassNames> <[ClassName]>+ % <Comma> |
|
1754
|
0
|
|
|
|
|
|
|
|
1755
|
|
|
|
|
|
|
<objrule: PT::Packages> <LParen> <PackageList> <RParen> <SemiColon> |
|
1756
|
|
|
|
|
|
|
<objrule: PT::PackageList> <[Package]>+ % <Comma> |
|
1757
|
|
|
|
|
|
|
<objrule: PT::Package> <PackageWithConstructor> | <PackageWithoutConstructor> |
|
1758
|
|
|
|
|
|
|
<objrule: PT::PackageWithConstructor> [!] <Object> <Equal> <PackageName> <Dot> <Constructor> <LParen> <ObjectParameters>? <RParen> |
|
1759
|
0
|
|
|
0
|
|
|
<objrule: PT::ObjectParameters> <PackageParams> | <Parameters> |
|
1760
|
0
|
|
|
|
|
|
<objrule: PT::PackageParams> <[KeyValue]>+ % <Comma> |
|
1761
|
|
|
|
|
|
|
<objrule: PT::PackageName> <[PackageDir]>+ % (::) |
|
1762
|
|
|
|
|
|
|
<objrule: PT::PackageWithoutConstructor> <PackageName> <QW>? |
|
1763
|
|
|
|
|
|
|
<objrule: PT::QW> <Dot> <LParen> <FunctionList> <RParen> |
|
1764
|
0
|
|
|
0
|
|
|
<objrule: PT::FunctionList> <[FunctionName]>+ % <Comma> |
|
1765
|
0
|
|
|
|
|
|
<objrule: PT::Constructor> [a-zA-Z]+? |
|
1766
|
|
|
|
|
|
|
<objrule: PT::Object> [a-zA-Z]+? |
|
1767
|
|
|
|
|
|
|
<objrule: PT::PackageDir> [a-zA-Z]+? |
|
1768
|
|
|
|
|
|
|
|
|
1769
|
0
|
|
|
0
|
|
|
<objrule: PT::Function> <TokenFunction> <FunctionName> <LParen> <FunctionParamList> <RParen> <CodeBlock> |
|
1770
|
0
|
|
|
|
|
|
<objtoken: PT::FunctionName> [a-zA-Z_]+? |
|
1771
|
0
|
|
|
|
|
|
|
|
1772
|
|
|
|
|
|
|
<objrule: PT::FunctionParamList> <EmptyParamList> | <FunctionParams> |
|
1773
|
|
|
|
|
|
|
<objtoken: PT::EmptyParamList> .{0} |
|
1774
|
|
|
|
|
|
|
<objrule: PT::FunctionParams> <[Arg]>+ % <Comma> |
|
1775
|
0
|
|
|
0
|
|
|
<objrule: PT::Arg> [a-zA-Z]+? |
|
1776
|
0
|
|
|
|
|
|
|
|
1777
|
0
|
|
|
|
|
|
<objrule: PT::CodeBlock> <LBrace> <Blocks> <RBrace> |
|
1778
|
|
|
|
|
|
|
<objrule: PT::Blocks> <[Block]>+ |
|
1779
|
|
|
|
|
|
|
|
|
1780
|
|
|
|
|
|
|
<objrule: PT::Block> <IfElse> | <While> | <ForEach> | <For> | <ArrayEach> | <HashEach> | <EmbedBlock> |
|
1781
|
0
|
|
|
0
|
|
|
| <Comment> | <Statement> | <TryCatch> | <RegexMatch> | <Packages> | <NonSyntaxFunction> |
|
1782
|
0
|
|
|
|
|
|
|
|
1783
|
0
|
|
|
|
|
|
<objtoken: PT::NonSyntaxFunction> \b.*\b |
|
1784
|
|
|
|
|
|
|
|
|
1785
|
|
|
|
|
|
|
<objrule: PT::TryCatch> <TokenTry> <CodeBlock> <CatchBlock>? |
|
1786
|
|
|
|
|
|
|
<objrule: PT::CatchBlock> <TokenCatch> <LParen> <TokenError> <RParen> <CodeBlock> |
|
1787
|
0
|
|
|
0
|
|
|
|
|
1788
|
0
|
|
|
|
|
|
<objrule: PT::EmbedBlock> <TokenEmbedBlock> <EmbedCodeBlock> |
|
1789
|
0
|
|
|
|
|
|
<objrule: PT::EmbedCodeBlock> <EmbedBegin> <EmbeddedCode> <EmbedEnd> |
|
1790
|
|
|
|
|
|
|
<objrule: PT::EmbedBegin> <LParen>\? |
|
1791
|
|
|
|
|
|
|
<objrule: PT::EmbedEnd> \?<RParen> |
|
1792
|
|
|
|
|
|
|
<objrule: PT::EmbeddedCode> (?<=\(\?)\s*.*?\s*(?=\?\)) |
|
1793
|
0
|
|
|
0
|
|
|
|
|
1794
|
0
|
|
|
|
|
|
<objrule: PT::While> <TokenWhile> <LParen> <BoolExpression> <RParen> <CodeBlock> |
|
1795
|
0
|
|
|
|
|
|
|
|
1796
|
|
|
|
|
|
|
<objrule: PT::ForEach> <TokenForeach> <LParen> <ForRange> <RParen> <EachSymbol> <VariableName> <CodeBlock> |
|
1797
|
|
|
|
|
|
|
|
|
1798
|
|
|
|
|
|
|
<objrule: PT::ArrayEach> <TokenArrayEach> <LParen> <VariableName> <RParen> <EachSymbol> <ArrayEachVariableName> <CodeBlock> |
|
1799
|
0
|
|
|
0
|
|
|
<objrule: PT::ArrayEachVariableName> <VariableName> |
|
1800
|
0
|
|
|
|
|
|
|
|
1801
|
0
|
|
|
|
|
|
<objrule: PT::HashEach> <TokenHashEach> <LParen> <VariableName> <RParen> <EachSymbol> <LParen> <HashEachKey> <Comma> <HashEachValue> <RParen> <CodeBlock> |
|
1802
|
|
|
|
|
|
|
<objrule: PT::HashEachKey> <VariableName> |
|
1803
|
|
|
|
|
|
|
<objrule: PT::HashEachValue> <VariableName> |
|
1804
|
|
|
|
|
|
|
|
|
1805
|
0
|
|
|
0
|
|
|
<objrule: PT::For> <TokenFor> <Var> <VariableName> <LParen> <ForRange> <RParen> <CodeBlock> |
|
1806
|
0
|
|
|
|
|
|
<objrule: PT::ForRange> <LowerRange> <Dot><Dot><Dot> <UpperRange> |
|
1807
|
0
|
|
|
|
|
|
|
|
1808
|
|
|
|
|
|
|
<objrule: PT::LowerRange> <Number> | <VariableName> | <ArrayElement> | <HashElement> |
|
1809
|
|
|
|
|
|
|
| <ClassAccessor> | <ClassFunctionReturn> | <FunctionReturn> |
|
1810
|
|
|
|
|
|
|
|
|
1811
|
0
|
|
|
0
|
|
|
<objrule: PT::UpperRange> <Number> | <VariableName> | <ArrayElement> | <HashElement> |
|
1812
|
0
|
|
|
|
|
|
| <ClassAccessor> | <ClassFunctionReturn> | <FunctionReturn> |
|
1813
|
0
|
|
|
|
|
|
|
|
1814
|
|
|
|
|
|
|
<objrule: PT::RegexMatch> <TokenMatchRegex> <LParen> <Pattern> <RegexMatchSymbol> <MatchString> <RParen> <CodeBlock> |
|
1815
|
|
|
|
|
|
|
<objrule: PT::Pattern> <VariableName> |
|
1816
|
|
|
|
|
|
|
<objrule: PT::MatchString> <VariableName> |
|
1817
|
0
|
|
|
0
|
|
|
|
|
1818
|
0
|
|
|
|
|
|
<objrule: PT::IfElse> <If> <ElsIf>? <Else>? |
|
1819
|
0
|
|
|
|
|
|
<objrule: PT::If> <TokenIf> <LParen> <BoolExpression> <RParen> <CodeBlock> |
|
1820
|
|
|
|
|
|
|
|
|
1821
|
|
|
|
|
|
|
<objrule: PT::BoolExpression> <[BooleanExpression]>+ % <[BoolOperator]> |
|
1822
|
|
|
|
|
|
|
<objrule: PT::BooleanExpression> <BoolOperands> <BoolOperatorExpression>? |
|
1823
|
0
|
|
|
0
|
|
|
<objrule: PT::BoolOperatorExpression> <BoolOperator> <BoolOperands> |
|
1824
|
0
|
|
|
|
|
|
|
|
1825
|
0
|
|
|
|
|
|
<objrule: PT::BoolOperands> <RealNumber> | <String> | <ScalarVariable> | <ArrayElement> | <HashElement> |
|
1826
|
|
|
|
|
|
|
| <ClassAccessor> | <ClassFunctionReturn> | <FunctionReturn> | <GroupAccess> | <EmbedBlock> |
|
1827
|
|
|
|
|
|
|
|
|
1828
|
|
|
|
|
|
|
<objrule: PT::BoolOperator> <GreaterThan> | <LessThan> | <Equals> | <GreaterThanEquals> | <LessThanEquals> |
|
1829
|
0
|
|
|
0
|
|
|
| <StringEquals> | <StringNotEquals> | <NotEqulas> | <LogicalAnd> | <LogicalOr> |
|
1830
|
0
|
|
|
|
|
|
| <EmbedBlock> |
|
1831
|
0
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
<objrule: PT::ElsIf> <[ElsIfChain]>+ |
|
1833
|
|
|
|
|
|
|
<objrule: PT::ElsIfChain> <TokenElsIf> <LParen> <BoolExpression> <RParen> <CodeBlock> |
|
1834
|
|
|
|
|
|
|
<objrule: PT::Else> <TokenElse> <CodeBlock> |
|
1835
|
0
|
|
|
0
|
|
|
|
|
1836
|
0
|
|
|
|
|
|
<objrule: PT::Statement> <FunctionReferenceCall> | <VariableDeclaration> | <Regex> | <MakeGroup> | <FunctionCall> |
|
1837
|
0
|
|
|
|
|
|
| <ClassFunctionCall> | <ObjectCall> | <Assignment> | <Return> | <Last> | <Next> |
|
1838
|
|
|
|
|
|
|
|
|
1839
|
|
|
|
|
|
|
<objrule: PT::Regex> <TokenMakeRegex> <LParen> <RegexVariable> <Comma> <Regexp> <Comma> <Modifiers> <RParen> <SemiColon> |
|
1840
|
|
|
|
|
|
|
<objrule: PT::RegexVariable> <VariableName> |
|
1841
|
0
|
|
|
0
|
|
|
<objrule: PT::Regexp> <BackSlash> <Pre> <BackSlash> |
|
1842
|
0
|
|
|
|
|
|
<objrule: PT::Pre> (?<=\/)\s*.*?\s*(?=\/\,) |
|
1843
|
0
|
|
|
|
|
|
<objrule: PT::Modifiers> <LParen> <RegexModifiers> <RParen> |
|
1844
|
|
|
|
|
|
|
<objtoken: PT::RegexModifiers> [nmasdilxpu]+ |
|
1845
|
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
<objrule: PT::ClassFunctionCall> <TokenClass> <Dot> <FunctionName> <LParen> <Parameters>? <RParen> <SemiColon> |
|
1847
|
0
|
|
|
0
|
|
|
|
|
1848
|
0
|
|
|
|
|
|
<objrule: PT::ObjectCall> <ObjectFunctionCall> <SemiColon> |
|
1849
|
0
|
|
|
|
|
|
<objrule: PT::VariableDeclaration> <ArrayDeclaration> | <HashDeclaration> | <ScalarDeclaration> | <GroupDeclaration> |
|
1850
|
|
|
|
|
|
|
|
|
1851
|
|
|
|
|
|
|
<objrule: PT::GroupDeclaration> <TokenGroup> <GroupName> <GroupBlock> <SemiColon> |
|
1852
|
|
|
|
|
|
|
<objtoken: PT::GroupName> <VariableName> |
|
1853
|
0
|
|
|
0
|
|
|
<objrule: PT::GroupBlock> <LessThan> <GroupElements> <GreaterThan> |
|
1854
|
0
|
|
|
|
|
|
<objrule: PT::GroupElements> <[GroupElement]>+ % <Comma> |
|
1855
|
0
|
|
|
|
|
|
<objrule: PT::GroupElement> [A-Za-z]+ |
|
1856
|
|
|
|
|
|
|
|
|
1857
|
|
|
|
|
|
|
<objrule: PT::MakeGroup> <TokenMakeGroup> <LParen> <GroupName> <Comma> <GroupNameObject> <RParen> <SemiColon> |
|
1858
|
|
|
|
|
|
|
<objrule: PT::GroupNameObject> <VariableName> |
|
1859
|
0
|
|
|
0
|
|
|
<objrule: PT::GroupReference> <TokenGroupReference> <GroupName> |
|
1860
|
0
|
|
|
|
|
|
|
|
1861
|
0
|
|
|
|
|
|
<objrule: PT::GroupAssignment> <GroupAccess> <Equal> <RHS> <SemiColon> |
|
1862
|
|
|
|
|
|
|
<objrule: PT::GroupAccess> <GroupName> <[GroupAccessElement]>+ |
|
1863
|
|
|
|
|
|
|
<objrule: PT::GroupAccessElement> <LessThan> <GroupElement> <GreaterThan> |
|
1864
|
|
|
|
|
|
|
|
|
1865
|
0
|
|
|
0
|
|
|
<objrule: PT::ScalarDeclaration> <Var> <VariableName> <Equal> <Value> <SemiColon> |
|
1866
|
0
|
|
|
|
|
|
<objtoken: PT::Var> var |
|
1867
|
0
|
|
|
|
|
|
<objtoken: PT::VariableName> [a-zA-Z_]+? |
|
1868
|
|
|
|
|
|
|
<objrule: PT::Value> <RHS> |
|
1869
|
|
|
|
|
|
|
<objtoken: PT::Number> [0-9]+ |
|
1870
|
|
|
|
|
|
|
<objtoken: PT::RealNumber> [-]?[0-9]+\.?[0-9]+|[0-9]+ |
|
1871
|
0
|
|
|
0
|
|
|
<objrule: PT::String> <LQuote> <StringValue> <RQuote> |
|
1872
|
0
|
|
|
|
|
|
<objrule: PT::LQuote> <Quote> |
|
1873
|
0
|
|
|
|
|
|
<objrule: PT::RQuote> <Quote> |
|
1874
|
|
|
|
|
|
|
<objtoken: PT::StringValue> (?<=")\s*.*?\s*(?=") |
|
1875
|
|
|
|
|
|
|
|
|
1876
|
|
|
|
|
|
|
<objrule: PT::ArrayDeclaration> <Var> <VariableName> <Equal> <ArrayList> <SemiColon> |
|
1877
|
0
|
|
|
0
|
|
|
<objrule: PT::ArrayList> <LBracket> <ListElements> <RBracket> |
|
1878
|
0
|
|
|
|
|
|
<objrule: PT::ListElements> .{0} | <[ListElement]>+ % <Comma> |
|
1879
|
0
|
|
|
|
|
|
|
|
1880
|
|
|
|
|
|
|
<objrule: PT::ListElement> <RealNumber> | <String> | <ClassFunctionReturn> | <FunctionReturn> |
|
1881
|
|
|
|
|
|
|
| <ArrayElement> | <HashElement> | <ArrayList> | <HashRef> |
|
1882
|
|
|
|
|
|
|
| <VariableName> | <EmbedBlock> |
|
1883
|
0
|
|
|
0
|
|
|
|
|
1884
|
0
|
|
|
|
|
|
<objrule: PT::HashDeclaration> <Var> <VariableName> <Equal> <HashRef> <SemiColon> |
|
1885
|
0
|
|
|
|
|
|
<objrule: PT::HashRef> <LBrace> <KeyValuePairs> <RBrace> |
|
1886
|
|
|
|
|
|
|
<objrule: PT::KeyValuePairs> .{0} | <[KeyValue]>+ % <Comma> |
|
1887
|
|
|
|
|
|
|
<objrule: PT::KeyValue> <PairKey> <Colon> <PairValue> |
|
1888
|
|
|
|
|
|
|
|
|
1889
|
0
|
|
|
0
|
|
|
<objrule: PT::PairKey> <Number> | <String> | <ClassFunctionReturn> | <FunctionReturn> |
|
1890
|
0
|
|
|
|
|
|
| <VariableName> | <EmbedBlock> |
|
1891
|
0
|
|
|
|
|
|
|
|
1892
|
|
|
|
|
|
|
<objrule: PT::PairValue> <RealNumber> | <String> | <ClassFunctionReturn> | <FunctionReturn> |
|
1893
|
|
|
|
|
|
|
| <ArrayElement> | <HashElement> | <ArrayList> | <HashRef> |
|
1894
|
|
|
|
|
|
|
| <VariableName> | <EmbedBlock> |
|
1895
|
|
|
|
|
|
|
|
|
1896
|
|
|
|
|
|
|
<objrule: PT::FunctionCall> <FunctionName> <LParen> <Parameters>? <RParen> <SemiColon> |
|
1897
|
|
|
|
|
|
|
<objrule: PT::Parameters> <[Param]>+ % <Comma> |
|
1898
|
|
|
|
|
|
|
<objrule: PT::Param> <RealNumber> | <String> | <VariableName> | <ArrayElement> | <HashElement> |
|
1899
|
|
|
|
|
|
|
| <HashRef> | <FunctionReturn> | <ClassFunctionReturn> | <GroupAccess> | <EmbedBlock> |
|
1900
|
|
|
|
|
|
|
| <FunctionReference> | <GroupAccess> | <ClassFunctionReturn> | <Calc> | <ParamChars> | <ObjectFunctionCall> |
|
1901
|
|
|
|
|
|
|
|
|
1902
|
|
|
|
|
|
|
<objtoken: PT::ParamChars> [A-Za-z]+ |
|
1903
|
|
|
|
|
|
|
|
|
1904
|
|
|
|
|
|
|
<objrule: PT::Assignment> <ScalarAssignment> | <ArrayAssignment> | <HashAssignment> | <AccessorAssignment> | <GroupAssignment> |
|
1905
|
|
|
|
|
|
|
|
|
1906
|
|
|
|
|
|
|
<objrule: PT::ScalarAssignment> <ScalarVariable> <Equal> <RHS> <SemiColon> |
|
1907
|
|
|
|
|
|
|
<objtoken: PT::ScalarVariable> [a-zA-Z]+ |
|
1908
|
|
|
|
|
|
|
|
|
1909
|
|
|
|
|
|
|
<objrule: PT::RHS> <RealNumber> | <FunctionReference> | <FunctionReturn> | <ArrayElement> | <HashElement> |
|
1910
|
|
|
|
|
|
|
| <ScalarVariable> | <Calc> | <ArrayList> | <HashRef> | <ClassAccessor> |
|
1911
|
|
|
|
|
|
|
| <GroupElement> | <GroupReference> | <MakeGroup> | <GroupAccess> | <ClassFunctionReturn> |
|
1912
|
|
|
|
|
|
|
| <String> | <STDIN> | <RegexMatchVariables> | <ObjectFunctionCall> | <EmbedBlock> |
|
1913
|
|
|
|
|
|
|
|
|
1914
|
|
|
|
|
|
|
<objrule: PT::RegexMatchVariables> <RegexMatchSymbol> <MatchVariable> |
|
1915
|
|
|
|
|
|
|
<objrule: PT::MatchVariable> <Number> | <MatchParts> |
|
1916
|
|
|
|
|
|
|
<objtoken: PT::MatchParts> PREMATCH|MATCH|POSTMATCH |
|
1917
|
|
|
|
|
|
|
|
|
1918
|
|
|
|
|
|
|
<objrule: PT::FunctionReference> <TokenReference> <TokenClass> <Dot> <FunctionName> <LParen> <RParen> |
|
1919
|
|
|
|
|
|
|
<objrule: PT::FunctionReferenceCall> <TokenReferenceCall> <FunctionName> <LParen> <Parameters>? <RParen> <SemiColon> |
|
1920
|
|
|
|
|
|
|
|
|
1921
|
|
|
|
|
|
|
<objrule: PT::FunctionReturn> <FunctionName> <LParen> <Parameters>? <RParen> |
|
1922
|
|
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
<objrule: PT::ArrayElement> <ArrayName> <[ArrayAccess]>+ |
|
1924
|
|
|
|
|
|
|
<objrule: PT::ArrayAccess> <LBracket> <ArrayKey> <RBracket> |
|
1925
|
|
|
|
|
|
|
<objrule: PT::ArrayKey> <Number> | <ScalarVariable> | <ArrayElement> |
|
1926
|
|
|
|
|
|
|
| <HashElement> | <FunctionReturn> | <ClassFunctionReturn> |
|
1927
|
|
|
|
|
|
|
<objrule: PT::ArrayName> [a-zA-Z]+? |
|
1928
|
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
<objrule: PT::HashElement> <HashName> <[HashAccess]>+ |
|
1930
|
|
|
|
|
|
|
<objrule: PT::HashAccess> <LBrace> <HashKey> <RBrace> |
|
1931
|
|
|
|
|
|
|
<objtoken: PT::HashName> [a-zA-Z]+? |
|
1932
|
|
|
|
|
|
|
<objrule: PT::HashKey> <String> | <Number> | <ScalarVariable> | <ArrayElement> |
|
1933
|
|
|
|
|
|
|
| <HashElement> | <FunctionReturn> | <ClassFunctionReturn> |
|
1934
|
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
<objrule: PT::STDIN> <LessThan> <TokenSTDIN> <GreaterThan> |
|
1936
|
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
<objtoken: PT::HashKeyStringValue> [a-zA-Z]+? |
|
1938
|
|
|
|
|
|
|
<objrule: PT::AccessorAssignment> <TokenClass> <Dot> <HashKeyStringValue> <Equal> <RHS> <SemiColon> |
|
1939
|
|
|
|
|
|
|
<objrule: PT::ClassAccessor> <TokenClass> <Dot> <HashKeyStringValue> |
|
1940
|
|
|
|
|
|
|
<objrule: PT::ClassFunctionReturn> <TokenClass> <Dot> <FunctionName> <LParen> <Parameters>? <RParen> |
|
1941
|
|
|
|
|
|
|
|
|
1942
|
|
|
|
|
|
|
<objrule: PT::ArrayAssignment> <ArrayElement> <Equal> <RHS> <SemiColon> |
|
1943
|
|
|
|
|
|
|
<objrule: PT::HashAssignment> <HashElement> <Equal> <RHS> <SemiColon> |
|
1944
|
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
<objrule: PT::Calc> <CalcExpression> |
|
1946
|
|
|
|
|
|
|
<objrule: PT::CalcExpression> <[CalcOperands]>+ % <[CalcOperator]> |
|
1947
|
|
|
|
|
|
|
<objrule: PT::CalcOperands> <RealNumber> | <ScalarVariable> | <ArrayElement> | <HashElement> | <ClassAccessor> |
|
1948
|
|
|
|
|
|
|
| <ClassFunctionReturn> | <FunctionReturn> | <EmbedBlock> | <ObjectFunctionCall> |
|
1949
|
|
|
|
|
|
|
|
|
1950
|
|
|
|
|
|
|
<objtoken: PT::CalcOperator> <Plus> | <Minus> | <Multiply> | <Divide> | <Modulus> | <Exponent> | <EmbedBlock> |
|
1951
|
|
|
|
|
|
|
|
|
1952
|
|
|
|
|
|
|
<objrule: PT::Return> <TokenReturn> <RHS>? <SemiColon> |
|
1953
|
|
|
|
|
|
|
<objrule: PT::Last> <TokenLast> <SemiColon> |
|
1954
|
|
|
|
|
|
|
<objrule: PT::Next> <TokenNext> <SemiColon> |
|
1955
|
|
|
|
|
|
|
|
|
1956
|
|
|
|
|
|
|
<objrule: PT::ObjectFunctionCall> [!] <Object> <Dot> <FunctionName> <LParen> <Parameters>? <RParen> |
|
1957
|
|
|
|
|
|
|
|
|
1958
|
|
|
|
|
|
|
<objtoken: PT::TokenReturn> return |
|
1959
|
|
|
|
|
|
|
<objtoken: PT::TokenNext> next |
|
1960
|
|
|
|
|
|
|
<objtoken: PT::TokenLast> last |
|
1961
|
|
|
|
|
|
|
<objtoken: PT::TokenElse> else |
|
1962
|
|
|
|
|
|
|
<objtoken: PT::TokenElsIf> elsif |
|
1963
|
|
|
|
|
|
|
<objtoken: PT::TokenIf> if |
|
1964
|
|
|
|
|
|
|
<objtoken: PT::TokenFor> for |
|
1965
|
|
|
|
|
|
|
<objtoken: PT::TokenForeach> forEach |
|
1966
|
|
|
|
|
|
|
<objtoken: PT::TokenWhile> while |
|
1967
|
|
|
|
|
|
|
<objtoken: PT::TokenFunction> function |
|
1968
|
|
|
|
|
|
|
<objtoken: PT::TokenParent> parent |
|
1969
|
|
|
|
|
|
|
<objtoken: PT::TokenClass> class |
|
1970
|
|
|
|
|
|
|
<objtoken: PT::TokenEmbedBlock> embed |
|
1971
|
|
|
|
|
|
|
<objtoken: PT::TokenSTDIN> STDIN |
|
1972
|
|
|
|
|
|
|
<objtoken: PT::TokenNot> not |
|
1973
|
|
|
|
|
|
|
<objtoken: PT::TokenArrayEach> arrayEach |
|
1974
|
|
|
|
|
|
|
<objtoken: PT::TokenHashEach> hashEach |
|
1975
|
|
|
|
|
|
|
<objtoken: PT::TokenImplement> implement |
|
1976
|
|
|
|
|
|
|
<objtoken: PT::TokenTry> try |
|
1977
|
|
|
|
|
|
|
<objtoken: PT::TokenCatch> catch |
|
1978
|
|
|
|
|
|
|
<objtoken: PT::TokenError> error |
|
1979
|
|
|
|
|
|
|
<objtoken: PT::TokenMakeRegex> makeRegex |
|
1980
|
|
|
|
|
|
|
<objtoken: PT::TokenMatchRegex> matchRegex |
|
1981
|
|
|
|
|
|
|
<objtoken: PT::TokenReference> reference |
|
1982
|
|
|
|
|
|
|
<objtoken: PT::TokenReferenceCall> referenceCall |
|
1983
|
|
|
|
|
|
|
<objtoken: PT::TokenGroup> group |
|
1984
|
|
|
|
|
|
|
<objtoken: PT::TokenMakeGroup> makeGroup |
|
1985
|
|
|
|
|
|
|
<objtoken: PT::TokenGroupReference> groupReference |
|
1986
|
|
|
|
|
|
|
|
|
1987
|
|
|
|
|
|
|
<objtoken: PT::BackSlash> \/ |
|
1988
|
|
|
|
|
|
|
<objtoken: PT::RegexMatchSymbol> \@ |
|
1989
|
|
|
|
|
|
|
<objtoken: PT::EachSymbol> =\> |
|
1990
|
|
|
|
|
|
|
<objtoken: PT::Ampersand> \& |
|
1991
|
|
|
|
|
|
|
<objtoken: PT::Asterisk> \* |
|
1992
|
|
|
|
|
|
|
<objtoken: PT::Modulus> \% |
|
1993
|
|
|
|
|
|
|
<objtoken: PT::Exponent> \*\* |
|
1994
|
|
|
|
|
|
|
<objtoken: PT::LogicalAnd> \&\& |
|
1995
|
|
|
|
|
|
|
<objtoken: PT::LogicalOr> \|\| |
|
1996
|
|
|
|
|
|
|
<objtoken: PT::NotEqulas> \!= |
|
1997
|
|
|
|
|
|
|
<objtoken: PT::StringNotEquals> ne |
|
1998
|
|
|
|
|
|
|
<objtoken: PT::StringEquals> eq |
|
1999
|
|
|
|
|
|
|
<objtoken: PT::LessThanEquals> \<= |
|
2000
|
|
|
|
|
|
|
<objtoken: PT::GreaterThanEquals> \>= |
|
2001
|
|
|
|
|
|
|
<objtoken: PT::GreaterThan> \> |
|
2002
|
|
|
|
|
|
|
<objtoken: PT::LessThan> \< |
|
2003
|
|
|
|
|
|
|
<objtoken: PT::Equals> == |
|
2004
|
|
|
|
|
|
|
<objtoken: PT::Plus> \+ |
|
2005
|
|
|
|
|
|
|
<objtoken: PT::Minus> \- |
|
2006
|
|
|
|
|
|
|
<objtoken: PT::Multiply> \* |
|
2007
|
|
|
|
|
|
|
<objtoken: PT::Divide> \/ |
|
2008
|
|
|
|
|
|
|
<objtoken: PT::Quote> " |
|
2009
|
|
|
|
|
|
|
<objtoken: PT::SemiColon> ; |
|
2010
|
|
|
|
|
|
|
<objtoken: PT::Colon> : |
|
2011
|
|
|
|
|
|
|
<objtoken: PT::Dot> \. |
|
2012
|
|
|
|
|
|
|
<objtoken: PT::Equal> = |
|
2013
|
|
|
|
|
|
|
<objtoken: PT::Comma> , |
|
2014
|
|
|
|
|
|
|
<objtoken: PT::LParen> \( |
|
2015
|
|
|
|
|
|
|
<objtoken: PT::RParen> \) |
|
2016
|
|
|
|
|
|
|
<objtoken: PT::LBrace> \{ |
|
2017
|
|
|
|
|
|
|
<objtoken: PT::RBrace> \} |
|
2018
|
|
|
|
|
|
|
<objtoken: PT::LBracket> \[ |
|
2019
|
|
|
|
|
|
|
<objtoken: PT::RBracket> \] |
|
2020
|
|
|
|
|
|
|
}xms; |
|
2021
|
|
|
|
|
|
|
|
|
2022
|
|
|
|
|
|
|
my ($class, $program) = @_; |
|
2023
|
|
|
|
|
|
|
if($program =~ $parser) { |
|
2024
|
|
|
|
|
|
|
my $code = $/{Lang}->X(); |
|
2025
|
|
|
|
|
|
|
return $code; |
|
2026
|
|
|
|
|
|
|
} else { |
|
2027
|
|
|
|
|
|
|
my $notMatch = "print 'Error';"; |
|
2028
|
|
|
|
|
|
|
return $notMatch; |
|
2029
|
|
|
|
|
|
|
} |
|
2030
|
|
|
|
|
|
|
} |
|
2031
|
|
|
|
|
|
|
|
|
2032
|
|
|
|
|
|
|
1; |
|
2033
|
|
|
|
|
|
|
|
|
2034
|
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
|
|
2036
|
|
|
|
|
|
|
=head1 NAME |
|
2037
|
|
|
|
|
|
|
|
|
2038
|
|
|
|
|
|
|
Lang::HL HL programming language. |
|
2039
|
|
|
|
|
|
|
|
|
2040
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
2041
|
|
|
|
|
|
|
|
|
2042
|
|
|
|
|
|
|
$> hlc <directoryName> |
|
2043
|
|
|
|
|
|
|
$> hlp <directoryName> |
|
2044
|
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
2046
|
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
HL is a programming language. |
|
2048
|
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
=head1 EXAMPLE |
|
2050
|
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
class Main { |
|
2052
|
|
|
|
|
|
|
(JSON, |
|
2053
|
|
|
|
|
|
|
!mechanize = WWW::Mechanize.new()); |
|
2054
|
|
|
|
|
|
|
|
|
2055
|
|
|
|
|
|
|
function main() { |
|
2056
|
|
|
|
|
|
|
class.counter = 0; |
|
2057
|
|
|
|
|
|
|
|
|
2058
|
|
|
|
|
|
|
var hash = class.returnNumber(); |
|
2059
|
|
|
|
|
|
|
var json = encode_json(hash); |
|
2060
|
|
|
|
|
|
|
print(json, "\n"); |
|
2061
|
|
|
|
|
|
|
|
|
2062
|
|
|
|
|
|
|
var url = "https://metacpan.org/pod/WWW::Mechanize"; |
|
2063
|
|
|
|
|
|
|
!mechanize.get(url); |
|
2064
|
|
|
|
|
|
|
var page = !mechanize.text(); |
|
2065
|
|
|
|
|
|
|
print(page, "\n"); |
|
2066
|
|
|
|
|
|
|
} |
|
2067
|
|
|
|
|
|
|
|
|
2068
|
|
|
|
|
|
|
function returnNumber() { |
|
2069
|
|
|
|
|
|
|
var number = {}; |
|
2070
|
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
if(class.counter < 10) { |
|
2072
|
|
|
|
|
|
|
class.counter = class.counter + 1; |
|
2073
|
|
|
|
|
|
|
|
|
2074
|
|
|
|
|
|
|
number = { "number" : class.returnNumber() }; |
|
2075
|
|
|
|
|
|
|
return number; |
|
2076
|
|
|
|
|
|
|
} |
|
2077
|
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
return class.counter; |
|
2079
|
|
|
|
|
|
|
} |
|
2080
|
|
|
|
|
|
|
} |
|
2081
|
|
|
|
|
|
|
|
|
2082
|
|
|
|
|
|
|
=head1 AUTHOR |
|
2083
|
|
|
|
|
|
|
|
|
2084
|
|
|
|
|
|
|
Rajkumar Reddy |
|
2085
|
|
|
|
|
|
|
|
|
2086
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
2087
|
|
|
|
|
|
|
|
|
2088
|
|
|
|
|
|
|
Copyright (C) 2022 by Rajkumar Reddy. All rights reserved. |
|
2089
|
|
|
|
|
|
|
|
|
2090
|
|
|
|
|
|
|
|
|
2091
|
|
|
|
|
|
|
=cut |