line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
56761
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
495
|
use Regexp::Grammars; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
1101
|
|
|
1
|
|
|
|
|
27384
|
|
|
1
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
our $VERSION = '5.016'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my ($class) = @_; |
10
|
|
|
|
|
|
|
return bless {}, $class; |
11
|
0
|
|
|
0
|
0
|
|
} |
12
|
0
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my ($class) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $code = 'use strict; |
16
|
0
|
|
|
0
|
|
|
use warnings; |
17
|
|
|
|
|
|
|
use utf8;'; |
18
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
for my $element ( @{ $class->{Class}} ) { |
20
|
|
|
|
|
|
|
$code .= $element->X(); |
21
|
|
|
|
|
|
|
} |
22
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$code .= 'my $object = Main->new(); $object->main();'; |
24
|
|
|
|
|
|
|
return $code; |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my ($class) = @_; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $className = $class->{ClassName}->X(); |
30
|
|
|
|
|
|
|
my $classBlock = $class->{ClassBlock}->X($className); |
31
|
0
|
|
|
0
|
|
|
|
32
|
|
|
|
|
|
|
my $classCode = ' |
33
|
0
|
|
|
|
|
|
package ' . $className . '; |
34
|
0
|
|
|
|
|
|
use strict; |
35
|
|
|
|
|
|
|
use warnings; |
36
|
0
|
|
|
|
|
|
use utf8; |
37
|
|
|
|
|
|
|
use Lang::HL::Export; |
38
|
|
|
|
|
|
|
use feature qw(signatures); |
39
|
|
|
|
|
|
|
no warnings "experimental::signatures"; |
40
|
|
|
|
|
|
|
use Data::Printer; |
41
|
|
|
|
|
|
|
'; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$classCode .= $classBlock . "\n1;"; |
44
|
|
|
|
|
|
|
return $classCode; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my ($class) = @_; |
48
|
0
|
|
|
|
|
|
my $className = $class->{''}; |
49
|
|
|
|
|
|
|
return $className; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
53
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $classBlock = ' |
55
|
|
|
|
|
|
|
sub new($class) { |
56
|
|
|
|
|
|
|
my $hashRef = { "' . $className . '" => {} }; |
57
|
|
|
|
|
|
|
return bless $hashRef, $class; |
58
|
0
|
|
|
0
|
|
|
} |
59
|
|
|
|
|
|
|
'; |
60
|
0
|
|
|
|
|
|
my $classGroups = $class->{ClassGroups}->X($className); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
$classBlock .= $classGroups; |
63
|
|
|
|
|
|
|
return $classBlock; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
my @classGroups; |
69
|
0
|
|
|
|
|
|
for my $element ( @{$class->{Group}} ) { |
70
|
|
|
|
|
|
|
push @classGroups, $element->X($className); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
|
|
my $classGroups = join("", @classGroups); |
74
|
|
|
|
|
|
|
return $classGroups; |
75
|
0
|
|
|
|
|
|
} |
76
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
return ( $class->{Comment} |
80
|
0
|
|
|
|
|
|
|| $class->{Parent} |
81
|
0
|
|
|
|
|
|
|| $class->{Packages} |
82
|
|
|
|
|
|
|
|| $class->{EmbedBlock} |
83
|
|
|
|
|
|
|
|| $class->{Function} |
84
|
|
|
|
|
|
|
|| $class->{NonSyntaxClass} )->X($className); |
85
|
0
|
|
|
0
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
my ($class, $className) = @_; |
88
|
|
|
|
|
|
|
my $nonSyntax = $class->{''}; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my @nonSyntax = split(" ", $nonSyntax); |
91
|
|
|
|
|
|
|
$nonSyntax = $nonSyntax[0]; |
92
|
0
|
|
0
|
|
|
|
|
93
|
|
|
|
|
|
|
print "SyntaxError", "\n"; |
94
|
|
|
|
|
|
|
print "===========", "\n"; |
95
|
|
|
|
|
|
|
print "ClassName: ", $className, "\n"; |
96
|
0
|
|
|
0
|
|
|
die "Error: $nonSyntax \n"; |
97
|
0
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
100
|
0
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
my @packageList = ($class->{PackageList})->X($className); |
102
|
0
|
|
|
|
|
|
my $packages = join("\n", @packageList); |
103
|
0
|
|
|
|
|
|
return $packages; |
104
|
0
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
my ($class, $className) = @_; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my @packageList; |
109
|
0
|
|
|
0
|
|
|
for my $element ( @{$class->{Package}} ) { |
110
|
|
|
|
|
|
|
push @packageList, $element->X($className); |
111
|
0
|
|
|
|
|
|
} |
112
|
0
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
|
return @packageList; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
my ($class, $className) = @_; |
117
|
0
|
|
|
0
|
|
|
|
118
|
|
|
|
|
|
|
return ( $class->{PackageWithConstructor} |
119
|
0
|
|
|
|
|
|
|| $class->{PackageWithoutConstructor} )->X($className); |
120
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
my ($class, $className) = @_; |
123
|
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
my $object = $class->{Object}->X(); |
125
|
|
|
|
|
|
|
my $packageName = $class->{PackageName}->X(); |
126
|
|
|
|
|
|
|
my $constructor = $class->{Constructor}->X(); |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
0
|
|
|
if(exists $class->{ObjectParameters}) { |
129
|
|
|
|
|
|
|
my $objectParameters = $class->{ObjectParameters}->X($className); |
130
|
|
|
|
|
|
|
my $parameters; |
131
|
0
|
|
0
|
|
|
|
|
132
|
|
|
|
|
|
|
if(ref($objectParameters)) { |
133
|
|
|
|
|
|
|
$parameters = join(",", @{$objectParameters}); |
134
|
|
|
|
|
|
|
} else { |
135
|
0
|
|
|
0
|
|
|
$parameters = $objectParameters; |
136
|
|
|
|
|
|
|
} |
137
|
0
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
my $packageWithConstructor = "use " . $packageName . ";\n" |
139
|
0
|
|
|
|
|
|
. "my \$" . $object . " = " . $packageName . "->" |
140
|
|
|
|
|
|
|
. $constructor . "(" . $parameters . ");\n"; |
141
|
0
|
0
|
|
|
|
|
return $packageWithConstructor; |
142
|
0
|
|
|
|
|
|
} |
143
|
0
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
my $packageWithConstructor = "use " . $packageName . ";\n" |
145
|
0
|
0
|
|
|
|
|
. "my \$" . $object . " = " . $packageName |
146
|
0
|
|
|
|
|
|
. "->" . $constructor . "();\n"; |
|
0
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
return $packageWithConstructor; |
148
|
0
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
my ($class, $className) = @_; |
151
|
0
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
return ( $class->{PackageParams} |
153
|
|
|
|
|
|
|
|| $class->{Parameters} )->X(); |
154
|
0
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
my ($class, $className) = @_; |
157
|
0
|
|
|
|
|
|
my @keyValuePairs; |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
my $keyValuePairs = ""; |
160
|
0
|
|
|
|
|
|
for my $element ( @{ $class->{KeyValue}} ) { |
161
|
|
|
|
|
|
|
@keyValuePairs = (); |
162
|
|
|
|
|
|
|
push @keyValuePairs, $element->X($className); |
163
|
|
|
|
|
|
|
$keyValuePairs .= $keyValuePairs[0] . " => " . $keyValuePairs[1] . ", "; |
164
|
0
|
|
|
0
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
return $keyValuePairs; |
167
|
0
|
|
0
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
my ($class, $className) = @_; |
170
|
|
|
|
|
|
|
|
171
|
0
|
|
|
0
|
|
|
my @packageDir; |
172
|
0
|
|
|
|
|
|
for my $element ( @{ $class->{PackageDir}} ) { |
173
|
|
|
|
|
|
|
push @packageDir, $element->X($className); |
174
|
0
|
|
|
|
|
|
} |
175
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
my $packageName = join("::", @packageDir); |
177
|
0
|
|
|
|
|
|
return $packageName; |
178
|
0
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
my ($class, $className) = @_; |
181
|
0
|
|
|
|
|
|
my $packageName = $class->{PackageName}->X($className); |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
if(exists $class->{QW}) { |
184
|
|
|
|
|
|
|
my $qw = $class->{QW}->X($className); |
185
|
0
|
|
|
0
|
|
|
|
186
|
|
|
|
|
|
|
my $packageWithoutConstructor = "use " . $packageName . $qw . ";\n"; |
187
|
0
|
|
|
|
|
|
return $packageWithoutConstructor; |
188
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
189
|
0
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
my $packageWithoutConstructor = "use " . $packageName . ";\n"; |
191
|
|
|
|
|
|
|
return $packageWithoutConstructor; |
192
|
0
|
|
|
|
|
|
} |
193
|
0
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
my ($class, $className) = @_; |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
my @functionList = $class->{FunctionList}->X($className); |
197
|
0
|
|
|
0
|
|
|
my $qw = " qw("; |
198
|
0
|
|
|
|
|
|
my $funcitonList = join(" ", @functionList); |
199
|
|
|
|
|
|
|
$qw .= $funcitonList . ")"; |
200
|
0
|
0
|
|
|
|
|
} |
201
|
0
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
my ($class, $className) = @_; |
203
|
0
|
|
|
|
|
|
|
204
|
0
|
|
|
|
|
|
my @functionList; |
205
|
|
|
|
|
|
|
for my $element ( @{ $class->{FunctionName}} ) { |
206
|
|
|
|
|
|
|
push @functionList, $element->X($className); |
207
|
0
|
|
|
|
|
|
} |
208
|
0
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
return @functionList; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
213
|
|
|
|
|
|
|
|
214
|
0
|
|
|
|
|
|
my $constructor = $class->{''}; |
215
|
0
|
|
|
|
|
|
return $constructor; |
216
|
0
|
|
|
|
|
|
} |
217
|
0
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
my ($class, $className) = @_; |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
my $object = $class->{''}; |
221
|
0
|
|
|
0
|
|
|
return $object; |
222
|
|
|
|
|
|
|
} |
223
|
0
|
|
|
|
|
|
|
224
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
0
|
|
|
|
|
|
|
225
|
0
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
my $packageDir = $class->{''}; |
227
|
|
|
|
|
|
|
return $packageDir; |
228
|
0
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
my ($class, $className) = @_; |
231
|
|
|
|
|
|
|
my $parent = 'our @ISA = qw('; |
232
|
0
|
|
|
0
|
|
|
|
233
|
|
|
|
|
|
|
my $classNames = $class->{ClassNames}->X($className); |
234
|
0
|
|
|
|
|
|
$parent .= $classNames . ");\n"; |
235
|
0
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
my ($class, $className) = @_; |
238
|
|
|
|
|
|
|
|
239
|
0
|
|
|
0
|
|
|
my @classNames; |
240
|
|
|
|
|
|
|
for my $element ( @{$class->{ClassName}} ) { |
241
|
0
|
|
|
|
|
|
push @classNames, $element->X($className); |
242
|
0
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
my $classNames = join(" ", @classNames); |
245
|
|
|
|
|
|
|
return $classNames; |
246
|
0
|
|
|
0
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
249
|
0
|
|
|
|
|
|
my $comment = $class->{LineComment}->X($className); |
250
|
|
|
|
|
|
|
$comment = "\n" . "# " . $comment . "\n"; |
251
|
|
|
|
|
|
|
return $comment; |
252
|
|
|
|
|
|
|
} |
253
|
0
|
|
|
0
|
|
|
|
254
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
255
|
|
|
|
|
|
|
return $class->{''}; |
256
|
0
|
|
|
|
|
|
} |
257
|
0
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
my ($class, $className) = @_; |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
261
|
0
|
|
|
0
|
|
|
my $functionParamList = $class->{FunctionParamList}->X($className); |
262
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className, $functionName); |
263
|
0
|
|
|
|
|
|
|
264
|
0
|
|
|
|
|
|
my $function = "\n sub " . $functionName . $functionParamList . $codeBlock; |
|
0
|
|
|
|
|
|
|
265
|
0
|
|
|
|
|
|
return $function; |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
269
|
0
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
my $functionName = $class->{''}; |
271
|
|
|
|
|
|
|
return $functionName; |
272
|
|
|
|
|
|
|
} |
273
|
0
|
|
|
0
|
|
|
|
274
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
275
|
0
|
|
|
|
|
|
|
276
|
0
|
|
|
|
|
|
my @params = ( $class->{EmptyParamList} |
277
|
|
|
|
|
|
|
|| $class->{FunctionParams} )->X($className); |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
my $functionParamList; |
280
|
0
|
|
|
0
|
|
|
$functionParamList = '( $class, '; |
281
|
0
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
if($#params >= 0) { |
283
|
|
|
|
|
|
|
foreach my $param (@params) { |
284
|
|
|
|
|
|
|
if( $param eq "" ) {} else { |
285
|
0
|
|
|
0
|
|
|
$functionParamList .= "\$" . $param . ","; |
286
|
|
|
|
|
|
|
} |
287
|
0
|
|
|
|
|
|
} |
288
|
0
|
|
|
|
|
|
if( substr($functionParamList, -1) eq "," ) { |
289
|
0
|
|
|
|
|
|
chop($functionParamList); |
290
|
|
|
|
|
|
|
} |
291
|
0
|
|
|
|
|
|
} |
292
|
0
|
|
|
|
|
|
else { |
293
|
|
|
|
|
|
|
chop($functionParamList); |
294
|
|
|
|
|
|
|
} |
295
|
|
|
|
|
|
|
$functionParamList .= ")"; |
296
|
0
|
|
|
0
|
|
|
|
297
|
|
|
|
|
|
|
return $functionParamList; |
298
|
0
|
|
|
|
|
|
} |
299
|
0
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
301
|
|
|
|
|
|
|
my $blocks = $class->{Blocks}->X($className, $functionName); |
302
|
|
|
|
|
|
|
my $codeBlock = "{\n" . $blocks . "\n}"; |
303
|
0
|
|
|
0
|
|
|
return $codeBlock; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
|
306
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
307
|
|
|
|
|
|
|
return $class->{''}; |
308
|
0
|
|
|
|
|
|
} |
309
|
0
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
my ($class, $className) = @_; |
311
|
0
|
0
|
|
|
|
|
my @functionParams; |
312
|
0
|
|
|
|
|
|
|
313
|
0
|
0
|
|
|
|
|
for my $element ( @{ $class->{Arg}} ) { |
314
|
0
|
|
|
|
|
|
push @functionParams, $element->X($className); |
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
0
|
0
|
|
|
|
|
return @functionParams; |
318
|
0
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
my ($class, $className) = @_; |
321
|
|
|
|
|
|
|
return $class->{''}; |
322
|
0
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
|
324
|
0
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
325
|
|
|
|
|
|
|
my @blocks; |
326
|
0
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
for my $element ( @{$class->{Block}} ) { |
328
|
|
|
|
|
|
|
push @blocks, $element->X($className, $functionName); |
329
|
|
|
|
|
|
|
} |
330
|
0
|
|
|
0
|
|
|
|
331
|
0
|
|
|
|
|
|
my $blocks = join("\n", @blocks); |
332
|
0
|
|
|
|
|
|
return $blocks; |
333
|
0
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
336
|
|
|
|
|
|
|
my $block = ( $class->{IfElse} |
337
|
0
|
|
|
0
|
|
|
|| $class->{While} |
338
|
0
|
|
|
|
|
|
|| $class->{ForEach} |
339
|
|
|
|
|
|
|
|| $class->{For} |
340
|
|
|
|
|
|
|
|| $class->{EmbedBlock} |
341
|
|
|
|
|
|
|
|| $class->{Comment} |
342
|
0
|
|
|
0
|
|
|
|| $class->{Statement} |
343
|
0
|
|
|
|
|
|
|| $class->{NonSyntaxFunction} )->X($className, $functionName); |
344
|
|
|
|
|
|
|
return $block; |
345
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
346
|
0
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
my ($class, $className, $functionName) = @_; |
348
|
|
|
|
|
|
|
my $nonSyntax = $class->{''}; |
349
|
0
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
my @nonSyntax = split(" ", $nonSyntax); |
351
|
|
|
|
|
|
|
$nonSyntax = $nonSyntax[0]; |
352
|
|
|
|
|
|
|
|
353
|
0
|
|
|
0
|
|
|
print "SyntaxError", "\n"; |
354
|
0
|
|
|
|
|
|
print "===========", "\n"; |
355
|
|
|
|
|
|
|
print "ClassName: ", $className, "\n"; |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
if(defined $functionName) { |
358
|
0
|
|
|
0
|
|
|
print "FunctionName: ", $functionName, "\n"; |
359
|
0
|
|
|
|
|
|
} |
360
|
|
|
|
|
|
|
|
361
|
0
|
|
|
|
|
|
die "Error: $nonSyntax \n"; |
|
0
|
|
|
|
|
|
|
362
|
0
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
my ($class, $className) = @_; |
365
|
0
|
|
|
|
|
|
|
366
|
0
|
|
|
|
|
|
my $embedBlock = $class->{EmbedCodeBlock}->X($className); |
367
|
|
|
|
|
|
|
return $embedBlock; |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
my $embedCode = $class->{EmbeddedCode}->X($className); |
373
|
|
|
|
|
|
|
return $embedCode; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
my ($class, $className) = @_; |
377
|
|
|
|
|
|
|
|
378
|
0
|
|
0
|
|
|
|
my $embedCode = $class->{''}; |
379
|
0
|
|
|
|
|
|
return $embedCode; |
380
|
|
|
|
|
|
|
} |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
my ($class, $className) = @_; |
383
|
0
|
|
|
0
|
|
|
|
384
|
0
|
|
|
|
|
|
my $boolExpression = $class->{BoolExpression}->X($className); |
385
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
386
|
0
|
|
|
|
|
|
|
387
|
0
|
|
|
|
|
|
my $while = "\n while ( " . $boolExpression . " ) " . $codeBlock; |
388
|
|
|
|
|
|
|
return $while; |
389
|
0
|
|
|
|
|
|
} |
390
|
0
|
|
|
|
|
|
|
391
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
392
|
|
|
|
|
|
|
|
393
|
0
|
0
|
|
|
|
|
my $forEachVariableName = $class->{ForEachVariableName}->X($className); |
394
|
0
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
395
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
396
|
|
|
|
|
|
|
|
397
|
0
|
|
|
|
|
|
my $forEach = "\n foreach my " . $forEachVariableName |
398
|
|
|
|
|
|
|
. " ( \@{" . $variableName . "} ) " . $codeBlock; |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
return $forEach; |
401
|
0
|
|
|
0
|
|
|
} |
402
|
|
|
|
|
|
|
|
403
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
404
|
0
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
406
|
|
|
|
|
|
|
return $variableName; |
407
|
|
|
|
|
|
|
} |
408
|
0
|
|
|
0
|
|
|
|
409
|
|
|
|
|
|
|
my ($class, $className) = @_; |
410
|
0
|
|
|
|
|
|
|
411
|
0
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
412
|
|
|
|
|
|
|
my @forRange = $class->{ForRange}->X($className); |
413
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
414
|
|
|
|
|
|
|
|
415
|
0
|
|
|
0
|
|
|
my $for = "\n for my " . $variableName . " ( " . $forRange[0] |
416
|
|
|
|
|
|
|
. " ... " . $forRange[1] . " ) " . $codeBlock; |
417
|
0
|
|
|
|
|
|
|
418
|
0
|
|
|
|
|
|
return $for; |
419
|
|
|
|
|
|
|
} |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
my ($class, $className) = @_; |
422
|
0
|
|
|
0
|
|
|
|
423
|
|
|
|
|
|
|
my $lowerRange = $class->{LowerRange}->X($className); |
424
|
0
|
|
|
|
|
|
my $upperRange = $class->{UpperRange}->X($className); |
425
|
0
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
my @forRange = ($lowerRange, $upperRange); |
427
|
0
|
|
|
|
|
|
return @forRange; |
428
|
0
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
my ($class, $className) = @_; |
431
|
|
|
|
|
|
|
|
432
|
0
|
|
|
0
|
|
|
my $number = ( $class->{Number} |
433
|
|
|
|
|
|
|
|| $class->{VariableName} |
434
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
435
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
436
|
0
|
|
|
|
|
|
|| $class->{ClassAccessor} |
437
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
438
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} )->X($className); |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
return $number; |
441
|
0
|
|
|
|
|
|
} |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
my ($class, $className) = @_; |
444
|
|
|
|
|
|
|
|
445
|
0
|
|
|
0
|
|
|
my $number = ( $class->{Number} |
446
|
|
|
|
|
|
|
|| $class->{VariableName} |
447
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
448
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
449
|
|
|
|
|
|
|
|| $class->{ClassAccessor} |
450
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
451
|
|
|
|
|
|
|
|| $class->{FunctionReturn} )->X($className); |
452
|
0
|
|
|
0
|
|
|
|
453
|
|
|
|
|
|
|
return $number; |
454
|
0
|
|
|
|
|
|
} |
455
|
0
|
|
|
|
|
|
|
456
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
457
|
|
|
|
|
|
|
my $if = $class->{If}->X($className); |
458
|
0
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
my $elsif; |
460
|
|
|
|
|
|
|
my $else; |
461
|
0
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
if( exists $class->{ElsIf} ) { |
463
|
|
|
|
|
|
|
$elsif = $class->{ElsIf}->X($className); |
464
|
|
|
|
|
|
|
} |
465
|
0
|
|
|
0
|
|
|
if( exists $class->{Else} ) { |
466
|
|
|
|
|
|
|
$else = $class->{Else}->X($className); |
467
|
0
|
|
|
|
|
|
} |
468
|
0
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
my $ifElseIf; |
470
|
0
|
|
|
|
|
|
if (defined $elsif) { |
471
|
0
|
|
|
|
|
|
$ifElseIf = $if . $elsif . $else; |
472
|
|
|
|
|
|
|
return $ifElseIf; |
473
|
|
|
|
|
|
|
} |
474
|
|
|
|
|
|
|
if (defined $else) { |
475
|
0
|
|
|
0
|
|
|
$ifElseIf = $if . $else; |
476
|
|
|
|
|
|
|
return $ifElseIf; |
477
|
|
|
|
|
|
|
} |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
$ifElseIf = $if; |
480
|
|
|
|
|
|
|
return $ifElseIf; |
481
|
|
|
|
|
|
|
} |
482
|
|
|
|
|
|
|
|
483
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
484
|
|
|
|
|
|
|
my $if = $class->{If}->X($className); |
485
|
0
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
my $elsif; |
487
|
|
|
|
|
|
|
my $else; |
488
|
|
|
|
|
|
|
|
489
|
0
|
|
|
0
|
|
|
if( exists $class->{ElsIf} ) { |
490
|
|
|
|
|
|
|
$elsif = $class->{ElsIf}->X($className); |
491
|
|
|
|
|
|
|
} |
492
|
|
|
|
|
|
|
if( exists $class->{Else} ) { |
493
|
|
|
|
|
|
|
$else = $class->{Else}->X($className); |
494
|
|
|
|
|
|
|
} |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
my $ifElseIf; |
497
|
0
|
|
0
|
|
|
|
if (defined $elsif) { |
498
|
|
|
|
|
|
|
$ifElseIf = $if . $elsif . $else; |
499
|
0
|
|
|
|
|
|
return $ifElseIf; |
500
|
|
|
|
|
|
|
} |
501
|
|
|
|
|
|
|
if (defined $else) { |
502
|
|
|
|
|
|
|
$ifElseIf = $if . $else; |
503
|
0
|
|
|
0
|
|
|
return $ifElseIf; |
504
|
0
|
|
|
|
|
|
} |
505
|
|
|
|
|
|
|
|
506
|
0
|
|
|
|
|
|
$ifElseIf = $if; |
507
|
|
|
|
|
|
|
return $ifElseIf; |
508
|
|
|
|
|
|
|
} |
509
|
0
|
0
|
|
|
|
|
|
510
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
511
|
|
|
|
|
|
|
|
512
|
0
|
0
|
|
|
|
|
my $boolExpression = $class->{BoolExpression}->X($className); |
513
|
0
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
my $if = "\n if ( " . $boolExpression . " ) " . $codeBlock; |
516
|
0
|
|
|
|
|
|
return $if; |
517
|
0
|
0
|
|
|
|
|
} |
518
|
0
|
|
|
|
|
|
|
519
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
520
|
|
|
|
|
|
|
my @booleanExpressions; |
521
|
0
|
0
|
|
|
|
|
|
522
|
0
|
|
|
|
|
|
for my $element ( @{ $class->{BooleanExpression}} ) { |
523
|
0
|
|
|
|
|
|
push @booleanExpressions, $element->X($className); |
524
|
|
|
|
|
|
|
} |
525
|
|
|
|
|
|
|
|
526
|
0
|
|
|
|
|
|
my @boolOperators; |
527
|
0
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
for my $element (@{ $class->{BoolOperator} }) { |
529
|
|
|
|
|
|
|
push @boolOperators, $element->X($className); |
530
|
|
|
|
|
|
|
} |
531
|
0
|
|
|
0
|
|
|
|
532
|
0
|
|
|
|
|
|
my $boolExpression = $booleanExpressions[0]; |
533
|
|
|
|
|
|
|
for my $counter (1 .. $#booleanExpressions) { |
534
|
0
|
|
|
|
|
|
$boolExpression .= $boolOperators[$counter - 1] . " " . $booleanExpressions[$counter]; |
535
|
|
|
|
|
|
|
} |
536
|
|
|
|
|
|
|
|
537
|
0
|
0
|
|
|
|
|
return $boolExpression; |
538
|
0
|
|
|
|
|
|
} |
539
|
|
|
|
|
|
|
|
540
|
0
|
0
|
|
|
|
|
my ($class, $className) = @_; |
541
|
0
|
|
|
|
|
|
my $boolExpression; |
542
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
my $boolOperand = $class->{BoolOperands}->X($className); |
544
|
0
|
|
|
|
|
|
if( exists $class->{BoolOperatorExpression} ) { |
545
|
0
|
0
|
|
|
|
|
my @boolOperatorExpression = $class->{BoolOperatorExpression}->X($className); |
546
|
0
|
|
|
|
|
|
$boolExpression = $boolOperand . " " |
547
|
0
|
|
|
|
|
|
. $boolOperatorExpression[0] . " " . $boolOperatorExpression[1]; |
548
|
|
|
|
|
|
|
return $boolExpression; |
549
|
0
|
0
|
|
|
|
|
} |
550
|
0
|
|
|
|
|
|
|
551
|
0
|
|
|
|
|
|
$boolExpression = $boolOperand; |
552
|
|
|
|
|
|
|
return $boolExpression; |
553
|
|
|
|
|
|
|
} |
554
|
0
|
|
|
|
|
|
|
555
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
my $boolOperator = $class->{BoolOperator}->X($className); |
558
|
|
|
|
|
|
|
my $boolOperand = $class->{BoolOperands}->X($className); |
559
|
0
|
|
|
0
|
|
|
|
560
|
|
|
|
|
|
|
my @boolOperatorExpression = ($boolOperator, $boolOperand); |
561
|
0
|
|
|
|
|
|
return @boolOperatorExpression; |
562
|
0
|
|
|
|
|
|
} |
563
|
|
|
|
|
|
|
|
564
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
565
|
0
|
|
|
|
|
|
return ( $class->{GreaterThan} |
566
|
|
|
|
|
|
|
|| $class->{LessThan} |
567
|
|
|
|
|
|
|
|| $class->{Equals} |
568
|
|
|
|
|
|
|
|| $class->{GreaterThanEquals} |
569
|
0
|
|
|
0
|
|
|
|| $class->{LessThanEquals} |
570
|
0
|
|
|
|
|
|
|| $class->{StringEquals} |
571
|
|
|
|
|
|
|
|| $class->{StringNotEquals} |
572
|
0
|
|
|
|
|
|
|| $class->{NotEqulas} |
|
0
|
|
|
|
|
|
|
573
|
0
|
|
|
|
|
|
|| $class->{LogicalAnd} |
574
|
|
|
|
|
|
|
|| $class->{LogicalOr} |
575
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
576
|
0
|
|
|
|
|
|
} |
577
|
|
|
|
|
|
|
|
578
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
0
|
|
|
|
|
|
|
579
|
0
|
|
|
|
|
|
return ( $class->{RealNumber} |
580
|
|
|
|
|
|
|
|| $class->{String} |
581
|
|
|
|
|
|
|
|| $class->{ScalarVariable} |
582
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
583
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
584
|
0
|
|
|
|
|
|
|| $class->{ClassAccessor} |
585
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
586
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
587
|
0
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
588
|
|
|
|
|
|
|
} |
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
my ($class, $className) = @_; |
591
|
0
|
|
|
0
|
|
|
my @elsIfChain; |
592
|
0
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
for my $element ( @{$class->{ElsIfChain}} ) { |
594
|
0
|
|
|
|
|
|
push @elsIfChain, $element->X($className); |
595
|
0
|
0
|
|
|
|
|
} |
596
|
0
|
|
|
|
|
|
|
597
|
0
|
|
|
|
|
|
my $elsIfChain; |
598
|
|
|
|
|
|
|
foreach my $elsIf (@elsIfChain) { |
599
|
0
|
|
|
|
|
|
$elsIfChain .= $elsIf; |
600
|
|
|
|
|
|
|
} |
601
|
|
|
|
|
|
|
|
602
|
0
|
|
|
|
|
|
return $elsIfChain; |
603
|
0
|
|
|
|
|
|
} |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
my ($class, $className) = @_; |
606
|
|
|
|
|
|
|
my $boolExpression = $class->{BoolExpression}->X($className); |
607
|
0
|
|
|
0
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
608
|
|
|
|
|
|
|
|
609
|
0
|
|
|
|
|
|
my $elsIf = "\n elsif ( " . $boolExpression . " ) " . $codeBlock; |
610
|
0
|
|
|
|
|
|
return $elsIf; |
611
|
|
|
|
|
|
|
} |
612
|
0
|
|
|
|
|
|
|
613
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
614
|
|
|
|
|
|
|
my $codeBlock = $class->{CodeBlock}->X($className); |
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
my $else = "\n else " . $codeBlock; |
617
|
0
|
|
|
0
|
|
|
return $else; |
618
|
|
|
|
|
|
|
} |
619
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
my ($class, $className) = @_; |
621
|
|
|
|
|
|
|
return ( $class->{VariableDeclaration} |
622
|
|
|
|
|
|
|
|| $class->{FunctionCall} |
623
|
|
|
|
|
|
|
|| $class->{Assignment} |
624
|
|
|
|
|
|
|
|| $class->{ClassFunctionCall} |
625
|
|
|
|
|
|
|
|| $class->{Return} |
626
|
|
|
|
|
|
|
|| $class->{Last} |
627
|
|
|
|
|
|
|
|| $class->{Next} |
628
|
0
|
|
0
|
|
|
|
|| $class->{ObjectCall} )->X($className); |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
my ($class, $className) = @_; |
632
|
0
|
|
|
0
|
|
|
my $objectCall = ""; |
633
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
$objectCall .= $class->{ObjectFunctionCall}->X($className); |
635
|
|
|
|
|
|
|
$objectCall .= ";\n"; |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
return $objectCall; |
638
|
|
|
|
|
|
|
} |
639
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
my ($class, $className) = @_; |
641
|
0
|
|
0
|
|
|
|
return ( $class->{ScalarDeclaration} |
642
|
|
|
|
|
|
|
|| $class->{ArrayDeclaration} |
643
|
|
|
|
|
|
|
|| $class->{HashDeclaration} )->X($className); |
644
|
|
|
|
|
|
|
} |
645
|
0
|
|
|
0
|
|
|
|
646
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
647
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
648
|
0
|
|
|
|
|
|
my $value = $class->{Value}->X($className); |
|
0
|
|
|
|
|
|
|
649
|
0
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
my $scalarDeclaration = "\n my " . $variableName |
651
|
|
|
|
|
|
|
. " = " . $value . ";\n"; |
652
|
0
|
|
|
|
|
|
return $scalarDeclaration; |
653
|
0
|
|
|
|
|
|
} |
654
|
0
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
my ($class, $className) = @_; |
656
|
|
|
|
|
|
|
my $variableName = $class->{''}; |
657
|
0
|
|
|
|
|
|
return "\$" . $variableName; |
658
|
|
|
|
|
|
|
} |
659
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
my ($class, $className) = @_; |
661
|
0
|
|
|
0
|
|
|
my $rhs = $class->{RHS}->X($className); |
662
|
0
|
|
|
|
|
|
return $rhs; |
663
|
0
|
|
|
|
|
|
} |
664
|
|
|
|
|
|
|
|
665
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
666
|
0
|
|
|
|
|
|
my $number = $class->{''}; |
667
|
|
|
|
|
|
|
return $number; |
668
|
|
|
|
|
|
|
} |
669
|
|
|
|
|
|
|
|
670
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
671
|
0
|
|
|
|
|
|
my $realNumber = $class->{''}; |
672
|
|
|
|
|
|
|
return $realNumber; |
673
|
0
|
|
|
|
|
|
} |
674
|
0
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
my ($class, $className) = @_; |
676
|
|
|
|
|
|
|
my $stringValue = $class->{StringValue}->X($className); |
677
|
|
|
|
|
|
|
|
678
|
0
|
|
|
0
|
|
|
my $string = "\"" . $stringValue . "\""; |
679
|
|
|
|
|
|
|
} |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
my ($class, $className) = @_; |
682
|
|
|
|
|
|
|
my $stringValue = $class->{''}; |
683
|
|
|
|
|
|
|
return $stringValue; |
684
|
|
|
|
|
|
|
} |
685
|
|
|
|
|
|
|
|
686
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
687
|
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
688
|
|
|
|
|
|
|
my $arrayList = $class->{ArrayList}->X($className); |
689
|
|
|
|
|
|
|
|
690
|
0
|
|
|
0
|
|
|
my $arrayDeclaration = "\n my " . $variableName |
691
|
0
|
|
|
|
|
|
. " = " . $arrayList . ";\n"; |
692
|
|
|
|
|
|
|
|
693
|
0
|
|
|
|
|
|
return $arrayDeclaration; |
694
|
0
|
|
|
|
|
|
} |
695
|
|
|
|
|
|
|
|
696
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
697
|
|
|
|
|
|
|
my $arrayList = "["; |
698
|
|
|
|
|
|
|
my @listElements = $class->{ListElements}->X($className); |
699
|
|
|
|
|
|
|
|
700
|
0
|
|
|
0
|
|
|
$arrayList .= join(",", @listElements); |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
$arrayList .= "]"; |
703
|
0
|
|
0
|
|
|
|
return $arrayList; |
704
|
|
|
|
|
|
|
} |
705
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
my ($class, $className) = @_; |
707
|
0
|
|
|
0
|
|
|
my @listElements; |
708
|
0
|
|
|
|
|
|
|
709
|
0
|
|
|
|
|
|
for my $element ( @{ $class->{ListElement}} ) { |
710
|
|
|
|
|
|
|
push @listElements, $element->X($className); |
711
|
0
|
|
|
|
|
|
} |
712
|
|
|
|
|
|
|
|
713
|
0
|
|
|
|
|
|
return @listElements; |
714
|
|
|
|
|
|
|
} |
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
my ($class, $className) = @_; |
717
|
0
|
|
|
0
|
|
|
return ( $class->{RealNumber} |
718
|
0
|
|
|
|
|
|
|| $class->{String} |
719
|
0
|
|
|
|
|
|
|| $class->{ArrayList} |
720
|
|
|
|
|
|
|
|| $class->{HashRef} |
721
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
722
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
723
|
0
|
|
|
0
|
|
|
|| $class->{ArrayElement} |
724
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
725
|
0
|
|
|
|
|
|
|| $class->{VariableName} |
726
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
727
|
|
|
|
|
|
|
} |
728
|
|
|
|
|
|
|
|
729
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
730
|
0
|
|
|
|
|
|
my $variableName = $class->{VariableName}->X($className); |
731
|
0
|
|
|
|
|
|
my $hashRef = $class->{HashRef}->X($className); |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
my $hashDeclaration = "\n my " . $variableName |
734
|
|
|
|
|
|
|
. " = " . $hashRef . ";\n"; |
735
|
0
|
|
|
0
|
|
|
} |
736
|
0
|
|
|
|
|
|
|
737
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
738
|
|
|
|
|
|
|
my $hashRef = "{"; |
739
|
|
|
|
|
|
|
my $keyValuePairs = $class->{KeyValuePairs}->X($className); |
740
|
|
|
|
|
|
|
$hashRef .= $keyValuePairs . "}"; |
741
|
0
|
|
|
0
|
|
|
return $hashRef; |
742
|
0
|
|
|
|
|
|
} |
743
|
|
|
|
|
|
|
|
744
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
745
|
|
|
|
|
|
|
my @keyValuePairs; |
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
my $keyValuePairs = ""; |
748
|
0
|
|
|
0
|
|
|
for my $element ( @{ $class->{KeyValue}} ) { |
749
|
0
|
|
|
|
|
|
@keyValuePairs = (); |
750
|
0
|
|
|
|
|
|
push @keyValuePairs, $element->X($className); |
751
|
|
|
|
|
|
|
$keyValuePairs .= $keyValuePairs[0] . " => " . $keyValuePairs[1] . ", "; |
752
|
|
|
|
|
|
|
} |
753
|
|
|
|
|
|
|
|
754
|
0
|
|
|
0
|
|
|
return $keyValuePairs; |
755
|
0
|
|
|
|
|
|
} |
756
|
0
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
my ($class, $className) = @_; |
758
|
0
|
|
|
|
|
|
my $pairKey = $class->{PairKey}->X($className); |
759
|
|
|
|
|
|
|
my $pairValue = $class->{PairValue}->X($className); |
760
|
|
|
|
|
|
|
|
761
|
0
|
|
|
|
|
|
my @keyValue = ($pairKey, $pairValue); |
762
|
|
|
|
|
|
|
return @keyValue; |
763
|
|
|
|
|
|
|
} |
764
|
|
|
|
|
|
|
|
765
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
766
|
0
|
|
|
|
|
|
return ( $class->{Number} |
767
|
0
|
|
|
|
|
|
|| $class->{String} |
768
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
769
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} |
770
|
|
|
|
|
|
|
|| $class->{VariableName} |
771
|
0
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
772
|
0
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
my ($class, $className) = @_; |
775
|
|
|
|
|
|
|
return ( $class->{RealNumber} |
776
|
0
|
|
|
0
|
|
|
|| $class->{String} |
777
|
0
|
|
|
|
|
|
|| $class->{ArrayList} |
778
|
|
|
|
|
|
|
|| $class->{HashRef} |
779
|
0
|
|
|
|
|
|
|| $class->{VariableName} |
|
0
|
|
|
|
|
|
|
780
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
781
|
|
|
|
|
|
|
|| $class->{HashElement} |
782
|
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
783
|
0
|
|
|
|
|
|
|| $class->{FunctionReturn} |
784
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
785
|
|
|
|
|
|
|
} |
786
|
|
|
|
|
|
|
|
787
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
788
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
789
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
my $functionCall = $functionName . "(" ; |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
793
|
|
|
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
794
|
|
|
|
|
|
|
$functionCall .= join(",", @parameters); |
795
|
|
|
|
|
|
|
} |
796
|
|
|
|
|
|
|
|
797
|
0
|
|
0
|
|
|
|
$functionCall .= ");"; |
798
|
|
|
|
|
|
|
return $functionCall; |
799
|
|
|
|
|
|
|
} |
800
|
|
|
|
|
|
|
|
801
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
802
|
0
|
|
|
|
|
|
my @parameters; |
803
|
0
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
for my $element (@{ $class->{Param} }) { |
805
|
0
|
|
|
|
|
|
push @parameters, $element->X($className); |
806
|
|
|
|
|
|
|
} |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
return \@parameters; |
809
|
|
|
|
|
|
|
} |
810
|
0
|
|
|
0
|
|
|
|
811
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
812
|
0
|
|
|
|
|
|
return ( $class->{RealNumber} |
813
|
0
|
|
|
|
|
|
|| $class->{String} |
814
|
0
|
|
|
|
|
|
|| $class->{VariableName} |
815
|
|
|
|
|
|
|
|| $class->{ArrayElement} |
816
|
|
|
|
|
|
|
|| $class->{HashElement} |
817
|
|
|
|
|
|
|
|| $class->{HashRef} |
818
|
0
|
|
|
0
|
|
|
|| $class->{FunctionReturn} |
819
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
820
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
821
|
0
|
|
|
|
|
|
} |
822
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
823
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
824
|
0
|
|
|
|
|
|
return ( $class->{ScalarAssignment} |
825
|
0
|
|
|
|
|
|
|| $class->{ArrayAssignment} |
826
|
|
|
|
|
|
|
|| $class->{HashAssignment} |
827
|
|
|
|
|
|
|
|| $class->{AccessorAssignment} )->X($className); |
828
|
0
|
|
|
|
|
|
} |
829
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
my ($class, $className) = @_; |
831
|
|
|
|
|
|
|
|
832
|
0
|
|
|
0
|
|
|
my $variableName = $class->{HashKeyStringValue}->X($className); |
833
|
0
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
834
|
0
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
my $accessorAssignment = '$class->{"' . $className . '"}->{"'. $variableName .'"} = ' . $rhs .';'; |
836
|
0
|
|
|
|
|
|
return $accessorAssignment; |
837
|
0
|
|
|
|
|
|
} |
838
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
my ($class, $className) = @_; |
840
|
|
|
|
|
|
|
my $lhs = $class->{ScalarVariable}->X($className); |
841
|
0
|
|
|
0
|
|
|
my $rhs = $class->{RHS}->X($className); |
842
|
|
|
|
|
|
|
|
843
|
|
|
|
|
|
|
my $scalarAssignment = $lhs . " = " . $rhs . ";\n"; |
844
|
|
|
|
|
|
|
return $scalarAssignment; |
845
|
|
|
|
|
|
|
} |
846
|
|
|
|
|
|
|
|
847
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
848
|
|
|
|
|
|
|
my $scalarVariable = $class->{ScalarVariable}->X($className); |
849
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
return $scalarVariable; |
851
|
0
|
|
|
0
|
|
|
} |
852
|
|
|
|
|
|
|
|
853
|
|
|
|
|
|
|
my ($class, $className) = @_; |
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
my $scalarVariable = "\$"; |
856
|
|
|
|
|
|
|
$scalarVariable .= $class->{''}; |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
return $scalarVariable; |
859
|
|
|
|
|
|
|
} |
860
|
|
|
|
|
|
|
|
861
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
862
|
|
|
|
|
|
|
return ( $class->{RealNumber} |
863
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
864
|
|
|
|
|
|
|
|| $class->{ArrayElement} |
865
|
0
|
|
|
0
|
|
|
|| $class->{HashElement} |
866
|
0
|
|
|
|
|
|
|| $class->{ScalarVariable} |
867
|
|
|
|
|
|
|
|| $class->{Calc} |
868
|
0
|
|
|
|
|
|
|| $class->{ArrayList} |
869
|
|
|
|
|
|
|
|| $class->{HashRef} |
870
|
0
|
0
|
|
|
|
|
|| $class->{ClassAccessor} |
871
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
|
0
|
|
|
|
|
|
|
872
|
0
|
|
|
|
|
|
|| $class->{String} |
873
|
|
|
|
|
|
|
|| $class->{STDIN} |
874
|
|
|
|
|
|
|
|| $class->{ObjectFunctionCall} |
875
|
0
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
876
|
0
|
|
|
|
|
|
} |
877
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
my ($class, $className) = @_; |
879
|
|
|
|
|
|
|
my $stdin = '<STDIN>'; |
880
|
0
|
|
|
0
|
|
|
return $stdin; |
881
|
0
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
|
883
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
|
0
|
|
|
|
|
|
|
884
|
0
|
|
|
|
|
|
|
885
|
|
|
|
|
|
|
my $object = $class->{Object}->X($className); |
886
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
887
|
0
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
my $objectFunctionCall; |
889
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
890
|
|
|
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
891
|
0
|
|
|
0
|
|
|
my $parameters = join(",", @parameters); |
892
|
|
|
|
|
|
|
$objectFunctionCall = "\$" . $object . "->" . $functionName . "(" . $parameters . ")"; |
893
|
|
|
|
|
|
|
} else { |
894
|
|
|
|
|
|
|
$objectFunctionCall = "\$" . $object . "->" . $functionName . "()"; |
895
|
|
|
|
|
|
|
} |
896
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
return $objectFunctionCall; |
898
|
|
|
|
|
|
|
} |
899
|
|
|
|
|
|
|
|
900
|
0
|
|
0
|
|
|
|
my ($class, $className) = @_; |
901
|
|
|
|
|
|
|
my $variableName = $class->{HashKeyStringValue}->X($className); |
902
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
my $classAccessor = '$class->{"' . $className . '"}->{"'. $variableName .'"}'; |
904
|
0
|
|
|
0
|
|
|
return $classAccessor; |
905
|
|
|
|
|
|
|
} |
906
|
|
|
|
|
|
|
|
907
|
|
|
|
|
|
|
my ($class, $className) = @_; |
908
|
0
|
|
0
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
909
|
|
|
|
|
|
|
my @parameters; |
910
|
|
|
|
|
|
|
my $parameters = ""; |
911
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
912
|
0
|
|
|
0
|
|
|
@parameters = @{$class->{Parameters}->X($className)}; |
913
|
|
|
|
|
|
|
$parameters = join(",", @parameters); |
914
|
0
|
|
|
|
|
|
} |
915
|
0
|
|
|
|
|
|
|
916
|
|
|
|
|
|
|
my $classFunctionReturn = '$class->' . $functionName . '('. $parameters .');'; |
917
|
0
|
|
|
|
|
|
return $classFunctionReturn; |
918
|
0
|
|
|
|
|
|
} |
919
|
|
|
|
|
|
|
|
920
|
|
|
|
|
|
|
my ($class, $className) = @_; |
921
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
922
|
0
|
|
|
0
|
|
|
my @parameters; |
923
|
0
|
|
|
|
|
|
my $parameters = ""; |
924
|
0
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
926
|
0
|
|
|
|
|
|
@parameters = @{$class->{Parameters}->X($className)}; |
927
|
0
|
|
|
|
|
|
$parameters = join(",", @parameters); |
928
|
|
|
|
|
|
|
} |
929
|
|
|
|
|
|
|
|
930
|
|
|
|
|
|
|
my $classFunctionReturn = '$class->' . $functionName . '('. $parameters .')'; |
931
|
0
|
|
|
0
|
|
|
return $classFunctionReturn; |
932
|
0
|
|
|
|
|
|
} |
933
|
|
|
|
|
|
|
|
934
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
935
|
|
|
|
|
|
|
my $functionName = $class->{FunctionName}->X($className); |
936
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
my $functionReturn = $functionName . "(" ; |
938
|
0
|
|
|
0
|
|
|
|
939
|
|
|
|
|
|
|
if(exists $class->{Parameters}) { |
940
|
0
|
|
|
|
|
|
my @parameters = @{$class->{Parameters}->X($className)}; |
941
|
0
|
|
|
|
|
|
my $parameters = join(",", @parameters); |
942
|
|
|
|
|
|
|
$functionReturn .= $parameters; |
943
|
0
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
$functionReturn .= ")"; |
946
|
|
|
|
|
|
|
return $functionReturn; |
947
|
0
|
|
|
0
|
|
|
} |
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
my ($class, $className) = @_; |
950
|
|
|
|
|
|
|
my $arrayName = $class->{ArrayName}->X($className); |
951
|
|
|
|
|
|
|
my @accessList; |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
for my $element (@{ $class->{ArrayAccess} }) { |
954
|
|
|
|
|
|
|
push @accessList, $element->X($className); |
955
|
|
|
|
|
|
|
} |
956
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
my $arrayElement = "\$" . $arrayName; |
958
|
|
|
|
|
|
|
foreach my $element (@accessList) { |
959
|
|
|
|
|
|
|
$arrayElement .= "->[" . $element . "]"; |
960
|
|
|
|
|
|
|
} |
961
|
0
|
|
0
|
|
|
|
|
962
|
|
|
|
|
|
|
return $arrayElement; |
963
|
|
|
|
|
|
|
} |
964
|
|
|
|
|
|
|
|
965
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
966
|
0
|
|
|
|
|
|
my $number = $class->{ArrayKey}->X($className); |
967
|
0
|
|
|
|
|
|
return $number; |
968
|
|
|
|
|
|
|
} |
969
|
|
|
|
|
|
|
|
970
|
|
|
|
|
|
|
my ($class, $className) = @_; |
971
|
0
|
|
|
0
|
|
|
return ( $class->{Number} |
972
|
|
|
|
|
|
|
|| $class->{ScalarVariable} |
973
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
974
|
0
|
|
|
|
|
|
|| $class->{HashElement} |
975
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
976
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} )->X($className); |
977
|
0
|
0
|
|
|
|
|
} |
978
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
979
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
980
|
0
|
|
|
|
|
|
my $arrayName = $class->{''}; |
981
|
|
|
|
|
|
|
return $arrayName; |
982
|
0
|
|
|
|
|
|
} |
983
|
|
|
|
|
|
|
|
984
|
|
|
|
|
|
|
my ($class, $className) = @_; |
985
|
0
|
|
|
|
|
|
my $hashName = $class->{HashName}->X($className); |
986
|
|
|
|
|
|
|
my @accessList; |
987
|
|
|
|
|
|
|
|
988
|
|
|
|
|
|
|
for my $element (@{ $class->{HashAccess} }) { |
989
|
0
|
|
|
0
|
|
|
push @accessList, $element->X($className); |
990
|
0
|
|
|
|
|
|
} |
991
|
|
|
|
|
|
|
|
992
|
0
|
|
|
|
|
|
my $hashElement = "\$" . $hashName; |
993
|
0
|
|
|
|
|
|
foreach my $element (@accessList) { |
994
|
|
|
|
|
|
|
$hashElement .= "->{" . $element . "}"; |
995
|
|
|
|
|
|
|
} |
996
|
|
|
|
|
|
|
|
997
|
0
|
|
|
0
|
|
|
return $hashElement; |
998
|
0
|
|
|
|
|
|
} |
999
|
0
|
|
|
|
|
|
|
1000
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1001
|
0
|
0
|
|
|
|
|
my $hashKey = $class->{HashKey}->X($className); |
1002
|
0
|
|
|
|
|
|
return $hashKey; |
|
0
|
|
|
|
|
|
|
1003
|
0
|
|
|
|
|
|
} |
1004
|
|
|
|
|
|
|
|
1005
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1006
|
0
|
|
|
|
|
|
my $hashName = $class->{''}; |
1007
|
0
|
|
|
|
|
|
return $hashName; |
1008
|
|
|
|
|
|
|
} |
1009
|
|
|
|
|
|
|
|
1010
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1011
|
0
|
|
|
0
|
|
|
return ( $class->{String} |
1012
|
0
|
|
|
|
|
|
|| $class->{Number} |
1013
|
0
|
|
|
|
|
|
|| $class->{ScalarVariable} |
1014
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
1015
|
|
|
|
|
|
|
|| $class->{HashElement} |
1016
|
0
|
0
|
|
|
|
|
|| $class->{FunctionReturn} |
1017
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} )->X($className); |
|
0
|
|
|
|
|
|
|
1018
|
0
|
|
|
|
|
|
} |
1019
|
|
|
|
|
|
|
|
1020
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1021
|
0
|
|
|
|
|
|
|
1022
|
0
|
|
|
|
|
|
my $hashKeyStringValue = "\""; |
1023
|
|
|
|
|
|
|
$hashKeyStringValue .= $class->{HashKeyStringValue}->X($className); |
1024
|
|
|
|
|
|
|
$hashKeyStringValue .= "\""; |
1025
|
|
|
|
|
|
|
|
1026
|
0
|
|
|
0
|
|
|
return $hashKeyStringValue; |
1027
|
0
|
|
|
|
|
|
} |
1028
|
|
|
|
|
|
|
|
1029
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1030
|
|
|
|
|
|
|
my $hashKeyStringValue = $class->{''}; |
1031
|
0
|
0
|
|
|
|
|
return $hashKeyStringValue; |
1032
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
1033
|
0
|
|
|
|
|
|
|
1034
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1035
|
|
|
|
|
|
|
my $hashKeyNumber = $class->{''}; |
1036
|
|
|
|
|
|
|
return $hashKeyNumber; |
1037
|
0
|
|
|
|
|
|
} |
1038
|
0
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1040
|
|
|
|
|
|
|
my $arrayElement = $class->{ArrayElement}->X($className); |
1041
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
1042
|
0
|
|
|
0
|
|
|
|
1043
|
0
|
|
|
|
|
|
my $arrayAssignment = $arrayElement . " = " . $rhs . ";\n"; |
1044
|
0
|
|
|
|
|
|
return $arrayAssignment; |
1045
|
|
|
|
|
|
|
} |
1046
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1047
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1048
|
|
|
|
|
|
|
my $hashElement = $class->{HashElement}->X($className); |
1049
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
1050
|
0
|
|
|
|
|
|
|
1051
|
0
|
|
|
|
|
|
my $hashAssignment = $hashElement . " = " . $rhs . ";\n"; |
1052
|
0
|
|
|
|
|
|
return $hashAssignment; |
1053
|
|
|
|
|
|
|
} |
1054
|
|
|
|
|
|
|
|
1055
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1056
|
|
|
|
|
|
|
my $calcExpression = $class->{CalcExpression}->X($className); |
1057
|
|
|
|
|
|
|
return $calcExpression; |
1058
|
|
|
|
|
|
|
} |
1059
|
0
|
|
|
0
|
|
|
|
1060
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1061
|
0
|
|
|
|
|
|
my @calcOperands; |
1062
|
|
|
|
|
|
|
my @calcOperator; |
1063
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
for my $element (@{ $class->{CalcOperands} }) { |
1065
|
0
|
|
|
0
|
|
|
push @calcOperands, $element->X($className); |
1066
|
|
|
|
|
|
|
} |
1067
|
|
|
|
|
|
|
|
1068
|
|
|
|
|
|
|
for my $element (@{ $class->{CalcOperator} }) { |
1069
|
|
|
|
|
|
|
push @calcOperator, $element->X($className); |
1070
|
|
|
|
|
|
|
} |
1071
|
0
|
|
0
|
|
|
|
|
1072
|
|
|
|
|
|
|
my $calcExpression = $calcOperands[0]; |
1073
|
|
|
|
|
|
|
for my $counter (1 .. $#calcOperands) { |
1074
|
|
|
|
|
|
|
$calcExpression .= $calcOperator[$counter - 1] . " " . $calcOperands[$counter]; |
1075
|
0
|
|
|
0
|
|
|
} |
1076
|
0
|
|
|
|
|
|
|
1077
|
0
|
|
|
|
|
|
return $calcExpression; |
1078
|
|
|
|
|
|
|
} |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1081
|
0
|
|
|
0
|
|
|
return ( $class->{RealNumber} |
1082
|
0
|
|
|
|
|
|
|| $class->{ScalarVariable} |
1083
|
0
|
|
|
|
|
|
|| $class->{ArrayElement} |
1084
|
|
|
|
|
|
|
|| $class->{HashElement} |
1085
|
0
|
|
|
|
|
|
|| $class->{ClassAccessor} |
|
0
|
|
|
|
|
|
|
1086
|
0
|
|
|
|
|
|
|| $class->{ClassFunctionReturn} |
1087
|
|
|
|
|
|
|
|| $class->{FunctionReturn} |
1088
|
|
|
|
|
|
|
|| $class->{EmbedBlock} |
1089
|
0
|
|
|
|
|
|
|| $class->{ObjectFunctionCall} )->X($className); |
1090
|
0
|
|
|
|
|
|
} |
1091
|
0
|
|
|
|
|
|
|
1092
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1093
|
|
|
|
|
|
|
return ( $class->{Plus} |
1094
|
0
|
|
|
|
|
|
|| $class->{Minus} |
1095
|
|
|
|
|
|
|
|| $class->{Multiply} |
1096
|
|
|
|
|
|
|
|| $class->{Divide} |
1097
|
|
|
|
|
|
|
|| $class->{EmbedBlock} )->X($className); |
1098
|
0
|
|
|
0
|
|
|
} |
1099
|
0
|
|
|
|
|
|
|
1100
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1101
|
|
|
|
|
|
|
if(exists $class->{RHS}) { |
1102
|
|
|
|
|
|
|
my $rhs = $class->{RHS}->X($className); |
1103
|
|
|
|
|
|
|
my $return = "return " . $rhs . ";\n"; |
1104
|
0
|
|
|
0
|
|
|
return $return; |
1105
|
0
|
|
|
|
|
|
} else { |
1106
|
0
|
|
|
|
|
|
return "return;"; |
1107
|
|
|
|
|
|
|
} |
1108
|
|
|
|
|
|
|
} |
1109
|
|
|
|
|
|
|
|
1110
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
1111
|
|
|
|
|
|
|
return "last;"; |
1112
|
|
|
|
|
|
|
} |
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1115
|
|
|
|
|
|
|
return "next;"; |
1116
|
|
|
|
|
|
|
} |
1117
|
0
|
|
0
|
|
|
|
|
1118
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1119
|
|
|
|
|
|
|
my $greaterThan = $class->{''}; |
1120
|
|
|
|
|
|
|
return $greaterThan; |
1121
|
0
|
|
|
0
|
|
|
} |
1122
|
|
|
|
|
|
|
|
1123
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1124
|
0
|
|
|
|
|
|
my $lessThan = $class->{''}; |
1125
|
0
|
|
|
|
|
|
return $lessThan; |
1126
|
|
|
|
|
|
|
} |
1127
|
0
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1129
|
|
|
|
|
|
|
my $equals = $class->{''}; |
1130
|
|
|
|
|
|
|
return $equals; |
1131
|
0
|
|
|
0
|
|
|
} |
1132
|
0
|
|
|
|
|
|
|
1133
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1134
|
|
|
|
|
|
|
my $plus = $class->{''}; |
1135
|
|
|
|
|
|
|
return $plus; |
1136
|
|
|
|
|
|
|
} |
1137
|
0
|
|
|
0
|
|
|
|
1138
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1139
|
0
|
|
|
|
|
|
my $minus = $class->{''}; |
1140
|
|
|
|
|
|
|
return $minus; |
1141
|
|
|
|
|
|
|
} |
1142
|
|
|
|
|
|
|
|
1143
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
1144
|
0
|
|
|
|
|
|
my $multiply = $class->{''}; |
1145
|
0
|
|
|
|
|
|
return $multiply; |
1146
|
|
|
|
|
|
|
} |
1147
|
0
|
|
|
|
|
|
|
1148
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1149
|
|
|
|
|
|
|
my $divide = $class->{''}; |
1150
|
|
|
|
|
|
|
return $divide; |
1151
|
|
|
|
|
|
|
} |
1152
|
0
|
|
|
0
|
|
|
|
1153
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1154
|
0
|
|
|
|
|
|
my $divide = $class->{''}; |
1155
|
|
|
|
|
|
|
return $divide; |
1156
|
0
|
|
|
|
|
|
} |
1157
|
0
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1159
|
|
|
|
|
|
|
my $divide = $class->{''}; |
1160
|
|
|
|
|
|
|
return $divide; |
1161
|
0
|
|
|
0
|
|
|
} |
1162
|
0
|
|
|
|
|
|
|
1163
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1164
|
|
|
|
|
|
|
my $greaterThanEquals = $class->{''}; |
1165
|
|
|
|
|
|
|
return $greaterThanEquals; |
1166
|
|
|
|
|
|
|
} |
1167
|
0
|
|
|
0
|
|
|
|
1168
|
0
|
|
|
|
|
|
my ($class, $className) = @_; |
1169
|
|
|
|
|
|
|
my $lessThanEquals = $class->{''}; |
1170
|
|
|
|
|
|
|
return $lessThanEquals; |
1171
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
1172
|
0
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1174
|
|
|
|
|
|
|
my $stringEquals = $class->{''}; |
1175
|
0
|
|
|
|
|
|
return $stringEquals; |
|
0
|
|
|
|
|
|
|
1176
|
0
|
|
|
|
|
|
} |
1177
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1179
|
0
|
|
|
|
|
|
my $stringNotEquals = $class->{''}; |
1180
|
0
|
|
|
|
|
|
return $stringNotEquals; |
1181
|
0
|
|
|
|
|
|
} |
1182
|
|
|
|
|
|
|
|
1183
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1184
|
0
|
|
|
|
|
|
my $notEqulas = $class->{''}; |
1185
|
|
|
|
|
|
|
return $notEqulas; |
1186
|
|
|
|
|
|
|
} |
1187
|
|
|
|
|
|
|
|
1188
|
0
|
|
|
0
|
|
|
my ($class, $className) = @_; |
1189
|
|
|
|
|
|
|
my $logicalAnd = $class->{''}; |
1190
|
|
|
|
|
|
|
return $logicalAnd; |
1191
|
|
|
|
|
|
|
} |
1192
|
|
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
my ($class, $className) = @_; |
1194
|
|
|
|
|
|
|
my $logicalOr = $class->{''}; |
1195
|
|
|
|
|
|
|
return $logicalOr; |
1196
|
|
|
|
|
|
|
} |
1197
|
0
|
|
0
|
|
|
|
|
1198
|
|
|
|
|
|
|
my $parser = qr { |
1199
|
|
|
|
|
|
|
<nocontext:> |
1200
|
|
|
|
|
|
|
# <debug: on> |
1201
|
0
|
|
|
0
|
|
|
|
1202
|
|
|
|
|
|
|
<Lang> |
1203
|
|
|
|
|
|
|
<objrule: PT::Lang> <[Class]>+ |
1204
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
<objrule: PT::Class> <TokenClass> <ClassName> <ClassBlock> |
1206
|
0
|
|
0
|
|
|
|
<objrule: PT::ClassName> [a-zA-Z]+? |
1207
|
|
|
|
|
|
|
<objrule: PT::ClassBlock> <LBrace> <ClassGroups> <RBrace> |
1208
|
|
|
|
|
|
|
<objrule: PT::ClassGroups> <[Group]>+ |
1209
|
|
|
|
|
|
|
|
1210
|
0
|
|
|
0
|
|
|
<objrule: PT::Group> <ws: (\s++)*> <Comment> | <Parent> | <Packages> | <EmbedBlock> | <Function> | <NonSyntaxClass> |
1211
|
0
|
0
|
|
|
|
|
|
1212
|
0
|
|
|
|
|
|
<objtoken: PT::NonSyntaxClass> \b.*\b |
1213
|
0
|
|
|
|
|
|
|
1214
|
0
|
|
|
|
|
|
<objrule: PT::Comment> [#] <LineComment> @ |
1215
|
|
|
|
|
|
|
<objtoken: PT::LineComment> .*? |
1216
|
0
|
|
|
|
|
|
|
1217
|
|
|
|
|
|
|
<objrule: PT::Parent> <TokenParent> <LParen> <ClassNames> <RParen> <SemiColon> |
1218
|
|
|
|
|
|
|
<objrule: PT::ClassNames> <[ClassName]>+ % <Comma> |
1219
|
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
|
<objrule: PT::Packages> <LParen> <PackageList> <RParen> <SemiColon> |
1221
|
0
|
|
|
0
|
|
|
<objrule: PT::PackageList> <[Package]>+ % <Comma> |
1222
|
0
|
|
|
|
|
|
<objrule: PT::Package> <PackageWithConstructor> | <PackageWithoutConstructor> |
1223
|
|
|
|
|
|
|
<objrule: PT::PackageWithConstructor> [!] <Object> <Equal> <PackageName> <Dot> <Constructor> <LParen> <ObjectParameters>? <RParen> |
1224
|
|
|
|
|
|
|
<objrule: PT::ObjectParameters> <PackageParams> | <Parameters> |
1225
|
|
|
|
|
|
|
<objrule: PT::PackageParams> <[KeyValue]>+ % <Comma> |
1226
|
0
|
|
|
0
|
|
|
<objrule: PT::PackageName> <[PackageDir]>+ % (::) |
1227
|
0
|
|
|
|
|
|
<objrule: PT::PackageWithoutConstructor> <PackageName> <QW>? |
1228
|
|
|
|
|
|
|
<objrule: PT::QW> <Dot> <LParen> <FunctionList> <RParen> |
1229
|
|
|
|
|
|
|
<objrule: PT::FunctionList> <[FunctionName]>+ % <Comma> |
1230
|
|
|
|
|
|
|
<objrule: PT::Constructor> [a-zA-Z]+? |
1231
|
0
|
|
|
0
|
|
|
<objrule: PT::Object> [a-zA-Z]+? |
1232
|
0
|
|
|
|
|
|
<objrule: PT::PackageDir> [a-zA-Z]+? |
1233
|
0
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
<objrule: PT::Function> <TokenFunction> <FunctionName> <LParen> <FunctionParamList> <RParen> <CodeBlock> |
1235
|
|
|
|
|
|
|
<objtoken: PT::FunctionName> [a-zA-Z_]+? |
1236
|
|
|
|
|
|
|
|
1237
|
0
|
|
|
0
|
|
|
<objrule: PT::FunctionParamList> <EmptyParamList> | <FunctionParams> |
1238
|
0
|
|
|
|
|
|
<objtoken: PT::EmptyParamList> .{0} |
1239
|
0
|
|
|
|
|
|
<objrule: PT::FunctionParams> <[Arg]>+ % <Comma> |
1240
|
|
|
|
|
|
|
<objrule: PT::Arg> [a-zA-Z]+? |
1241
|
|
|
|
|
|
|
|
1242
|
|
|
|
|
|
|
<objrule: PT::CodeBlock> <LBrace> <Blocks> <RBrace> |
1243
|
0
|
|
|
0
|
|
|
<objrule: PT::Blocks> <[Block]>+ |
1244
|
0
|
|
|
|
|
|
|
1245
|
0
|
|
|
|
|
|
<objrule: PT::Block> <IfElse> | <While> | <ForEach> | <For> | <EmbedBlock> | <Comment> | <Statement> | <NonSyntaxFunction> |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
<objtoken: PT::NonSyntaxFunction> \b.*\b |
1248
|
|
|
|
|
|
|
|
1249
|
0
|
|
|
0
|
|
|
<objrule: PT::EmbedBlock> <TokenEmbedBlock> <EmbedCodeBlock> |
1250
|
0
|
|
|
|
|
|
<objrule: PT::EmbedCodeBlock> <EmbedBegin> <EmbeddedCode> <EmbedEnd> |
1251
|
0
|
|
|
|
|
|
<objrule: PT::EmbedBegin> <LParen>\? |
1252
|
|
|
|
|
|
|
<objrule: PT::EmbedEnd> \?<RParen> |
1253
|
|
|
|
|
|
|
<objrule: PT::EmbeddedCode> (?<=\(\?)\s*.*?\s*(?=\?\)) |
1254
|
|
|
|
|
|
|
|
1255
|
0
|
|
|
0
|
|
|
<objrule: PT::While> <TokenWhile> <LParen> <BoolExpression> <RParen> <CodeBlock> |
1256
|
0
|
|
|
|
|
|
<objrule: PT::ForEach> <TokenForeach> <Var> <ForEachVariableName> <LParen> <VariableName> <RParen> <CodeBlock> |
1257
|
0
|
|
|
|
|
|
<objrule: PT::ForEachVariableName> <VariableName> |
1258
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
<objrule: PT::For> <TokenFor> <Var> <VariableName> <LParen> <ForRange> <RParen> <CodeBlock> |
1260
|
|
|
|
|
|
|
<objrule: PT::ForRange> <LowerRange> <Dot><Dot><Dot> <UpperRange> |
1261
|
0
|
|
|
0
|
|
|
|
1262
|
0
|
|
|
|
|
|
<objrule: PT::LowerRange> <Number> | <VariableName> | <ArrayElement> | <HashElement> |
1263
|
0
|
|
|
|
|
|
| <ClassAccessor> | <ClassFunctionReturn> | <FunctionReturn> |
1264
|
|
|
|
|
|
|
|
1265
|
|
|
|
|
|
|
<objrule: PT::UpperRange> <Number> | <VariableName> | <ArrayElement> | <HashElement> |
1266
|
|
|
|
|
|
|
| <ClassAccessor> | <ClassFunctionReturn> | <FunctionReturn> |
1267
|
0
|
|
|
0
|
|
|
|
1268
|
0
|
|
|
|
|
|
<objrule: PT::IfElse> <If> <ElsIf>? <Else>? |
1269
|
0
|
|
|
|
|
|
<objrule: PT::If> <TokenIf> <LParen> <BoolExpression> <RParen> <CodeBlock> |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
<objrule: PT::BoolExpression> <[BooleanExpression]>+ % <[BoolOperator]> |
1272
|
|
|
|
|
|
|
<objrule: PT::BooleanExpression> <BoolOperands> <BoolOperatorExpression>? |
1273
|
0
|
|
|
0
|
|
|
<objrule: PT::BoolOperatorExpression> <BoolOperator> <BoolOperands> |
1274
|
0
|
|
|
|
|
|
|
1275
|
0
|
|
|
|
|
|
<objrule: PT::BoolOperands> <RealNumber> | <String> | <ScalarVariable> | <ArrayElement> | <HashElement> |
1276
|
|
|
|
|
|
|
| <ClassAccessor> | <ClassFunctionReturn> | <FunctionReturn> | <EmbedBlock> |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
<objrule: PT::BoolOperator> <GreaterThan> | <LessThan> | <Equals> | <GreaterThanEquals> | <LessThanEquals> |
1279
|
0
|
|
|
0
|
|
|
| <StringEquals> | <StringNotEquals> | <NotEqulas> | <LogicalAnd> | <LogicalOr> |
1280
|
0
|
|
|
|
|
|
| <EmbedBlock> |
1281
|
0
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
|
<objrule: PT::ElsIf> <[ElsIfChain]>+ |
1283
|
|
|
|
|
|
|
<objrule: PT::ElsIfChain> <TokenElsIf> <LParen> <BoolExpression> <RParen> <CodeBlock> |
1284
|
|
|
|
|
|
|
<objrule: PT::Else> <TokenElse> <CodeBlock> |
1285
|
0
|
|
|
0
|
|
|
|
1286
|
0
|
|
|
|
|
|
<objrule: PT::Statement> <VariableDeclaration> | <FunctionCall> | <ClassFunctionCall> |
1287
|
0
|
|
|
|
|
|
| <ObjectCall> | <Assignment> | <Return> | <Last> | <Next> |
1288
|
|
|
|
|
|
|
<objrule: PT::ClassFunctionCall> <TokenClass> <Dot> <FunctionName> <LParen> <Parameters>? <RParen> <SemiColon> |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
<objrule: PT::ObjectCall> <ObjectFunctionCall> <SemiColon> |
1291
|
0
|
|
|
0
|
|
|
<objrule: PT::VariableDeclaration> <ArrayDeclaration> | <HashDeclaration> | <ScalarDeclaration> |
1292
|
0
|
|
|
|
|
|
<objrule: PT::ScalarDeclaration> <Var> <VariableName> <Equal> <Value> <SemiColon> |
1293
|
0
|
|
|
|
|
|
|
1294
|
|
|
|
|
|
|
<objtoken: PT::Var> var |
1295
|
|
|
|
|
|
|
<objtoken: PT::VariableName> [a-zA-Z_]+? |
1296
|
|
|
|
|
|
|
<objrule: PT::Value> <RHS> |
1297
|
0
|
|
|
0
|
|
|
<objtoken: PT::Number> [0-9]+ |
1298
|
0
|
|
|
|
|
|
<objtoken: PT::RealNumber> [-]?[0-9]+\.?[0-9]+|[0-9]+ |
1299
|
0
|
|
|
|
|
|
<objrule: PT::String> <LQuote> <StringValue> <RQuote> |
1300
|
|
|
|
|
|
|
<objrule: PT::LQuote> <Quote> |
1301
|
|
|
|
|
|
|
<objrule: PT::RQuote> <Quote> |
1302
|
|
|
|
|
|
|
<objtoken: PT::StringValue> (?<=")\s*.*?\s*(?=") |
1303
|
0
|
|
|
0
|
|
|
|
1304
|
0
|
|
|
|
|
|
<objrule: PT::ArrayDeclaration> <Var> <VariableName> <Equal> <ArrayList> <SemiColon> |
1305
|
0
|
|
|
|
|
|
<objrule: PT::ArrayList> <LBracket> <ListElements> <RBracket> |
1306
|
|
|
|
|
|
|
<objrule: PT::ListElements> .{0} | <[ListElement]>+ % <Comma> |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
<objrule: PT::ListElement> <RealNumber> | <String> | <ClassFunctionReturn> | <FunctionReturn> |
1309
|
0
|
|
|
0
|
|
|
| <ArrayElement> | <HashElement> | <ArrayList> | <HashRef> |
1310
|
0
|
|
|
|
|
|
| <VariableName> | <EmbedBlock> |
1311
|
0
|
|
|
|
|
|
|
1312
|
|
|
|
|
|
|
<objrule: PT::HashDeclaration> <Var> <VariableName> <Equal> <HashRef> <SemiColon> |
1313
|
|
|
|
|
|
|
<objrule: PT::HashRef> <LBrace> <KeyValuePairs> <RBrace> |
1314
|
|
|
|
|
|
|
<objrule: PT::KeyValuePairs> .{0} | <[KeyValue]>+ % <Comma> |
1315
|
0
|
|
|
0
|
|
|
<objrule: PT::KeyValue> <PairKey> <Colon> <PairValue> |
1316
|
0
|
|
|
|
|
|
|
1317
|
0
|
|
|
|
|
|
<objrule: PT::PairKey> <Number> | <String> | <ClassFunctionReturn> | <FunctionReturn> |
1318
|
|
|
|
|
|
|
| <VariableName> | <EmbedBlock> |
1319
|
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
|
<objrule: PT::PairValue> <RealNumber> | <String> | <ClassFunctionReturn> | <FunctionReturn> |
1321
|
0
|
|
|
0
|
|
|
| <ArrayElement> | <HashElement> | <ArrayList> | <HashRef> |
1322
|
0
|
|
|
|
|
|
| <VariableName> | <EmbedBlock> |
1323
|
0
|
|
|
|
|
|
|
1324
|
|
|
|
|
|
|
<objrule: PT::FunctionCall> <FunctionName> <LParen> <Parameters>? <RParen> <SemiColon> |
1325
|
|
|
|
|
|
|
<objrule: PT::Parameters> <[Param]>+ % <Comma> |
1326
|
|
|
|
|
|
|
<objrule: PT::Param> <RealNumber> | <String> | <VariableName> | <ArrayElement> | <HashElement> |
1327
|
|
|
|
|
|
|
| <HashRef> | <FunctionReturn> | <ClassFunctionReturn> | <EmbedBlock> |
1328
|
|
|
|
|
|
|
|
1329
|
|
|
|
|
|
|
<objrule: PT::Assignment> <ScalarAssignment> | <ArrayAssignment> | <HashAssignment> | <AccessorAssignment> |
1330
|
|
|
|
|
|
|
|
1331
|
|
|
|
|
|
|
<objrule: PT::ScalarAssignment> <ScalarVariable> <Equal> <RHS> <SemiColon> |
1332
|
|
|
|
|
|
|
<objtoken: PT::ScalarVariable> [a-zA-Z]+ |
1333
|
|
|
|
|
|
|
|
1334
|
|
|
|
|
|
|
<objrule: PT::RHS> <RealNumber> | <FunctionReturn> | <ArrayElement> | <HashElement> |
1335
|
|
|
|
|
|
|
| <ScalarVariable> | <Calc> | <ArrayList> | <HashRef> | <ClassAccessor> |
1336
|
|
|
|
|
|
|
| <ClassFunctionReturn> | <String> | <STDIN> | <ObjectFunctionCall> |
1337
|
|
|
|
|
|
|
| <EmbedBlock> |
1338
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
<objrule: PT::FunctionReturn> <FunctionName> <LParen> <Parameters>? <RParen> |
1340
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
<objrule: PT::ArrayElement> <ArrayName> <[ArrayAccess]>+ |
1342
|
|
|
|
|
|
|
<objrule: PT::ArrayAccess> <LBracket> <ArrayKey> <RBracket> |
1343
|
|
|
|
|
|
|
<objrule: PT::ArrayKey> <Number> | <ScalarVariable> | <ArrayElement> |
1344
|
|
|
|
|
|
|
| <HashElement> | <FunctionReturn> | <ClassFunctionReturn> |
1345
|
|
|
|
|
|
|
<objrule: PT::ArrayName> [a-zA-Z]+? |
1346
|
|
|
|
|
|
|
|
1347
|
|
|
|
|
|
|
<objrule: PT::HashElement> <HashName> <[HashAccess]>+ |
1348
|
|
|
|
|
|
|
<objrule: PT::HashAccess> <LBrace> <HashKey> <RBrace> |
1349
|
|
|
|
|
|
|
<objtoken: PT::HashName> [a-zA-Z]+? |
1350
|
|
|
|
|
|
|
<objrule: PT::HashKey> <String> | <Number> | <ScalarVariable> | <ArrayElement> |
1351
|
|
|
|
|
|
|
| <HashElement> | <FunctionReturn> | <ClassFunctionReturn> |
1352
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
<objrule: PT::STDIN> <LessThan> <TokenSTDIN> <GreaterThan> |
1354
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
<objtoken: PT::HashKeyStringValue> [a-zA-Z]+? |
1356
|
|
|
|
|
|
|
<objrule: PT::AccessorAssignment> <TokenClass> <Dot> <HashKeyStringValue> <Equal> <RHS> <SemiColon> |
1357
|
|
|
|
|
|
|
<objrule: PT::ClassAccessor> <TokenClass> <Dot> <HashKeyStringValue> |
1358
|
|
|
|
|
|
|
<objrule: PT::ClassFunctionReturn> <TokenClass> <Dot> <FunctionName> <LParen> <Parameters>? <RParen> |
1359
|
|
|
|
|
|
|
|
1360
|
|
|
|
|
|
|
<objrule: PT::ArrayAssignment> <ArrayElement> <Equal> <RHS> <SemiColon> |
1361
|
|
|
|
|
|
|
<objrule: PT::HashAssignment> <HashElement> <Equal> <RHS> <SemiColon> |
1362
|
|
|
|
|
|
|
|
1363
|
|
|
|
|
|
|
<objrule: PT::Calc> <CalcExpression> |
1364
|
|
|
|
|
|
|
<objrule: PT::CalcExpression> <[CalcOperands]>+ % <[CalcOperator]> |
1365
|
|
|
|
|
|
|
<objrule: PT::CalcOperands> <RealNumber> | <ScalarVariable> | <ArrayElement> | <HashElement> | <ClassAccessor> |
1366
|
|
|
|
|
|
|
| <ClassFunctionReturn> | <FunctionReturn> | <EmbedBlock> | <ObjectFunctionCall> |
1367
|
|
|
|
|
|
|
|
1368
|
|
|
|
|
|
|
<objtoken: PT::CalcOperator> <Plus> | <Minus> | <Multiply> | <Divide> | <Modulus> | <Exponent> | <EmbedBlock> |
1369
|
|
|
|
|
|
|
|
1370
|
|
|
|
|
|
|
<objrule: PT::Return> <TokenReturn> <RHS>? <SemiColon> |
1371
|
|
|
|
|
|
|
<objrule: PT::Last> <TokenLast> <SemiColon> |
1372
|
|
|
|
|
|
|
<objrule: PT::Next> <TokenNext> <SemiColon> |
1373
|
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
<objtoken: PT::TokenReturn> return |
1375
|
|
|
|
|
|
|
<objtoken: PT::TokenNext> next |
1376
|
|
|
|
|
|
|
<objtoken: PT::TokenLast> last |
1377
|
|
|
|
|
|
|
<objtoken: PT::TokenElse> else |
1378
|
|
|
|
|
|
|
<objtoken: PT::TokenElsIf> elsif |
1379
|
|
|
|
|
|
|
<objtoken: PT::TokenIf> if |
1380
|
|
|
|
|
|
|
<objtoken: PT::TokenFor> for |
1381
|
|
|
|
|
|
|
<objtoken: PT::TokenForeach> foreach |
1382
|
|
|
|
|
|
|
<objtoken: PT::TokenWhile> while |
1383
|
|
|
|
|
|
|
<objtoken: PT::TokenFunction> function |
1384
|
|
|
|
|
|
|
<objtoken: PT::TokenParent> parent |
1385
|
|
|
|
|
|
|
<objtoken: PT::TokenClass> class |
1386
|
|
|
|
|
|
|
<objtoken: PT::TokenEmbedBlock> embed |
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
<objtoken: PT::TokenSTDIN> STDIN |
1389
|
|
|
|
|
|
|
|
1390
|
|
|
|
|
|
|
<objrule: PT::ObjectFunctionCall> [!] <Object> <Dot> <FunctionName> <LParen> <Parameters>? <RParen> |
1391
|
|
|
|
|
|
|
|
1392
|
|
|
|
|
|
|
<objtoken: PT::Modulus> \% |
1393
|
|
|
|
|
|
|
<objtoken: PT::Exponent> \*\* |
1394
|
|
|
|
|
|
|
<objtoken: PT::LogicalAnd> \&\& |
1395
|
|
|
|
|
|
|
<objtoken: PT::LogicalOr> \|\| |
1396
|
|
|
|
|
|
|
<objtoken: PT::NotEqulas> \!= |
1397
|
|
|
|
|
|
|
<objtoken: PT::StringNotEquals> ne |
1398
|
|
|
|
|
|
|
<objtoken: PT::StringEquals> eq |
1399
|
|
|
|
|
|
|
<objtoken: PT::LessThanEquals> \<= |
1400
|
|
|
|
|
|
|
<objtoken: PT::GreaterThanEquals> \>= |
1401
|
|
|
|
|
|
|
<objtoken: PT::GreaterThan> \> |
1402
|
|
|
|
|
|
|
<objtoken: PT::LessThan> \< |
1403
|
|
|
|
|
|
|
<objtoken: PT::Equals> == |
1404
|
|
|
|
|
|
|
<objtoken: PT::Plus> \+ |
1405
|
|
|
|
|
|
|
<objtoken: PT::Minus> \- |
1406
|
|
|
|
|
|
|
<objtoken: PT::Multiply> \* |
1407
|
|
|
|
|
|
|
<objtoken: PT::Divide> \/ |
1408
|
|
|
|
|
|
|
<objtoken: PT::Quote> " |
1409
|
|
|
|
|
|
|
<objtoken: PT::SemiColon> ; |
1410
|
|
|
|
|
|
|
<objtoken: PT::Colon> : |
1411
|
|
|
|
|
|
|
<objtoken: PT::Dot> \. |
1412
|
|
|
|
|
|
|
<objtoken: PT::Equal> = |
1413
|
|
|
|
|
|
|
<objtoken: PT::Comma> , |
1414
|
|
|
|
|
|
|
<objtoken: PT::LParen> \( |
1415
|
|
|
|
|
|
|
<objtoken: PT::RParen> \) |
1416
|
|
|
|
|
|
|
<objtoken: PT::LBrace> \{ |
1417
|
|
|
|
|
|
|
<objtoken: PT::RBrace> \} |
1418
|
|
|
|
|
|
|
<objtoken: PT::LBracket> \[ |
1419
|
|
|
|
|
|
|
<objtoken: PT::RBracket> \] |
1420
|
|
|
|
|
|
|
}xms; |
1421
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
my ($class, $program) = @_; |
1423
|
|
|
|
|
|
|
if($program =~ $parser) { |
1424
|
|
|
|
|
|
|
my $code = $/{Lang}->X(); |
1425
|
|
|
|
|
|
|
return $code; |
1426
|
|
|
|
|
|
|
} else { |
1427
|
|
|
|
|
|
|
my $notMatch = "print 'Error';"; |
1428
|
|
|
|
|
|
|
return $notMatch; |
1429
|
|
|
|
|
|
|
} |
1430
|
|
|
|
|
|
|
} |
1431
|
|
|
|
|
|
|
|
1432
|
|
|
|
|
|
|
1; |
1433
|
|
|
|
|
|
|
|
1434
|
|
|
|
|
|
|
|
1435
|
|
|
|
|
|
|
=head1 NAME |
1436
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
Lang::HL HL programming language. |
1438
|
|
|
|
|
|
|
|
1439
|
|
|
|
|
|
|
=head1 SYNOPSIS |
1440
|
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
|
$> hlc <directoryName> |
1442
|
|
|
|
|
|
|
$> hlp <directoryName> |
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
=head1 DESCRIPTION |
1445
|
|
|
|
|
|
|
|
1446
|
|
|
|
|
|
|
HL is a programming language. |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
=head1 EXAMPLE |
1449
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
class Main { |
1451
|
|
|
|
|
|
|
(JSON, |
1452
|
|
|
|
|
|
|
!mechanize = WWW::Mechanize.new()); |
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
function main() { |
1455
|
|
|
|
|
|
|
class.counter = 0; |
1456
|
|
|
|
|
|
|
|
1457
|
|
|
|
|
|
|
var hash = class.returnNumber(); |
1458
|
|
|
|
|
|
|
var json = encode_json(hash); |
1459
|
|
|
|
|
|
|
print(json, "\n"); |
1460
|
|
|
|
|
|
|
|
1461
|
|
|
|
|
|
|
var url = "https://metacpan.org/pod/WWW::Mechanize"; |
1462
|
|
|
|
|
|
|
!mechanize.get(url); |
1463
|
|
|
|
|
|
|
var page = !mechanize.text(); |
1464
|
|
|
|
|
|
|
print(page, "\n"); |
1465
|
|
|
|
|
|
|
} |
1466
|
|
|
|
|
|
|
|
1467
|
|
|
|
|
|
|
function returnNumber() { |
1468
|
|
|
|
|
|
|
var number = {}; |
1469
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
if(class.counter < 10) { |
1471
|
|
|
|
|
|
|
class.counter = class.counter + 1; |
1472
|
|
|
|
|
|
|
|
1473
|
|
|
|
|
|
|
number = { "number" : class.returnNumber() }; |
1474
|
|
|
|
|
|
|
return number; |
1475
|
|
|
|
|
|
|
} |
1476
|
|
|
|
|
|
|
|
1477
|
|
|
|
|
|
|
return class.counter; |
1478
|
|
|
|
|
|
|
} |
1479
|
|
|
|
|
|
|
} |
1480
|
|
|
|
|
|
|
|
1481
|
|
|
|
|
|
|
=head1 AUTHOR |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
Rajkumar Reddy |
1484
|
|
|
|
|
|
|
|
1485
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
1486
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
Copyright (C) 2022 by Rajkumar Reddy. All rights reserved. |
1488
|
|
|
|
|
|
|
|
1489
|
|
|
|
|
|
|
|
1490
|
|
|
|
|
|
|
=cut |