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