1 |
wakaba |
1.1 |
Module: |
2 |
|
|
@QName: |
3 |
|
|
Util:PerlCode |
4 |
|
|
@FullName: |
5 |
|
|
@@lang: en |
6 |
|
|
@@@: |
7 |
|
|
Perl Code Constructor |
8 |
|
|
@Namespace: |
9 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/PerlCode# |
10 |
|
|
|
11 |
|
|
@Description: |
12 |
|
|
@@lang:en |
13 |
|
|
@@@: |
14 |
|
|
This module provides an object-oriented interface to construct |
15 |
|
|
Perl code. |
16 |
|
|
|
17 |
wakaba |
1.30 |
@DISCore:author: DISCore|Wakaba |
18 |
wakaba |
1.1 |
@License: |
19 |
|
|
@@@: |
20 |
|
|
license:Perl+MPL |
21 |
|
|
@@Original: |
22 |
|
|
@@@FullName: |
23 |
|
|
manakai <CODE::lib/manakai/genlib.pl> |
24 |
|
|
@@@Year:2004 |
25 |
wakaba |
1.30 |
@@@DISCore:author: DISCore|Wakaba |
26 |
wakaba |
1.1 |
@Date: |
27 |
|
|
@@@: |
28 |
wakaba |
1.35 |
$Date: 2005/10/08 15:05:46 $ |
29 |
wakaba |
1.1 |
@@ContentType: |
30 |
|
|
dis:Date.RCS |
31 |
|
|
|
32 |
|
|
@Require: |
33 |
|
|
@@Module: |
34 |
wakaba |
1.35 |
@@@QName: MDOM|DOMCore |
35 |
|
|
@@@WithFor: ManakaiDOM|ManakaiDOMLatest |
36 |
wakaba |
1.1 |
|
37 |
wakaba |
1.35 |
@DefaultFor: ManakaiDOM|ManakaiDOMLatest |
38 |
wakaba |
1.1 |
|
39 |
|
|
Namespace: |
40 |
|
|
@DIS: |
41 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS# |
42 |
|
|
@dis: |
43 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis-- |
44 |
|
|
@dis2pm: |
45 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/11/8/dis2pm# |
46 |
|
|
@DISlib: |
47 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/ |
48 |
|
|
@DOMCore: |
49 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core# |
50 |
|
|
@DOMLS: |
51 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/ls# |
52 |
|
|
@DOMMain: |
53 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/main# |
54 |
wakaba |
1.24 |
@DOMMetaImpl: |
55 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/meta# |
56 |
wakaba |
1.20 |
@dx: |
57 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException# |
58 |
wakaba |
1.33 |
@ecore: |
59 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/ |
60 |
|
|
@f: |
61 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/feature# |
62 |
|
|
@idl: |
63 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/IDL# |
64 |
wakaba |
1.1 |
@infoset: |
65 |
|
|
http://www.w3.org/2001/04/infoset# |
66 |
wakaba |
1.25 |
@kwd: |
67 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/rfc2119/ |
68 |
wakaba |
1.1 |
@lang: |
69 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/lang# |
70 |
|
|
@license: |
71 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/license# |
72 |
|
|
@ManakaiDOM: |
73 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom# |
74 |
|
|
@Markup: |
75 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup# |
76 |
wakaba |
1.5 |
@MDOM: |
77 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM. |
78 |
wakaba |
1.1 |
@MDOMX: |
79 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception# |
80 |
wakaba |
1.30 |
@mn: |
81 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode# |
82 |
wakaba |
1.1 |
@owl: |
83 |
|
|
http://www.w3.org/2002/07/owl# |
84 |
|
|
@pc: |
85 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/PerlCode# |
86 |
|
|
@Perl: |
87 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl-- |
88 |
|
|
@rdf: |
89 |
|
|
http://www.w3.org/1999/02/22-rdf-syntax-ns# |
90 |
|
|
@rdfs: |
91 |
|
|
http://www.w3.org/2000/01/rdf-schema# |
92 |
wakaba |
1.35 |
@s: |
93 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/Markup# |
94 |
wakaba |
1.1 |
@swcfg21: |
95 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/swcfg21# |
96 |
|
|
@TreeCore:\ |
97 |
|
|
@Util: |
98 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ |
99 |
|
|
|
100 |
wakaba |
1.35 |
## -- Module sets |
101 |
|
|
|
102 |
|
|
ResourceDef: |
103 |
|
|
@QName: Util| |
104 |
|
|
@For: ManakaiDOM|DOM |
105 |
|
|
@rdf:type: dis|ModuleGroup |
106 |
|
|
@FullName: |
107 |
|
|
@@lang:en |
108 |
|
|
@@@: |
109 |
|
|
Manakai support modules |
110 |
|
|
@DISPerl:packageName: |
111 |
|
|
Message::Util:: |
112 |
|
|
@DISPerl:interfacePackageName: |
113 |
|
|
@@@: |
114 |
|
|
Message::Util::IF:: |
115 |
|
|
@@For: ManakaiDOM|ManakaiDOM !ManakaiDOM|ManakaiDOMLatest |
116 |
|
|
@DISPerl:interfacePackageName: |
117 |
|
|
@@@: |
118 |
|
|
Message::Util::IFLatest:: |
119 |
|
|
@@For: ManakaiDOM|ManakaiDOMLatest |
120 |
|
|
@ImplNote: |
121 |
|
|
@@lang:en |
122 |
|
|
@@@: |
123 |
|
|
Resources <Q::Util|> for <Q::ManakaiDOM|all> and for <Q::ManakaiDOM|Perl> |
124 |
|
|
is defined in module <Module::Util|ManakaiNode>. |
125 |
|
|
|
126 |
wakaba |
1.1 |
## -- Features |
127 |
|
|
|
128 |
|
|
ElementTypeBinding: |
129 |
|
|
@Name: FeatureDef |
130 |
|
|
@ElementType: |
131 |
|
|
dis:ResourceDef |
132 |
|
|
@ShadowContent: |
133 |
wakaba |
1.29 |
@@rdf:type: DOMFeature|Feature |
134 |
wakaba |
1.27 |
@@For: =ManakaiDOM|all |
135 |
wakaba |
1.1 |
|
136 |
|
|
ElementTypeBinding: |
137 |
|
|
@Name: FeatureVerDef |
138 |
|
|
@ElementType: |
139 |
|
|
dis:ResourceDef |
140 |
|
|
@ShadowContent: |
141 |
wakaba |
1.29 |
@@rdf:type: DOMFeature|Feature |
142 |
wakaba |
1.1 |
|
143 |
|
|
ElementTypeBinding: |
144 |
|
|
@Name: featureQName |
145 |
|
|
@ElementType: |
146 |
wakaba |
1.29 |
DOMFeature:name |
147 |
wakaba |
1.1 |
@ShadowContent: |
148 |
wakaba |
1.29 |
@@ContentType: DISCore|QName |
149 |
wakaba |
1.1 |
|
150 |
|
|
FeatureDef: |
151 |
|
|
@QName: CoreFeature |
152 |
|
|
@featureQName: |
153 |
|
|
Util:PerlCode |
154 |
|
|
@FeatureVerDef: |
155 |
|
|
@@QName: CoreFeature10 |
156 |
|
|
@@Version: 1.0 |
157 |
|
|
@@ISA: CoreFeature |
158 |
|
|
@@FullName: |
159 |
|
|
@@@lang:en |
160 |
|
|
@@@@: |
161 |
|
|
Perl Code Constructor, version 1.0 |
162 |
|
|
@@Description: |
163 |
|
|
@@@lang:en |
164 |
|
|
@@@@: |
165 |
|
|
Perl Code Constructor, version 1.0. |
166 |
|
|
|
167 |
wakaba |
1.25 |
ElementTypeBinding: |
168 |
|
|
@Name: IFClsDef |
169 |
|
|
@ElementType: |
170 |
|
|
dis:ResourceDef |
171 |
|
|
@ShadowContent: |
172 |
|
|
@@rdf:type: |
173 |
|
|
@@@@: dis|MultipleResource |
174 |
|
|
@@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass |
175 |
|
|
@@resourceFor: ManakaiDOM|ForIF |
176 |
wakaba |
1.35 |
@@resourceFor: pc|ForClassCompat |
177 |
|
|
@@resourceFor: pc|ForClass |
178 |
|
|
@@For: ManakaiDOM|Perl |
179 |
|
|
|
180 |
|
|
@@rdf:type: |
181 |
|
|
@@@@: DISLang|Interface |
182 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
183 |
|
|
|
184 |
|
|
@@rdf:type: |
185 |
|
|
@@@@: DISLang|Class |
186 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
187 |
|
|
@@Implement: |
188 |
|
|
@@@@: ||ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF |
189 |
|
|
@@@ContentType: DISCore|TFPQNames |
190 |
|
|
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOM |
191 |
|
|
@@Implement: |
192 |
|
|
@@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF |
193 |
|
|
@@@ContentType: DISCore|TFPQNames |
194 |
|
|
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest |
195 |
|
|
|
196 |
|
|
@@f:implements: pc|CoreFeature10 |
197 |
|
|
|
198 |
|
|
ForDef: |
199 |
|
|
@QName: pc|ForClassCompat |
200 |
|
|
@ISA: ManakaiDOM|ForClass |
201 |
|
|
|
202 |
|
|
ForDef: |
203 |
|
|
@QName: pc|ForClass |
204 |
|
|
@ISA: ManakaiDOM|ForClass |
205 |
|
|
|
206 |
|
|
ElementTypeBinding: |
207 |
|
|
@Name: IFClsETDef |
208 |
|
|
@ElementType: |
209 |
|
|
dis:ResourceDef |
210 |
|
|
@ShadowContent: |
211 |
|
|
@@rdf:type: |
212 |
|
|
@@@@: dis|MultipleResource |
213 |
|
|
@@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass !s|ForML |
214 |
|
|
@@resourceFor: ManakaiDOM|ForIF |
215 |
|
|
@@resourceFor: pc|ForClassCompat |
216 |
|
|
@@resourceFor: pc|ForClass |
217 |
|
|
@@resourceFor: s|ForML |
218 |
wakaba |
1.25 |
@@For: ManakaiDOM|Perl |
219 |
|
|
|
220 |
|
|
@@rdf:type: |
221 |
wakaba |
1.35 |
@@@@: DISLang|Interface |
222 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
223 |
|
|
@@s:elementType: |
224 |
|
|
@@@@: ||+||s|ForML |
225 |
wakaba |
1.25 |
@@@ForCheck: ManakaiDOM|ForIF |
226 |
wakaba |
1.35 |
@@@ContentType: DISCore|TFPQNames |
227 |
wakaba |
1.25 |
|
228 |
|
|
@@rdf:type: |
229 |
wakaba |
1.35 |
@@@@: DISLang|Class |
230 |
wakaba |
1.25 |
@@@ForCheck: ManakaiDOM|ForClass |
231 |
|
|
@@Implement: |
232 |
wakaba |
1.35 |
@@@@: ||ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF |
233 |
|
|
@@@ContentType: DISCore|TFPQNames |
234 |
|
|
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOM |
235 |
|
|
@@Implement: |
236 |
|
|
@@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF |
237 |
wakaba |
1.25 |
@@@ContentType: DISCore|TFPQNames |
238 |
wakaba |
1.35 |
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest |
239 |
|
|
@@s:elementType: |
240 |
|
|
@@@@: ||+||s|ForML |
241 |
|
|
@@@ForCheck: pc|ForClass |
242 |
|
|
@@@ContentType: DISCore|TFPQNames |
243 |
|
|
@@@DISCore:stopISARecursive:1 |
244 |
|
|
|
245 |
|
|
@@rdf:type: |
246 |
|
|
@@@@: s|ElementType |
247 |
|
|
@@@ForCheck: s|ForML |
248 |
wakaba |
1.25 |
|
249 |
wakaba |
1.35 |
@@f:implements: pc|CoreFeature10 |
250 |
wakaba |
1.25 |
|
251 |
|
|
ElementTypeBinding: |
252 |
|
|
@Name: ClsDef |
253 |
|
|
@ElementType: |
254 |
|
|
dis:ResourceDef |
255 |
|
|
@ShadowContent: |
256 |
|
|
@@rdf:type: |
257 |
|
|
@@@@: dis|MultipleResource |
258 |
|
|
@@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass |
259 |
|
|
|
260 |
|
|
@@resourceFor: ManakaiDOM|ForClass |
261 |
|
|
@@For: ManakaiDOM|Perl |
262 |
|
|
|
263 |
|
|
@@rdf:type: |
264 |
|
|
@@@@: ManakaiDOM|Class |
265 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
266 |
|
|
|
267 |
|
|
@@DOMMain:implementFeature: CoreFeature10 |
268 |
|
|
|
269 |
|
|
ElementTypeBinding: |
270 |
|
|
@Name: caType |
271 |
|
|
@ElementType: |
272 |
|
|
dis:actualType |
273 |
|
|
@ShadowContent: |
274 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
275 |
|
|
|
276 |
|
|
ElementTypeBinding: |
277 |
|
|
@Name: IFQName |
278 |
|
|
@ElementType: |
279 |
|
|
dis:QName |
280 |
|
|
@ShadowContent: |
281 |
|
|
@@ForCheck: ManakaiDOM|ForIF |
282 |
|
|
|
283 |
|
|
ElementTypeBinding: |
284 |
|
|
@Name: ClsQName |
285 |
|
|
@ElementType: |
286 |
|
|
dis:QName |
287 |
|
|
@ShadowContent: |
288 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
289 |
|
|
|
290 |
|
|
ElementTypeBinding: |
291 |
|
|
@Name: CQName |
292 |
|
|
@ElementType: |
293 |
|
|
dis:QName |
294 |
|
|
@ShadowContent: |
295 |
|
|
@@ForCheck: pc|ForClass |
296 |
wakaba |
1.25 |
|
297 |
|
|
ElementTypeBinding: |
298 |
|
|
@Name: IFISA |
299 |
|
|
@ElementType: |
300 |
|
|
dis:ISA |
301 |
|
|
@ShadowContent: |
302 |
|
|
@@ForCheck: ManakaiDOM|ForIF |
303 |
|
|
|
304 |
|
|
ElementTypeBinding: |
305 |
|
|
@Name: ClsISA |
306 |
|
|
@ElementType: |
307 |
|
|
dis:ISA |
308 |
|
|
@ShadowContent: |
309 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
310 |
|
|
|
311 |
|
|
ElementTypeBinding: |
312 |
|
|
@Name: CISA |
313 |
|
|
@ElementType: |
314 |
|
|
dis:ISA |
315 |
|
|
@ShadowContent: |
316 |
|
|
@@ForCheck: pc|ForClass |
317 |
wakaba |
1.25 |
|
318 |
wakaba |
1.1 |
## -- Classes |
319 |
|
|
|
320 |
wakaba |
1.25 |
IFClsDef: |
321 |
|
|
@IFQName: PerlCode |
322 |
wakaba |
1.1 |
@ClsQName: ManakaiPerlCodeFragment |
323 |
wakaba |
1.35 |
@CQName: ManakaiPCCode |
324 |
wakaba |
1.25 |
|
325 |
wakaba |
1.1 |
@ClsISA: |
326 |
|
|
ManakaiDOM:ManakaiDOMNodeReference::ManakaiDOM:Perl |
327 |
wakaba |
1.35 |
@CISA: DOMCore|ManakaiDOMElement |
328 |
wakaba |
1.20 |
@ClsISA: |
329 |
|
|
dx:ManakaiDefaultExceptionHandler::ManakaiDOM:Perl |
330 |
wakaba |
1.25 |
|
331 |
wakaba |
1.1 |
@enDesc: |
332 |
|
|
A class on which another Perl code classes are constructed based. |
333 |
|
|
|
334 |
|
|
@Attr: |
335 |
wakaba |
1.35 |
@@ForCheck: !pc|ForClass |
336 |
wakaba |
1.1 |
@@Name: parentNode |
337 |
|
|
@@enDesc: |
338 |
|
|
The parent construction of this object. |
339 |
|
|
@@Get: |
340 |
wakaba |
1.25 |
@@@Type: PerlCode |
341 |
|
|
@@@caType: ManakaiPerlCodeFragment |
342 |
wakaba |
1.5 |
@@@nullCase: |
343 |
|
|
@@@@enDesc: |
344 |
|
|
This object has no parent. |
345 |
wakaba |
1.1 |
@@@PerlDef: |
346 |
wakaba |
1.30 |
$r = $self->{<H::mn:node>}->{<H::pc:parent>}; |
347 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($r) if $r; |
348 |
|
|
|
349 |
|
|
@Attr: |
350 |
|
|
@@Name: fileNode |
351 |
|
|
@@enDesc: |
352 |
|
|
The root <QUOTE::file> node of the tree to which this node belongs. |
353 |
wakaba |
1.25 |
@@Type: PerlCode |
354 |
wakaba |
1.6 |
@@Get: |
355 |
|
|
@@@enDesc: |
356 |
|
|
The <QUOTE::file> node of the tree. |
357 |
|
|
@@@nullCase: |
358 |
|
|
@@@@enDesc: |
359 |
|
|
This node does not belong to any file tree. |
360 |
|
|
@@@PerlDef: |
361 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
362 |
|
|
@@@@@: |
363 |
wakaba |
1.30 |
$r = $self->{<H::mn:node>}->{<H::pc:parent>}; |
364 |
wakaba |
1.6 |
{ |
365 |
wakaba |
1.30 |
if ($r->{<H::pc:parent>}) { |
366 |
|
|
$r = $r->{<H::pc:parent>}; |
367 |
wakaba |
1.6 |
redo; |
368 |
|
|
} |
369 |
|
|
}; |
370 |
|
|
if ($r) { |
371 |
wakaba |
1.30 |
if ($r->{<H::pc:nodeType>} eq 'file') { |
372 |
wakaba |
1.6 |
__DEEP{ |
373 |
|
|
$r = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($r); |
374 |
|
|
}__; |
375 |
|
|
} else { |
376 |
|
|
$r = null; |
377 |
|
|
} |
378 |
wakaba |
1.30 |
} elsif ($self->{<H::mn:node>}->{<H::pc:nodeType>} eq 'file') { |
379 |
wakaba |
1.6 |
$r = $self; |
380 |
|
|
} |
381 |
wakaba |
1.35 |
@@@PerlDef: |
382 |
|
|
@@@@ForCheck: pc|ForClass |
383 |
|
|
@@@@@: |
384 |
|
|
__DEEP{ |
385 |
|
|
$r = $self-><AG::Node.ownerDocument> |
386 |
|
|
-><AG::Document.documentElement>; |
387 |
|
|
if ($r) { |
388 |
|
|
unless (defined $r-><AG::Node.namespaceURI> and |
389 |
|
|
$r-><AG::Node.namespaceURI> eq <Q::pc:> and |
390 |
|
|
$r-><AG::Node.localName> eq 'file') { |
391 |
|
|
$r = null; |
392 |
|
|
} |
393 |
|
|
} |
394 |
|
|
}__; |
395 |
wakaba |
1.6 |
|
396 |
|
|
@IntMethod: |
397 |
wakaba |
1.35 |
@@ForCheck: !pc|ForClass |
398 |
wakaba |
1.6 |
@@Name: getNodeReference |
399 |
|
|
@@ManakaiDOM:isStatic:1 |
400 |
|
|
@@enDesc: |
401 |
|
|
Gets a node reference for a node object. |
402 |
|
|
@@Param: |
403 |
|
|
@@@Name: object |
404 |
|
|
@@@Type: |
405 |
|
|
ManakaiDOM:ManakaiDOMNodeReference::ManakaiDOM:Perl |
406 |
|
|
@@@enDesc: |
407 |
|
|
A node object. |
408 |
|
|
@@Return: |
409 |
|
|
@@@Type: |
410 |
|
|
ManakaiDOM:ManakaiDOMNodeReference::ManakaiDOM:Perl |
411 |
|
|
@@@PerlDef: |
412 |
wakaba |
1.30 |
my $nt = $object->{<H::pc:nodeType>}; |
413 |
wakaba |
1.6 |
my $pack; |
414 |
wakaba |
1.9 |
__CODE{pc:nodeTypeToPackageName:: |
415 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $object}__; |
416 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
417 |
wakaba |
1.6 |
$object => $object, $ref => $r, $class => $pack}__; |
418 |
|
|
|
419 |
|
|
@Method: |
420 |
|
|
@@Name: replaceVariable |
421 |
|
|
@@enDesc: |
422 |
|
|
Replaces a variable. |
423 |
|
|
\ |
424 |
|
|
{NOTE:: For objects of type <Class::ManakaiPerlFile>, |
425 |
wakaba |
1.11 |
<Class::ManakaiPerlPackageScope>, |
426 |
|
|
<Class::ManakaiPerlSub> and |
427 |
|
|
<Class::ManakaiPerlVariable>, the result is undefined. |
428 |
wakaba |
1.6 |
\ |
429 |
|
|
} |
430 |
|
|
@@Param: |
431 |
|
|
@@@Name: originalVariable |
432 |
|
|
@@@Type: |
433 |
|
|
lang:Perl::ManakaiDOM:all |
434 |
|
|
@@@enDesc: |
435 |
|
|
Original variable specification, including prefix. |
436 |
|
|
\ |
437 |
|
|
{NOTE:: Qualified name variable and hash key is not supported. |
438 |
|
|
\ |
439 |
|
|
} |
440 |
|
|
@@Param: |
441 |
|
|
@@@Name: newValue |
442 |
wakaba |
1.11 |
@@@Type: |
443 |
|
|
DOMMain:any::ManakaiDOM:all |
444 |
wakaba |
1.6 |
@@@enDesc: |
445 |
|
|
New value to replace. |
446 |
wakaba |
1.11 |
@@@InCase: |
447 |
wakaba |
1.25 |
@@@@Type: PerlCode |
448 |
|
|
@@@@caType: ManakaiPerlCodeFragment |
449 |
wakaba |
1.11 |
@@@@enDesc: |
450 |
|
|
New Perl code fragment to replace by. |
451 |
|
|
@@@InCase: |
452 |
|
|
@@@@Type: |
453 |
|
|
lang:Perl::ManakaiDOM:all |
454 |
|
|
@@@@enDesc: |
455 |
|
|
Inline Perl code fragment string to replace by. |
456 |
wakaba |
1.6 |
@@Return: |
457 |
|
|
@@@PerlDef: |
458 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
459 |
|
|
@@@@@: |
460 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
461 |
|
|
if ($node->{<H::pc:nodeType>} eq 'unparsed' or |
462 |
|
|
$node->{<H::pc:nodeType>} eq 'inunparsed') { |
463 |
wakaba |
1.11 |
my $newVariable = ref $newValue ? $newValue->stringify : ''.$newValue; |
464 |
wakaba |
1.30 |
$node->{<H::pc:code>} =~ s/\Q$originalVariable\E\b/$newVariable/g; |
465 |
|
|
} elsif ($node->{<H::pc:childNodes>}) { |
466 |
wakaba |
1.6 |
__DEEP{ |
467 |
wakaba |
1.30 |
for my $cnoi (0..$#{$node->{<H::pc:childNodes>}}) { |
468 |
|
|
my $cno = $node->{<H::pc:childNodes>}->[$cnoi]; |
469 |
|
|
if ($cno->{<H::pc:nodeType>} eq 'variable') { |
470 |
wakaba |
1.11 |
if (substr ($originalVariable, 0, 1) |
471 |
wakaba |
1.30 |
eq $cno->{<H::pc:variableType>} and |
472 |
|
|
not $cno->{<H::pc:packageName>} and |
473 |
wakaba |
1.11 |
substr ($originalVariable, 1) |
474 |
wakaba |
1.30 |
eq $cno->{<H::pc:localName>} and |
475 |
|
|
not $cno->{<H::pc:hashKey>}) { |
476 |
wakaba |
1.11 |
if (ref $newValue) { |
477 |
wakaba |
1.30 |
CORE::delete $cno->{<H::pc:parent>}; |
478 |
wakaba |
1.11 |
$cno-><M::ManakaiDOM:ManakaiDOMNodeObject |
479 |
|
|
::ManakaiDOM:Perl.orphanate>; |
480 |
wakaba |
1.30 |
my $newnode = $newValue->{<H::mn:node>}; |
481 |
wakaba |
1.11 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
482 |
|
|
::ManakaiDOM:Perl.importTree> ($newnode); |
483 |
wakaba |
1.30 |
$newnode->{<H::pc:parent>} = $node; |
484 |
|
|
$node->{<H::pc:childNodes>}->[$cnoi] = $newnode; |
485 |
wakaba |
1.11 |
} else { |
486 |
|
|
my $cn; |
487 |
wakaba |
1.35 |
__CODE{ManakaiNode:getWeakReference||ManakaiDOM|Perl:: |
488 |
wakaba |
1.11 |
$object => $cno, $ref => $cn, |
489 |
|
|
$class => {<ClassName::ManakaiPerlCodeFragment>}, |
490 |
|
|
}__; |
491 |
|
|
$cn-><M::ManakaiPerlInlineContainer.appendCode> |
492 |
|
|
($newValue); |
493 |
|
|
} |
494 |
|
|
} |
495 |
|
|
} else { ## Non-variable child |
496 |
|
|
my $cn; |
497 |
wakaba |
1.35 |
__CODE{ManakaiNode:getWeakReference||ManakaiDOM|Perl:: |
498 |
wakaba |
1.11 |
$object => $cno, $ref => $cn, |
499 |
|
|
$class => {<ClassName::ManakaiPerlCodeFragment>}, |
500 |
|
|
}__; |
501 |
|
|
$cn-><M::ManakaiPerlCodeFragment.replaceVariable> |
502 |
|
|
($originalVariable => $newValue); |
503 |
|
|
} |
504 |
wakaba |
1.6 |
} |
505 |
|
|
}__; |
506 |
|
|
} |
507 |
wakaba |
1.35 |
@@@PerlDef: |
508 |
|
|
@@@@ForCheck: pc|ForClass |
509 |
|
|
@@@@@: |
510 |
|
|
my $ln = $self-><AG::Node.localName>; |
511 |
|
|
if ($ln eq 'unparsed' or |
512 |
|
|
$ln eq 'inlineUnparsed') { |
513 |
|
|
my $new_var = ref $newValue ? $newValue->stringify : ''.$newValue; |
514 |
|
|
my $val = $self-><AG::Node.textContent>; |
515 |
|
|
$val =~ s/\Q$originalVariable\E\b/$new_var/g; |
516 |
|
|
$self-><AS::Node.textContent> ($val); |
517 |
|
|
} elsif ($ln eq 'stringLiteral' or $ln eq 'atom' or |
518 |
|
|
$ln eq 'tokens') { |
519 |
|
|
# |
520 |
|
|
} elsif ($self-><M::Node.hasChildNodes>) { |
521 |
|
|
__DEEP{ |
522 |
|
|
my @child_nodes = @{$self-><AG::Node.childNodes>}; |
523 |
|
|
for my $child_node (@child_nodes) { |
524 |
|
|
if (defined $child_node-><AG::Node.namespaceURI> and |
525 |
|
|
$child_node-><AG::Node.namespaceURI> eq <Q::pc:>) { |
526 |
|
|
if ($child_node-><AG::Node.localName> eq 'variable') { |
527 |
|
|
if (substr ($originalVariable, 0, 1) eq |
528 |
|
|
$child_node-><AG::PerlVariable.variableType> and |
529 |
|
|
not defined $child_node-><AG::PerlVariable.packageName> and |
530 |
|
|
substr ($originalVariable, 1) eq |
531 |
|
|
$child_node-><AG::PerlVariable.pcLocalName> and |
532 |
|
|
not defined $child_node-><AG::PerlVariable.hashKey>) { |
533 |
|
|
if (ref $newValue) { |
534 |
|
|
$self-><M::Node.replaceChild> ($child_node => $newValue); |
535 |
|
|
} else { ## ISSUE: Is this correct? |
536 |
|
|
$child_node-><M::PerlCodeInlines.appendCode> ($newValue); |
537 |
|
|
} |
538 |
|
|
} |
539 |
|
|
} else { ## Non-variable child |
540 |
|
|
$child_node-><M::PerlCode.replaceVariable> |
541 |
|
|
($originalVariable => $newValue); |
542 |
|
|
} |
543 |
|
|
} else { |
544 |
|
|
# |
545 |
|
|
} |
546 |
|
|
} |
547 |
|
|
}__; |
548 |
|
|
} # has child |
549 |
|
|
|
550 |
|
|
@ResourceDef: |
551 |
|
|
@@ForCheck: pc|ForClass |
552 |
|
|
@@QName: addNameListAttr |
553 |
|
|
@@rdf:type: DISPerl|BlockCode |
554 |
|
|
@@PerlDef: |
555 |
|
|
my %__mn = map {$_ => true} |
556 |
|
|
split /\s+/, $node-><M::Element.getAttributeNS> |
557 |
|
|
(<Q::pc:>, $attrName); |
558 |
|
|
$__mn{$newName} = true; |
559 |
|
|
$node-><M::Element.setAttributeNS> |
560 |
|
|
(<Q::pc:>, 'pc:'.$attrName => join ' ', keys %__mn); |
561 |
|
|
|
562 |
wakaba |
1.13 |
|
563 |
|
|
@Method: |
564 |
|
|
@@Name: addUsePerlModuleName |
565 |
|
|
@@enDesc: |
566 |
|
|
Adds a Perl module into the list of Perl modules |
567 |
|
|
<Perl::use>d by this code fragment. |
568 |
|
|
@@Param: |
569 |
|
|
@@@Name: moduleName |
570 |
wakaba |
1.35 |
@@@Type: DOMString |
571 |
wakaba |
1.13 |
@@@enDesc: |
572 |
|
|
The name of the module package that should be <Perl::use>d. |
573 |
|
|
@@Return: |
574 |
|
|
@@@PerlDef: |
575 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
576 |
|
|
@@@@@: |
577 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::pc:useModuleName>} |
578 |
wakaba |
1.13 |
->{$moduleName} = true; |
579 |
wakaba |
1.35 |
@@@PerlDef: |
580 |
|
|
@@@@ForCheck: pc|ForClass |
581 |
|
|
@@@@@: |
582 |
|
|
__DEEP{ |
583 |
|
|
__CODE{addNameListAttr:: |
584 |
|
|
$node => {$self}, |
585 |
|
|
$attrName => 'useModuleName', |
586 |
|
|
$newName => {$moduleName}, |
587 |
|
|
}__; |
588 |
|
|
}__; |
589 |
wakaba |
1.13 |
|
590 |
|
|
@Method: |
591 |
wakaba |
1.22 |
@@Name: addUseCharClassName |
592 |
|
|
@@enDesc: |
593 |
|
|
Adds a Perl module into the list of Perl character classes |
594 |
|
|
<Perl::use>d by this code fragment. |
595 |
|
|
@@Param: |
596 |
|
|
@@@Name: moduleName |
597 |
wakaba |
1.35 |
@@@Type: DOMString |
598 |
wakaba |
1.22 |
@@@enDesc: |
599 |
|
|
The name of the module package that should be <Perl::use>d. |
600 |
|
|
@@Param: |
601 |
|
|
@@@Name: charClassName |
602 |
wakaba |
1.35 |
@@@Type: DOMString |
603 |
wakaba |
1.22 |
@@@enDesc: |
604 |
|
|
The name of the character class. |
605 |
|
|
@@Return: |
606 |
|
|
@@@PerlDef: |
607 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
608 |
|
|
@@@@@: |
609 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::pc:useCharClassName>} |
610 |
wakaba |
1.22 |
->{$moduleName}->{$charClassName} = true; |
611 |
wakaba |
1.35 |
@@@PerlDef: |
612 |
|
|
@@@@ForCheck: pc|ForClass |
613 |
|
|
@@@@@: |
614 |
|
|
__DEEP{ |
615 |
|
|
__CODE{addNameListAttr:: |
616 |
|
|
$node => {$self}, |
617 |
|
|
$attrName => 'useCharClassName', |
618 |
|
|
$newName => {$moduleName.'.'.$charClassName}, |
619 |
|
|
}__; |
620 |
|
|
}__; |
621 |
wakaba |
1.22 |
|
622 |
|
|
@Method: |
623 |
wakaba |
1.19 |
@@Name: addRequirePerlModuleName |
624 |
|
|
@@enDesc: |
625 |
|
|
Adds a Perl module into the list of Perl modules |
626 |
|
|
<Perl::require>d by this code fragment. |
627 |
|
|
@@Param: |
628 |
|
|
@@@Name: moduleName |
629 |
wakaba |
1.35 |
@@@Type: DOMString |
630 |
wakaba |
1.19 |
@@@enDesc: |
631 |
|
|
The name of the module package that should be <Perl::require>d. |
632 |
|
|
@@Return: |
633 |
|
|
@@@PerlDef: |
634 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
635 |
|
|
@@@@@: |
636 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::pc:requireModuleName>} |
637 |
wakaba |
1.19 |
->{$moduleName} = true; |
638 |
wakaba |
1.35 |
@@@PerlDef: |
639 |
|
|
@@@@ForCheck: pc|ForClass |
640 |
|
|
@@@@@: |
641 |
|
|
__DEEP{ |
642 |
|
|
__CODE{addNameListAttr:: |
643 |
|
|
$node => {$self}, |
644 |
|
|
$attrName => 'requireModuleName', |
645 |
|
|
$newName => {$moduleName}, |
646 |
|
|
}__; |
647 |
|
|
}__; |
648 |
wakaba |
1.19 |
|
649 |
|
|
@Method: |
650 |
wakaba |
1.33 |
@@Name: addExceptionInterfacePackageName |
651 |
|
|
@@enDesc: |
652 |
|
|
Adds a Perl exception interface into the list of Perl packages. |
653 |
|
|
@@Param: |
654 |
|
|
@@@Name: moduleName |
655 |
wakaba |
1.35 |
@@@Type: DOMString |
656 |
wakaba |
1.33 |
@@@enDesc: |
657 |
|
|
The name of the interface package. |
658 |
|
|
@@Return: |
659 |
|
|
@@@PerlDef: |
660 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
661 |
|
|
@@@@@: |
662 |
wakaba |
1.33 |
$self->{<H::mn:node>}->{<H::pc:exceptionInterfaceName>} |
663 |
|
|
->{$moduleName} = true; |
664 |
wakaba |
1.35 |
@@@PerlDef: |
665 |
|
|
@@@@ForCheck: pc|ForClass |
666 |
|
|
@@@@@: |
667 |
|
|
__DEEP{ |
668 |
|
|
__CODE{addNameListAttr:: |
669 |
|
|
$node => {$self}, |
670 |
|
|
$attrName => 'exceptionInterfaceName', |
671 |
|
|
$newName => {$moduleName}, |
672 |
|
|
}__; |
673 |
|
|
}__; |
674 |
|
|
|
675 |
|
|
@ResourceDef: |
676 |
|
|
@@ForCheck: pc|ForClass |
677 |
|
|
@@QName: getNameListAttrR |
678 |
|
|
@@rdf:type: DISPerl|BlockCode |
679 |
|
|
@@PerlDef: |
680 |
|
|
my @__nodes = ($node); |
681 |
|
|
my %__result; |
682 |
|
|
while (@__nodes) { |
683 |
|
|
my $__cnode = shift @__nodes; |
684 |
|
|
if ($__cnode-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
685 |
|
|
defined $__cnode-><AG::Node.namespaceURI> and |
686 |
|
|
$__cnode-><AG::Node.namespaceURI> eq <Q::pc:>) { |
687 |
|
|
for (split /\s+/, $__cnode-><M::Element.getAttributeNS> |
688 |
|
|
(<Q::pc:>, $attrName)) { |
689 |
|
|
$__result{$_} = true; |
690 |
|
|
} |
691 |
|
|
push @__nodes, @{$__cnode-><AG::Node.childNodes>}; |
692 |
|
|
} |
693 |
|
|
} |
694 |
|
|
$result = [sort {$a cmp $b} keys %__result]; |
695 |
|
|
@ResourceDef: |
696 |
|
|
@@ForCheck: pc|ForClass |
697 |
|
|
@@QName: getNameListAttr |
698 |
|
|
@@rdf:type: DISPerl|BlockCode |
699 |
|
|
@@PerlDef: |
700 |
|
|
my %__result; |
701 |
|
|
for (split /\s+/, |
702 |
|
|
$node-><M::Element.getAttributeNS> (<Q::pc:>, $attrName)) { |
703 |
|
|
$__result{$_} = true; |
704 |
|
|
} |
705 |
|
|
$result = [sort {$a cmp $b} keys %__result]; |
706 |
wakaba |
1.33 |
|
707 |
|
|
@Method: |
708 |
wakaba |
1.15 |
@@Name: getUsePerlModuleNameList |
709 |
|
|
@@enDesc: |
710 |
|
|
Returns a list of Perl modules names that is <Perl::use>d |
711 |
|
|
by this code fragment, including all descendant nodes. |
712 |
|
|
@@Return: |
713 |
wakaba |
1.35 |
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
714 |
wakaba |
1.15 |
@@@enDesc: |
715 |
|
|
A list of module names. Note that the list is <EM::dead>; |
716 |
|
|
any modification to it does not affect to the code fragment |
717 |
|
|
and vice versa. |
718 |
|
|
@@@PerlDef: |
719 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
720 |
|
|
@@@@@: |
721 |
wakaba |
1.15 |
my $list = {}; |
722 |
wakaba |
1.30 |
my @node = ($self->{<H::mn:node>}); |
723 |
wakaba |
1.15 |
while (my $node = shift @node) { |
724 |
wakaba |
1.19 |
next unless ref $node; |
725 |
wakaba |
1.30 |
for my $mname (keys %{$node->{<H::pc:useModuleName>} || {}}) { |
726 |
|
|
$list->{$mname} ||= $node->{<H::pc:useModuleName>}->{$mname}; |
727 |
wakaba |
1.15 |
} |
728 |
|
|
push @node, $node->{$_} for @{$node->{<Q::TreeCore:subnode0>}}; |
729 |
|
|
my @n; |
730 |
|
|
for my $nn (map {$node->{$_}} @{$node->{<Q::TreeCore:subnode2>}}) { |
731 |
|
|
push @n, (ref $nn eq 'ARRAY' ? @$nn : values %{$nn || {}}); |
732 |
|
|
} |
733 |
|
|
for my $n ((map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}), @n) { |
734 |
|
|
push @node, (ref $n eq 'ARRAY' ? @$n : values %{$n || {}}); |
735 |
|
|
} |
736 |
|
|
} |
737 |
|
|
$r = [grep {$list->{$_}} keys %$list]; |
738 |
wakaba |
1.35 |
@@@PerlDef: |
739 |
|
|
@@@@ForCheck: pc|ForClass |
740 |
|
|
@@@@@: |
741 |
|
|
__DEEP{ |
742 |
|
|
__CODE{getNameListAttrR:: |
743 |
|
|
$node => {$self}, |
744 |
|
|
$attrName => 'useModuleName', |
745 |
|
|
$result => {$r}, |
746 |
|
|
}__; |
747 |
|
|
}__; |
748 |
wakaba |
1.15 |
|
749 |
|
|
@Method: |
750 |
wakaba |
1.22 |
@@Name: getUseCharClassNameList |
751 |
|
|
@@enDesc: |
752 |
|
|
Returns a list of Perl character class names that is <Perl::use>d |
753 |
|
|
by this code fragment, including all descendant nodes. |
754 |
|
|
@@Return: |
755 |
wakaba |
1.35 |
@@@Type: DISPerl|HASH||ManakaiDOM|all |
756 |
wakaba |
1.22 |
@@@enDesc: |
757 |
|
|
A list of module names. Note that the list is <EM::dead>; |
758 |
|
|
any modification to it does not affect to the code fragment |
759 |
|
|
and vice versa. |
760 |
|
|
@@@PerlDef: |
761 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
762 |
|
|
@@@@@: |
763 |
wakaba |
1.30 |
my @node = ($self->{<H::mn:node>}); |
764 |
wakaba |
1.22 |
while (my $node = shift @node) { |
765 |
|
|
next unless ref $node; |
766 |
wakaba |
1.30 |
for my $mname (keys %{$node->{<H::pc:useCharClassName>} || {}}) { |
767 |
|
|
for my $cname (keys %{$node->{<H::pc:useCharClassName>} |
768 |
wakaba |
1.22 |
->{$mname}}) { |
769 |
|
|
$r->{$mname}->{$cname} |
770 |
wakaba |
1.30 |
||= $node->{<H::pc:useCharClassName>}->{$mname}->{$cname}; |
771 |
wakaba |
1.22 |
} |
772 |
|
|
} |
773 |
|
|
push @node, $node->{$_} for @{$node->{<Q::TreeCore:subnode0>}}; |
774 |
|
|
my @n; |
775 |
|
|
for my $nn (map {$node->{$_}} @{$node->{<Q::TreeCore:subnode2>}}) { |
776 |
|
|
push @n, (ref $nn eq 'ARRAY' ? @$nn : values %{$nn || {}}); |
777 |
|
|
} |
778 |
|
|
for my $n ((map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}), @n) { |
779 |
|
|
push @node, (ref $n eq 'ARRAY' ? @$n : values %{$n || {}}); |
780 |
|
|
} |
781 |
|
|
} |
782 |
wakaba |
1.35 |
@@@PerlDef: |
783 |
|
|
@@@@ForCheck: pc|ForClass |
784 |
|
|
@@@@@: |
785 |
|
|
my $mc; |
786 |
|
|
__DEEP{ |
787 |
|
|
__CODE{getNameListAttrR:: |
788 |
|
|
$node => {$self}, |
789 |
|
|
$attrName => 'useCharClassName', |
790 |
|
|
$result => {$mc}, |
791 |
|
|
}__; |
792 |
|
|
}__; |
793 |
|
|
for (@$mc) { |
794 |
|
|
my ($m, $c) = split /\./, $_, 2; |
795 |
|
|
$r->{$m}->{$c} = true; |
796 |
|
|
} |
797 |
wakaba |
1.22 |
|
798 |
|
|
@Method: |
799 |
wakaba |
1.19 |
@@Name: getRequirePerlModuleNameList |
800 |
|
|
@@enDesc: |
801 |
|
|
Returns a list of Perl modules names that is <Perl::require>d |
802 |
|
|
by this code fragment, including all descendant nodes. |
803 |
|
|
@@Return: |
804 |
wakaba |
1.35 |
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
805 |
wakaba |
1.19 |
@@@enDesc: |
806 |
|
|
A list of module names. Note that the list is <EM::dead>; |
807 |
|
|
any modification to it does not affect to the code fragment |
808 |
|
|
and vice versa. |
809 |
|
|
@@@PerlDef: |
810 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
811 |
|
|
@@@@@: |
812 |
wakaba |
1.19 |
my $list = {}; |
813 |
wakaba |
1.30 |
my @node = ($self->{<H::mn:node>}); |
814 |
wakaba |
1.19 |
while (my $node = shift @node) { |
815 |
|
|
next unless ref $node; |
816 |
wakaba |
1.30 |
for my $mname (keys %{$node->{<H::pc:requireModuleName>} || {}}) { |
817 |
|
|
$list->{$mname} ||= $node->{<H::pc:requireModuleName>}->{$mname}; |
818 |
wakaba |
1.19 |
} |
819 |
|
|
push @node, $node->{$_} for @{$node->{<Q::TreeCore:subnode0>}}; |
820 |
|
|
my @n; |
821 |
|
|
for my $nn (map {$node->{$_}} @{$node->{<Q::TreeCore:subnode2>}}) { |
822 |
|
|
push @n, (ref $nn eq 'ARRAY' ? @$nn : values %{$nn || {}}); |
823 |
|
|
} |
824 |
|
|
for my $n ((map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}), @n) { |
825 |
|
|
push @node, (ref $n eq 'ARRAY' ? @$n : values %{$n || {}}); |
826 |
|
|
} |
827 |
|
|
} |
828 |
|
|
$r = [grep {$list->{$_}} keys %$list]; |
829 |
wakaba |
1.35 |
@@@PerlDef: |
830 |
|
|
@@@@ForCheck: pc|ForClass |
831 |
|
|
@@@@@: |
832 |
|
|
__DEEP{ |
833 |
|
|
__CODE{getNameListAttrR:: |
834 |
|
|
$node => {$self}, |
835 |
|
|
$attrName => 'requireModuleName', |
836 |
|
|
$result => {$r}, |
837 |
|
|
}__; |
838 |
|
|
}__; |
839 |
wakaba |
1.19 |
|
840 |
|
|
@Method: |
841 |
wakaba |
1.33 |
@@Name: getExceptionInterfacePackageNameList |
842 |
|
|
@@enDesc: |
843 |
|
|
Returns a list of Perl exception interface package names |
844 |
|
|
by this code fragment, including all descendant nodes. |
845 |
|
|
@@Return: |
846 |
wakaba |
1.35 |
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
847 |
wakaba |
1.33 |
@@@enDesc: |
848 |
|
|
A list of package names. Note that the list is <EM::dead>; |
849 |
|
|
any modification to it does not affect to the code fragment |
850 |
|
|
and vice versa. |
851 |
|
|
@@@PerlDef: |
852 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
853 |
|
|
@@@@@: |
854 |
wakaba |
1.33 |
my $list = {}; |
855 |
|
|
my @node = ($self->{<H::mn:node>}); |
856 |
|
|
while (my $node = shift @node) { |
857 |
|
|
next unless ref $node; |
858 |
|
|
for my $mname (keys %{$node->{<H::pc:exceptionInterfaceName>} || {}}) { |
859 |
|
|
$list->{$mname} ||= $node->{<H::pc:exceptionInterfaceName>}->{$mname}; |
860 |
|
|
} |
861 |
|
|
push @node, $node->{$_} for @{$node->{<Q::TreeCore:subnode0>}}; |
862 |
|
|
my @n; |
863 |
|
|
for my $nn (map {$node->{$_}} @{$node->{<Q::TreeCore:subnode2>}}) { |
864 |
|
|
push @n, (ref $nn eq 'ARRAY' ? @$nn : values %{$nn || {}}); |
865 |
|
|
} |
866 |
|
|
for my $n ((map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}), @n) { |
867 |
|
|
push @node, (ref $n eq 'ARRAY' ? @$n : values %{$n || {}}); |
868 |
|
|
} |
869 |
|
|
} |
870 |
|
|
$r = [grep {$list->{$_}} keys %$list]; |
871 |
wakaba |
1.35 |
@@@PerlDef: |
872 |
|
|
@@@@ForCheck: pc|ForClass |
873 |
|
|
@@@@@: |
874 |
|
|
__DEEP{ |
875 |
|
|
__CODE{getNameListAttrR:: |
876 |
|
|
$node => {$self}, |
877 |
|
|
$attrName => 'exceptionInterfaceName', |
878 |
|
|
$result => {$r}, |
879 |
|
|
}__; |
880 |
|
|
}__; |
881 |
wakaba |
1.33 |
|
882 |
|
|
@Method: |
883 |
wakaba |
1.13 |
@@Name: disAddRequireURI |
884 |
|
|
@@enDesc: |
885 |
|
|
Adds a <QUOTE::dis> resource into the list of <Perl::require>d |
886 |
|
|
resources of this code fragment. |
887 |
|
|
@@Param: |
888 |
|
|
@@@Name: uriArg |
889 |
wakaba |
1.35 |
@@@Type: DOMString |
890 |
wakaba |
1.13 |
@@@enDesc: |
891 |
|
|
The URI reference of the resource to add. |
892 |
|
|
@@Return: |
893 |
|
|
@@@PerlDef: |
894 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
895 |
|
|
@@@@@: |
896 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::pc:requireResourceURI>} |
897 |
wakaba |
1.13 |
->{$uriArg} = true; |
898 |
wakaba |
1.35 |
@@@PerlDef: |
899 |
|
|
@@@@ForCheck: pc|ForClass |
900 |
|
|
@@@@@: |
901 |
|
|
__DEEP{ |
902 |
|
|
__CODE{addNameListAttr:: |
903 |
|
|
$node => {$self}, |
904 |
|
|
$attrName => 'requireResourceURI', |
905 |
|
|
$newName => {$uriArg}, |
906 |
|
|
}__; |
907 |
|
|
}__; |
908 |
wakaba |
1.15 |
|
909 |
|
|
@Method: |
910 |
|
|
@@Name: disGetRequireURIList |
911 |
|
|
@@enDesc: |
912 |
|
|
Returns a list of <QUOTE::dis> resource URI references that is |
913 |
|
|
<Perl::require>d by this code fragment, including all descendant nodes. |
914 |
|
|
@@Return: |
915 |
wakaba |
1.35 |
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
916 |
wakaba |
1.15 |
@@@enDesc: |
917 |
|
|
A list of resource URI references. Note that the list is <EM::dead>; |
918 |
|
|
any modification to it does not affect to the code fragment |
919 |
|
|
and vice versa. |
920 |
|
|
@@@PerlDef: |
921 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
922 |
|
|
@@@@@: |
923 |
wakaba |
1.15 |
my $list = {}; |
924 |
wakaba |
1.30 |
my @node = ($self->{<H::mn:node>}); |
925 |
wakaba |
1.15 |
while (my $node = shift @node) { |
926 |
wakaba |
1.19 |
next unless ref $node; |
927 |
wakaba |
1.30 |
for my $mname (keys %{$node->{<H::pc:requireResourceURI>} || {}}) { |
928 |
|
|
$list->{$mname} ||= $node->{<H::pc:requireResourceURI>}->{$mname}; |
929 |
wakaba |
1.15 |
} |
930 |
|
|
push @node, $node->{$_} for @{$node->{<Q::TreeCore:subnode0>}}; |
931 |
|
|
my @n; |
932 |
|
|
for my $nn (map {$node->{$_}} @{$node->{<Q::TreeCore:subnode2>}}) { |
933 |
|
|
push @n, (ref $nn eq 'ARRAY' ? @$nn : values %{$nn || {}}); |
934 |
|
|
} |
935 |
|
|
for my $n ((map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}), @n) { |
936 |
|
|
push @node, (ref $n eq 'ARRAY' ? @$n : values %{$n || {}}); |
937 |
|
|
} |
938 |
|
|
} |
939 |
|
|
$r = [grep {$list->{$_}} keys %$list]; |
940 |
wakaba |
1.35 |
@@@PerlDef: |
941 |
|
|
@@@@ForCheck: pc|ForClass |
942 |
|
|
@@@@@: |
943 |
|
|
__DEEP{ |
944 |
|
|
__CODE{getNameListAttrR:: |
945 |
|
|
$node => {$self}, |
946 |
|
|
$attrName => 'requireResourceURI', |
947 |
|
|
$result => {$r}, |
948 |
|
|
}__; |
949 |
|
|
}__; |
950 |
|
|
|
951 |
|
|
@Method: |
952 |
|
|
@@ForCheck: pc|ForClass |
953 |
|
|
@@Operator: DISPerl|CloneMethod |
954 |
|
|
@@Return: |
955 |
|
|
@@@Type: PerlCode |
956 |
|
|
@@@PerlDef: |
957 |
|
|
__DEEP{ |
958 |
|
|
$r = $self-><M::Node.cloneNode> (true); |
959 |
|
|
}__; |
960 |
wakaba |
1.25 |
##PerlCode |
961 |
wakaba |
1.1 |
|
962 |
wakaba |
1.13 |
PropDef: |
963 |
|
|
@QName: useModuleName |
964 |
|
|
@enDesc: |
965 |
|
|
The list of modules. |
966 |
|
|
|
967 |
|
|
PropDef: |
968 |
wakaba |
1.33 |
@QName: pc|exceptionInterfaceName |
969 |
|
|
@enDesc: |
970 |
|
|
The list of exception interface packages. |
971 |
|
|
|
972 |
|
|
PropDef: |
973 |
wakaba |
1.22 |
@QName: useCharClassName |
974 |
|
|
@enDesc: |
975 |
|
|
The list of modules. |
976 |
|
|
|
977 |
|
|
PropDef: |
978 |
wakaba |
1.13 |
@QName: requireResourceURI |
979 |
|
|
@enDesc: |
980 |
|
|
The list of resources. |
981 |
|
|
|
982 |
wakaba |
1.9 |
ResourceDef: |
983 |
wakaba |
1.28 |
@For: ManakaiDOM|Perl |
984 |
wakaba |
1.9 |
@QName: nodeTypeToPackageName |
985 |
|
|
@rdf:type: |
986 |
|
|
dis2pm:BlockCode |
987 |
|
|
@enDesc: |
988 |
|
|
Gets Perl class package name from a node type string. |
989 |
wakaba |
1.28 |
@PerlCDef: |
990 |
wakaba |
1.9 |
if ($nodeType eq 'unparsed') { |
991 |
|
|
$packageName = <ClassName::ManakaiPerlUnparsedCode>; |
992 |
|
|
} elsif ($nodeType eq 'bare') { |
993 |
|
|
$packageName = <ClassName::ManakaiPerlBare>; |
994 |
|
|
} elsif ($nodeType eq 'atom') { |
995 |
|
|
$packageName = <ClassName::ManakaiPerlAtom>; |
996 |
|
|
} elsif ($nodeType eq 'variable') { |
997 |
|
|
$packageName = <ClassName::ManakaiPerlVariable>; |
998 |
|
|
} elsif ($nodeType eq 'inunparsed') { |
999 |
|
|
$packageName = <ClassName::ManakaiPerlInlineUnparsedCode>; |
1000 |
|
|
} elsif ($nodeType eq 'incontainer') { |
1001 |
|
|
$packageName = <ClassName::ManakaiPerlInlineContainer>; |
1002 |
|
|
} elsif ($nodeType eq 'statement') { |
1003 |
|
|
$packageName = <ClassName::ManakaiPerlStatement>; |
1004 |
wakaba |
1.11 |
} elsif ($nodeType eq 'assign') { |
1005 |
|
|
$packageName = <ClassName::ManakaiPerlAssignment>; |
1006 |
wakaba |
1.9 |
} elsif ($nodeType eq 'string') { |
1007 |
|
|
$packageName = <ClassName::ManakaiPerlStringLiteral>; |
1008 |
|
|
} elsif ($nodeType eq 'blockcontainer') { |
1009 |
|
|
$packageName = <ClassName::ManakaiPerlBlockContainer>; |
1010 |
|
|
} elsif ($nodeType eq 'block') { |
1011 |
|
|
$packageName = <ClassName::ManakaiPerlBlock>; |
1012 |
wakaba |
1.12 |
} elsif ($nodeType eq 'if') { |
1013 |
|
|
$packageName = <ClassName::ManakaiPerlIf>; |
1014 |
wakaba |
1.9 |
} elsif ($nodeType eq 'sub') { |
1015 |
|
|
$packageName = <ClassName::ManakaiPerlSub>; |
1016 |
|
|
} elsif ($nodeType eq 'package') { |
1017 |
|
|
$packageName = <ClassName::ManakaiPerlPackageScope>; |
1018 |
|
|
} elsif ($nodeType eq 'file') { |
1019 |
|
|
$packageName = <ClassName::ManakaiPerlFile>; |
1020 |
|
|
} else { |
1021 |
|
|
__ASSERT{DISPerl:invariant:: |
1022 |
|
|
msg => {qq[Node type: "$nodeType" ]. |
1023 |
|
|
qq[(ref: "@{[ref $object]}")]}, |
1024 |
|
|
}__; |
1025 |
|
|
} |
1026 |
|
|
|
1027 |
|
|
|
1028 |
wakaba |
1.6 |
PropDef: |
1029 |
|
|
@QName: nodeType |
1030 |
|
|
@enDesc: |
1031 |
|
|
Node type. |
1032 |
|
|
|
1033 |
wakaba |
1.35 |
ElementTypeBinding: |
1034 |
|
|
@Name: ETQName |
1035 |
|
|
@ElementType: |
1036 |
|
|
dis:AppName |
1037 |
|
|
@ShadowContent: |
1038 |
|
|
@@ForCheck: s|ForML |
1039 |
|
|
@@ContentType: DISCore|QName |
1040 |
|
|
|
1041 |
|
|
IFClsETDef: |
1042 |
wakaba |
1.25 |
@IFQName: PerlFile |
1043 |
wakaba |
1.1 |
@ClsQName: ManakaiPerlFile |
1044 |
wakaba |
1.35 |
@CQName: ManakaiPCFile |
1045 |
|
|
@ETQName: pc|file |
1046 |
wakaba |
1.25 |
|
1047 |
|
|
@IFISA: PerlCode |
1048 |
|
|
|
1049 |
|
|
@IFISA: PerlCodeStatements |
1050 |
wakaba |
1.16 |
@ClsISA: ManakaiPerlStatementContainer |
1051 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeStatements |
1052 |
wakaba |
1.25 |
|
1053 |
wakaba |
1.1 |
@enDesc: |
1054 |
|
|
Perl source code files. |
1055 |
|
|
|
1056 |
|
|
@IntMethod: |
1057 |
wakaba |
1.35 |
@@ForCheck: !pc|ForClass |
1058 |
wakaba |
1.1 |
@@Name:newObject |
1059 |
|
|
@@ManakaiDOM:isStatic:1 |
1060 |
|
|
@@Description: |
1061 |
|
|
@@@lang:en |
1062 |
|
|
@@@@: |
1063 |
|
|
Creates a new instance object for <Class::ManakaiPerlFile>. |
1064 |
|
|
@@Return: |
1065 |
|
|
@@@Type: |
1066 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
1067 |
|
|
@@@Description: |
1068 |
|
|
@@@@lang:en |
1069 |
|
|
@@@@@: |
1070 |
|
|
The newly created node object. |
1071 |
|
|
@@@PerlDef: |
1072 |
|
|
@@@@@: |
1073 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
1074 |
|
|
::ManakaiDOM:Perl.new>; |
1075 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
1076 |
|
|
$node->{<H::pc:childNodes>} = []; |
1077 |
|
|
$node->{<H::pc:sourceFile>} = ''; |
1078 |
|
|
$node->{<H::pc:sourceModule>} = ''; |
1079 |
|
|
$node->{<H::pc:sourceFor>} = ''; |
1080 |
|
|
$node->{<H::pc:currentPackage>} = 'main'; |
1081 |
|
|
$node->{<H::pc:currentChunk>} = 0; |
1082 |
|
|
$node->{<H::pc:nodeType>} = 'file'; |
1083 |
wakaba |
1.1 |
@@@@ImplNote: |
1084 |
|
|
@@@@@lang:en |
1085 |
|
|
@@@@@@: |
1086 |
|
|
Properties: <Q::pc:sourceFile>, |
1087 |
|
|
<Q::pc:sourceModule>, <Q::pc:sourceFor>, <Q::childNodes>, |
1088 |
wakaba |
1.6 |
<Q::pc:currentPackage>, <Q::pc:currentChunk>, |
1089 |
wakaba |
1.22 |
<Q::pc:nodeType>, <Q::pc:useModuleName>, |
1090 |
|
|
<Q::pc:useCharClassName>, |
1091 |
wakaba |
1.15 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
1092 |
wakaba |
1.1 |
|
1093 |
|
|
@Method: |
1094 |
|
|
@@Name: appendNewPackage |
1095 |
|
|
@@enDesc: |
1096 |
|
|
Appends a new package scope block. |
1097 |
|
|
@@Param: |
1098 |
|
|
@@@Name: packageName |
1099 |
wakaba |
1.35 |
@@@Type: DOMString |
1100 |
wakaba |
1.1 |
@@@enDesc: |
1101 |
|
|
The fully-qualified name of the package to create. |
1102 |
|
|
@@Return: |
1103 |
wakaba |
1.25 |
@@@Type: PerlPackage |
1104 |
wakaba |
1.1 |
@@@enDesc: |
1105 |
|
|
The newly created package scope object. |
1106 |
|
|
@@@PerlDef: |
1107 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1108 |
|
|
@@@@@: |
1109 |
wakaba |
1.1 |
$r = <ClassM::ManakaiPerlPackageScope.newObject>; |
1110 |
wakaba |
1.30 |
$r->{<H::pc:packageName>} = $packageName; |
1111 |
|
|
$self->{<H::mn:node>} |
1112 |
wakaba |
1.1 |
-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
1113 |
|
|
.importTree> ($r); |
1114 |
wakaba |
1.30 |
push @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}, $r; |
1115 |
|
|
$r->{<H::pc:parent>} = $self->{<H::mn:node>}; |
1116 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
1117 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
1118 |
|
|
$class => {<ClassName::ManakaiPerlPackageScope>}}__; |
1119 |
wakaba |
1.35 |
@@@PerlDef: |
1120 |
|
|
@@@@ForCheck: pc|ForClass |
1121 |
|
|
@@@@@: |
1122 |
|
|
__DEEP{ |
1123 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
1124 |
|
|
(<Q::pc:>, 'package'); |
1125 |
|
|
$r-><AS::PerlPackage.packageName> ($packageName); |
1126 |
|
|
$self-><M::Node.appendChild> ($r); |
1127 |
|
|
}__; |
1128 |
wakaba |
1.1 |
|
1129 |
|
|
@Method: |
1130 |
wakaba |
1.13 |
@@Name: appendPackage |
1131 |
|
|
@@enDesc: |
1132 |
|
|
Appends a Perl package scope object. |
1133 |
|
|
@@Param: |
1134 |
|
|
@@@Name: codeArg |
1135 |
wakaba |
1.25 |
@@@Type: PerlPackage |
1136 |
wakaba |
1.13 |
@@@enDesc: |
1137 |
|
|
The package to append. |
1138 |
|
|
@@Return: |
1139 |
|
|
@@@RaiseException: |
1140 |
|
|
@@@@@:IN_USE_NODE_ERR |
1141 |
|
|
@@@@enDesc: |
1142 |
|
|
An attempt is made to set a subroutine that is |
1143 |
|
|
already used elsewhere. |
1144 |
|
|
@@@PerlDef: |
1145 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1146 |
|
|
@@@@@: |
1147 |
wakaba |
1.30 |
my $packobj = $codeArg->{<H::mn:node>}; |
1148 |
|
|
if ($packobj->{<H::pc:parent>}) { |
1149 |
wakaba |
1.13 |
__EXCEPTION{IN_USE_NODE_ERR:: |
1150 |
|
|
pc:childNode => {$codeArg}, |
1151 |
|
|
MDOMX:param-name => 'codeArg', |
1152 |
|
|
}__; |
1153 |
|
|
} |
1154 |
wakaba |
1.30 |
$self->{<H::mn:node>} |
1155 |
wakaba |
1.13 |
-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
1156 |
|
|
.importTree> ($packobj); |
1157 |
wakaba |
1.30 |
push @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}, $packobj; |
1158 |
|
|
$packobj->{<H::pc:parent>} = $self->{<H::mn:node>}; |
1159 |
wakaba |
1.1 |
@@@PerlDef: |
1160 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClass |
1161 |
|
|
@@@@@: |
1162 |
|
|
if ($codeArg-><AG::Node.parentNode>) { |
1163 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
1164 |
|
|
pc:childNode => {$codeArg}, |
1165 |
|
|
MDOMX:param-name => 'codeArg', |
1166 |
|
|
}__; |
1167 |
wakaba |
1.1 |
} |
1168 |
|
|
__DEEP{ |
1169 |
wakaba |
1.35 |
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($codeArg); |
1170 |
|
|
$self-><M::Node.appendChild> ($codeArg); |
1171 |
wakaba |
1.1 |
}__; |
1172 |
|
|
|
1173 |
|
|
@Method: |
1174 |
|
|
@@Name: getLastPackage |
1175 |
|
|
@@enDesc: |
1176 |
|
|
Gets the last package scope block of a name. |
1177 |
|
|
@@Param: |
1178 |
|
|
@@@Name: packageName |
1179 |
|
|
@@@@Type: |
1180 |
|
|
Perl:package-name::ManakaiDOM:all |
1181 |
|
|
@@@@enDesc: |
1182 |
|
|
The fully-qualified name of the package to get. |
1183 |
|
|
@@NamedParam: |
1184 |
|
|
@@@Name: makeNewPackage |
1185 |
|
|
@@@Type: |
1186 |
wakaba |
1.12 |
DOMMain:boolean::ManakaiDOM:all |
1187 |
wakaba |
1.1 |
@@@enDesc: |
1188 |
|
|
Whether a new package scope object should be created if |
1189 |
|
|
no package of <P::packageName> found. |
1190 |
|
|
@@@TrueCase: |
1191 |
|
|
@@@@enDesc: |
1192 |
|
|
Makes a new object if not found. |
1193 |
|
|
@@@FalseCase: |
1194 |
|
|
@@@@enDesc: |
1195 |
|
|
Don't make a new object. |
1196 |
|
|
@@Return: |
1197 |
wakaba |
1.25 |
@@@Type: PerlPackage |
1198 |
wakaba |
1.1 |
@@@enDesc: |
1199 |
|
|
The last package scope object whose name is equal to |
1200 |
|
|
<P::packageName>. |
1201 |
|
|
@@@nullCase: |
1202 |
|
|
@@@@enDesc: |
1203 |
|
|
There is no <P::packageName> package object and |
1204 |
|
|
the <P::makeNewPackage> parameter is set to <DOM::false>. |
1205 |
|
|
@@@PerlDef: |
1206 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1207 |
|
|
@@@@@: |
1208 |
wakaba |
1.30 |
for my $cn (reverse @{$self->{<H::mn:node>} |
1209 |
|
|
->{<H::pc:childNodes>}}) { |
1210 |
|
|
if ($cn->{<H::pc:nodeType>} eq 'package' and |
1211 |
|
|
$cn->{<H::pc:packageName>} eq $packageName) { |
1212 |
wakaba |
1.1 |
$r = $cn; |
1213 |
|
|
last; |
1214 |
|
|
} |
1215 |
|
|
} |
1216 |
|
|
if ($r) { |
1217 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
1218 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
1219 |
|
|
$class => {<ClassName::ManakaiPerlPackageScope>}}__; |
1220 |
wakaba |
1.1 |
} elsif ($makeNewPackage) { |
1221 |
|
|
__DEEP{ |
1222 |
|
|
$r = $self-><M::ManakaiPerlFile.appendNewPackage> ($packageName); |
1223 |
|
|
}__; |
1224 |
|
|
} |
1225 |
wakaba |
1.35 |
@@@PerlDef: |
1226 |
|
|
@@@@ForCheck: pc|ForClass |
1227 |
|
|
@@@@@: |
1228 |
|
|
__DEEP{ |
1229 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
1230 |
|
|
if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1231 |
|
|
defined $child-><AG::Node.namespaceURI> and |
1232 |
|
|
$child-><AG::Node.namespaceURI> eq <Q::pc:> and |
1233 |
|
|
$child-><AG::Node.localName> eq 'package') { |
1234 |
|
|
if ($child-><M::Element.getAttributeNS> |
1235 |
|
|
(<Q::pc:>, 'packageName') eq $packageName) { |
1236 |
|
|
$r = $child; |
1237 |
|
|
} |
1238 |
|
|
} |
1239 |
|
|
} |
1240 |
|
|
if (not $r and $makeNewPackage) { |
1241 |
|
|
$r = $self-><M::PerlFile.appendNewPackage> ($packageName); |
1242 |
|
|
} |
1243 |
|
|
}__; |
1244 |
wakaba |
1.1 |
|
1245 |
wakaba |
1.35 |
@ATTR: |
1246 |
wakaba |
1.1 |
@@Name: sourceFile |
1247 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceFile |
1248 |
wakaba |
1.1 |
@@enDesc: |
1249 |
|
|
The file name of the source file from which this |
1250 |
|
|
Perl code is primary generated. |
1251 |
wakaba |
1.35 |
@@ReflectCDATA: |
1252 |
wakaba |
1.1 |
@@Get: |
1253 |
|
|
@@@disDef: |
1254 |
|
|
@@@@GetProp: sourceFile |
1255 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1256 |
wakaba |
1.1 |
@@Set: |
1257 |
|
|
@@@disDef: |
1258 |
|
|
@@@@SetProp: sourceFile |
1259 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1260 |
wakaba |
1.1 |
|
1261 |
wakaba |
1.35 |
@ATTR: |
1262 |
wakaba |
1.1 |
@@Name: sourceModule |
1263 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceModule |
1264 |
wakaba |
1.1 |
@@enDesc: |
1265 |
|
|
The name URI reference of the source module that this package defines. |
1266 |
wakaba |
1.35 |
@@ReflectCDATA: |
1267 |
wakaba |
1.1 |
@@Get: |
1268 |
|
|
@@@disDef: |
1269 |
|
|
@@@@GetProp: sourceModule |
1270 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1271 |
wakaba |
1.1 |
@@Set: |
1272 |
|
|
@@@disDef: |
1273 |
|
|
@@@@SetProp: sourceModule |
1274 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1275 |
wakaba |
1.1 |
|
1276 |
wakaba |
1.35 |
@ATTR: |
1277 |
wakaba |
1.1 |
@@Name: sourceFor |
1278 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceFor |
1279 |
wakaba |
1.1 |
@@enDesc: |
1280 |
|
|
The URI reference of the source module <QUOTE::for> for which this |
1281 |
|
|
package is. |
1282 |
wakaba |
1.35 |
@@ReflectCDATA: |
1283 |
wakaba |
1.1 |
@@Get: |
1284 |
|
|
@@@disDef: |
1285 |
|
|
@@@@GetProp: sourceFor |
1286 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1287 |
wakaba |
1.1 |
@@Set: |
1288 |
|
|
@@@disDef: |
1289 |
|
|
@@@@SetProp: sourceFor |
1290 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1291 |
wakaba |
1.1 |
|
1292 |
|
|
@ToStringMethod: |
1293 |
|
|
@@Return: |
1294 |
wakaba |
1.35 |
@@@Type: DOMString |
1295 |
wakaba |
1.1 |
@@@enDesc: |
1296 |
|
|
The Perl code generated. |
1297 |
|
|
@@@PerlDef: |
1298 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1299 |
|
|
@@@@@: |
1300 |
wakaba |
1.1 |
__DEEP{ |
1301 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
1302 |
wakaba |
1.1 |
## -- Header |
1303 |
|
|
$r = qq<#!/usr/bin/perl \n>; |
1304 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1305 |
|
|
(q<This file is automatically generated>); |
1306 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1307 |
|
|
(q< at >.<ClassM::ManakaiPerlCodeImplementation |
1308 |
|
|
.rfc3339DateTime> (time).q<,>); |
1309 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1310 |
wakaba |
1.30 |
(q< from file ">.$node->{<H::pc:sourceFile>}.q<",>); |
1311 |
wakaba |
1.1 |
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1312 |
wakaba |
1.30 |
(q[ module <].$node->{<H::pc:sourceModule>}.q[>,]); |
1313 |
wakaba |
1.1 |
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1314 |
wakaba |
1.30 |
(q[ for <].$node->{<H::pc:sourceFor>}.q[>.]); |
1315 |
wakaba |
1.1 |
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1316 |
|
|
(q<Don't edit by hand!>); |
1317 |
|
|
$r .= qq<use strict;\n>; |
1318 |
|
|
$self-><AS::ManakaiPerlFile.currentPackage> ('main'); |
1319 |
wakaba |
1.6 |
$self-><AS::ManakaiPerlFile.currentChunkNumber> (0); |
1320 |
wakaba |
1.1 |
|
1321 |
wakaba |
1.15 |
## -- Requires |
1322 |
wakaba |
1.19 |
my $req = $self-><M::ManakaiPerlCodeFragment |
1323 |
|
|
.getRequirePerlModuleNameList>; |
1324 |
wakaba |
1.32 |
for my $pack (sort {$a cmp $b} @$req) { |
1325 |
wakaba |
1.15 |
$r .= qq<require $pack;\n>; |
1326 |
|
|
} |
1327 |
|
|
|
1328 |
wakaba |
1.16 |
## -- Packages and global objects |
1329 |
wakaba |
1.1 |
my $pack = {}; |
1330 |
wakaba |
1.30 |
for my $cno (@{$node->{<H::pc:childNodes>}}) { |
1331 |
wakaba |
1.16 |
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
1332 |
|
|
$r .= $cn->stringify; |
1333 |
wakaba |
1.30 |
if ($cno->{<H::pc:nodeType>} eq 'package') { |
1334 |
|
|
for my $ipack (keys %{$cno->{<H::dis:Implement>}}) { |
1335 |
wakaba |
1.16 |
$pack->{$ipack} ||= true; # not defined |
1336 |
|
|
} |
1337 |
wakaba |
1.30 |
$pack->{$cno->{<H::pc:packageName>}} = []; # defined |
1338 |
wakaba |
1.1 |
} |
1339 |
|
|
} |
1340 |
|
|
|
1341 |
wakaba |
1.33 |
## -- Exception interface packages |
1342 |
|
|
for (sort {$a cmp $b} @{$self-><M::PerlCode |
1343 |
|
|
.getExceptionInterfacePackageNameList>}) { |
1344 |
|
|
next if ref $pack->{$_}; |
1345 |
|
|
$pack->{$_} = []; |
1346 |
|
|
$r .= sprintf q<push @%s::ISA, 'Message::Util::Error' >. |
1347 |
|
|
q<unless @%s::ISA;%s>, $_, $_, "\n"; |
1348 |
|
|
} |
1349 |
|
|
|
1350 |
wakaba |
1.1 |
## -- Enables interface packages |
1351 |
wakaba |
1.3 |
my @packs = map {'$' . $_ . '::'} |
1352 |
wakaba |
1.33 |
sort {$a cmp $b} |
1353 |
wakaba |
1.3 |
grep {not ref $pack->{$_} and $pack->{$_}} |
1354 |
|
|
keys %$pack; |
1355 |
|
|
$r .= q<for (>. join (', ', @packs) . qq<){}\n> if @packs; |
1356 |
wakaba |
1.1 |
|
1357 |
|
|
## -- Footer |
1358 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1359 |
wakaba |
1.30 |
(q[License: <].$node->{<H::dis:License>}.qq[>\n]); |
1360 |
wakaba |
1.1 |
$r .= qq<1;\n>; |
1361 |
|
|
}__; |
1362 |
wakaba |
1.35 |
@@@PerlDef: |
1363 |
|
|
@@@@ForCheck: pc|ForClass |
1364 |
|
|
@@@@@: |
1365 |
|
|
__DEEP{ |
1366 |
|
|
## -- Header |
1367 |
|
|
$r = qq<#!/usr/bin/perl \n>; |
1368 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1369 |
|
|
(q<This file is automatically generated>); |
1370 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1371 |
|
|
(q< at >.<ClassM::ManakaiPerlCodeImplementation |
1372 |
|
|
.rfc3339DateTime> (time).q<,>); |
1373 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1374 |
|
|
(q< from file ">.$self-><AG::PerlFile.sourceFile>.q<",>); |
1375 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1376 |
|
|
(q[ module <].$self-><AG::PerlFile.sourceModule>.q[>,]); |
1377 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1378 |
|
|
(q[ for <].$self-><AG::PerlFile.sourceFor>.q[>.]); |
1379 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1380 |
|
|
(q<Don't edit by hand!>); |
1381 |
|
|
$r .= qq<use strict;\n>; |
1382 |
|
|
$self-><AS::PerlFile.currentPackage> ('main'); |
1383 |
|
|
$self-><AS::PerlFile.currentChunkNumber> (0); |
1384 |
|
|
|
1385 |
|
|
## -- Requires |
1386 |
|
|
my $req = $self-><M::PerlCode.getRequirePerlModuleNameList>; |
1387 |
|
|
for my $pack (sort {$a cmp $b} @$req) { |
1388 |
|
|
$r .= qq<require $pack;\n>; |
1389 |
|
|
} |
1390 |
|
|
|
1391 |
|
|
## -- Packages and global objects |
1392 |
|
|
my $pack = {}; |
1393 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
1394 |
|
|
$r .= $child->stringify; |
1395 |
|
|
if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1396 |
|
|
defined $child-><AG::Node.namespaceURI> and |
1397 |
|
|
$child-><AG::Node.namespaceURI> eq <Q::pc:> and |
1398 |
|
|
$child-><AG::Node.localName> eq 'package') { |
1399 |
|
|
for my $ipack (@{$child-><M::PerlPackage |
1400 |
|
|
.getImplementPackageNameList>}) { |
1401 |
|
|
$pack->{$ipack} ||= true; # not defined |
1402 |
|
|
} |
1403 |
|
|
$pack->{$child-><AG::PerlPackage.packageName>} = []; # defined |
1404 |
|
|
} |
1405 |
|
|
} |
1406 |
|
|
|
1407 |
|
|
## -- Exception interface packages |
1408 |
|
|
for (sort {$a cmp $b} @{$self-><M::PerlCode |
1409 |
|
|
.getExceptionInterfacePackageNameList>}) { |
1410 |
|
|
next if ref $pack->{$_}; |
1411 |
|
|
$pack->{$_} = []; |
1412 |
|
|
$r .= sprintf q<push @%s::ISA, 'Message::Util::Error' >. |
1413 |
|
|
q<unless @%s::ISA;%s>, $_, $_, "\n"; |
1414 |
|
|
} |
1415 |
|
|
|
1416 |
|
|
## -- Enables interface packages |
1417 |
|
|
my @packs = map {'$' . $_ . '::'} |
1418 |
|
|
sort {$a cmp $b} |
1419 |
|
|
grep {not ref $pack->{$_} and $pack->{$_}} |
1420 |
|
|
keys %$pack; |
1421 |
|
|
$r .= q<for (>. join (', ', @packs) . qq<){}\n> if @packs; |
1422 |
|
|
|
1423 |
|
|
## -- Footer |
1424 |
|
|
$r .= <ClassM::ManakaiPerlCodeImplementation.perlComment> |
1425 |
|
|
(q[License: <].$self-><AG::PerlFile.licenseURI>.qq[>\n]); |
1426 |
|
|
$r .= qq<1;\n>; |
1427 |
|
|
}__; |
1428 |
wakaba |
1.1 |
|
1429 |
|
|
@Attr: |
1430 |
|
|
@@Name: currentPackage |
1431 |
|
|
@@enDesc: |
1432 |
|
|
The current Perl package (used in stringify method). |
1433 |
wakaba |
1.35 |
|
1434 |
|
|
{NOTE:: This attribute is not preserved by the <Perl::clone> operation. |
1435 |
|
|
} |
1436 |
|
|
@@Type: DOMString |
1437 |
wakaba |
1.1 |
@@Get: |
1438 |
|
|
@@@disDef: |
1439 |
|
|
@@@@GetProp: currentPackage |
1440 |
|
|
@@Set: |
1441 |
|
|
@@@disDef: |
1442 |
|
|
@@@@SetProp: currentPackage |
1443 |
|
|
|
1444 |
|
|
@Attr: |
1445 |
wakaba |
1.6 |
@@Name: currentChunkNumber |
1446 |
wakaba |
1.1 |
@@enDesc: |
1447 |
wakaba |
1.6 |
The current code chunk number (used in stringify method). |
1448 |
wakaba |
1.35 |
|
1449 |
|
|
{NOTE:: This attribute is not preserved by the <Perl::clone> operation. |
1450 |
|
|
} |
1451 |
|
|
@@Type: idl|unsignedLong||ManakaiDOM|all |
1452 |
wakaba |
1.1 |
@@Get: |
1453 |
|
|
@@@disDef: |
1454 |
|
|
@@@@GetProp: currentChunk |
1455 |
|
|
@@Set: |
1456 |
|
|
@@@disDef: |
1457 |
|
|
@@@@SetProp: currentChunk |
1458 |
wakaba |
1.6 |
|
1459 |
|
|
@Method: |
1460 |
|
|
@@Name: getNextChunkNumber |
1461 |
|
|
@@enDesc: |
1462 |
|
|
Increments the current chunk number of this file |
1463 |
|
|
and returns it. |
1464 |
|
|
@@Return: |
1465 |
wakaba |
1.35 |
@@@Type: idl|unsignedLong||ManakaiDOM|all |
1466 |
wakaba |
1.6 |
@@@enDesc: |
1467 |
|
|
The next chunk number. |
1468 |
|
|
@@@PerlDef: |
1469 |
wakaba |
1.30 |
$r = ++$self->{<H::mn:node>}->{<H::pc:currentChunk>}; |
1470 |
wakaba |
1.2 |
|
1471 |
wakaba |
1.35 |
@ATTR: |
1472 |
wakaba |
1.2 |
@@Name: licenseURI |
1473 |
wakaba |
1.35 |
@@ATTRQName: dis|License |
1474 |
wakaba |
1.2 |
@@enDesc: |
1475 |
|
|
The license term URI reference for this code. |
1476 |
wakaba |
1.35 |
@@ReflectCDATA: |
1477 |
wakaba |
1.2 |
@@Get: |
1478 |
|
|
@@@disDef: |
1479 |
|
|
@@@@GetProp: |
1480 |
|
|
dis:License |
1481 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1482 |
wakaba |
1.2 |
@@Set: |
1483 |
|
|
@@@disDef: |
1484 |
|
|
@@@@SetProp: |
1485 |
|
|
dis:License |
1486 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1487 |
wakaba |
1.1 |
##PerlFile |
1488 |
|
|
|
1489 |
|
|
PropDef: |
1490 |
wakaba |
1.18 |
@QName: export |
1491 |
|
|
@enDesc: |
1492 |
|
|
The list of exported members. |
1493 |
|
|
|
1494 |
|
|
PropDef: |
1495 |
wakaba |
1.15 |
@QName: requireModuleName |
1496 |
|
|
@enDesc: |
1497 |
|
|
The list of <Perl::require>d Perl module names |
1498 |
|
|
|
1499 |
|
|
PropDef: |
1500 |
wakaba |
1.1 |
@QName: sourceModule |
1501 |
|
|
@enDesc: |
1502 |
|
|
The soruce module name URI reference. |
1503 |
|
|
|
1504 |
|
|
PropDef: |
1505 |
|
|
@QName: sourceFor |
1506 |
|
|
@enDesc: |
1507 |
|
|
The source module <QUOTE::for> URI reference. |
1508 |
|
|
|
1509 |
|
|
PropDef: |
1510 |
|
|
@QName: currentPackage |
1511 |
|
|
@enDesc: |
1512 |
|
|
The current Perl package name (used for stringify). |
1513 |
|
|
|
1514 |
|
|
PropDef: |
1515 |
|
|
@QName: currentChunk |
1516 |
|
|
@enDesc: |
1517 |
|
|
The current code chunk (used for stringify). |
1518 |
|
|
|
1519 |
wakaba |
1.35 |
ElementTypeBinding: |
1520 |
|
|
@Name: ReflectCDATA |
1521 |
|
|
@ElementType: |
1522 |
|
|
dis:Type |
1523 |
|
|
@ShadowContent: |
1524 |
|
|
@@@: DOMString |
1525 |
|
|
@ShadowSibling: |
1526 |
|
|
@@actualType: CDATADOMString |
1527 |
|
|
|
1528 |
|
|
ResourceDef: |
1529 |
|
|
@QName: DOMString |
1530 |
|
|
@For: ManakaiDOM|Perl |
1531 |
|
|
@AliasFor: DOMMain|DOMString||ManakaiDOM|ManakaiDOMLatest |
1532 |
|
|
|
1533 |
|
|
ReflectTypeDef: |
1534 |
|
|
@QName: CDATADOMString |
1535 |
|
|
@enDesc: |
1536 |
|
|
<IF::DOMMain:DOMString> for DOM attributes reflecting |
1537 |
|
|
<SGML::CDATA> element attributes. |
1538 |
|
|
@rdfs:subClassOf: DOMString |
1539 |
|
|
@ResourceDef: |
1540 |
|
|
@@rdf:type: DOMMain|ReflectGet |
1541 |
|
|
@@enDesc: |
1542 |
|
|
The DOM attribute returns the current value of the element attribute |
1543 |
|
|
in a transparent, case-sensitive manner. |
1544 |
|
|
\ |
1545 |
|
|
If the element attribute is absent, the default value, if any, |
1546 |
|
|
or an empty string is returned. |
1547 |
|
|
@@PerlCDef: |
1548 |
|
|
__DEEP{ |
1549 |
|
|
$r = $self-><M::Element.getAttributeNS> ($NS_URI_NO_NULL, $LOCAL_NAME); |
1550 |
|
|
}__; |
1551 |
|
|
@ResourceDef: |
1552 |
|
|
@@QName: CDATADOMStringSet |
1553 |
|
|
@@rdf:type: DOMMain|ReflectSet |
1554 |
|
|
@@enDesc: |
1555 |
|
|
The corresponding element attribute is set to the given value, |
1556 |
|
|
in a transparent, case-sensitive manner. |
1557 |
|
|
@@ImplNote: |
1558 |
|
|
@@@lang:en |
1559 |
|
|
@@@@: |
1560 |
|
|
What will happen if the <DOM::null> value is given? |
1561 |
|
|
@@PerlCDef: |
1562 |
|
|
__DEEP{ |
1563 |
|
|
if (defined $given) { |
1564 |
|
|
$self-><M::Element.setAttributeNS> ($NS_URI_NO_NULL, $LOCAL_NAME |
1565 |
|
|
=> $given); |
1566 |
|
|
} else { |
1567 |
|
|
$self-><M::Element.removeAttributeNS> ($NS_URI_NO_NULL, $LOCAL_NAME); |
1568 |
|
|
} |
1569 |
|
|
}__; |
1570 |
|
|
|
1571 |
|
|
ElementTypeBinding: |
1572 |
|
|
@Name: ReflectTypeDef |
1573 |
|
|
@ElementType: |
1574 |
|
|
dis:ResourceDef |
1575 |
|
|
@ShadowContent: |
1576 |
|
|
@@rdf:type: DISLang|DataType |
1577 |
|
|
@@ForCheck: !ManakaiDOM|IDL |
1578 |
|
|
@@For: ManakaiDOM|DOM |
1579 |
|
|
|
1580 |
|
|
ElementTypeBinding: |
1581 |
|
|
@Name: ATTR |
1582 |
|
|
@ElementType: |
1583 |
|
|
dis:ResourceDef |
1584 |
|
|
@ShadowContent: |
1585 |
|
|
@@rdf:type: |
1586 |
|
|
@@@@: s|Attribute |
1587 |
|
|
@@@ForCheck: s|ForML |
1588 |
|
|
@@rdf:type: |
1589 |
|
|
@@@@: DISLang|Attribute |
1590 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
1591 |
|
|
@@rdf:type: |
1592 |
|
|
@@@@: DISLang|Attribute |
1593 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
1594 |
|
|
@@DocAttr: |
1595 |
|
|
@@@@: ||+||s|ForML |
1596 |
|
|
@@@ContentType: DISCore|TFPQNames |
1597 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
1598 |
|
|
@@DocAttr: |
1599 |
|
|
@@@@: ||+||s|ForML |
1600 |
|
|
@@@ContentType: DISCore|TFPQNames |
1601 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
1602 |
|
|
@@ForCheck: !=ManakaiDOM|ManakaiDOM |
1603 |
|
|
|
1604 |
|
|
ElementTypeBinding: |
1605 |
|
|
@Name: ATTRQName |
1606 |
|
|
@ElementType: |
1607 |
|
|
dis:AppName |
1608 |
|
|
@ShadowContent: |
1609 |
|
|
@@ForCheck: s|ForML |
1610 |
|
|
@@ContentType: DISCore|QName |
1611 |
|
|
|
1612 |
|
|
IFClsETDef: |
1613 |
wakaba |
1.25 |
@IFQName: PerlPackage |
1614 |
wakaba |
1.1 |
@ClsQName: ManakaiPerlPackageScope |
1615 |
wakaba |
1.35 |
@CQName: ManakaiPCPackage |
1616 |
|
|
@ETQName: pc|package |
1617 |
wakaba |
1.25 |
|
1618 |
|
|
@IFISA: PerlCode |
1619 |
|
|
|
1620 |
|
|
@IFISA: PerlCodeStatements |
1621 |
wakaba |
1.16 |
@ClsISA: ManakaiPerlStatementContainer |
1622 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeStatements |
1623 |
wakaba |
1.16 |
|
1624 |
|
|
@enDesc: |
1625 |
|
|
A Perl lexical lines for which a <Perl::package> declaration |
1626 |
|
|
in effect. |
1627 |
wakaba |
1.1 |
|
1628 |
wakaba |
1.35 |
@ATTR: |
1629 |
wakaba |
1.1 |
@@Name: packageName |
1630 |
wakaba |
1.35 |
@@ATTRQName: pc|packageName |
1631 |
|
|
@@ReflectCDATA: |
1632 |
wakaba |
1.1 |
@@enDesc: |
1633 |
|
|
The fully-qualified package name. |
1634 |
|
|
@@Get: |
1635 |
|
|
@@@disDef: |
1636 |
|
|
@@@@GetProp: packageName |
1637 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1638 |
|
|
@@Set: |
1639 |
|
|
@@@ForCheck: !pc|ForClassCompat |
1640 |
wakaba |
1.1 |
|
1641 |
|
|
@IntMethod: |
1642 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
1643 |
wakaba |
1.1 |
@@Name:newObject |
1644 |
|
|
@@ManakaiDOM:isStatic:1 |
1645 |
|
|
@@Description: |
1646 |
|
|
@@@lang:en |
1647 |
|
|
@@@@: |
1648 |
|
|
Creates a new instance object for <Class::ManakaiPerlPackageScope>. |
1649 |
|
|
@@Return: |
1650 |
|
|
@@@Type: |
1651 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
1652 |
|
|
@@@Description: |
1653 |
|
|
@@@@lang:en |
1654 |
|
|
@@@@@: |
1655 |
|
|
The newly created node object. |
1656 |
|
|
@@@PerlDef: |
1657 |
|
|
@@@@@: |
1658 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
1659 |
|
|
::ManakaiDOM:Perl.new>; |
1660 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:sub>, |
1661 |
|
|
<H::dis2pm:operator>, |
1662 |
|
|
<H::pc:childNodes>; |
1663 |
|
|
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
1664 |
|
|
$node->{<H::pc:sub>} = {}; |
1665 |
|
|
$node->{<H::dis2pm:operator>} = {}; |
1666 |
|
|
$node->{<H::dis:ISA>} = []; |
1667 |
|
|
$node->{<H::dis:Implement>} = {}; |
1668 |
|
|
$node->{<H::pc:nodeType>} = 'package'; |
1669 |
|
|
$node->{<H::pc:childNodes>} = []; |
1670 |
wakaba |
1.6 |
@@@@ImplNote: |
1671 |
|
|
@@@@@lang:en |
1672 |
|
|
@@@@@@: |
1673 |
wakaba |
1.14 |
Properties: <Q::pc:sub>, <Q::dis2pm:operator>, |
1674 |
wakaba |
1.6 |
<Q::dis:ISA>, <Q::dis:Implement>, |
1675 |
wakaba |
1.22 |
<Q::pc:nodeType>, <Q::pc:useModuleName>, |
1676 |
|
|
<Q::pc:useCharClassName>, |
1677 |
wakaba |
1.18 |
<Q::pc:requireResourceURI>, <Q::pc:childNodes>, |
1678 |
wakaba |
1.19 |
<Q::pc:export>, <Q::pc:requireModuleName>. |
1679 |
wakaba |
1.1 |
|
1680 |
|
|
@Method: |
1681 |
|
|
@@Name: getSub |
1682 |
|
|
@@enDesc: |
1683 |
|
|
Gets a subroutine. |
1684 |
|
|
@@Param: |
1685 |
|
|
@@@Name: subName |
1686 |
|
|
@@@Type: |
1687 |
|
|
DISPerl:SubName::ManakaiDOM:all |
1688 |
|
|
@@@enDesc: |
1689 |
|
|
The name of subroutine to get. |
1690 |
|
|
@@NamedParam: |
1691 |
|
|
@@@Name: makeNewNode |
1692 |
|
|
@@@Type: |
1693 |
wakaba |
1.12 |
DOMMain:boolean::ManakaiDOM:all |
1694 |
wakaba |
1.1 |
@@@enDesc: |
1695 |
|
|
Whether a new subroutine object should be created, |
1696 |
|
|
if it is not exist, or not. |
1697 |
|
|
@@Return: |
1698 |
wakaba |
1.25 |
@@@Type: PerlSub |
1699 |
wakaba |
1.1 |
@@@enDesc: |
1700 |
|
|
The subroutine object. |
1701 |
wakaba |
1.4 |
@@@nullCase: |
1702 |
|
|
@@@@enDesc: |
1703 |
|
|
Either the specified subroutine is not found and |
1704 |
|
|
the <P::makeNewNode> parameter is set to <DOM::false> or |
1705 |
|
|
the subroutine is defined as an alias. |
1706 |
wakaba |
1.1 |
@@@PerlDef: |
1707 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1708 |
|
|
@@@@@: |
1709 |
wakaba |
1.30 |
if ($self->{<H::mn:node>}->{<H::pc:sub>}->{$subName}) { |
1710 |
|
|
$r = ref $self->{<H::mn:node>}->{<H::pc:sub>}->{$subName} |
1711 |
|
|
? $self->{<H::mn:node>}->{<H::pc:sub>}->{$subName} : null; |
1712 |
wakaba |
1.1 |
} elsif ($makeNewNode) { |
1713 |
wakaba |
1.30 |
$r = $self->{<H::mn:node>}->{<H::pc:sub>}->{$subName} |
1714 |
wakaba |
1.1 |
= <ClassM::ManakaiPerlSub.newObject>; |
1715 |
wakaba |
1.30 |
$self->{<H::mn:node>} |
1716 |
wakaba |
1.1 |
-><M::ManakaiDOM:ManakaiDOMNodeObject |
1717 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
1718 |
wakaba |
1.30 |
$r->{<H::pc:parent>} = $self->{<H::mn:node>}; |
1719 |
|
|
$r->{<H::pc:localName>} = $subName; |
1720 |
wakaba |
1.1 |
} |
1721 |
wakaba |
1.6 |
if ($r) { |
1722 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
1723 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
1724 |
|
|
$class => {<ClassName::ManakaiPerlSub>}}__; |
1725 |
|
|
} |
1726 |
wakaba |
1.35 |
@@@PerlDef: |
1727 |
|
|
@@@@ForCheck: pc|ForClass |
1728 |
|
|
@@@@@: |
1729 |
|
|
__DEEP{ |
1730 |
|
|
F: { |
1731 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
1732 |
|
|
if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1733 |
|
|
defined $child-><AG::Node.namespaceURI> and |
1734 |
|
|
$child-><AG::Node.namespaceURI> eq <Q::pc:> and |
1735 |
|
|
$child-><AG::Node.localName> eq 'sub') { |
1736 |
|
|
if ($child-><M::PerlSub.hasPerlName> ($subName)) { |
1737 |
|
|
$r = $child; |
1738 |
|
|
last F; |
1739 |
|
|
} |
1740 |
|
|
} |
1741 |
|
|
} |
1742 |
|
|
if ($makeNewNode) { |
1743 |
|
|
$r = $self-><AG::Node.ownerDocument> |
1744 |
|
|
-><M::Document.createElementNS> |
1745 |
|
|
(<Q::pc:>, 'sub'); |
1746 |
|
|
$r-><M::PerlSub.addPerlName> ($subName); |
1747 |
|
|
$self-><M::Node.appendChild> ($r); |
1748 |
|
|
} |
1749 |
|
|
} # F |
1750 |
|
|
}__; |
1751 |
wakaba |
1.1 |
|
1752 |
wakaba |
1.4 |
@Method: |
1753 |
wakaba |
1.5 |
@@Name: setSub |
1754 |
|
|
@@enDesc: |
1755 |
|
|
Sets a subrotine. |
1756 |
|
|
@@Param: |
1757 |
|
|
@@@Name: subName |
1758 |
|
|
@@@Type: |
1759 |
|
|
DISLang:String::ManakaiDOM:all |
1760 |
|
|
@@@enDesc: |
1761 |
|
|
The name of the subroutine. |
1762 |
|
|
\ |
1763 |
|
|
{NOTE:: The <P::subName> value must be equal to the |
1764 |
wakaba |
1.35 |
<A::PerlSub.pcLocalName> of the <P::subArg>. |
1765 |
wakaba |
1.26 |
|
1766 |
|
|
} |
1767 |
wakaba |
1.5 |
@@Param: |
1768 |
|
|
@@@Name: subArg |
1769 |
wakaba |
1.25 |
@@@Type: PerlSub |
1770 |
|
|
@@@caType: ManakaiPerlSub |
1771 |
wakaba |
1.5 |
@@@enDesc: |
1772 |
|
|
The subroutine object. |
1773 |
|
|
@@Return: |
1774 |
|
|
@@@RaiseException: |
1775 |
|
|
@@@@@:IN_USE_NODE_ERR |
1776 |
|
|
@@@@enDesc: |
1777 |
|
|
An attempt is made to set a subroutine that is |
1778 |
|
|
already used elsewhere. |
1779 |
|
|
@@@PerlDef: |
1780 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1781 |
|
|
@@@@@: |
1782 |
wakaba |
1.30 |
my $ops = $self->{<H::mn:node>}->{<H::pc:sub>}; |
1783 |
wakaba |
1.5 |
if (ref $ops->{$subName}) { |
1784 |
wakaba |
1.30 |
CORE::delete $ops->{<H::pc:parent>}; |
1785 |
wakaba |
1.5 |
$ops->{$subName} |
1786 |
|
|
-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>; |
1787 |
|
|
} |
1788 |
wakaba |
1.30 |
if ($subArg->{<H::mn:node>}->{<H::pc:parent>}) { |
1789 |
wakaba |
1.5 |
__EXCEPTION{IN_USE_NODE_ERR:: |
1790 |
|
|
pc:childNode => {$subArg}, |
1791 |
|
|
}__; |
1792 |
|
|
} |
1793 |
wakaba |
1.30 |
$self->{<H::mn:node>}-><M::MNodeObject.importTree> |
1794 |
|
|
($subArg->{<H::mn:node>}); |
1795 |
|
|
$ops->{$subName} = $subArg->{<H::mn:node>}; |
1796 |
|
|
$subArg->{<H::mn:node>}->{<H::pc:parent>} |
1797 |
|
|
= $self->{<H::mn:node>}; |
1798 |
wakaba |
1.5 |
|
1799 |
|
|
@Method: |
1800 |
wakaba |
1.35 |
@@ForCheck: !pc|ForClassCompat |
1801 |
|
|
@@Name: setSubNode |
1802 |
|
|
@@enDesc: |
1803 |
|
|
Sets a subrotine. |
1804 |
|
|
@@Param: |
1805 |
|
|
@@@Name: subArg |
1806 |
|
|
@@@Type: PerlSub |
1807 |
|
|
@@@caType: ManakaiPerlSub |
1808 |
|
|
@@@enDesc: |
1809 |
|
|
The subroutine object. |
1810 |
|
|
@@Return: |
1811 |
|
|
@@@RaiseException: |
1812 |
|
|
@@@@@:IN_USE_NODE_ERR |
1813 |
|
|
@@@@enDesc: |
1814 |
|
|
An attempt is made to set a subroutine that is |
1815 |
|
|
already used elsewhere. |
1816 |
|
|
@@@PerlDef: |
1817 |
|
|
__DEEP{ |
1818 |
|
|
if ($subArg-><AG::Node.parentNode>) { |
1819 |
|
|
__UNDEEP{__EXCEPTION{IN_USE_NODE_ERR:: |
1820 |
|
|
pc:childNode => {$subArg}, |
1821 |
|
|
}__}__; |
1822 |
|
|
} |
1823 |
|
|
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($subArg); |
1824 |
|
|
$self-><M::Node.appendChild> ($subArg); |
1825 |
|
|
}__; |
1826 |
|
|
|
1827 |
|
|
@Method: |
1828 |
|
|
@@ForCheck: pc|ForClassCompat |
1829 |
wakaba |
1.4 |
@@Name: getSubAliasName |
1830 |
|
|
@@enDesc: |
1831 |
wakaba |
1.35 |
Gets the secondary name of a subroutine. |
1832 |
wakaba |
1.4 |
@@Param: |
1833 |
|
|
@@@Name: subName |
1834 |
|
|
@@@Type: |
1835 |
|
|
DISLang:String::ManakaiDOM:all |
1836 |
|
|
@@@enDesc: |
1837 |
|
|
The name of the alias subroutine. |
1838 |
|
|
@@Return: |
1839 |
|
|
@@@Type: |
1840 |
|
|
DISLang:String::ManakaiDOM:all |
1841 |
|
|
@@@enDesc: |
1842 |
|
|
The real name. |
1843 |
|
|
@@@nullCase: |
1844 |
|
|
@@@@enDesc: |
1845 |
|
|
The specified name is used. |
1846 |
|
|
@@@InCase: |
1847 |
|
|
@@@@Value:\#CODE |
1848 |
wakaba |
1.27 |
@@@@ContentType: DISCore|String |
1849 |
wakaba |
1.4 |
@@@@enDesc: |
1850 |
|
|
The specified name is not an alias. |
1851 |
|
|
@@@PerlDef: |
1852 |
wakaba |
1.30 |
if ($self->{<H::mn:node>}->{<H::pc:sub>}->{$subName}) { |
1853 |
|
|
$r = ref $self->{<H::mn:node>} |
1854 |
|
|
->{<H::pc:sub>}->{$subName} |
1855 |
|
|
? q<#CODE> : $self->{<H::mn:node>} |
1856 |
|
|
->{<H::pc:sub>}->{$subName}; |
1857 |
wakaba |
1.4 |
} |
1858 |
|
|
|
1859 |
|
|
@Method: |
1860 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
1861 |
wakaba |
1.4 |
@@Name: setSubAliasName |
1862 |
|
|
@@enDesc: |
1863 |
|
|
Sets a subroutine name as an alias of another subroutine. |
1864 |
|
|
@@Param: |
1865 |
|
|
@@@Name: aliasName |
1866 |
|
|
@@@Type: |
1867 |
|
|
DISLang:String::ManakaiDOM:all |
1868 |
|
|
@@@enDesc: |
1869 |
|
|
The alias name. |
1870 |
|
|
@@Param: |
1871 |
|
|
@@@Name: realName |
1872 |
|
|
@@@Type: |
1873 |
|
|
DISLang:String::ManakaiDOM:all |
1874 |
|
|
@@@enDesc: |
1875 |
|
|
The real name. |
1876 |
|
|
@@Return: |
1877 |
|
|
@@@UnknownOperatorException: |
1878 |
|
|
@@@PerlDef: |
1879 |
wakaba |
1.30 |
my $ops = $self->{<H::mn:node>}->{<H::pc:sub>}; |
1880 |
wakaba |
1.4 |
if (ref $ops->{$aliasName}) { |
1881 |
wakaba |
1.30 |
CORE::delete $ops->{<H::pc:parent>}; |
1882 |
wakaba |
1.4 |
$ops->{$aliasName} |
1883 |
|
|
-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>; |
1884 |
|
|
} |
1885 |
|
|
$ops->{$aliasName} = $realName; |
1886 |
|
|
|
1887 |
|
|
@Method: |
1888 |
|
|
@@Name: getOverloadSub |
1889 |
|
|
@@enDesc: |
1890 |
|
|
Gets an overloading subroutine. |
1891 |
|
|
@@Param: |
1892 |
|
|
@@@Name: opName |
1893 |
|
|
@@@Type: |
1894 |
|
|
DISLang:String::ManakaiDOM:all |
1895 |
|
|
@@@enDesc: |
1896 |
|
|
The name of the overloaded operator. |
1897 |
|
|
@@NamedParam: |
1898 |
|
|
@@@Name: makeNewNode |
1899 |
|
|
@@@Type: |
1900 |
wakaba |
1.12 |
DOMMain:boolean::ManakaiDOM:all |
1901 |
wakaba |
1.4 |
@@@enDesc: |
1902 |
|
|
Whether a new subroutine object should be created, |
1903 |
|
|
if it is not exist, or not. |
1904 |
|
|
@@Return: |
1905 |
wakaba |
1.25 |
@@@Type: PerlSub |
1906 |
|
|
@@@caType: ManakaiPerlSub |
1907 |
wakaba |
1.4 |
@@@enDesc: |
1908 |
|
|
The subroutine object. |
1909 |
|
|
@@@nullCase: |
1910 |
|
|
@@@@enDesc: |
1911 |
|
|
Either the specified subroutine is not found and |
1912 |
|
|
the <P::makeNewNode> parameter is set to <DOM::false> or |
1913 |
|
|
the specified operator is overloaded by specifying method name. |
1914 |
|
|
@@@UnknownOperatorException: |
1915 |
|
|
@@@PerlDef: |
1916 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
1917 |
|
|
@@@@@: |
1918 |
wakaba |
1.4 |
unless (<Code::operatorNameList>->{$opName}) { |
1919 |
|
|
__EXCEPTION{UNSUPPORTED_OPERATOR_ERR:: |
1920 |
|
|
pc:operator => {$opName}, |
1921 |
|
|
}__; |
1922 |
|
|
} |
1923 |
wakaba |
1.30 |
if ($self->{<H::mn:node>}->{<H::dis2pm:operator>}->{$opName}) { |
1924 |
|
|
$r = ref $self->{<H::mn:node>} |
1925 |
|
|
->{<H::dis2pm:operator>}->{$opName} |
1926 |
|
|
? $self->{<H::mn:node>} |
1927 |
|
|
->{<H::dis2pm:operator>}->{$opName} : null; |
1928 |
wakaba |
1.4 |
} elsif ($makeNewNode) { |
1929 |
wakaba |
1.30 |
$r = $self->{<H::mn:node>}->{<H::dis2pm:operator>}->{$opName} |
1930 |
wakaba |
1.4 |
= <ClassM::ManakaiPerlSub.newObject>; |
1931 |
wakaba |
1.30 |
$self->{<H::mn:node>} |
1932 |
wakaba |
1.4 |
-><M::ManakaiDOM:ManakaiDOMNodeObject |
1933 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
1934 |
wakaba |
1.30 |
$r->{<H::pc:parent>} = $self->{<H::mn:node>}; |
1935 |
wakaba |
1.4 |
} |
1936 |
wakaba |
1.6 |
if ($r) { |
1937 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
1938 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
1939 |
|
|
$class => {<ClassName::ManakaiPerlSub>}}__; |
1940 |
|
|
} |
1941 |
wakaba |
1.35 |
@@@PerlDef: |
1942 |
|
|
@@@@ForCheck: pc|ForClass |
1943 |
|
|
@@@@@: |
1944 |
|
|
unless (<Code::operatorNameList>->{$opName}) { |
1945 |
|
|
__EXCEPTION{UNSUPPORTED_OPERATOR_ERR:: |
1946 |
|
|
pc:operator => {$opName}, |
1947 |
|
|
MDOMX:param-name => 'opName', |
1948 |
|
|
}__; |
1949 |
|
|
} |
1950 |
|
|
__DEEP{ |
1951 |
|
|
F: { |
1952 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
1953 |
|
|
if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1954 |
|
|
defined $child-><AG::Node.namespaceURI> and |
1955 |
|
|
$child-><AG::Node.namespaceURI> eq <Q::pc:> and |
1956 |
|
|
$child-><AG::Node.localName> eq 'sub') { |
1957 |
|
|
if ($child-><M::PerlSub.hasPerlOperator> ($opName)) { |
1958 |
|
|
$r = $child; |
1959 |
|
|
last F; |
1960 |
|
|
} |
1961 |
|
|
} |
1962 |
|
|
} |
1963 |
|
|
if ($makeNewNode) { |
1964 |
|
|
$r = $self-><AG::Node.ownerDocument> |
1965 |
|
|
-><M::Document.createElementNS> |
1966 |
|
|
(<Q::pc:>, 'sub'); |
1967 |
|
|
$r-><M::PerlSub.addPerlOperator> ($opName); |
1968 |
|
|
$self-><M::Node.appendChild> ($r); |
1969 |
|
|
} |
1970 |
|
|
} # F |
1971 |
|
|
}__; |
1972 |
wakaba |
1.4 |
|
1973 |
|
|
@Method: |
1974 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
1975 |
wakaba |
1.5 |
@@Name: setOverloadSub |
1976 |
|
|
@@enDesc: |
1977 |
|
|
Sets an overloading subrotine. |
1978 |
|
|
@@Param: |
1979 |
|
|
@@@Name: opName |
1980 |
|
|
@@@Type: |
1981 |
|
|
DISLang:String::ManakaiDOM:all |
1982 |
|
|
@@@enDesc: |
1983 |
|
|
The name of the opeartor to overload. |
1984 |
|
|
@@Param: |
1985 |
|
|
@@@Name: subArg |
1986 |
wakaba |
1.25 |
@@@Type: PerlSub |
1987 |
|
|
@@@caType: ManakaiPerlSub |
1988 |
wakaba |
1.5 |
@@@enDesc: |
1989 |
|
|
The subroutine object. |
1990 |
|
|
@@Return: |
1991 |
|
|
@@@UnknownOperatorException: |
1992 |
|
|
@@@RaiseException: |
1993 |
|
|
@@@@@:IN_USE_NODE_ERR |
1994 |
|
|
@@@@enDesc: |
1995 |
|
|
An attempt is made to set a subroutine that is |
1996 |
|
|
already used elsewhere. |
1997 |
|
|
@@@PerlDef: |
1998 |
|
|
unless (<Code::operatorNameList>->{$opName}) { |
1999 |
|
|
__EXCEPTION{UNSUPPORTED_OPERATOR_ERR:: |
2000 |
|
|
pc:operator => {$opName}, |
2001 |
|
|
}__; |
2002 |
|
|
} |
2003 |
wakaba |
1.30 |
my $ops = $self->{<H::mn:node>}->{<H::dis2pm:operator>}; |
2004 |
wakaba |
1.5 |
if (ref $ops->{$opName}) { |
2005 |
wakaba |
1.30 |
CORE::delete $ops->{<H::pc:parent>}; |
2006 |
wakaba |
1.5 |
$ops->{$opName} |
2007 |
|
|
-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>; |
2008 |
|
|
} |
2009 |
wakaba |
1.30 |
if ($subArg->{<H::mn:node>}->{<H::pc:parent>}) { |
2010 |
wakaba |
1.5 |
__EXCEPTION{IN_USE_NODE_ERR:: |
2011 |
|
|
pc:parentNode => {$self}, |
2012 |
|
|
pc:childNode => {$subArg}, |
2013 |
|
|
}__; |
2014 |
|
|
} |
2015 |
wakaba |
1.30 |
$self->{<H::mn:node>}-><M::MNodeObject.importTree> |
2016 |
|
|
($subArg->{<H::mn:node>}); |
2017 |
|
|
$ops->{$opName} = $subArg->{<H::mn:node>}; |
2018 |
|
|
$subArg->{<H::mn:node>}->{<H::pc:parent>} |
2019 |
|
|
= $self->{<H::mn:node>}; |
2020 |
wakaba |
1.5 |
|
2021 |
|
|
|
2022 |
|
|
@Method: |
2023 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
2024 |
wakaba |
1.4 |
@@Name: getOverloadMethodName |
2025 |
|
|
@@enDesc: |
2026 |
|
|
Gets an overloading method name. |
2027 |
|
|
@@Param: |
2028 |
|
|
@@@Name: opName |
2029 |
|
|
@@@Type: |
2030 |
|
|
DISLang:String::ManakaiDOM:all |
2031 |
|
|
@@@enDesc: |
2032 |
|
|
The name of the overloaded operator. |
2033 |
|
|
@@Return: |
2034 |
|
|
@@@Type: |
2035 |
|
|
DISLang:String::ManakaiDOM:all |
2036 |
|
|
@@@enDesc: |
2037 |
|
|
The method name. |
2038 |
|
|
@@@nullCase: |
2039 |
|
|
@@@@enDesc: |
2040 |
|
|
The specified operator is not overloaded. |
2041 |
|
|
@@@InCase: |
2042 |
|
|
@@@@Value:\#CODE |
2043 |
|
|
@@@@enDesc: |
2044 |
|
|
The operator is overloaded by an anonymous subroutine. |
2045 |
|
|
@@@PerlDef: |
2046 |
wakaba |
1.30 |
if ($self->{<H::mn:node>}->{<H::dis2pm:operator>}->{$opName}) { |
2047 |
|
|
$r = ref $self->{<H::mn:node>} |
2048 |
|
|
->{<H::dis2pm:operator>}->{$opName} |
2049 |
|
|
? q<#CODE> : $self->{<H::mn:node>} |
2050 |
|
|
->{<H::dis2pm:operator>}->{$opName}; |
2051 |
wakaba |
1.4 |
} |
2052 |
|
|
|
2053 |
|
|
@Method: |
2054 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
2055 |
wakaba |
1.4 |
@@Name: setOverloadMethodName |
2056 |
|
|
@@enDesc: |
2057 |
|
|
Sets an overloading method name. |
2058 |
|
|
@@Param: |
2059 |
|
|
@@@Name: opName |
2060 |
|
|
@@@Type: |
2061 |
|
|
DISLang:String::ManakaiDOM:all |
2062 |
|
|
@@@enDesc: |
2063 |
|
|
The name of the overloaded operator. |
2064 |
|
|
@@Param: |
2065 |
|
|
@@@Name: methodName |
2066 |
|
|
@@@Type: |
2067 |
|
|
DISLang:String::ManakaiDOM:all |
2068 |
|
|
@@@enDesc: |
2069 |
|
|
The name of the method by which overloads an operator. |
2070 |
|
|
\ |
2071 |
|
|
{NOTE:: The method may or may not belong to this package. |
2072 |
|
|
\ |
2073 |
|
|
} |
2074 |
|
|
@@Return: |
2075 |
|
|
@@@UnknownOperatorException: |
2076 |
|
|
@@@PerlDef: |
2077 |
|
|
unless (<Code::operatorNameList>->{$opName}) { |
2078 |
|
|
__EXCEPTION{UNSUPPORTED_OPERATOR_ERR:: |
2079 |
|
|
pc:operator => {$opName}, |
2080 |
|
|
}__; |
2081 |
|
|
} |
2082 |
wakaba |
1.30 |
my $ops = $self->{<H::mn:node>}->{<H::dis2pm:operator>}; |
2083 |
wakaba |
1.4 |
if (ref $ops->{$opName}) { |
2084 |
wakaba |
1.30 |
CORE::delete $ops->{<H::pc:parent>}; |
2085 |
wakaba |
1.4 |
$ops->{$opName} |
2086 |
|
|
-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>; |
2087 |
|
|
} |
2088 |
|
|
$ops->{$opName} = $methodName; |
2089 |
|
|
|
2090 |
wakaba |
1.1 |
@Method: |
2091 |
wakaba |
1.13 |
@@Name: addISAPackage |
2092 |
wakaba |
1.1 |
@@enDesc: |
2093 |
|
|
Adds a class package that this class inherits. |
2094 |
|
|
@@Param: |
2095 |
|
|
@@@Name: packageName |
2096 |
wakaba |
1.35 |
@@@Type: DOMString |
2097 |
wakaba |
1.1 |
@@@enDesc: |
2098 |
|
|
The name of package to add. |
2099 |
|
|
@@Return: |
2100 |
|
|
@@@PerlDef: |
2101 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2102 |
|
|
@@@@@: |
2103 |
wakaba |
1.30 |
push @{$self->{<H::mn:node>}->{<H::dis:ISA>}}, $packageName; |
2104 |
wakaba |
1.35 |
@@@PerlDef: |
2105 |
|
|
@@@@ForCheck: pc|ForClass |
2106 |
|
|
@@@@@: |
2107 |
|
|
__DEEP{ |
2108 |
|
|
$self-><M::Element.setAttributeNS> |
2109 |
|
|
(<Q::pc:>, 'pc:extends' => |
2110 |
|
|
join ' ', (split /\s+/, $self-><M::Element.getAttributeNS> |
2111 |
|
|
(<Q::pc:>, 'extends')), $packageName); |
2112 |
|
|
}__; |
2113 |
|
|
|
2114 |
|
|
@Method: |
2115 |
|
|
@@ForCheck: !pc|ForClassCompat |
2116 |
|
|
@@Name: getISAPackageNameList |
2117 |
|
|
@@enDesc: |
2118 |
|
|
Returns a list of names of packages extended by the package. |
2119 |
|
|
@@Return: |
2120 |
|
|
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
2121 |
|
|
@@@enDesc: |
2122 |
|
|
An ordered snapshot list of superpackage names. |
2123 |
|
|
@@@PerlDef: |
2124 |
|
|
__DEEP{ |
2125 |
|
|
$r = [split /\s+/, $self-><M::Element.getAttributeNS> |
2126 |
|
|
(<Q::pc:>, 'extends')]; |
2127 |
|
|
}__; |
2128 |
wakaba |
1.1 |
|
2129 |
|
|
@Method: |
2130 |
|
|
@@Name: addImplementPackage |
2131 |
|
|
@@enDesc: |
2132 |
|
|
Adds a interface package that this class implements. |
2133 |
|
|
@@Param: |
2134 |
|
|
@@@Name: packageName |
2135 |
wakaba |
1.35 |
@@@Type: DOMString |
2136 |
wakaba |
1.1 |
@@@enDesc: |
2137 |
|
|
The name of package to add. |
2138 |
|
|
@@Return: |
2139 |
|
|
@@@PerlDef: |
2140 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2141 |
|
|
@@@@@: |
2142 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::dis:Implement>}->{$packageName} = true; |
2143 |
wakaba |
1.35 |
@@@PerlDef: |
2144 |
|
|
@@@@ForCheck: pc|ForClass |
2145 |
|
|
@@@@@: |
2146 |
|
|
__DEEP{ |
2147 |
|
|
__CODE{addNameListAttr:: |
2148 |
|
|
$node => {$self}, |
2149 |
|
|
$attrName => 'implements', |
2150 |
|
|
$newName => {$packageName}, |
2151 |
|
|
}__; |
2152 |
|
|
}__; |
2153 |
|
|
|
2154 |
|
|
@Method: |
2155 |
|
|
@@ForCheck: !pc|ForClassCompat |
2156 |
|
|
@@Name: getImplementPackageNameList |
2157 |
|
|
@@enDesc: |
2158 |
|
|
Returns a list of names of packages implemented by the package. |
2159 |
|
|
@@Return: |
2160 |
|
|
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
2161 |
|
|
@@@enDesc: |
2162 |
|
|
An unordered snapshot list of interface packages. |
2163 |
|
|
@@@PerlDef: |
2164 |
|
|
__DEEP{ |
2165 |
|
|
__CODE{getNameListAttr:: |
2166 |
|
|
$node => {$self}, |
2167 |
|
|
$attrName => 'implements', |
2168 |
|
|
$result => {$r}, |
2169 |
|
|
}__; |
2170 |
|
|
}__; |
2171 |
wakaba |
1.1 |
|
2172 |
|
|
@ToStringMethod: |
2173 |
|
|
@@Return: |
2174 |
wakaba |
1.35 |
@@@Type: DOMString |
2175 |
wakaba |
1.1 |
@@@enDesc: |
2176 |
|
|
Perl code. |
2177 |
|
|
@@@PerlDef: |
2178 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2179 |
|
|
@@@@@: |
2180 |
wakaba |
1.1 |
my $file = $self-><AG::ManakaiPerlCodeFragment.parentNode>; |
2181 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
2182 |
wakaba |
1.15 |
|
2183 |
|
|
## Package name |
2184 |
wakaba |
1.30 |
my $pn = $node->{<H::pc:packageName>}; |
2185 |
wakaba |
1.1 |
$r .= q<package > . $pn . ";\n"; |
2186 |
wakaba |
1.15 |
|
2187 |
|
|
## Package version |
2188 |
wakaba |
1.1 |
__DEEP{ |
2189 |
|
|
$file-><AS::ManakaiPerlFile.currentPackage> ($pn); |
2190 |
|
|
$r .= 'our $VERSION = '. |
2191 |
|
|
<ClassM::ManakaiPerlCodeImplementation.versionDateTime> (time). |
2192 |
|
|
";\n"; |
2193 |
|
|
}__; |
2194 |
wakaba |
1.15 |
|
2195 |
|
|
## Inheritance |
2196 |
wakaba |
1.30 |
my @isa = (@{$node->{<H::dis:ISA>}}, |
2197 |
wakaba |
1.33 |
sort {$a cmp $b} keys %{$node->{<H::dis:Implement>}}); |
2198 |
wakaba |
1.1 |
if (@isa) { |
2199 |
|
|
$r .= 'push our @ISA, ' . |
2200 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> (\@isa) . |
2201 |
|
|
";\n"; |
2202 |
|
|
} |
2203 |
wakaba |
1.15 |
|
2204 |
|
|
## Uses |
2205 |
|
|
my $use = $self-><M::ManakaiPerlCodeFragment.getUsePerlModuleNameList>; |
2206 |
|
|
for my $pack (@$use) { |
2207 |
|
|
$r .= 'use ' . $pack . ";\n"; |
2208 |
|
|
} |
2209 |
|
|
|
2210 |
wakaba |
1.22 |
my $cls = $self-><M::ManakaiPerlCodeFragment.getUseCharClassNameList>; |
2211 |
wakaba |
1.33 |
for my $pack (sort {$a cmp $b} keys %$cls) { |
2212 |
wakaba |
1.22 |
$r .= 'use ' . $pack . ' ' . |
2213 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> |
2214 |
|
|
([grep {$cls->{$pack}->{$_}} keys %{$cls->{$pack}}]) . ";\n"; |
2215 |
|
|
} |
2216 |
|
|
|
2217 |
wakaba |
1.16 |
## Package-scope objects |
2218 |
wakaba |
1.30 |
for my $cno (@{$node->{<H::pc:childNodes>}}) { |
2219 |
wakaba |
1.16 |
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
2220 |
|
|
$r .= $cn->stringify; |
2221 |
|
|
} |
2222 |
|
|
|
2223 |
wakaba |
1.15 |
## Subroutines |
2224 |
wakaba |
1.33 |
for my $cnk (sort {$a cmp $b} keys %{$node->{<H::pc:sub>}}) { |
2225 |
wakaba |
1.30 |
my $cno = $node->{<H::pc:sub>}->{$cnk}; |
2226 |
wakaba |
1.4 |
if (ref $cno) { |
2227 |
wakaba |
1.6 |
my $cn; |
2228 |
wakaba |
1.35 |
__CODE{ManakaiNode:getWeakReference||ManakaiDOM|Perl:: |
2229 |
wakaba |
1.6 |
$object => $cno, $ref => $cn, |
2230 |
|
|
$class => {<ClassName::ManakaiPerlSub>}}__; |
2231 |
wakaba |
1.4 |
$r .= $cn->stringify; |
2232 |
|
|
} else { |
2233 |
wakaba |
1.19 |
$r .= qq<*$cnk = \\&$cno;\n>; |
2234 |
wakaba |
1.4 |
} |
2235 |
|
|
} |
2236 |
wakaba |
1.15 |
|
2237 |
|
|
## Operators |
2238 |
wakaba |
1.4 |
my $op = ''; |
2239 |
wakaba |
1.33 |
for my $cnk (sort {$a cmp $b} keys %{$node->{<H::dis2pm:operator>}}) { |
2240 |
wakaba |
1.30 |
my $cno = $node->{<H::dis2pm:operator>}->{$cnk}; |
2241 |
wakaba |
1.4 |
if (ref $cno) { |
2242 |
wakaba |
1.6 |
my $cn; |
2243 |
wakaba |
1.35 |
__CODE{ManakaiNode:getWeakReference||ManakaiDOM|Perl:: |
2244 |
wakaba |
1.6 |
$object => $cno, $ref => $cn, |
2245 |
|
|
$class => {<ClassName::ManakaiPerlSub>}}__; |
2246 |
wakaba |
1.4 |
$op .= <ClassM::ManakaiPerlCodeImplementation.perlLiteral> ($cnk) |
2247 |
|
|
. ' => ' . $cn->stringify . ', '; |
2248 |
|
|
} elsif (defined $cno) { |
2249 |
|
|
$op .= <ClassM::ManakaiPerlCodeImplementation.perlList> |
2250 |
|
|
([$cnk => $cno]) . ', '; |
2251 |
|
|
} |
2252 |
|
|
} |
2253 |
wakaba |
1.14 |
$r .= 'use overload bool => sub () {1}, ' . |
2254 |
|
|
$op . qq[fallback => 1;\n] if $op; |
2255 |
wakaba |
1.18 |
|
2256 |
|
|
|
2257 |
|
|
## -- Exports |
2258 |
wakaba |
1.34 |
if (%{$node->{<H::pc:export>} || {}}) { |
2259 |
wakaba |
1.18 |
$r .= q[our %EXPORT_TAG = (] . |
2260 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> |
2261 |
wakaba |
1.33 |
([map {$_ => [sort {$a cmp $b} |
2262 |
|
|
keys %{$node->{<H::pc:export>}->{$_}}]} |
2263 |
|
|
sort {$a cmp $b} |
2264 |
wakaba |
1.30 |
grep {$_} keys %{$node->{<H::pc:export>}}]) . qq[);\n]; |
2265 |
wakaba |
1.18 |
$r .= q[our @EXPORT_OK = (] . |
2266 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> |
2267 |
wakaba |
1.33 |
([map {sort {$a cmp $b} |
2268 |
|
|
keys %{$node->{<H::pc:export>}->{$_}}} |
2269 |
|
|
sort {$a cmp $b} |
2270 |
wakaba |
1.30 |
keys %{$node->{<H::pc:export>}}]) . qq[);\n]; |
2271 |
wakaba |
1.18 |
$r .= q[use Exporter; push our @ISA, 'Exporter';] . qq[\n]; |
2272 |
|
|
} |
2273 |
wakaba |
1.35 |
@@@PerlDef: |
2274 |
|
|
@@@@ForCheck: pc|ForClass |
2275 |
|
|
@@@@@: |
2276 |
|
|
__DEEP{ |
2277 |
|
|
my $file = $self-><AG::PerlCode.fileNode>; |
2278 |
|
|
|
2279 |
|
|
## Package name |
2280 |
|
|
my $pn = $self-><AG::PerlPackage.packageName>; |
2281 |
|
|
$r .= q<package > . $pn . ";\n"; |
2282 |
|
|
$file-><AS::PerlFile.currentPackage> ($pn) if $file; |
2283 |
|
|
|
2284 |
|
|
## Package version |
2285 |
|
|
$r .= 'our $VERSION = '. |
2286 |
|
|
<ClassM::ManakaiPerlCodeImplementation.versionDateTime> (time). |
2287 |
|
|
";\n"; |
2288 |
|
|
|
2289 |
|
|
## Inheritance |
2290 |
|
|
my @isa = (@{$self-><M::PerlPackage.getISAPackageNameList>}, |
2291 |
|
|
sort {$a cmp $b} @{$self-><M::PerlPackage |
2292 |
|
|
.getImplementPackageNameList>}); |
2293 |
|
|
if (@isa) { |
2294 |
|
|
$r .= 'push our @ISA, ' . |
2295 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> (\@isa) . |
2296 |
|
|
";\n"; |
2297 |
|
|
} |
2298 |
|
|
|
2299 |
|
|
## Use'ing modules |
2300 |
|
|
for my $pack (sort {$a cmp $b} @{$self-><M::PerlCode |
2301 |
|
|
.getUsePerlModuleNameList>}) { |
2302 |
|
|
$r .= 'use ' . $pack . ";\n"; |
2303 |
|
|
} |
2304 |
|
|
|
2305 |
|
|
my $cls = $self-><M::PerlCode.getUseCharClassNameList>; |
2306 |
|
|
for my $pack (sort {$a cmp $b} keys %$cls) { |
2307 |
|
|
$r .= 'use ' . $pack . ' ' . |
2308 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> |
2309 |
|
|
([sort {$a cmp $b} grep {$cls->{$pack}->{$_}} |
2310 |
|
|
keys %{$cls->{$pack}}]) . ";\n"; |
2311 |
|
|
} |
2312 |
|
|
|
2313 |
|
|
## Package-scope objects |
2314 |
|
|
my $has_bool; |
2315 |
|
|
my $op = ''; |
2316 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
2317 |
|
|
if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
2318 |
|
|
defined $child-><AG::Node.namespaceURI> and |
2319 |
|
|
$child-><AG::Node.namespaceURI> eq <Q::pc:>) { |
2320 |
|
|
my $ln = $child-><AG::Node.localName>; |
2321 |
|
|
if ($ln eq 'sub') { |
2322 |
|
|
my $names = $child-><M::PerlSub.getPerlNameList>; |
2323 |
|
|
my $ops = $child-><M::PerlSub.getPerlOperatorList>; |
2324 |
|
|
if (@$names) { |
2325 |
|
|
$r .= $child->stringify; |
2326 |
|
|
if (@$names > 1) { |
2327 |
|
|
$r .= sprintf q<*%s = \&%s;%s>, |
2328 |
|
|
$_, $names->[0], "\n" for @$names[1..$#$names]; |
2329 |
|
|
} |
2330 |
|
|
for (@$ops) { |
2331 |
|
|
$op .= sprintf q['%s' => '%s', %s], |
2332 |
|
|
$_ => $names->[0], "\n"; |
2333 |
|
|
$has_bool = true if $_ eq 'bool'; |
2334 |
|
|
} |
2335 |
|
|
} else { |
2336 |
|
|
my $v = $child->stringify; |
2337 |
|
|
for (@$ops) { |
2338 |
|
|
$op .= sprintf q['%s' => %s, %s], $_ => $v, "\n"; |
2339 |
|
|
$has_bool = true if $_ eq 'bool'; |
2340 |
|
|
} |
2341 |
|
|
} |
2342 |
|
|
} else { |
2343 |
|
|
$r .= $child->stringify; |
2344 |
|
|
} |
2345 |
|
|
} # pc:* |
2346 |
|
|
} # children |
2347 |
|
|
|
2348 |
|
|
if (length $op) { |
2349 |
|
|
$r .= "use overload \n"; |
2350 |
|
|
$r .= "bool => sub () {1}, \n" unless $has_bool; |
2351 |
|
|
$r .= $op . "fallback => 1;\n"; |
2352 |
|
|
} |
2353 |
|
|
|
2354 |
|
|
## -- Exports |
2355 |
|
|
my $xport = $self-><M::PerlPackage.getExportList>; |
2356 |
|
|
if (map {values %$_} values %$xport) { |
2357 |
|
|
$r .= q[our %EXPORT_TAG = (] . |
2358 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> |
2359 |
|
|
([map {$_ => [sort {$a cmp $b} keys %{$xport->{$_}}]} |
2360 |
|
|
sort {$a cmp $b} grep {length} |
2361 |
|
|
keys %$xport]) . qq[);\n]; |
2362 |
|
|
$r .= q[our @EXPORT_OK = (] . |
2363 |
|
|
<ClassM::ManakaiPerlCodeImplementation.perlList> |
2364 |
|
|
([map {sort {$a cmp $b} keys %{$xport->{$_}}} |
2365 |
|
|
sort {$a cmp $b} keys %$xport]) . qq[);\n]; |
2366 |
|
|
$r .= q[use Exporter; push our @ISA, 'Exporter';] . qq[\n]; |
2367 |
|
|
} |
2368 |
|
|
}__; |
2369 |
|
|
|
2370 |
|
|
@Method: |
2371 |
|
|
@@ForCheck: !pc|ForClassCompat |
2372 |
|
|
@@Name: getExportList |
2373 |
|
|
@@enDesc: |
2374 |
|
|
Returns a list of export tag and names. |
2375 |
|
|
@@Return: |
2376 |
|
|
@@@Type: DISPerl|HASH||ManakaiDOM|all |
2377 |
|
|
@@@enDesc: |
2378 |
|
|
Snapshot list of lists. |
2379 |
|
|
@@@PerlDef: |
2380 |
|
|
my $mc; |
2381 |
|
|
__DEEP{ |
2382 |
|
|
__CODE{getNameListAttr:: |
2383 |
|
|
$node => {$self}, |
2384 |
|
|
$attrName => 'export', |
2385 |
|
|
$result => {$mc}, |
2386 |
|
|
}__; |
2387 |
|
|
}__; |
2388 |
|
|
for (@$mc) { |
2389 |
|
|
my ($m, $c) = split /\./, $_, 2; |
2390 |
|
|
$r->{$m}->{$c} = true; |
2391 |
|
|
} |
2392 |
wakaba |
1.18 |
|
2393 |
|
|
@Method: |
2394 |
|
|
@@Name: addExport |
2395 |
|
|
@@enDesc: |
2396 |
wakaba |
1.26 |
Adds a name to the list of exported items (<Perl::@EXPORT_OK>). |
2397 |
wakaba |
1.18 |
@@Param: |
2398 |
|
|
@@@Name: exportTag |
2399 |
wakaba |
1.35 |
@@@Type: DOMString |
2400 |
wakaba |
1.18 |
@@@enDesc: |
2401 |
|
|
The name of the tag (without <CHAR::COLON> prefix). |
2402 |
|
|
The <P::exportName> is added both to <Perl::@EXPORT_OK> |
2403 |
|
|
and <Perl::$EXPORT_OK{<P::exportTag>}>. |
2404 |
|
|
@@@nullCase: |
2405 |
|
|
@@@@enDesc: |
2406 |
|
|
The <P::exportName> is added only to the <Perl::@EXPORT_OK>. |
2407 |
|
|
@@Param: |
2408 |
|
|
@@@Name: exportName |
2409 |
wakaba |
1.35 |
@@@Type: DOMString |
2410 |
wakaba |
1.18 |
@@@enDesc: |
2411 |
|
|
The name to be exported. |
2412 |
|
|
@@Return: |
2413 |
|
|
@@@PerlDef: |
2414 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2415 |
|
|
@@@@@: |
2416 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::pc:export>} |
2417 |
wakaba |
1.18 |
->{defined $exportTag ? $exportTag : ''}->{$exportName} = true; |
2418 |
wakaba |
1.35 |
@@@PerlDef: |
2419 |
|
|
@@@@ForCheck: pc|ForClass |
2420 |
|
|
@@@@@: |
2421 |
|
|
__DEEP{ |
2422 |
|
|
__CODE{addNameListAttr:: |
2423 |
|
|
$node => {$self}, |
2424 |
|
|
$attrName => 'export', |
2425 |
|
|
$newName => {$exportTag.'.'.$exportName}, |
2426 |
|
|
}__; |
2427 |
|
|
}__; |
2428 |
wakaba |
1.1 |
##PerlPackageScope |
2429 |
|
|
|
2430 |
wakaba |
1.4 |
PropDef: |
2431 |
|
|
@QName: |
2432 |
|
|
dis2pm:operator |
2433 |
|
|
@enDesc: |
2434 |
|
|
Overloaded operators. |
2435 |
|
|
|
2436 |
|
|
ElementTypeBinding: |
2437 |
|
|
@Name: UnknownOperatorException |
2438 |
|
|
@ElementType: |
2439 |
|
|
ManakaiDOM:raises |
2440 |
|
|
@ShadowContent: |
2441 |
|
|
@@@:UNSUPPORTED_OPERATOR_ERR |
2442 |
|
|
@@enDesc: |
2443 |
|
|
An attempt is made to overload an unknown operator. |
2444 |
|
|
|
2445 |
|
|
XParamDef: |
2446 |
|
|
@QName: |
2447 |
|
|
pc:operator |
2448 |
|
|
@enDesc: |
2449 |
|
|
An operator to overload. |
2450 |
|
|
|
2451 |
|
|
ResourceDef: |
2452 |
wakaba |
1.28 |
@For: ManakaiDOM|Perl |
2453 |
wakaba |
1.4 |
@QName: operatorNameList |
2454 |
|
|
@enDesc: |
2455 |
|
|
The list of valid operators for <PerlModule::operator> pragma. |
2456 |
|
|
@rdf:type: |
2457 |
|
|
dis2pm:InlineCode |
2458 |
wakaba |
1.28 |
@PerlCDef: |
2459 |
wakaba |
1.4 |
{qw[ |
2460 |
|
|
+ 1 - 1 * 1 / 1 % 1 ** 1 << 1 >> 1 x 1 . 1 |
2461 |
|
|
+= 1 -= 1 *= 1 /= 1 %= 1 **= 1 <<= 1 >>= 1 x= 1 .= 1 |
2462 |
|
|
< 1 <= 1 > 1 >= 1 == 1 != 1 <=> 1 |
2463 |
|
|
lt 1 le 1 gt 1 ge 1 eq 1 ne 1 cmp 1 |
2464 |
|
|
& 1 | 1 ^ 1 neg 1 ! 1 ~ 1 |
2465 |
|
|
++ 1 -- 1 = 1 |
2466 |
|
|
atan2 1 cos 1 sin 1 exp 1 abs 1 log 1 sqrt 1 |
2467 |
|
|
bool 1 "" 1 0+ 1 ${} 1 @{} 1 %{} 1 &{} 1 *{} 1 <> 1 |
2468 |
|
|
nomethod 1 |
2469 |
|
|
]} |
2470 |
|
|
|
2471 |
wakaba |
1.35 |
IFClsETDef: |
2472 |
wakaba |
1.25 |
@IFQName: PerlCodeStatements |
2473 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlStatementContainer |
2474 |
wakaba |
1.35 |
@CQName: ManakaiPCCodeStatements |
2475 |
|
|
@ETQName: |
2476 |
|
|
@@@: pc|statementContainer |
2477 |
|
|
@@ImplNote: |
2478 |
|
|
@@@lang:en |
2479 |
|
|
@@@@: Dummy. |
2480 |
wakaba |
1.25 |
|
2481 |
|
|
@IFISA: PerlCodeUnits |
2482 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlAnyContainer |
2483 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeUnits |
2484 |
wakaba |
1.1 |
@enDesc: |
2485 |
wakaba |
1.6 |
A base class for node types that contains zero or more |
2486 |
|
|
statements and/or blocks. |
2487 |
wakaba |
1.1 |
|
2488 |
wakaba |
1.35 |
@ATTR: |
2489 |
wakaba |
1.10 |
@@Name: sourceFile |
2490 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceFile |
2491 |
wakaba |
1.10 |
@@enDesc: |
2492 |
|
|
The source file name of this fragment. |
2493 |
wakaba |
1.35 |
@@ReflectCDATA: |
2494 |
wakaba |
1.10 |
@@Get: |
2495 |
|
|
@@@enDesc: |
2496 |
|
|
Any string identifying the source. |
2497 |
|
|
@@@nullCase: |
2498 |
|
|
@@@@enDesc: No source file name is set. |
2499 |
|
|
@@@disDef: |
2500 |
|
|
@@@@GetProp: sourceFile |
2501 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2502 |
wakaba |
1.10 |
@@Set: |
2503 |
|
|
@@@nullCase: |
2504 |
|
|
@@@@enDesc: No (or unknown) source file. |
2505 |
|
|
@@@disDef: |
2506 |
|
|
@@@@SetProp: sourceFile |
2507 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2508 |
wakaba |
1.10 |
|
2509 |
wakaba |
1.35 |
@ATTR: |
2510 |
wakaba |
1.10 |
@@Name: sourceLine |
2511 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceLine |
2512 |
wakaba |
1.10 |
@@enDesc: |
2513 |
|
|
Source file line number of the first line of this fragment. |
2514 |
wakaba |
1.35 |
@@ReflectCDATA: |
2515 |
wakaba |
1.10 |
@@Get: |
2516 |
|
|
@@@disDef: |
2517 |
|
|
@@@@GetProp: sourceLine |
2518 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2519 |
wakaba |
1.10 |
@@Set: |
2520 |
|
|
@@@disDef: |
2521 |
|
|
@@@@SetProp: sourceLine |
2522 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2523 |
wakaba |
1.10 |
|
2524 |
wakaba |
1.35 |
@ATTR: |
2525 |
wakaba |
1.1 |
@@Name: currentSourceFile |
2526 |
wakaba |
1.35 |
@@ATTRQName: pc|currentSourceFile |
2527 |
wakaba |
1.1 |
@@enDesc: |
2528 |
|
|
The current source file name that is referred when |
2529 |
|
|
a code fragment is added. |
2530 |
wakaba |
1.35 |
@@ReflectCDATA: |
2531 |
wakaba |
1.1 |
@@Get: |
2532 |
|
|
@@@nullCase: |
2533 |
|
|
@@@@enDesc: No source file name is set. |
2534 |
|
|
@@@disDef: |
2535 |
wakaba |
1.10 |
@@@@GetProp:currentSourceFile |
2536 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2537 |
wakaba |
1.1 |
@@Set: |
2538 |
|
|
@@@nullCase: |
2539 |
|
|
@@@@enDesc: No (or unknown) source file. |
2540 |
|
|
@@@disDef: |
2541 |
wakaba |
1.10 |
@@@@SetProp:currentSourceFile |
2542 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2543 |
wakaba |
1.1 |
|
2544 |
wakaba |
1.35 |
@ATTR: |
2545 |
wakaba |
1.1 |
@@Name: currentSourceLine |
2546 |
wakaba |
1.35 |
@@ATTRQName: pc|currentSourceLine |
2547 |
wakaba |
1.1 |
@@enDesc: |
2548 |
|
|
The current line number in source file that is referred when |
2549 |
|
|
a code fragment is added. |
2550 |
wakaba |
1.35 |
@@ReflectCDATA: |
2551 |
wakaba |
1.1 |
@@Get: |
2552 |
|
|
@@@disDef: |
2553 |
wakaba |
1.10 |
@@@@GetProp:currentSourceLine |
2554 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2555 |
wakaba |
1.1 |
@@Set: |
2556 |
|
|
@@@disDef: |
2557 |
wakaba |
1.10 |
@@@@SetProp:currentSourceLine |
2558 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2559 |
wakaba |
1.1 |
|
2560 |
|
|
@Method: |
2561 |
wakaba |
1.5 |
@@Name: appendCodeFragment |
2562 |
|
|
@@enDesc: |
2563 |
|
|
Appends a <Class::ManakaiPerlCodeFragment> object. |
2564 |
|
|
@@Param: |
2565 |
|
|
@@@Name: codeArg |
2566 |
wakaba |
1.25 |
@@@Type: PerlCode |
2567 |
|
|
@@@caType: ManakaiPerlCodeFragment |
2568 |
wakaba |
1.5 |
@@@enDesc: |
2569 |
|
|
A code fragment object. |
2570 |
|
|
@@Return: |
2571 |
|
|
@@@RaiseException: |
2572 |
|
|
@@@@@:BAD_CHILD_ERR |
2573 |
|
|
@@@@enDesc: |
2574 |
|
|
An attempt is made to append a child |
2575 |
|
|
that is not a <Class::ManakaiPerlUnparsedCode>. |
2576 |
|
|
@@@RaiseException: |
2577 |
|
|
@@@@@:IN_USE_NODE_ERR |
2578 |
|
|
@@@@enDesc: |
2579 |
|
|
An attempt is made to append a node that is |
2580 |
|
|
already used elsewhere. |
2581 |
|
|
@@@PerlDef: |
2582 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2583 |
|
|
@@@@@: |
2584 |
wakaba |
1.6 |
if ({ |
2585 |
|
|
unparsed => 1, if => 1, statement => 1, block => 1, |
2586 |
wakaba |
1.9 |
blockcontainer => true, |
2587 |
wakaba |
1.6 |
inunparsed => 1, variable => 1, bare => 1, atom => 1, |
2588 |
|
|
incontainer => 1, string => 1, assign => 1, |
2589 |
wakaba |
1.30 |
}->{$codeArg->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
2590 |
|
|
if ($codeArg->{<H::mn:node>}->{<H::pc:parent>}) { |
2591 |
wakaba |
1.5 |
__EXCEPTION{IN_USE_NODE_ERR:: |
2592 |
|
|
pc:childNode => {$codeArg}, |
2593 |
|
|
}__; |
2594 |
|
|
} |
2595 |
wakaba |
1.30 |
$self->{<H::mn:node>}-><M::MNodeObject.importTree> |
2596 |
|
|
($codeArg->{<H::mn:node>}); |
2597 |
|
|
push @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}, |
2598 |
|
|
$codeArg->{<H::mn:node>}; |
2599 |
|
|
$codeArg->{<H::mn:node>}->{<H::pc:parent>} |
2600 |
|
|
= $self->{<H::mn:node>}; |
2601 |
wakaba |
1.5 |
} else { |
2602 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
2603 |
|
|
pc:parentNode => {$self}, |
2604 |
|
|
pc:childNode => {$codeArg}, |
2605 |
|
|
}__; |
2606 |
|
|
} |
2607 |
wakaba |
1.35 |
@@@PerlDef: |
2608 |
|
|
@@@@ForCheck: pc|ForClass |
2609 |
|
|
@@@@@: |
2610 |
|
|
if ({ |
2611 |
|
|
unparsed => 1, if => 1, statement => 1, block => 1, |
2612 |
|
|
blockContainer => true, |
2613 |
|
|
inlineUnparsed => 1, variable => 1, tokens => 1, atom => 1, |
2614 |
|
|
inlineContainer => 1, stringLiteral => 1, assignment => 1, |
2615 |
|
|
}->{$codeArg-><AG::Node.localName>}) { |
2616 |
|
|
if ($codeArg-><AG::Node.parentNode>) { |
2617 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
2618 |
|
|
pc:childNode => {$codeArg}, |
2619 |
|
|
MDOMX:param-name => 'codeArg', |
2620 |
|
|
}__; |
2621 |
|
|
} |
2622 |
|
|
__DEEP{ |
2623 |
|
|
$self-><AG::Node.ownerDocument> |
2624 |
|
|
-><M::Document.adoptNode> ($codeArg); |
2625 |
|
|
$self-><M::Node.appendChild> ($codeArg); |
2626 |
|
|
}__; |
2627 |
|
|
} else { |
2628 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
2629 |
|
|
pc:parentNode => {$self}, |
2630 |
|
|
pc:childNode => {$codeArg}, |
2631 |
|
|
MDOMX:param-name => 'codeArg', |
2632 |
|
|
}__; |
2633 |
|
|
} |
2634 |
wakaba |
1.5 |
|
2635 |
|
|
@Method: |
2636 |
wakaba |
1.1 |
@@Name: appendCode |
2637 |
|
|
@@enDesc: |
2638 |
|
|
Appends an unparsed Perl code fragment. |
2639 |
|
|
@@Param: |
2640 |
|
|
@@@Name: codeArg |
2641 |
wakaba |
1.35 |
@@@Type: DOMString |
2642 |
wakaba |
1.1 |
@@@enDesc: |
2643 |
|
|
An unparsed Perl code fragment. |
2644 |
|
|
@@Return: |
2645 |
wakaba |
1.25 |
@@@Type: PerlUnparsedCode |
2646 |
wakaba |
1.1 |
@@@enDesc: |
2647 |
|
|
The newly created Perl code object. |
2648 |
|
|
@@@PerlDef: |
2649 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2650 |
|
|
@@@@@: |
2651 |
wakaba |
1.1 |
$r = <ClassM::ManakaiPerlUnparsedCode.newObject>; |
2652 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
2653 |
|
|
$r->{<H::pc:sourceFile>} = $node->{<H::pc:currentSourceFile>}; |
2654 |
|
|
$r->{<H::pc:sourceLine>} = $node->{<H::pc:currentSourceLine>}; |
2655 |
|
|
$r->{<H::pc:code>} = $codeArg; |
2656 |
|
|
$node->{<H::pc:currentSourceLine>} += ($codeArg =~ tr/\x0A/\x0A/); |
2657 |
wakaba |
1.6 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
2658 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
2659 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
2660 |
|
|
$r->{<H::pc:parent>} = $node; |
2661 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
2662 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
2663 |
|
|
$class =>{<ClassName::ManakaiPerlUnparsedCode>}, |
2664 |
|
|
}__; |
2665 |
wakaba |
1.35 |
@@@PerlDef: |
2666 |
|
|
@@@@ForCheck: pc|ForClass |
2667 |
|
|
@@@@@: |
2668 |
|
|
__DEEP{ |
2669 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
2670 |
|
|
(<Q::pc:>, 'unparsed'); |
2671 |
|
|
$r-><AS::Node.textContent> ($codeArg); |
2672 |
|
|
$r-><AS::PerlCodeStatements.sourceFile> |
2673 |
|
|
($self-><AG::PerlCodeStatements.currentSourceFile>); |
2674 |
|
|
my $sl = $self-><AG::PerlCodeStatements.currentSourceLine>; |
2675 |
|
|
$r-><AS::PerlCodeStatements.sourceLine> ($sl); |
2676 |
|
|
$self-><AG::PerlCodeStatements.currentSourceLine> |
2677 |
|
|
($sl + ($codeArg =~ tr/\x0A/\x0A/)); |
2678 |
|
|
$self-><M::Node.appendChild> ($r); |
2679 |
|
|
}__; |
2680 |
wakaba |
1.1 |
|
2681 |
|
|
@Method: |
2682 |
|
|
@@Name: skipLines |
2683 |
|
|
@@enDesc: |
2684 |
|
|
Skips lines in a code. |
2685 |
|
|
@@Param: |
2686 |
|
|
@@@Name: codeArg |
2687 |
wakaba |
1.35 |
@@@Type: DOMString |
2688 |
wakaba |
1.1 |
@@@enDesc: |
2689 |
|
|
A code fragment, which is counted lines. |
2690 |
|
|
@@Return: |
2691 |
|
|
@@@PerlDef: |
2692 |
wakaba |
1.30 |
$self->{<H::mn:node>}->{<H::pc:currentSourceLine>} |
2693 |
wakaba |
1.1 |
+= ($codeArg =~ tr/\x0A/\x0A/); |
2694 |
wakaba |
1.4 |
|
2695 |
wakaba |
1.6 |
@ImplNote: |
2696 |
|
|
@@lang:en |
2697 |
|
|
@@@: |
2698 |
|
|
A <Class::ManakaiPerlStatementContainer> object must have |
2699 |
|
|
a property: |
2700 |
|
|
<Q::pc:childNodes>. |
2701 |
wakaba |
1.35 |
@@ForCheck: pc|ForClassCompat |
2702 |
wakaba |
1.8 |
|
2703 |
wakaba |
1.35 |
@ATTR: |
2704 |
wakaba |
1.8 |
@@Name: label |
2705 |
wakaba |
1.35 |
@@ATTRQName: pc|label |
2706 |
wakaba |
1.8 |
@@enDesc: |
2707 |
|
|
Label for this block. |
2708 |
wakaba |
1.35 |
@@ReflectCDATA: |
2709 |
wakaba |
1.8 |
@@Get: |
2710 |
|
|
@@@nullCase: |
2711 |
|
|
@@@@enDesc: |
2712 |
|
|
No label. |
2713 |
|
|
@@@disDef: |
2714 |
|
|
@@@@GetProp:label |
2715 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2716 |
wakaba |
1.8 |
@@Set: |
2717 |
|
|
@@@nullCase: |
2718 |
|
|
@@@@enDesc: |
2719 |
|
|
No label. |
2720 |
|
|
@@@disDef: |
2721 |
|
|
@@@@SetProp:label |
2722 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
2723 |
wakaba |
1.8 |
|
2724 |
|
|
@Method: |
2725 |
|
|
@@Name: appendBlock |
2726 |
|
|
@@enDesc: |
2727 |
|
|
Appends a Perl block code. |
2728 |
|
|
@@Return: |
2729 |
wakaba |
1.25 |
@@@Type: PerlBlock |
2730 |
wakaba |
1.8 |
@@@enDesc: |
2731 |
|
|
The newly created Perl code object. |
2732 |
|
|
@@@PerlDef: |
2733 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2734 |
|
|
@@@@@: |
2735 |
wakaba |
1.8 |
$r = <ClassM::ManakaiPerlBlock.newObject>; |
2736 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
2737 |
wakaba |
1.8 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
2738 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
2739 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
2740 |
|
|
$r->{<H::pc:parent>} = $node; |
2741 |
wakaba |
1.8 |
if (defined wantarray) { |
2742 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
2743 |
wakaba |
1.8 |
$object => $r, $ref => $r, |
2744 |
|
|
$class =>{<ClassName::ManakaiPerlBlock>}, |
2745 |
|
|
}__; |
2746 |
|
|
} |
2747 |
wakaba |
1.35 |
@@@PerlDef: |
2748 |
|
|
@@@@ForCheck: pc|ForClass |
2749 |
|
|
@@@@@: |
2750 |
|
|
__DEEP{ |
2751 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
2752 |
|
|
(<Q::pc:>, 'block'); |
2753 |
|
|
$self-><M::Node.appendChild> ($r); |
2754 |
|
|
}__; |
2755 |
wakaba |
1.8 |
|
2756 |
|
|
@Method: |
2757 |
|
|
@@Name: appendStatement |
2758 |
|
|
@@enDesc: |
2759 |
|
|
Appends a Perl statement. |
2760 |
|
|
@@Param: |
2761 |
|
|
@@@Name: codeArg |
2762 |
|
|
@@@Type: |
2763 |
|
|
lang:Perl::ManakaiDOM:all |
2764 |
|
|
@@@enDesc: |
2765 |
|
|
A Perl statement without terminating <Perl::;>. |
2766 |
|
|
@@@nullCase: |
2767 |
|
|
@@@@enDesc: |
2768 |
|
|
No initial content. |
2769 |
|
|
@@Return: |
2770 |
wakaba |
1.25 |
@@@Type: PerlStatement |
2771 |
|
|
@@@caType: ManakaiPerlStatement |
2772 |
wakaba |
1.8 |
@@@enDesc: |
2773 |
|
|
The newly created Perl code object. |
2774 |
|
|
@@@PerlDef: |
2775 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2776 |
|
|
@@@@@: |
2777 |
wakaba |
1.8 |
$r = <ClassM::ManakaiPerlStatement.newObject>; |
2778 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
2779 |
wakaba |
1.8 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
2780 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
2781 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
2782 |
|
|
$r->{<H::pc:parent>} = $node; |
2783 |
wakaba |
1.8 |
if (defined wantarray or defined $codeArg) { |
2784 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
2785 |
wakaba |
1.8 |
$object => $r, $ref => $r, |
2786 |
|
|
$class =>{<ClassName::ManakaiPerlStatement>}, |
2787 |
|
|
}__; |
2788 |
|
|
if (defined $codeArg) { |
2789 |
|
|
__DEEP{ |
2790 |
|
|
$r-><M::ManakaiPerlAnyContainer.appendBare> ($codeArg); |
2791 |
|
|
}__; |
2792 |
|
|
} |
2793 |
|
|
} |
2794 |
wakaba |
1.35 |
@@@PerlDef: |
2795 |
|
|
@@@@ForCheck: pc|ForClass |
2796 |
|
|
@@@@@: |
2797 |
|
|
__DEEP{ |
2798 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
2799 |
|
|
(<Q::pc:>, 'statement'); |
2800 |
|
|
if (defined $codeArg) { |
2801 |
|
|
$r-><M::PerlCodeUnits.appendBare> ($codeArg); |
2802 |
|
|
} |
2803 |
|
|
$self-><M::Node.appendChild> ($r); |
2804 |
|
|
}__; |
2805 |
wakaba |
1.12 |
|
2806 |
|
|
@Method: |
2807 |
|
|
@@Name: appendNewIf |
2808 |
|
|
@@enDesc: |
2809 |
|
|
Appends a newly created <Class::ManakaiPerlIf> object. |
2810 |
|
|
@@Param: |
2811 |
|
|
@@@Name: conditionArg |
2812 |
wakaba |
1.25 |
@@@Type: PerlCode |
2813 |
wakaba |
1.12 |
@@@enDesc: |
2814 |
|
|
Conditoon code fragment object. |
2815 |
|
|
@@Param: |
2816 |
|
|
@@@Name: trueArg |
2817 |
wakaba |
1.25 |
@@@Type: PerlCode |
2818 |
wakaba |
1.12 |
@@@enDesc: |
2819 |
|
|
A true code fragment object. |
2820 |
|
|
@@@nullCase: |
2821 |
|
|
@@@@enDesc: No true code. |
2822 |
|
|
@@Param: |
2823 |
|
|
@@@Name: falseArg |
2824 |
wakaba |
1.25 |
@@@Type: PerlCode |
2825 |
wakaba |
1.12 |
@@@enDesc: |
2826 |
|
|
A false code fragment object. |
2827 |
|
|
@@@nullCase: |
2828 |
|
|
@@@@enDesc: No false code. |
2829 |
|
|
@@Return: |
2830 |
wakaba |
1.35 |
@@@Type: |
2831 |
|
|
@@@@@: PerlIf |
2832 |
|
|
@@@@ForCheck: !pc|ForClassCompat |
2833 |
|
|
@@@enDesc: |
2834 |
|
|
The newly created element. |
2835 |
wakaba |
1.12 |
@@@RaiseException: |
2836 |
|
|
@@@@@:BAD_CHILD_ERR |
2837 |
|
|
@@@@enDesc: |
2838 |
|
|
An attempt is made to append a child |
2839 |
|
|
that is not valid type. |
2840 |
|
|
@@@RaiseException: |
2841 |
|
|
@@@@@:IN_USE_NODE_ERR |
2842 |
|
|
@@@@enDesc: |
2843 |
|
|
An attempt is made to append a node that is |
2844 |
|
|
already used elsewhere. |
2845 |
|
|
@@@PerlDef: |
2846 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
2847 |
|
|
@@@@@: |
2848 |
wakaba |
1.12 |
for my $arg ([conditionArg => $conditionArg]) { |
2849 |
|
|
if ({ |
2850 |
|
|
atom => 1, bare => 1, incontainer => 1, assign => true, |
2851 |
|
|
inunparsed => 1, variable => 1, string => true, |
2852 |
wakaba |
1.30 |
}->{$arg->[1]->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
2853 |
|
|
if ($arg->[1]->{<H::mn:node>}->{<H::pc:parent>}) { |
2854 |
wakaba |
1.12 |
__EXCEPTION{IN_USE_NODE_ERR:: |
2855 |
|
|
pc:childNode => {$arg->[1]}, |
2856 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2857 |
|
|
}__; |
2858 |
|
|
} |
2859 |
|
|
} else { |
2860 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
2861 |
|
|
pc:parentNode => {$self}, |
2862 |
|
|
pc:childNode => {$arg->[1]}, |
2863 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2864 |
|
|
}__; |
2865 |
|
|
} |
2866 |
|
|
} # c |
2867 |
|
|
|
2868 |
|
|
for my $arg ([trueArg => $trueArg], |
2869 |
|
|
[falseArg => $falseArg]) { |
2870 |
|
|
next unless $arg->[1]; |
2871 |
|
|
if ({ |
2872 |
|
|
blockcontainer => true, |
2873 |
wakaba |
1.30 |
}->{$arg->[1]->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
2874 |
|
|
if ($arg->[1]->{<H::mn:node>}->{<H::pc:parent>}) { |
2875 |
wakaba |
1.12 |
__EXCEPTION{IN_USE_NODE_ERR:: |
2876 |
|
|
pc:childNode => {$arg->[1]}, |
2877 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2878 |
|
|
}__; |
2879 |
|
|
} |
2880 |
|
|
} else { |
2881 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
2882 |
|
|
pc:parentNode => {$self}, |
2883 |
|
|
pc:childNode => {$arg->[1]}, |
2884 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2885 |
|
|
}__; |
2886 |
|
|
} |
2887 |
|
|
} # t/f |
2888 |
|
|
|
2889 |
|
|
my $assign = <ClassM::ManakaiPerlIf.newObject>; |
2890 |
wakaba |
1.30 |
$assign->{<H::pc:condition>} = $conditionArg->{<H::mn:node>}; |
2891 |
|
|
$assign->{<H::pc:true>} = $trueArg->{<H::mn:node>} if $trueArg; |
2892 |
|
|
$assign->{<H::pc:false>} = $falseArg->{<H::mn:node>} if $falseArg; |
2893 |
|
|
$conditionArg->{<H::mn:node>}->{<H::pc:parent>} = $assign; |
2894 |
|
|
$trueArg->{<H::mn:node>}->{<H::pc:parent>} = $assign if $trueArg; |
2895 |
|
|
$falseArg->{<H::mn:node>}->{<H::pc:parent>} = $assign if $falseArg; |
2896 |
|
|
$self->{<H::mn:node>}-><M::MNodeObject.importTree> ($assign); |
2897 |
|
|
$assign->{<H::pc:parent>} = $self->{<H::mn:node>}; |
2898 |
|
|
push @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}, $assign; |
2899 |
wakaba |
1.35 |
@@@PerlDef: |
2900 |
|
|
@@@@ForCheck: pc|ForClass |
2901 |
|
|
@@@@@: |
2902 |
|
|
for my $arg ([conditionArg => $conditionArg]) { |
2903 |
|
|
if ({ |
2904 |
|
|
atom => 1, tokens => 1, inlineContainer => 1, assignment => true, |
2905 |
|
|
inlineUnparsed => 1, variable => 1, stringLiteral => true, |
2906 |
|
|
}->{$arg->[1]-><AG::Node.localName>}) { |
2907 |
|
|
if ($arg->[1]-><AG::Node.parentNode>) { |
2908 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
2909 |
|
|
pc:childNode => {$arg->[1]}, |
2910 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2911 |
|
|
}__; |
2912 |
|
|
} |
2913 |
|
|
} else { |
2914 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
2915 |
|
|
pc:parentNode => {$self}, |
2916 |
|
|
pc:childNode => {$arg->[1]}, |
2917 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2918 |
|
|
}__; |
2919 |
|
|
} |
2920 |
|
|
} # c |
2921 |
wakaba |
1.6 |
|
2922 |
wakaba |
1.35 |
for my $arg ([trueArg => $trueArg], |
2923 |
|
|
[falseArg => $falseArg]) { |
2924 |
|
|
next unless $arg->[1]; |
2925 |
|
|
if ({ |
2926 |
|
|
blockContainer => true, |
2927 |
|
|
}->{$arg->[1]-><AG::Node.localName>}) { |
2928 |
|
|
if ($arg->[1]-><AG::Node.parentNode>) { |
2929 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
2930 |
|
|
pc:childNode => {$arg->[1]}, |
2931 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2932 |
|
|
}__; |
2933 |
|
|
} |
2934 |
|
|
} else { |
2935 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
2936 |
|
|
pc:parentNode => {$self}, |
2937 |
|
|
pc:childNode => {$arg->[1]}, |
2938 |
|
|
MDOMX:param-name => {$arg->[0]}, |
2939 |
|
|
}__; |
2940 |
|
|
} |
2941 |
|
|
} # t/f |
2942 |
|
|
|
2943 |
|
|
__DEEP{ |
2944 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
2945 |
|
|
(<Q::pc:>, 'if'); |
2946 |
|
|
$r-><AS::PerlIf.condition> ($conditionArg); |
2947 |
|
|
$r-><AS::PerlIf.trueCode> ($trueArg) if $trueArg; |
2948 |
|
|
$r-><AS::PerlIf.falseCode> ($falseArg) if $falseArg; |
2949 |
|
|
$self-><M::Node.appendChild> ($r); |
2950 |
|
|
}__; |
2951 |
|
|
##PCIf |
2952 |
|
|
|
2953 |
|
|
IFClsETDef: |
2954 |
wakaba |
1.25 |
@IFQName: PerlSub |
2955 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlSub |
2956 |
wakaba |
1.35 |
@CQName: ManakaiPCSub |
2957 |
|
|
@ETQName: pc|sub |
2958 |
wakaba |
1.25 |
|
2959 |
|
|
@IFISA: PerlCode |
2960 |
|
|
|
2961 |
|
|
@IFISA: PerlCodeStatements |
2962 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlStatementContainer |
2963 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeStatements |
2964 |
wakaba |
1.25 |
|
2965 |
wakaba |
1.6 |
@enDesc: |
2966 |
|
|
Perl subroutines. |
2967 |
|
|
|
2968 |
|
|
@IntMethod: |
2969 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
2970 |
wakaba |
1.6 |
@@Name:newObject |
2971 |
|
|
@@ManakaiDOM:isStatic:1 |
2972 |
|
|
@@Description: |
2973 |
|
|
@@@lang:en |
2974 |
|
|
@@@@: |
2975 |
|
|
Creates a new instance object for <Class::ManakaiPerlSub>. |
2976 |
|
|
@@Return: |
2977 |
|
|
@@@Type: |
2978 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
2979 |
|
|
@@@Description: |
2980 |
|
|
@@@@lang:en |
2981 |
|
|
@@@@@: |
2982 |
|
|
The newly created node object. |
2983 |
|
|
@@@PerlDef: |
2984 |
|
|
@@@@@: |
2985 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
2986 |
|
|
::ManakaiDOM:Perl.new>; |
2987 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
2988 |
|
|
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
2989 |
|
|
$node->{<H::pc:childNodes>} = []; |
2990 |
|
|
$node->{<H::pc:sourceLine>} = 0; |
2991 |
|
|
$node->{<H::pc:nodeType>} = 'sub'; |
2992 |
wakaba |
1.6 |
@@@@ImplNote: |
2993 |
|
|
@@@@@lang:en |
2994 |
|
|
@@@@@@: |
2995 |
wakaba |
1.22 |
Optional properties: <Q::pc:localName>, <Q::pc:useCharClassName>, |
2996 |
wakaba |
1.6 |
<Q::pc:sourceFile>, <Q::pc:sourceLine>, |
2997 |
wakaba |
1.14 |
<Q::pc:nodeType>, <Q::pc:useModuleName>, |
2998 |
wakaba |
1.24 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>, |
2999 |
|
|
<Q::pc:prototype>. |
3000 |
wakaba |
1.6 |
|
3001 |
wakaba |
1.20 |
@IntCloneMethod: |
3002 |
|
|
@@Return: |
3003 |
|
|
@@@Type: |
3004 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3005 |
|
|
@@@PerlDef: |
3006 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3007 |
|
|
::ManakaiDOM:Perl.new>; |
3008 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'sub'; |
3009 |
|
|
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3010 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
3011 |
|
|
for my $prop (<H::pc:sourceFile>, <H::pc:sourceLine>, |
3012 |
|
|
<H::pc:localName>, <H::pc:prototype>) { |
3013 |
wakaba |
1.20 |
$node->{$prop} = $nodeObject->{$prop}; |
3014 |
|
|
} |
3015 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
3016 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3017 |
|
|
$node->{<H::pc:useModuleName>} |
3018 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3019 |
|
|
$node->{<H::pc:useCharClassName>} |
3020 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3021 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3022 |
|
|
$node->{<H::pc:requireModuleName>} |
3023 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3024 |
|
|
$node->{<H::pc:childNodes>} = []; |
3025 |
|
|
for my $cno (@{$nodeObject->{<H::pc:childNodes>}}) { |
3026 |
wakaba |
1.20 |
my $pack; |
3027 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
3028 |
wakaba |
1.20 |
__CODE{pc:nodeTypeToPackageName:: |
3029 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
3030 |
|
|
## NOTE: Method name written directly |
3031 |
|
|
my $cno_clone = $pack->_make_clone_object ($cno); |
3032 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $cno_clone; |
3033 |
|
|
$cno_clone->{<H::pc:parent>} = $node; |
3034 |
wakaba |
1.20 |
## NOTE: Tree ID is not updated yet. |
3035 |
|
|
} |
3036 |
|
|
|
3037 |
wakaba |
1.6 |
@Attr: |
3038 |
wakaba |
1.35 |
@@Name: pcLocalName |
3039 |
wakaba |
1.6 |
@@enDesc: |
3040 |
|
|
The name of this subroutine. |
3041 |
wakaba |
1.35 |
@@Type: DOMString |
3042 |
wakaba |
1.6 |
@@Get: |
3043 |
|
|
@@@nullCase: |
3044 |
|
|
@@@@enDesc: |
3045 |
|
|
This subroutine has no name. |
3046 |
|
|
@@@disDef: |
3047 |
|
|
@@@@GetProp: localName |
3048 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3049 |
|
|
@@@PerlDef: |
3050 |
|
|
@@@@ForCheck: pc|ForClass |
3051 |
|
|
@@@@@: |
3052 |
|
|
__DEEP{ |
3053 |
|
|
$r = $self-><M::PerlSub.getPerlNameList>->[0]; |
3054 |
|
|
}__; |
3055 |
wakaba |
1.6 |
@@Set: |
3056 |
wakaba |
1.35 |
@@@ForCheck: pc|ForClassCompat |
3057 |
wakaba |
1.6 |
@@@enDesc: |
3058 |
|
|
Sets the name of this subroutine. |
3059 |
|
|
\ |
3060 |
|
|
{NOTE:: Setting this attribute does not change the |
3061 |
|
|
name by which the subroutine is registerred to |
3062 |
|
|
the parent object. |
3063 |
|
|
\ |
3064 |
|
|
} |
3065 |
|
|
@@@nullCase: |
3066 |
|
|
@@@@enDesc: |
3067 |
|
|
This subroutine has no name. |
3068 |
|
|
@@@disDef: |
3069 |
|
|
@@@@SetProp: localName |
3070 |
|
|
|
3071 |
wakaba |
1.35 |
@Method: |
3072 |
|
|
@@ForCheck: !pc|ForClassCompat |
3073 |
|
|
@@Name: addPerlName |
3074 |
|
|
@@enDesc: |
3075 |
|
|
Adds a subroutine name. |
3076 |
|
|
@@Param: |
3077 |
|
|
@@@Name: subName |
3078 |
|
|
@@@Type: DOMString |
3079 |
|
|
@@@enDesc: The name to add. |
3080 |
|
|
@@Return: |
3081 |
|
|
@@@PerlDef: |
3082 |
|
|
__DEEP{ |
3083 |
|
|
__CODE{addNameListAttr:: |
3084 |
|
|
$node => {$self}, |
3085 |
|
|
$attrName => 'localName', |
3086 |
|
|
$newName => {$subName}, |
3087 |
|
|
}__; |
3088 |
|
|
}__; |
3089 |
|
|
|
3090 |
|
|
@Method: |
3091 |
|
|
@@ForCheck: !pc|ForClassCompat |
3092 |
|
|
@@Name: getPerlNameList |
3093 |
|
|
@@enDesc: |
3094 |
|
|
Returns a list of names of the subroutine. |
3095 |
|
|
@@Return: |
3096 |
|
|
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
3097 |
|
|
@@@enDesc: |
3098 |
|
|
An unordered snapshot list of names. |
3099 |
|
|
@@@PerlDef: |
3100 |
|
|
__DEEP{ |
3101 |
|
|
__CODE{getNameListAttr:: |
3102 |
|
|
$node => {$self}, |
3103 |
|
|
$attrName => 'localName', |
3104 |
|
|
$result => {$r}, |
3105 |
|
|
}__; |
3106 |
|
|
}__; |
3107 |
|
|
|
3108 |
|
|
@Method: |
3109 |
|
|
@@ForCheck: !pc|ForClassCompat |
3110 |
|
|
@@Name: hasPerlName |
3111 |
|
|
@@enDesc: |
3112 |
|
|
Returns whether the subroutine has a name or not. |
3113 |
|
|
@@Param: |
3114 |
|
|
@@@Name: subName |
3115 |
|
|
@@@Type: DOMString |
3116 |
|
|
@@@enDesc: The name. |
3117 |
|
|
@@Return: |
3118 |
|
|
@@@Type: idl|boolean||ManakaiDOM|all |
3119 |
|
|
@@@PerlDef: |
3120 |
|
|
__DEEP{ |
3121 |
|
|
my $l; |
3122 |
|
|
__CODE{getNameListAttr:: |
3123 |
|
|
$node => {$self}, |
3124 |
|
|
$attrName => 'localName', |
3125 |
|
|
$result => {$l}, |
3126 |
|
|
}__; |
3127 |
|
|
F: for (@$l) { |
3128 |
|
|
if ($_ eq $subName) { |
3129 |
|
|
$r = true; |
3130 |
|
|
last F; |
3131 |
|
|
} |
3132 |
|
|
} |
3133 |
|
|
}__; |
3134 |
|
|
|
3135 |
|
|
@Method: |
3136 |
|
|
@@ForCheck: !pc|ForClassCompat |
3137 |
|
|
@@Name: addPerlOperator |
3138 |
|
|
@@enDesc: |
3139 |
|
|
Adds an operator overloaded by the method. |
3140 |
|
|
@@Param: |
3141 |
|
|
@@@Name: op |
3142 |
|
|
@@@Type: DOMString |
3143 |
|
|
@@@enDesc: The operator to add. |
3144 |
|
|
@@Return: |
3145 |
|
|
@@@PerlDef: |
3146 |
|
|
__DEEP{ |
3147 |
|
|
__CODE{addNameListAttr:: |
3148 |
|
|
$node => {$self}, |
3149 |
|
|
$attrName => 'operator', |
3150 |
|
|
$newName => {$op}, |
3151 |
|
|
}__; |
3152 |
|
|
}__; |
3153 |
|
|
|
3154 |
|
|
@Method: |
3155 |
|
|
@@ForCheck: !pc|ForClassCompat |
3156 |
|
|
@@Name: getPerlOperatorList |
3157 |
|
|
@@enDesc: |
3158 |
|
|
Returns a list of operators of the subroutine. |
3159 |
|
|
@@Return: |
3160 |
|
|
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
3161 |
|
|
@@@enDesc: |
3162 |
|
|
An unordered snapshot list of operators. |
3163 |
|
|
@@@PerlDef: |
3164 |
|
|
__DEEP{ |
3165 |
|
|
__CODE{getNameListAttr:: |
3166 |
|
|
$node => {$self}, |
3167 |
|
|
$attrName => 'operator', |
3168 |
|
|
$result => {$r}, |
3169 |
|
|
}__; |
3170 |
|
|
}__; |
3171 |
|
|
|
3172 |
|
|
@Method: |
3173 |
|
|
@@ForCheck: !pc|ForClassCompat |
3174 |
|
|
@@Name: hasPerlOperator |
3175 |
|
|
@@enDesc: |
3176 |
|
|
Returns whether the subroutine has an operator or not. |
3177 |
|
|
@@Param: |
3178 |
|
|
@@@Name: op |
3179 |
|
|
@@@Type: DOMString |
3180 |
|
|
@@@enDesc: The operator. |
3181 |
|
|
@@Return: |
3182 |
|
|
@@@Type: idl|boolean||ManakaiDOM|all |
3183 |
|
|
@@@PerlDef: |
3184 |
|
|
__DEEP{ |
3185 |
|
|
my $l; |
3186 |
|
|
__CODE{getNameListAttr:: |
3187 |
|
|
$node => {$self}, |
3188 |
|
|
$attrName => 'operator', |
3189 |
|
|
$result => {$l}, |
3190 |
|
|
}__; |
3191 |
|
|
F: for (@$l) { |
3192 |
|
|
if ($_ eq $op) { |
3193 |
|
|
$r = true; |
3194 |
|
|
last F; |
3195 |
|
|
} |
3196 |
|
|
} |
3197 |
|
|
}__; |
3198 |
|
|
|
3199 |
|
|
@ATTR: |
3200 |
wakaba |
1.6 |
@@Name: prototype |
3201 |
wakaba |
1.35 |
@@ATTRQName: pc|prototype |
3202 |
wakaba |
1.6 |
@@enDesc: |
3203 |
|
|
The prototype of this subroutine. |
3204 |
wakaba |
1.35 |
@@ReflectCDATA: |
3205 |
wakaba |
1.6 |
@@Get: |
3206 |
|
|
@@@disDef: |
3207 |
|
|
@@@@GetProp: prototype |
3208 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3209 |
wakaba |
1.6 |
@@@nullCase: |
3210 |
|
|
@@@@enDesc: |
3211 |
|
|
No prototype is set. |
3212 |
|
|
@@Set: |
3213 |
|
|
@@@disDef: |
3214 |
|
|
@@@@SetProp: prototype |
3215 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3216 |
wakaba |
1.6 |
@@@nullCase: |
3217 |
|
|
@@@@enDesc: |
3218 |
|
|
No prototype declaration. |
3219 |
|
|
|
3220 |
wakaba |
1.4 |
@ToStringMethod: |
3221 |
|
|
@@Return: |
3222 |
wakaba |
1.35 |
@@@Type: DOMString |
3223 |
wakaba |
1.4 |
@@@enDesc: |
3224 |
|
|
Perl code. |
3225 |
|
|
@@@PerlDef: |
3226 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3227 |
|
|
@@@@@: |
3228 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
3229 |
wakaba |
1.4 |
$r = q<sub>; |
3230 |
wakaba |
1.30 |
$r .= ' ' . $node->{<H::pc:localName>} |
3231 |
|
|
if defined $node->{<H::pc:localName>}; |
3232 |
|
|
$r .= ' (' . $node->{<H::pc:prototype>} . ')' |
3233 |
|
|
if defined $node->{<H::pc:prototype>}; |
3234 |
wakaba |
1.4 |
$r .= " {\n"; |
3235 |
wakaba |
1.30 |
for my $cno (@{$node->{<H::pc:childNodes>}}) { |
3236 |
wakaba |
1.7 |
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
3237 |
wakaba |
1.6 |
$r .= $cn->stringify; |
3238 |
|
|
} |
3239 |
wakaba |
1.4 |
$r .= "}\n"; |
3240 |
wakaba |
1.35 |
@@@PerlDef: |
3241 |
|
|
@@@@ForCheck: pc|ForClass |
3242 |
|
|
@@@@@: |
3243 |
|
|
__DEEP{ |
3244 |
|
|
$r = q<sub>; |
3245 |
|
|
my $nm = $self-><M::PerlSub.getPerlNameList>; |
3246 |
|
|
$r .= q< > . $nm->[0] if @$nm; |
3247 |
|
|
my $pt = $self-><AG::PerlSub.prototype>; |
3248 |
|
|
$r .= q< (> . $pt . q<)> if length $pt; |
3249 |
|
|
$r .= qq< {\n>; |
3250 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
3251 |
|
|
$r .= $child->stringify; |
3252 |
|
|
} |
3253 |
|
|
$r .= qq<}\n>; |
3254 |
|
|
}__; |
3255 |
wakaba |
1.14 |
|
3256 |
|
|
@NumValMethod: |
3257 |
|
|
@@Return: |
3258 |
wakaba |
1.35 |
@@@Type: idl|unsignedLong||ManakaiDOM|all |
3259 |
wakaba |
1.14 |
@@@PerlDef: |
3260 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3261 |
|
|
@@@@@: |
3262 |
wakaba |
1.30 |
my $cno = $self->{<H::mn:node>}->{<H::pc:childNodes>}->[-1]; |
3263 |
wakaba |
1.14 |
if ($cno) { |
3264 |
|
|
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
3265 |
|
|
$r = 0 + $cn; |
3266 |
|
|
} |
3267 |
wakaba |
1.35 |
@@@PerlDef: |
3268 |
|
|
@@@@ForCheck: pc|ForClass |
3269 |
|
|
@@@@@: |
3270 |
|
|
__DEEP{ |
3271 |
|
|
$r = 0 + $self-><AG::Node.lastChild>; |
3272 |
|
|
}__; |
3273 |
|
|
##PCSub |
3274 |
wakaba |
1.1 |
|
3275 |
wakaba |
1.5 |
XParamDef: |
3276 |
|
|
@QName: parentNode |
3277 |
|
|
@enDesc: |
3278 |
|
|
Parent node. |
3279 |
|
|
|
3280 |
|
|
XParamDef: |
3281 |
|
|
@QName: childNode |
3282 |
|
|
@enDesc: |
3283 |
|
|
Child node. |
3284 |
|
|
|
3285 |
wakaba |
1.35 |
IFClsETDef: |
3286 |
wakaba |
1.25 |
@IFQName: PerlUnparsedCode |
3287 |
wakaba |
1.1 |
@ClsQName: ManakaiPerlUnparsedCode |
3288 |
wakaba |
1.35 |
@CQName: ManakaiPCUnparsedCode |
3289 |
|
|
@ETQName: pc|unparsed |
3290 |
wakaba |
1.25 |
|
3291 |
|
|
@IFISA: PerlCode |
3292 |
wakaba |
1.1 |
@ClsISA: ManakaiPerlCodeFragment |
3293 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
3294 |
wakaba |
1.25 |
|
3295 |
wakaba |
1.1 |
@enDesc: |
3296 |
|
|
Unparsed Perl code fragments. |
3297 |
|
|
|
3298 |
|
|
@IntMethod: |
3299 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
3300 |
wakaba |
1.1 |
@@Name:newObject |
3301 |
|
|
@@ManakaiDOM:isStatic:1 |
3302 |
|
|
@@Description: |
3303 |
|
|
@@@lang:en |
3304 |
|
|
@@@@: |
3305 |
|
|
Creates a new instance object for <Class::ManakaiPerlUnparsedCode>. |
3306 |
|
|
@@Return: |
3307 |
|
|
@@@Type: |
3308 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3309 |
|
|
@@@Description: |
3310 |
|
|
@@@@lang:en |
3311 |
|
|
@@@@@: |
3312 |
|
|
The newly created node object. |
3313 |
|
|
@@@PerlDef: |
3314 |
|
|
@@@@@: |
3315 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3316 |
|
|
::ManakaiDOM:Perl.new>; |
3317 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3318 |
|
|
$node->{<H::pc:code>} = ''; |
3319 |
|
|
$node->{<H::pc:nodeType>} = 'unparsed'; |
3320 |
wakaba |
1.1 |
@@@@ImplNote: |
3321 |
|
|
@@@@@lang:en |
3322 |
|
|
@@@@@@: |
3323 |
wakaba |
1.9 |
Properties: <Q::pc:nodeType>, <Q::pc:code>, |
3324 |
wakaba |
1.14 |
<Q::pc:sourceFile>, <Q::pc:sourceLine>, |
3325 |
wakaba |
1.22 |
<Q::pc:useModuleName>, <Q::pc:useCharClassName>, |
3326 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
3327 |
wakaba |
1.9 |
|
3328 |
|
|
@IntCloneMethod: |
3329 |
|
|
@@Return: |
3330 |
|
|
@@@Type: |
3331 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3332 |
|
|
@@@PerlDef: |
3333 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3334 |
|
|
::ManakaiDOM:Perl.new>; |
3335 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3336 |
|
|
for my $prop (<H::pc:sourceFile>, <H::pc:sourceLine>, <H::pc:code>) { |
3337 |
wakaba |
1.9 |
$node->{$prop} = $nodeObject->{$prop}; |
3338 |
|
|
} |
3339 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'unparsed'; |
3340 |
|
|
$node->{<H::pc:requireResourceURI>} |
3341 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3342 |
|
|
$node->{<H::pc:useModuleName>} |
3343 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3344 |
|
|
$node->{<H::pc:useCharClassName>} |
3345 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3346 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3347 |
|
|
$node->{<H::pc:requireModuleName>} |
3348 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3349 |
wakaba |
1.5 |
|
3350 |
|
|
@Attr: |
3351 |
|
|
@@Name: code |
3352 |
|
|
@@enDesc: |
3353 |
|
|
Perl code. |
3354 |
wakaba |
1.35 |
@@Type: DOMString |
3355 |
wakaba |
1.5 |
@@Get: |
3356 |
|
|
@@@disDef: |
3357 |
|
|
@@@@GetProp: code |
3358 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3359 |
|
|
@@@disDef: |
3360 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.get |
3361 |
|
|
@@@@ForCheck: pc|ForClass |
3362 |
wakaba |
1.5 |
@@Set: |
3363 |
|
|
@@@disDef: |
3364 |
|
|
@@@@SetProp: code |
3365 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3366 |
|
|
@@@disDef: |
3367 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.set |
3368 |
|
|
@@@@ForCheck: pc|ForClass |
3369 |
wakaba |
1.5 |
|
3370 |
wakaba |
1.35 |
@ATTR: |
3371 |
wakaba |
1.5 |
@@Name: sourceFile |
3372 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceFile |
3373 |
wakaba |
1.5 |
@@enDesc: |
3374 |
|
|
The source file name of this fragment. |
3375 |
wakaba |
1.35 |
@@ReflectCDATA: |
3376 |
wakaba |
1.5 |
@@Get: |
3377 |
|
|
@@@enDesc: |
3378 |
|
|
Any string identifying the source. |
3379 |
|
|
@@@nullCase: |
3380 |
|
|
@@@@enDesc: No source file name is set. |
3381 |
|
|
@@@disDef: |
3382 |
|
|
@@@@GetProp: sourceFile |
3383 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3384 |
wakaba |
1.5 |
@@Set: |
3385 |
|
|
@@@nullCase: |
3386 |
|
|
@@@@enDesc: No (or unknown) source file. |
3387 |
|
|
@@@disDef: |
3388 |
|
|
@@@@SetProp: sourceFile |
3389 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3390 |
wakaba |
1.5 |
|
3391 |
wakaba |
1.35 |
@ATTR: |
3392 |
wakaba |
1.5 |
@@Name: sourceLine |
3393 |
wakaba |
1.35 |
@@ATTRQName: pc|sourceLine |
3394 |
wakaba |
1.5 |
@@enDesc: |
3395 |
|
|
Source file line number of the first line of this fragment. |
3396 |
wakaba |
1.35 |
@@ReflectCDATA: |
3397 |
wakaba |
1.5 |
@@Get: |
3398 |
|
|
@@@disDef: |
3399 |
|
|
@@@@GetProp: sourceLine |
3400 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3401 |
wakaba |
1.5 |
@@Set: |
3402 |
|
|
@@@disDef: |
3403 |
|
|
@@@@SetProp: sourceLine |
3404 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3405 |
wakaba |
1.6 |
|
3406 |
|
|
@ToStringMethod: |
3407 |
|
|
@@Return: |
3408 |
wakaba |
1.35 |
@@@Type: DOMString |
3409 |
wakaba |
1.6 |
@@@enDesc: |
3410 |
|
|
Perl code. |
3411 |
|
|
@@@PerlDef: |
3412 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3413 |
|
|
@@@@@: |
3414 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
3415 |
wakaba |
1.6 |
__DEEP{ |
3416 |
|
|
my $file = $self-><AG::ManakaiPerlCodeFragment.fileNode>; |
3417 |
wakaba |
1.19 |
$r = sprintf (qq<\n#line %d "%s [u] (Chunk #%d)"\n>, |
3418 |
wakaba |
1.30 |
$node->{<H::pc:sourceLine>} || 1, |
3419 |
|
|
$node->{<H::pc:sourceFile>} || |
3420 |
wakaba |
1.10 |
$file-><AG::ManakaiPerlFile.sourceFile>, |
3421 |
wakaba |
1.6 |
$file-><M::ManakaiPerlFile.getNextChunkNumber>) |
3422 |
wakaba |
1.30 |
. $node->{<H::pc:code>} |
3423 |
wakaba |
1.19 |
. sprintf (qq<\n#line 1 "%s [/u] (Chunk #%d)"\n>, |
3424 |
wakaba |
1.6 |
$file-><AG::ManakaiPerlFile.sourceFile>, |
3425 |
|
|
$file-><M::ManakaiPerlFile.getNextChunkNumber>); |
3426 |
|
|
}__; |
3427 |
wakaba |
1.35 |
@@@PerlDef: |
3428 |
|
|
@@@@ForCheck: pc|ForClass |
3429 |
|
|
@@@@@: |
3430 |
|
|
__DEEP{ |
3431 |
|
|
$r = $self-><AG::Node.textContent>; |
3432 |
|
|
my $file = $self-><AG::PerlCode.fileNode>; |
3433 |
|
|
my $src_file = $file ? $file-><AG::PerlFile.sourceFile> : ''; |
3434 |
|
|
my $nxt_cnum = $file ? $file-><M::PerlFile.getNextChunkNumber> : 0; |
3435 |
|
|
$r = sprintf qq<\n#line %d "%s [u] (Chunk #%d)"\n%s>. |
3436 |
|
|
qq<\n#line 1 "%s [/u] (Chunk #%d)"\n>, |
3437 |
|
|
$self-><AG::PerlUnparsedCode.sourceLine> || 1, |
3438 |
|
|
$self-><AG::PerlUnparsedCode.sourceFile> || $src_file, |
3439 |
|
|
$file ? $file-><M::PerlFile.getNextChunkNumber> : 0, |
3440 |
|
|
$self-><AG::Node.textContent>, |
3441 |
|
|
$src_file, |
3442 |
|
|
$file ? $file-><M::PerlFile.getNextChunkNumber> : 0; |
3443 |
|
|
}__; |
3444 |
wakaba |
1.1 |
##PerlUnparsedCode |
3445 |
|
|
|
3446 |
wakaba |
1.35 |
IFClsETDef: |
3447 |
wakaba |
1.25 |
@IFQName: PerlInlineUnparsedCode |
3448 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlInlineUnparsedCode |
3449 |
wakaba |
1.35 |
@CQName: ManakaiPCInlineUnparsedCode |
3450 |
|
|
@ETQName: pc|inlineUnparsed |
3451 |
wakaba |
1.25 |
|
3452 |
|
|
@IFISA: PerlCode |
3453 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlCodeFragment |
3454 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
3455 |
wakaba |
1.25 |
|
3456 |
wakaba |
1.6 |
@enDesc: |
3457 |
|
|
Unparsed Perl inline code fragments. |
3458 |
|
|
|
3459 |
|
|
@IntMethod: |
3460 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
3461 |
wakaba |
1.6 |
@@Name:newObject |
3462 |
|
|
@@ManakaiDOM:isStatic:1 |
3463 |
|
|
@@Description: |
3464 |
|
|
@@@lang:en |
3465 |
|
|
@@@@: |
3466 |
|
|
Creates a new instance object for |
3467 |
|
|
<Class::ManakaiPerlInlineUnparsedCode>. |
3468 |
|
|
@@Return: |
3469 |
|
|
@@@Type: |
3470 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3471 |
|
|
@@@Description: |
3472 |
|
|
@@@@lang:en |
3473 |
|
|
@@@@@: |
3474 |
|
|
The newly created node object. |
3475 |
|
|
@@@PerlDef: |
3476 |
|
|
@@@@@: |
3477 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3478 |
|
|
::ManakaiDOM:Perl.new>; |
3479 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3480 |
|
|
$node->{<H::pc:code>} = ''; |
3481 |
|
|
$node->{<H::pc:nodeType>} = 'inunparsed'; |
3482 |
wakaba |
1.6 |
@@@@ImplNote: |
3483 |
|
|
@@@@@lang:en |
3484 |
|
|
@@@@@@: |
3485 |
wakaba |
1.14 |
Properties: <Q::pc:nodeType>, <Q::pc:code>, <Q::pc:useModuleName>, |
3486 |
wakaba |
1.22 |
<Q::pc:useCharClassName>, |
3487 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
3488 |
wakaba |
1.6 |
|
3489 |
wakaba |
1.9 |
@IntCloneMethod: |
3490 |
|
|
@@Return: |
3491 |
|
|
@@@Type: |
3492 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3493 |
|
|
@@@PerlDef: |
3494 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3495 |
|
|
::ManakaiDOM:Perl.new>; |
3496 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3497 |
|
|
for my $prop (<H::pc:code>) { |
3498 |
wakaba |
1.9 |
$node->{$prop} = $nodeObject->{$prop}; |
3499 |
|
|
} |
3500 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'inunparsed'; |
3501 |
|
|
$node->{<H::pc:requireResourceURI>} |
3502 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3503 |
|
|
$node->{<H::pc:useModuleName>} |
3504 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3505 |
|
|
$node->{<H::pc:useCharClassName>} |
3506 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3507 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3508 |
|
|
$node->{<H::pc:requireModuleName>} |
3509 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3510 |
wakaba |
1.9 |
|
3511 |
wakaba |
1.6 |
@Attr: |
3512 |
|
|
@@Name: code |
3513 |
|
|
@@enDesc: |
3514 |
|
|
Perl code. |
3515 |
wakaba |
1.35 |
@@Type: DOMString |
3516 |
wakaba |
1.6 |
@@Get: |
3517 |
|
|
@@@disDef: |
3518 |
|
|
@@@@GetProp: code |
3519 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3520 |
|
|
@@@disDef: |
3521 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.get |
3522 |
|
|
@@@@ForCheck: pc|ForClass |
3523 |
wakaba |
1.6 |
@@Set: |
3524 |
|
|
@@@disDef: |
3525 |
|
|
@@@@SetProp: code |
3526 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3527 |
|
|
@@@disDef: |
3528 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.set |
3529 |
|
|
@@@@ForCheck: pc|ForClass |
3530 |
wakaba |
1.6 |
|
3531 |
|
|
@ToStringMethod: |
3532 |
|
|
@@Return: |
3533 |
|
|
@@@Type: |
3534 |
wakaba |
1.12 |
DISLang:String::ManakaiDOM:all |
3535 |
wakaba |
1.6 |
@@@enDesc: |
3536 |
|
|
Perl code. |
3537 |
|
|
@@@PerlDef: |
3538 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3539 |
|
|
@@@@@: |
3540 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
3541 |
|
|
$r = $node->{<H::pc:code>}; |
3542 |
wakaba |
1.35 |
@@@PerlDef: |
3543 |
|
|
@@@@ForCheck: pc|ForClass |
3544 |
|
|
@@@@@: |
3545 |
|
|
__DEEP{ |
3546 |
|
|
$r = $self-><AG::Node.textContent>; |
3547 |
|
|
}__; |
3548 |
wakaba |
1.6 |
##PerlInlineUnparsedCode |
3549 |
|
|
|
3550 |
wakaba |
1.35 |
IFClsETDef: |
3551 |
wakaba |
1.25 |
@IFQName: PerlStringLiteral |
3552 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlStringLiteral |
3553 |
wakaba |
1.35 |
@CQName: ManakaiPCPerlStringLiteral |
3554 |
|
|
@ETQName: pc|stringLiteral |
3555 |
wakaba |
1.25 |
|
3556 |
|
|
@IFISA: PerlCode |
3557 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlCodeFragment |
3558 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
3559 |
wakaba |
1.25 |
|
3560 |
wakaba |
1.6 |
@enDesc: |
3561 |
|
|
Perl string literal. |
3562 |
|
|
|
3563 |
|
|
@IntMethod: |
3564 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
3565 |
wakaba |
1.6 |
@@Name:newObject |
3566 |
|
|
@@ManakaiDOM:isStatic:1 |
3567 |
|
|
@@Description: |
3568 |
|
|
@@@lang:en |
3569 |
|
|
@@@@: |
3570 |
|
|
Creates a new instance object for |
3571 |
|
|
<Class::ManakaiPerlStringLiteral>. |
3572 |
|
|
@@Return: |
3573 |
|
|
@@@Type: |
3574 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3575 |
|
|
@@@Description: |
3576 |
|
|
@@@@lang:en |
3577 |
|
|
@@@@@: |
3578 |
|
|
The newly created node object. |
3579 |
|
|
@@@PerlDef: |
3580 |
|
|
@@@@@: |
3581 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3582 |
|
|
::ManakaiDOM:Perl.new>; |
3583 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3584 |
|
|
$node->{<H::infoset:content>} = ''; |
3585 |
|
|
$node->{<H::pc:nodeType>} = 'string'; |
3586 |
wakaba |
1.6 |
@@@@ImplNote: |
3587 |
|
|
@@@@@lang:en |
3588 |
|
|
@@@@@@: |
3589 |
wakaba |
1.22 |
Properties: <Q::pc:nodeType>, <Q::pc:useCharClassName>, |
3590 |
wakaba |
1.25 |
<Q::infoset:content>, <Q::pc:useModuleName>, |
3591 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
3592 |
wakaba |
1.6 |
|
3593 |
wakaba |
1.9 |
@IntCloneMethod: |
3594 |
|
|
@@Return: |
3595 |
|
|
@@@Type: |
3596 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3597 |
|
|
@@@PerlDef: |
3598 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3599 |
|
|
::ManakaiDOM:Perl.new>; |
3600 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3601 |
|
|
for my $prop (<H::infoset:content>) { |
3602 |
wakaba |
1.9 |
$node->{$prop} = $nodeObject->{$prop}; |
3603 |
|
|
} |
3604 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'string'; |
3605 |
|
|
$node->{<H::pc:requireResourceURI>} |
3606 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3607 |
|
|
$node->{<H::pc:useModuleName>} |
3608 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3609 |
|
|
$node->{<H::pc:useCharClassName>} |
3610 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3611 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3612 |
|
|
$node->{<H::pc:requireModuleName>} |
3613 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3614 |
wakaba |
1.9 |
|
3615 |
wakaba |
1.6 |
@Attr: |
3616 |
|
|
@@Name: data |
3617 |
|
|
@@enDesc: |
3618 |
|
|
String data. |
3619 |
wakaba |
1.35 |
@@Type: DOMString |
3620 |
wakaba |
1.6 |
@@Get: |
3621 |
|
|
@@@disDef: |
3622 |
wakaba |
1.35 |
@@@@GetProp: infoset|content |
3623 |
|
|
@@@@ForCheck: !pc|ForClass |
3624 |
|
|
@@@disDef: |
3625 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.get |
3626 |
|
|
@@@@ForCheck: pc|ForClass |
3627 |
wakaba |
1.6 |
@@Set: |
3628 |
|
|
@@@disDef: |
3629 |
wakaba |
1.35 |
@@@@SetProp: infoset|content |
3630 |
|
|
@@@@ForCheck: !pc|ForClass |
3631 |
|
|
@@@disDef: |
3632 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.set |
3633 |
|
|
@@@@ForCheck: pc|ForClass |
3634 |
wakaba |
1.6 |
|
3635 |
wakaba |
1.14 |
@NumValMethod: |
3636 |
|
|
@@Return: |
3637 |
wakaba |
1.35 |
@@@Type: idl|unsignedLong||ManakaiDOM|all |
3638 |
wakaba |
1.14 |
@@@enDesc: |
3639 |
|
|
Numeric value of the Perl code. |
3640 |
|
|
@@@PerlDef: |
3641 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3642 |
|
|
@@@@@: |
3643 |
wakaba |
1.30 |
$r = 0 + $self->{<H::mn:node>}->{<H::infoset:content>}; |
3644 |
wakaba |
1.35 |
@@@PerlDef: |
3645 |
|
|
@@@@ForCheck: pc|ForClass |
3646 |
|
|
@@@@@: |
3647 |
|
|
__DEEP{ |
3648 |
|
|
$r = 0 + $self-><AG::Node.textContent>; |
3649 |
|
|
}__; |
3650 |
wakaba |
1.14 |
|
3651 |
wakaba |
1.6 |
@ToStringMethod: |
3652 |
|
|
@@Return: |
3653 |
wakaba |
1.35 |
@@@Type: DOMString |
3654 |
wakaba |
1.6 |
@@@enDesc: |
3655 |
|
|
Perl code. |
3656 |
|
|
@@@PerlDef: |
3657 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3658 |
|
|
@@@@@: |
3659 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
3660 |
|
|
$r = $node->{<H::infoset:content>}; |
3661 |
wakaba |
1.6 |
$r =~ s/(['\\])/\\$1/g; |
3662 |
|
|
$r = q<'> . $r . q<'>; |
3663 |
wakaba |
1.35 |
@@@PerlDef: |
3664 |
|
|
@@@@ForCheck: pc|ForClass |
3665 |
|
|
@@@@@: |
3666 |
|
|
__DEEP{ |
3667 |
|
|
$r = $self-><AG::Node.textContent>; |
3668 |
|
|
$r =~ s/(['\\])/\\$1/g; |
3669 |
|
|
$r = q<'> . $r . q<'>; |
3670 |
|
|
}__; |
3671 |
wakaba |
1.6 |
##PerlStringLiteral |
3672 |
|
|
|
3673 |
wakaba |
1.35 |
IFClsETDef: |
3674 |
wakaba |
1.25 |
@IFQName: PerlTokens |
3675 |
|
|
@ClsQName: ManakaiPerlBare |
3676 |
wakaba |
1.35 |
@CQName: ManakaiPCTokens |
3677 |
|
|
@ETQName: pc|tokens |
3678 |
wakaba |
1.12 |
|
3679 |
wakaba |
1.25 |
@IFISA: PerlCode |
3680 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlCodeFragment |
3681 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
3682 |
wakaba |
1.25 |
|
3683 |
wakaba |
1.6 |
@enDesc: |
3684 |
|
|
Unparsed Perl inline code fragments. |
3685 |
|
|
|
3686 |
|
|
@IntMethod: |
3687 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
3688 |
wakaba |
1.6 |
@@Name:newObject |
3689 |
|
|
@@ManakaiDOM:isStatic:1 |
3690 |
|
|
@@Description: |
3691 |
|
|
@@@lang:en |
3692 |
|
|
@@@@: |
3693 |
|
|
Creates a new instance object for |
3694 |
|
|
<Class::ManakaiPerlInlineBare>. |
3695 |
|
|
@@Return: |
3696 |
|
|
@@@Type: |
3697 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3698 |
|
|
@@@Description: |
3699 |
|
|
@@@@lang:en |
3700 |
|
|
@@@@@: |
3701 |
|
|
The newly created node object. |
3702 |
|
|
@@@PerlDef: |
3703 |
|
|
@@@@@: |
3704 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3705 |
|
|
::ManakaiDOM:Perl.new>; |
3706 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3707 |
|
|
$node->{<H::pc:code>} = ''; |
3708 |
|
|
$node->{<H::pc:nodeType>} = 'bare'; |
3709 |
wakaba |
1.6 |
@@@@ImplNote: |
3710 |
|
|
@@@@@lang:en |
3711 |
|
|
@@@@@@: |
3712 |
wakaba |
1.14 |
Properties: <Q::pc:nodeType>, <Q::pc:code>, <Q::pc:useModuleName>, |
3713 |
wakaba |
1.22 |
<Q::pc:useCharClassName>, |
3714 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
3715 |
wakaba |
1.6 |
|
3716 |
wakaba |
1.9 |
@IntCloneMethod: |
3717 |
|
|
@@Return: |
3718 |
|
|
@@@Type: |
3719 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3720 |
|
|
@@@PerlDef: |
3721 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3722 |
|
|
::ManakaiDOM:Perl.new>; |
3723 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3724 |
|
|
for my $prop (<H::pc:code>) { |
3725 |
wakaba |
1.9 |
$node->{$prop} = $nodeObject->{$prop}; |
3726 |
|
|
} |
3727 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'bare'; |
3728 |
|
|
$node->{<H::pc:requireResourceURI>} |
3729 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3730 |
|
|
$node->{<H::pc:useModuleName>} |
3731 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3732 |
|
|
$node->{<H::pc:useCharClassName>} |
3733 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3734 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3735 |
|
|
$node->{<H::pc:requireModuleName>} |
3736 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3737 |
wakaba |
1.9 |
|
3738 |
wakaba |
1.6 |
@Attr: |
3739 |
|
|
@@Name: code |
3740 |
|
|
@@enDesc: |
3741 |
|
|
Perl code. |
3742 |
wakaba |
1.35 |
@@Type: DOMString |
3743 |
wakaba |
1.6 |
@@Get: |
3744 |
|
|
@@@disDef: |
3745 |
|
|
@@@@GetProp: code |
3746 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3747 |
|
|
@@@disDef: |
3748 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.get |
3749 |
|
|
@@@@ForCheck: pc|ForClass |
3750 |
wakaba |
1.6 |
@@Set: |
3751 |
|
|
@@@disDef: |
3752 |
|
|
@@@@SetProp: code |
3753 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3754 |
|
|
@@@disDef: |
3755 |
|
|
@@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.set |
3756 |
|
|
@@@@ForCheck: pc|ForClass |
3757 |
wakaba |
1.6 |
|
3758 |
|
|
@ToStringMethod: |
3759 |
|
|
@@Return: |
3760 |
|
|
@@@Type: |
3761 |
wakaba |
1.12 |
DISLang:String::ManakaiDOM:all |
3762 |
wakaba |
1.6 |
@@@enDesc: |
3763 |
|
|
Perl code. |
3764 |
|
|
@@@PerlDef: |
3765 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3766 |
|
|
@@@@@: |
3767 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
3768 |
|
|
$r = $node->{<H::pc:code>}; |
3769 |
wakaba |
1.35 |
@@@PerlDef: |
3770 |
|
|
@@@@ForCheck: pc|ForClass |
3771 |
|
|
@@@@@: |
3772 |
|
|
__DEEP{ |
3773 |
|
|
$r = $self-><AG::Node.textContent>; |
3774 |
|
|
}__; |
3775 |
|
|
##PCTokens |
3776 |
wakaba |
1.6 |
|
3777 |
wakaba |
1.35 |
IFClsETDef: |
3778 |
wakaba |
1.25 |
@IFQName: PerlAtom |
3779 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlAtom |
3780 |
wakaba |
1.35 |
@CQName: ManakaiPCAtom |
3781 |
|
|
@ETQName: pc|atom |
3782 |
wakaba |
1.25 |
|
3783 |
|
|
@IFISA: PerlCode |
3784 |
|
|
|
3785 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlBare |
3786 |
wakaba |
1.35 |
@CISA: ManakaiPCTokens |
3787 |
wakaba |
1.25 |
|
3788 |
wakaba |
1.6 |
@enDesc: |
3789 |
|
|
Unparsed Perl atomic code fragments (such as numeric literal). |
3790 |
|
|
|
3791 |
|
|
@IntMethod: |
3792 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
3793 |
wakaba |
1.6 |
@@Name:newObject |
3794 |
|
|
@@ManakaiDOM:isStatic:1 |
3795 |
|
|
@@Description: |
3796 |
|
|
@@@lang:en |
3797 |
|
|
@@@@: |
3798 |
|
|
Creates a new instance object for |
3799 |
|
|
<Class::ManakaiPerlAtom>. |
3800 |
|
|
@@Return: |
3801 |
|
|
@@@Type: |
3802 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3803 |
|
|
@@@Description: |
3804 |
|
|
@@@@lang:en |
3805 |
|
|
@@@@@: |
3806 |
|
|
The newly created node object. |
3807 |
|
|
@@@PerlDef: |
3808 |
|
|
@@@@@: |
3809 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3810 |
|
|
::ManakaiDOM:Perl.new>; |
3811 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3812 |
|
|
$node->{<H::pc:code>} = ''; |
3813 |
|
|
$node->{<H::pc:nodeType>} = 'atom'; |
3814 |
wakaba |
1.6 |
@@@@ImplNote: |
3815 |
|
|
@@@@@lang:en |
3816 |
|
|
@@@@@@: |
3817 |
wakaba |
1.14 |
Properties: <Q::pc:nodeType>, <Q::pc:code>, <Q::pc:useModuleName>, |
3818 |
wakaba |
1.22 |
<Q::pc:useCharClassName>, |
3819 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
3820 |
wakaba |
1.6 |
|
3821 |
wakaba |
1.9 |
@IntCloneMethod: |
3822 |
|
|
@@Return: |
3823 |
|
|
@@@Type: |
3824 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3825 |
|
|
@@@PerlDef: |
3826 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3827 |
|
|
::ManakaiDOM:Perl.new>; |
3828 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3829 |
|
|
for my $prop (<H::pc:code>) { |
3830 |
wakaba |
1.9 |
$node->{$prop} = $nodeObject->{$prop}; |
3831 |
|
|
} |
3832 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'atom'; |
3833 |
|
|
$node->{<H::pc:requireResourceURI>} |
3834 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3835 |
|
|
$node->{<H::pc:useModuleName>} |
3836 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3837 |
|
|
$node->{<H::pc:useCharClassName>} |
3838 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3839 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3840 |
|
|
$node->{<H::pc:requireModuleName>} |
3841 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3842 |
wakaba |
1.14 |
|
3843 |
|
|
@NumValMethod: |
3844 |
|
|
@@Return: |
3845 |
wakaba |
1.35 |
@@@Type: idl|unsignedLong||ManakaiDOM|all |
3846 |
wakaba |
1.14 |
@@@enDesc: |
3847 |
|
|
Numeric value of the Perl code. |
3848 |
|
|
@@@PerlDef: |
3849 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3850 |
|
|
@@@@@: |
3851 |
wakaba |
1.30 |
$r = 0 + $self->{<H::mn:node>}->{<H::pc:code>}; |
3852 |
wakaba |
1.35 |
@@@PerlDef: |
3853 |
|
|
@@@@ForCheck: pc|ForClass |
3854 |
|
|
@@@@@: |
3855 |
|
|
__DEEP{ |
3856 |
|
|
$r = 0 + $self-><AG::Node.textContent>; |
3857 |
|
|
}__; |
3858 |
wakaba |
1.9 |
|
3859 |
wakaba |
1.6 |
@ToStringMethod: |
3860 |
|
|
@@Return: |
3861 |
wakaba |
1.35 |
@@@Type: DOMString |
3862 |
wakaba |
1.6 |
@@@enDesc: |
3863 |
|
|
Perl code. |
3864 |
|
|
@@@PerlDef: |
3865 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
3866 |
|
|
@@@@@: |
3867 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
3868 |
|
|
$r = $node->{<H::pc:code>}; |
3869 |
wakaba |
1.35 |
@@@PerlDef: |
3870 |
|
|
@@@@ForCheck: pc|ForClass |
3871 |
|
|
@@@@@: |
3872 |
|
|
__DEEP{ |
3873 |
|
|
$r = $self-><AG::Node.textContent>; |
3874 |
|
|
}__; |
3875 |
wakaba |
1.6 |
##PerlAtom |
3876 |
|
|
|
3877 |
wakaba |
1.35 |
IFClsETDef: |
3878 |
wakaba |
1.25 |
@IFQName: PerlVariable |
3879 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlVariable |
3880 |
wakaba |
1.35 |
@CQName: ManakaiPCVariable |
3881 |
|
|
@ETQName: pc|variable |
3882 |
wakaba |
1.25 |
|
3883 |
|
|
@IFISA: PerlCode |
3884 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlCodeFragment |
3885 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
3886 |
wakaba |
1.25 |
|
3887 |
wakaba |
1.6 |
@enDesc: |
3888 |
|
|
Unparsed Perl variable. |
3889 |
|
|
\ |
3890 |
|
|
{NOTE:: Future version of the implementation may |
3891 |
|
|
support to specify array index or hash key. |
3892 |
|
|
\ |
3893 |
|
|
} |
3894 |
|
|
|
3895 |
|
|
@IntMethod: |
3896 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
3897 |
wakaba |
1.6 |
@@Name:newObject |
3898 |
|
|
@@ManakaiDOM:isStatic:1 |
3899 |
|
|
@@Description: |
3900 |
|
|
@@@lang:en |
3901 |
|
|
@@@@: |
3902 |
|
|
Creates a new instance object for |
3903 |
|
|
<Class::ManakaiPerlVariable>. |
3904 |
|
|
@@Return: |
3905 |
|
|
@@@Type: |
3906 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3907 |
|
|
@@@Description: |
3908 |
|
|
@@@@lang:en |
3909 |
|
|
@@@@@: |
3910 |
|
|
The newly created node object. |
3911 |
|
|
@@@PerlDef: |
3912 |
|
|
@@@@@: |
3913 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3914 |
|
|
::ManakaiDOM:Perl.new>; |
3915 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3916 |
|
|
$node->{<H::pc:variableType>} = ''; |
3917 |
|
|
$node->{<H::pc:nodeType>} = 'variable'; |
3918 |
wakaba |
1.6 |
@@@@ImplNote: |
3919 |
|
|
@@@@@lang:en |
3920 |
|
|
@@@@@@: |
3921 |
|
|
Properties: <Q::pc:nodeType>, <Q::pc:variableType>, |
3922 |
|
|
<Q::packageName>, <Q::localName> (required), |
3923 |
wakaba |
1.22 |
<Q::pc:useCharClassName>, |
3924 |
wakaba |
1.14 |
<Q::variableScope>, <Q::hashKey>, <Q::pc:useModuleName>, |
3925 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
3926 |
wakaba |
1.9 |
|
3927 |
|
|
@IntCloneMethod: |
3928 |
|
|
@@Return: |
3929 |
|
|
@@@Type: |
3930 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
3931 |
|
|
@@@PerlDef: |
3932 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
3933 |
|
|
::ManakaiDOM:Perl.new>; |
3934 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
3935 |
|
|
for my $prop (<H::pc:variableType>, <H::pc:packageName>, |
3936 |
|
|
<H::pc:localName>, <H::pc:variableScope>, <H::pc:hashKey>) { |
3937 |
wakaba |
1.9 |
$node->{$prop} = $nodeObject->{$prop}; |
3938 |
|
|
} |
3939 |
wakaba |
1.30 |
$node->{<H::pc:nodeType>} = 'variable'; |
3940 |
|
|
$node->{<H::pc:requireResourceURI>} |
3941 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
3942 |
|
|
$node->{<H::pc:useModuleName>} |
3943 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
3944 |
|
|
$node->{<H::pc:useCharClassName>} |
3945 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
3946 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
3947 |
|
|
$node->{<H::pc:requireModuleName>} |
3948 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
3949 |
wakaba |
1.6 |
|
3950 |
wakaba |
1.35 |
@ATTR: |
3951 |
wakaba |
1.6 |
@@Name: variableType |
3952 |
wakaba |
1.35 |
@@ATTRQName: pc|variableType |
3953 |
wakaba |
1.6 |
@@enDesc: |
3954 |
|
|
Perl variable type (<CODE::$>, <CODE::@>, <CODE::%>, |
3955 |
|
|
<CODE::&> or empty string). |
3956 |
wakaba |
1.35 |
@@ReflectCDATA: |
3957 |
wakaba |
1.6 |
@@Get: |
3958 |
|
|
@@@disDef: |
3959 |
|
|
@@@@GetProp: variableType |
3960 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3961 |
wakaba |
1.6 |
@@Set: |
3962 |
|
|
@@@disDef: |
3963 |
|
|
@@@@SetProp: variableType |
3964 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3965 |
wakaba |
1.6 |
|
3966 |
wakaba |
1.35 |
@ATTR: |
3967 |
wakaba |
1.6 |
@@Name: packageName |
3968 |
wakaba |
1.35 |
@@ATTRQName: pc|packageName |
3969 |
wakaba |
1.6 |
@@enDesc: |
3970 |
|
|
The name of the package to which this variable belongs. |
3971 |
wakaba |
1.35 |
@@ReflectCDATA: |
3972 |
wakaba |
1.6 |
@@Get: |
3973 |
|
|
@@@nullCase: |
3974 |
|
|
@@@@enDesc: |
3975 |
|
|
This package belongs to the current package or |
3976 |
|
|
does not belong to any package. |
3977 |
|
|
@@@disDef: |
3978 |
|
|
@@@@GetProp: packageName |
3979 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3980 |
wakaba |
1.6 |
@@Set: |
3981 |
|
|
@@@nullCase: |
3982 |
|
|
@@@@enDesc: |
3983 |
|
|
This package belongs to the current package or |
3984 |
|
|
does not belong to any package. |
3985 |
|
|
@@@disDef: |
3986 |
wakaba |
1.11 |
@@@@SetProp: packageName |
3987 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
3988 |
wakaba |
1.6 |
|
3989 |
wakaba |
1.35 |
@ATTR: |
3990 |
|
|
@@Name: |
3991 |
|
|
@@@@: localName |
3992 |
|
|
@@@ForCheck: pc|ForClassCompat |
3993 |
|
|
@@Name: |
3994 |
|
|
@@@@: pcLocalName |
3995 |
|
|
@@@ForCheck: !pc|ForClassCompat |
3996 |
|
|
@@ATTRQName: pc|localName |
3997 |
wakaba |
1.6 |
@@enDesc: |
3998 |
|
|
The local variable name. |
3999 |
wakaba |
1.35 |
@@ReflectCDATA: |
4000 |
wakaba |
1.6 |
@@Get: |
4001 |
|
|
@@@disDef: |
4002 |
|
|
@@@@GetProp: localName |
4003 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
4004 |
wakaba |
1.6 |
@@Set: |
4005 |
|
|
@@@disDef: |
4006 |
|
|
@@@@SetProp: localName |
4007 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
4008 |
wakaba |
1.6 |
|
4009 |
wakaba |
1.35 |
@ATTR: |
4010 |
wakaba |
1.6 |
@@Name: variableScope |
4011 |
wakaba |
1.35 |
@@ATTRQName: pc|variableScope |
4012 |
wakaba |
1.6 |
@@enDesc: |
4013 |
|
|
Scope modifier (<CODE::my> or <CODE::our> or <CODE::local>). |
4014 |
wakaba |
1.35 |
@@ReflectCDATA: |
4015 |
wakaba |
1.6 |
@@Get: |
4016 |
|
|
@@@nullCase: |
4017 |
|
|
@@@@enDesc: |
4018 |
|
|
This variable does not have scope modifier. |
4019 |
|
|
@@@disDef: |
4020 |
|
|
@@@@GetProp: variableScope |
4021 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
4022 |
wakaba |
1.6 |
@@Set: |
4023 |
|
|
@@@nullCase: |
4024 |
|
|
@@@@enDesc: |
4025 |
|
|
This variable does not have scope modifier. |
4026 |
|
|
@@@disDef: |
4027 |
|
|
@@@@SetProp: variableScope |
4028 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
4029 |
wakaba |
1.6 |
|
4030 |
|
|
@ToStringMethod: |
4031 |
|
|
@@Return: |
4032 |
wakaba |
1.35 |
@@@Type: DOMString |
4033 |
wakaba |
1.6 |
@@@enDesc: |
4034 |
|
|
Perl code. |
4035 |
|
|
@@@PerlDef: |
4036 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4037 |
|
|
@@@@@: |
4038 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4039 |
|
|
if ($node->{<H::pc:variableScope>}) { |
4040 |
|
|
$r = $node->{<H::pc:variableScope>} . ' '; |
4041 |
|
|
} |
4042 |
|
|
$r .= $node->{<H::pc:variableType>}; |
4043 |
|
|
$r .= $node->{<H::pc:packageName>} . '::' |
4044 |
|
|
if defined $node->{<H::pc:packageName>}; |
4045 |
|
|
$r .= $node->{<H::pc:localName>}; |
4046 |
|
|
if ($node->{<H::pc:variableType>} eq '$' and |
4047 |
|
|
defined $node->{<H::pc:hashKey>}) { |
4048 |
|
|
my $hashKey = $node->{<H::pc:hashKey>}; |
4049 |
wakaba |
1.6 |
$hashKey =~ s/(['\\])/\\$1/g; |
4050 |
|
|
$r .= q<{'> . $hashKey . q<'}>; |
4051 |
|
|
} |
4052 |
wakaba |
1.35 |
@@@PerlDef: |
4053 |
|
|
@@@@ForCheck: pc|ForClass |
4054 |
|
|
@@@@@: |
4055 |
|
|
__DEEP{ |
4056 |
|
|
my $t = $self-><AG::PerlVariable.variableScope>; |
4057 |
|
|
$r .= $t . ' ' if length $t; |
4058 |
|
|
$r .= $self-><AG::PerlVariable.variableType>; |
4059 |
|
|
my $v = $self-><AG::PerlVariable.packageName>; |
4060 |
|
|
$r .= $v . '::' if length $v; |
4061 |
|
|
$r .= $self-><AG::PerlVariable.pcLocalName>; |
4062 |
|
|
$v = $self-><AG::PerlVariable.hashKey>; |
4063 |
|
|
if ($t eq '$' and length $v) { |
4064 |
|
|
$v =~ s/(['\\])/\\$1/g; |
4065 |
|
|
$r .= q<{'> . $v . q<'}>; |
4066 |
|
|
} |
4067 |
|
|
}__; |
4068 |
wakaba |
1.6 |
|
4069 |
wakaba |
1.35 |
@ATTR: |
4070 |
wakaba |
1.6 |
@@Name: hashKey |
4071 |
wakaba |
1.35 |
@@ATTRQName: pc|hashKey |
4072 |
wakaba |
1.6 |
@@enDesc: |
4073 |
|
|
The key for hash. |
4074 |
|
|
\ |
4075 |
|
|
{NOTE:: Using Perl code for key is not supported in the current |
4076 |
|
|
version of the implementation. |
4077 |
|
|
\ |
4078 |
|
|
} |
4079 |
wakaba |
1.35 |
@@ReflectCDATA: |
4080 |
wakaba |
1.6 |
@@Get: |
4081 |
|
|
@@@nullCase: |
4082 |
|
|
@@@@enDesc: |
4083 |
|
|
This variable is not for hash value access. |
4084 |
|
|
@@@disDef: |
4085 |
|
|
@@@@GetProp: hashKey |
4086 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
4087 |
wakaba |
1.6 |
@@Set: |
4088 |
|
|
@@@nullCase: |
4089 |
|
|
@@@@enDesc: |
4090 |
|
|
This variable is not for hash value access. |
4091 |
|
|
@@@disDef: |
4092 |
|
|
@@@@SetProp: hashKey |
4093 |
wakaba |
1.35 |
@@@@ForCheck: pc|ForClassCompat |
4094 |
wakaba |
1.15 |
##PerlVariable |
4095 |
wakaba |
1.6 |
|
4096 |
|
|
PropDef: |
4097 |
|
|
@QName: variableScope |
4098 |
|
|
@enDesc: |
4099 |
|
|
Variable scope (<CODE::local>, <CODE::my> or <CODE::our>). |
4100 |
|
|
|
4101 |
|
|
PropDef: |
4102 |
|
|
@QName: variableType |
4103 |
|
|
@enDesc: |
4104 |
|
|
Variable type prefix. |
4105 |
|
|
|
4106 |
|
|
PropDef: |
4107 |
|
|
@QName: hashKey |
4108 |
|
|
@enDesc: |
4109 |
|
|
Hash key string. |
4110 |
|
|
|
4111 |
wakaba |
1.25 |
IFClsDef: |
4112 |
|
|
@IFQName: PerlCodeUnits |
4113 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlAnyContainer |
4114 |
wakaba |
1.35 |
@CQName: ManakaiPCCodeUnits |
4115 |
wakaba |
1.25 |
|
4116 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlCodeFragment |
4117 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
4118 |
wakaba |
1.25 |
|
4119 |
wakaba |
1.6 |
@enDesc: |
4120 |
|
|
A base class implemented by both inline container and |
4121 |
|
|
block-level container. |
4122 |
|
|
|
4123 |
|
|
@Attr: |
4124 |
|
|
@@Name: length |
4125 |
|
|
@@enDesc: |
4126 |
|
|
The number of child code fragments. |
4127 |
wakaba |
1.35 |
@@Type: idl|unsignedLong||ManakaiDOM|all |
4128 |
wakaba |
1.6 |
@@Get: |
4129 |
|
|
@@@PerlDef: |
4130 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4131 |
|
|
@@@@@: |
4132 |
wakaba |
1.30 |
$r = @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}; |
4133 |
wakaba |
1.35 |
@@@PerlDef: |
4134 |
|
|
@@@@ForCheck: pc|ForClass |
4135 |
|
|
@@@@@: |
4136 |
|
|
__DEEP{ |
4137 |
|
|
$r = @{$self-><AG::Node.childNodes>}; |
4138 |
|
|
}__; |
4139 |
wakaba |
1.6 |
|
4140 |
|
|
@Method: |
4141 |
|
|
@@Name: appendStringLiteral |
4142 |
|
|
@@enDesc: |
4143 |
|
|
Appends a Perl string literal (<CODE::q>). |
4144 |
|
|
@@Param: |
4145 |
|
|
@@@Name: stringArg |
4146 |
wakaba |
1.35 |
@@@Type: DOMString |
4147 |
wakaba |
1.6 |
@@@enDesc: |
4148 |
|
|
A string. |
4149 |
|
|
@@Return: |
4150 |
wakaba |
1.35 |
@@@Type: PerlStringLiteral |
4151 |
wakaba |
1.6 |
@@@enDesc: |
4152 |
|
|
The newly created Perl string literal object. |
4153 |
|
|
@@@PerlDef: |
4154 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4155 |
|
|
@@@@@: |
4156 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlStringLiteral.newObject>; |
4157 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4158 |
|
|
$r->{<H::infoset:content>} = $stringArg; |
4159 |
wakaba |
1.6 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
4160 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
4161 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
4162 |
|
|
$r->{<H::pc:parent>} = $node; |
4163 |
wakaba |
1.6 |
if (defined wantarray) { |
4164 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
4165 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
4166 |
|
|
$class =>{<ClassName::ManakaiPerlStringLiteral>}, |
4167 |
|
|
}__; |
4168 |
|
|
} |
4169 |
wakaba |
1.35 |
@@@PerlDef: |
4170 |
|
|
@@@@ForCheck: pc|ForClass |
4171 |
|
|
@@@@@: |
4172 |
|
|
__DEEP{ |
4173 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
4174 |
|
|
(<Q::pc:>, 'stringLiteral'); |
4175 |
|
|
$r-><AS::Node.textContent> ($stringArg); |
4176 |
|
|
$self-><M::Node.appendChild> ($r); |
4177 |
|
|
}__; |
4178 |
wakaba |
1.6 |
|
4179 |
|
|
@Method: |
4180 |
|
|
@@Name: appendAtom |
4181 |
|
|
@@enDesc: |
4182 |
|
|
Appends a Perl atomic code fragment. |
4183 |
|
|
@@Param: |
4184 |
|
|
@@@Name: codeArg |
4185 |
wakaba |
1.35 |
@@@Type: DOMString |
4186 |
wakaba |
1.6 |
@@@enDesc: |
4187 |
|
|
An atom. |
4188 |
|
|
@@Return: |
4189 |
wakaba |
1.35 |
@@@Type: PerlAtom |
4190 |
wakaba |
1.6 |
@@@enDesc: |
4191 |
|
|
The newly created Perl code object. |
4192 |
|
|
@@@PerlDef: |
4193 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4194 |
|
|
@@@@@: |
4195 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlAtom.newObject>; |
4196 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4197 |
|
|
$r->{<H::pc:code>} = $codeArg; |
4198 |
wakaba |
1.6 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
4199 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
4200 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
4201 |
|
|
$r->{<H::pc:parent>} = $node; |
4202 |
wakaba |
1.6 |
if (defined wantarray) { |
4203 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
4204 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
4205 |
|
|
$class =>{<ClassName::ManakaiPerlAtom>}, |
4206 |
|
|
}__; |
4207 |
|
|
} |
4208 |
wakaba |
1.35 |
@@@PerlDef: |
4209 |
|
|
@@@@ForCheck: pc|ForClass |
4210 |
|
|
@@@@@: |
4211 |
|
|
__DEEP{ |
4212 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
4213 |
|
|
(<Q::pc:>, 'atom'); |
4214 |
|
|
$r-><AS::Node.textContent> ($codeArg); |
4215 |
|
|
$self-><M::Node.appendChild> ($r); |
4216 |
|
|
}__; |
4217 |
wakaba |
1.6 |
|
4218 |
|
|
@Method: |
4219 |
|
|
@@Name: appendBare |
4220 |
|
|
@@enDesc: |
4221 |
|
|
Appends a Perl bare code fragment. |
4222 |
|
|
@@Param: |
4223 |
|
|
@@@Name: codeArg |
4224 |
wakaba |
1.35 |
@@@Type: DOMString |
4225 |
wakaba |
1.6 |
@@@enDesc: |
4226 |
wakaba |
1.7 |
An bare code. |
4227 |
wakaba |
1.6 |
@@Return: |
4228 |
wakaba |
1.35 |
@@@Type: PerlBare |
4229 |
wakaba |
1.6 |
@@@enDesc: |
4230 |
|
|
The newly created Perl code object. |
4231 |
|
|
@@@PerlDef: |
4232 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4233 |
|
|
@@@@@: |
4234 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlBare.newObject>; |
4235 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4236 |
|
|
$r->{<H::pc:code>} = $codeArg; |
4237 |
wakaba |
1.6 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
4238 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
4239 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
4240 |
|
|
$r->{<H::pc:parent>} = $node; |
4241 |
wakaba |
1.6 |
if (defined wantarray) { |
4242 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
4243 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
4244 |
|
|
$class =>{<ClassName::ManakaiPerlBare>}, |
4245 |
|
|
}__; |
4246 |
|
|
} |
4247 |
wakaba |
1.35 |
@@@PerlDef: |
4248 |
|
|
@@@@ForCheck: pc|ForClass |
4249 |
|
|
@@@@@: |
4250 |
|
|
__DEEP{ |
4251 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
4252 |
|
|
(<Q::pc:>, 'tokens'); |
4253 |
|
|
$r-><AS::Node.textContent> ($codeArg); |
4254 |
|
|
$self-><M::Node.appendChild> ($r); |
4255 |
|
|
}__; |
4256 |
wakaba |
1.11 |
|
4257 |
|
|
@Method: |
4258 |
|
|
@@Name: appendNewAssignment |
4259 |
|
|
@@enDesc: |
4260 |
|
|
Appends a newly created <Class::ManakaiPerlAssign> object. |
4261 |
|
|
@@Param: |
4262 |
|
|
@@@Name: leftArg |
4263 |
wakaba |
1.35 |
@@@Type: PerlCode |
4264 |
wakaba |
1.11 |
@@@enDesc: |
4265 |
|
|
A left hand side code fragment object. |
4266 |
|
|
@@Param: |
4267 |
|
|
@@@Name: rightArg |
4268 |
wakaba |
1.35 |
@@@Type: PerlCode |
4269 |
wakaba |
1.11 |
@@@enDesc: |
4270 |
|
|
A right hand side code fragment object. |
4271 |
|
|
@@Return: |
4272 |
wakaba |
1.35 |
@@@Type: |
4273 |
|
|
@@@@@: PerlAssignment |
4274 |
|
|
@@@@ForCheck: !pc|ForClassCompat |
4275 |
wakaba |
1.11 |
@@@RaiseException: |
4276 |
|
|
@@@@@:BAD_CHILD_ERR |
4277 |
|
|
@@@@enDesc: |
4278 |
|
|
An attempt is made to append a child |
4279 |
|
|
that is not valid type. |
4280 |
|
|
@@@RaiseException: |
4281 |
|
|
@@@@@:IN_USE_NODE_ERR |
4282 |
|
|
@@@@enDesc: |
4283 |
|
|
An attempt is made to append a node that is |
4284 |
|
|
already used elsewhere. |
4285 |
|
|
@@@PerlDef: |
4286 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4287 |
|
|
@@@@@: |
4288 |
wakaba |
1.11 |
for my $arg ([leftArg => $leftArg], [rightArg => $rightArg]) { |
4289 |
|
|
if ({ |
4290 |
|
|
atom => 1, bare => 1, incontainer => 1, assign => true, |
4291 |
|
|
inunparsed => 1, variable => 1, string => true, |
4292 |
wakaba |
1.30 |
}->{$arg->[1]->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
4293 |
|
|
if ($arg->[1]->{<H::mn:node>}->{<H::pc:parent>}) { |
4294 |
wakaba |
1.11 |
__EXCEPTION{IN_USE_NODE_ERR:: |
4295 |
|
|
pc:childNode => {$arg->[1]}, |
4296 |
|
|
MDOMX:param-name => {$arg->[0]}, |
4297 |
|
|
}__; |
4298 |
|
|
} |
4299 |
|
|
} else { |
4300 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
4301 |
|
|
pc:parentNode => {$self}, |
4302 |
|
|
pc:childNode => {$arg->[1]}, |
4303 |
|
|
MDOMX:param-name => {$arg->[0]}, |
4304 |
|
|
}__; |
4305 |
|
|
} |
4306 |
|
|
} # left/right |
4307 |
|
|
|
4308 |
|
|
my $assign = <ClassM::ManakaiPerlAssignment.newObject>; |
4309 |
wakaba |
1.30 |
$assign->{<H::pc:left>} = $leftArg->{<H::mn:node>}; |
4310 |
|
|
$assign->{<H::pc:right>} = $rightArg->{<H::mn:node>}; |
4311 |
|
|
$leftArg->{<H::mn:node>}->{<H::pc:parent>} = $assign; |
4312 |
|
|
$rightArg->{<H::mn:node>}->{<H::pc:parent>} = $assign; |
4313 |
|
|
$self->{<H::mn:node>}-><M::MNodeObject.importTree> ($assign); |
4314 |
|
|
$assign->{<H::pc:parent>} = $self->{<H::mn:node>}; |
4315 |
|
|
push @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}, $assign; |
4316 |
wakaba |
1.35 |
@@@PerlDef: |
4317 |
|
|
@@@@ForCheck: pc|ForClass |
4318 |
|
|
@@@@@: |
4319 |
|
|
for my $arg ([leftArg => $leftArg], [rightArg => $rightArg]) { |
4320 |
|
|
if ({ |
4321 |
|
|
atom => 1, tokens => 1, inlineContainer => 1, assignment => true, |
4322 |
|
|
inlineUnparsed => 1, variable => 1, stringLiteral => true, |
4323 |
|
|
}->{$arg->[1]-><AG::Node.localName>}) { |
4324 |
|
|
if ($arg->[1]-><AG::Node.parentNode>) { |
4325 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
4326 |
|
|
pc:childNode => {$arg->[1]}, |
4327 |
|
|
MDOMX:param-name => {$arg->[0]}, |
4328 |
|
|
}__; |
4329 |
|
|
} |
4330 |
|
|
} else { |
4331 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
4332 |
|
|
pc:parentNode => {$self}, |
4333 |
|
|
pc:childNode => {$arg->[1]}, |
4334 |
|
|
MDOMX:param-name => {$arg->[0]}, |
4335 |
|
|
}__; |
4336 |
|
|
} |
4337 |
|
|
} # left/right |
4338 |
|
|
|
4339 |
|
|
__DEEP{ |
4340 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
4341 |
|
|
(<Q::pc:>, 'assignment'); |
4342 |
|
|
$r-><AS::PerlAssignment.leftCode> ($leftArg); |
4343 |
|
|
$r-><AS::PerlAssignment.rightCode> ($rightArg); |
4344 |
|
|
$self-><M::Node.appendChild> ($r); |
4345 |
|
|
}__; |
4346 |
|
|
##PCAssignment |
4347 |
wakaba |
1.6 |
|
4348 |
wakaba |
1.35 |
IFClsETDef: |
4349 |
wakaba |
1.25 |
@IFQName: PerlStatement |
4350 |
wakaba |
1.8 |
@ClsQName: ManakaiPerlStatement |
4351 |
wakaba |
1.35 |
@CQName: ManakaiPCStatement |
4352 |
|
|
@ETQName: pc|statement |
4353 |
wakaba |
1.25 |
|
4354 |
|
|
@IFISA: PerlCode |
4355 |
|
|
|
4356 |
|
|
@IFISA: PerlCodeInlines |
4357 |
wakaba |
1.8 |
@ClsISA: ManakaiPerlInlineContainer |
4358 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeInlines |
4359 |
wakaba |
1.25 |
|
4360 |
wakaba |
1.8 |
@enDesc: |
4361 |
|
|
Perl statements. |
4362 |
|
|
|
4363 |
|
|
@IntMethod: |
4364 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
4365 |
wakaba |
1.8 |
@@Name:newObject |
4366 |
|
|
@@ManakaiDOM:isStatic:1 |
4367 |
|
|
@@Description: |
4368 |
|
|
@@@lang:en |
4369 |
|
|
@@@@: |
4370 |
|
|
Creates a new instance object for |
4371 |
|
|
<Class::ManakaiPerlStatement>. |
4372 |
|
|
@@Return: |
4373 |
|
|
@@@Type: |
4374 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4375 |
|
|
@@@Description: |
4376 |
|
|
@@@@lang:en |
4377 |
|
|
@@@@@: |
4378 |
|
|
The newly created node object. |
4379 |
|
|
@@@PerlDef: |
4380 |
|
|
@@@@@: |
4381 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4382 |
|
|
::ManakaiDOM:Perl.new>; |
4383 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4384 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4385 |
|
|
$node->{<H::pc:childNodes>} = []; |
4386 |
|
|
$node->{<H::pc:nodeType>} = 'statement'; |
4387 |
wakaba |
1.8 |
@@@@ImplNote: |
4388 |
|
|
@@@@@lang:en |
4389 |
|
|
@@@@@@: |
4390 |
wakaba |
1.14 |
Properties: <Q::pc:nodeType>, <Q::pc:childNodes>, |
4391 |
wakaba |
1.22 |
<Q::pc:parent>, <Q::pc:useModuleName>, <Q::pc:useCharClassName>, |
4392 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
4393 |
wakaba |
1.9 |
|
4394 |
|
|
@IntCloneMethod: |
4395 |
|
|
@@Return: |
4396 |
|
|
@@@Type: |
4397 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4398 |
|
|
@@@PerlDef: |
4399 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4400 |
|
|
::ManakaiDOM:Perl.new>; |
4401 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4402 |
|
|
$node->{<H::pc:nodeType>} = 'statement'; |
4403 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4404 |
|
|
$node->{<H::pc:childNodes>} = []; |
4405 |
|
|
for my $cno (@{$nodeObject->{<H::pc:childNodes>}}) { |
4406 |
wakaba |
1.9 |
my $pack; |
4407 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
4408 |
wakaba |
1.9 |
__CODE{pc:nodeTypeToPackageName:: |
4409 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
4410 |
|
|
## NOTE: Method name written directly |
4411 |
wakaba |
1.15 |
my $cno_clone = $pack->_make_clone_object ($cno); |
4412 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $cno_clone; |
4413 |
|
|
$cno_clone->{<H::pc:parent>} = $node; |
4414 |
wakaba |
1.9 |
## NOTE: Tree ID is not updated yet. |
4415 |
|
|
} |
4416 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
4417 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
4418 |
|
|
$node->{<H::pc:useModuleName>} |
4419 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
4420 |
|
|
$node->{<H::pc:useCharClassName>} |
4421 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
4422 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
4423 |
|
|
$node->{<H::pc:requireModuleName>} |
4424 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
4425 |
wakaba |
1.8 |
|
4426 |
|
|
@ToStringMethod: |
4427 |
|
|
@@Return: |
4428 |
wakaba |
1.35 |
@@@Type: DOMString |
4429 |
wakaba |
1.8 |
@@@enDesc: |
4430 |
|
|
Perl code. |
4431 |
|
|
@@@PerlDef: |
4432 |
|
|
$r = $self->SUPER::stringify; |
4433 |
wakaba |
1.16 |
$r .= ";\n" if length $r; |
4434 |
wakaba |
1.8 |
##PerlStatement |
4435 |
wakaba |
1.6 |
|
4436 |
wakaba |
1.35 |
IFClsETDef: |
4437 |
wakaba |
1.25 |
@IFQName: PerlCodeInlines |
4438 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlInlineContainer |
4439 |
wakaba |
1.35 |
@CQName: ManakaiPCCodeInlines |
4440 |
|
|
@ETQName: pc|inlineContainer |
4441 |
wakaba |
1.25 |
|
4442 |
wakaba |
1.6 |
@ClsISA: ManakaiPerlAnyContainer |
4443 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeUnits |
4444 |
wakaba |
1.25 |
|
4445 |
wakaba |
1.6 |
@enDesc: |
4446 |
|
|
Unparsed Perl inline code block. |
4447 |
|
|
|
4448 |
|
|
@IntMethod: |
4449 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
4450 |
wakaba |
1.6 |
@@Name:newObject |
4451 |
|
|
@@ManakaiDOM:isStatic:1 |
4452 |
|
|
@@Description: |
4453 |
|
|
@@@lang:en |
4454 |
|
|
@@@@: |
4455 |
|
|
Creates a new instance object for |
4456 |
|
|
<Class::ManakaiPerlInlineContainer>. |
4457 |
|
|
@@Return: |
4458 |
|
|
@@@Type: |
4459 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4460 |
|
|
@@@Description: |
4461 |
|
|
@@@@lang:en |
4462 |
|
|
@@@@@: |
4463 |
|
|
The newly created node object. |
4464 |
|
|
@@@PerlDef: |
4465 |
|
|
@@@@@: |
4466 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4467 |
|
|
::ManakaiDOM:Perl.new>; |
4468 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4469 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4470 |
|
|
$node->{<H::pc:childNodes>} = []; |
4471 |
|
|
$node->{<H::pc:nodeType>} = 'incontainer'; |
4472 |
wakaba |
1.6 |
@@@@ImplNote: |
4473 |
|
|
@@@@@lang:en |
4474 |
|
|
@@@@@@: |
4475 |
wakaba |
1.9 |
Properties: <Q::pc:nodeType>, <Q::pc:childNodes>, |
4476 |
wakaba |
1.22 |
<Q::pc:parent>, <Q::pc:useModuleName>, <Q::pc:useCharClassName>, |
4477 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
4478 |
wakaba |
1.9 |
|
4479 |
|
|
@IntCloneMethod: |
4480 |
|
|
@@Return: |
4481 |
|
|
@@@Type: |
4482 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4483 |
|
|
@@@PerlDef: |
4484 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4485 |
|
|
::ManakaiDOM:Perl.new>; |
4486 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4487 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4488 |
|
|
$node->{<H::pc:nodeType>} = 'incontainer'; |
4489 |
|
|
$node->{<H::pc:childNodes>} = []; |
4490 |
|
|
for my $cno (@{$nodeObject->{<H::pc:childNodes>}}) { |
4491 |
wakaba |
1.9 |
my $pack; |
4492 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
4493 |
wakaba |
1.9 |
__CODE{pc:nodeTypeToPackageName:: |
4494 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
4495 |
|
|
## NOTE: Method name written directly |
4496 |
wakaba |
1.15 |
my $cno_clone = $pack->_make_clone_object ($cno); |
4497 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $cno_clone; |
4498 |
|
|
$cno_clone->{<H::pc:parent>} = $node; |
4499 |
wakaba |
1.9 |
## NOTE: Tree ID is not updated yet. |
4500 |
|
|
} |
4501 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
4502 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
4503 |
|
|
$node->{<H::pc:useModuleName>} |
4504 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
4505 |
|
|
$node->{<H::pc:useCharClassName>} |
4506 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
4507 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
4508 |
|
|
$node->{<H::pc:requireModuleName>} |
4509 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
4510 |
wakaba |
1.6 |
|
4511 |
|
|
@Method: |
4512 |
|
|
@@Name: appendCodeFragment |
4513 |
|
|
@@enDesc: |
4514 |
wakaba |
1.35 |
Appends a <IF::PerlCode> object. |
4515 |
wakaba |
1.6 |
@@Param: |
4516 |
|
|
@@@Name: codeArg |
4517 |
wakaba |
1.25 |
@@@Type: PerlCode |
4518 |
wakaba |
1.6 |
@@@enDesc: |
4519 |
|
|
A code fragment object. |
4520 |
|
|
@@Return: |
4521 |
|
|
@@@RaiseException: |
4522 |
|
|
@@@@@:BAD_CHILD_ERR |
4523 |
|
|
@@@@enDesc: |
4524 |
|
|
An attempt is made to append a child |
4525 |
|
|
that is not a <Class::ManakaiPerlUnparsedCode>. |
4526 |
|
|
@@@RaiseException: |
4527 |
|
|
@@@@@:IN_USE_NODE_ERR |
4528 |
|
|
@@@@enDesc: |
4529 |
|
|
An attempt is made to append a node that is |
4530 |
|
|
already used elsewhere. |
4531 |
|
|
@@@PerlDef: |
4532 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4533 |
|
|
@@@@@: |
4534 |
wakaba |
1.6 |
if ({ |
4535 |
wakaba |
1.11 |
atom => 1, bare => 1, incontainer => 1, assign => true, |
4536 |
|
|
inunparsed => 1, variable => 1, string => 1, |
4537 |
wakaba |
1.30 |
}->{$codeArg->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
4538 |
|
|
if ($codeArg->{<H::mn:node>}->{<H::pc:parent>}) { |
4539 |
wakaba |
1.6 |
__EXCEPTION{IN_USE_NODE_ERR:: |
4540 |
|
|
pc:childNode => {$codeArg}, |
4541 |
|
|
}__; |
4542 |
|
|
} |
4543 |
wakaba |
1.30 |
$self->{<H::mn:node>}-><M::MNodeObject.importTree> |
4544 |
|
|
($codeArg->{<H::mn:node>}); |
4545 |
|
|
push @{$self->{<H::mn:node>}->{<H::pc:childNodes>}}, |
4546 |
|
|
$codeArg->{<H::mn:node>}; |
4547 |
|
|
$codeArg->{<H::mn:node>}->{<H::pc:parent>} |
4548 |
|
|
= $self->{<H::mn:node>}; |
4549 |
wakaba |
1.6 |
} else { |
4550 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
4551 |
|
|
pc:parentNode => {$self}, |
4552 |
|
|
pc:childNode => {$codeArg}, |
4553 |
|
|
}__; |
4554 |
|
|
} |
4555 |
wakaba |
1.35 |
@@@PerlDef: |
4556 |
|
|
@@@@ForCheck: pc|ForClass |
4557 |
|
|
@@@@@: |
4558 |
|
|
if ({ |
4559 |
|
|
atom => 1, tokens => 1, inlineContainer => 1, assignment => true, |
4560 |
|
|
inlineUnparsed => 1, variable => 1, stringLiteral => true, |
4561 |
|
|
}->{$codeArg-><AG::Node.localName>}) { |
4562 |
|
|
if ($codeArg-><AG::Node.parentNode>) { |
4563 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
4564 |
|
|
pc:childNode => {$codeArg}, |
4565 |
|
|
}__; |
4566 |
|
|
} |
4567 |
|
|
__DEEP{ |
4568 |
|
|
$self-><AG::Node.ownerDocument> |
4569 |
|
|
-><M::Document.adoptNode> ($codeArg); |
4570 |
|
|
$self-><M::Node.appendChild> ($codeArg); |
4571 |
|
|
}__; |
4572 |
|
|
} else { |
4573 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
4574 |
|
|
pc:parentNode => {$self}, |
4575 |
|
|
pc:childNode => {$codeArg}, |
4576 |
|
|
}__; |
4577 |
|
|
} |
4578 |
wakaba |
1.6 |
|
4579 |
|
|
@Method: |
4580 |
|
|
@@Name: appendCode |
4581 |
|
|
@@enDesc: |
4582 |
|
|
Appends an unparsed Perl code fragment. |
4583 |
|
|
@@Param: |
4584 |
|
|
@@@Name: codeArg |
4585 |
wakaba |
1.35 |
@@@Type: DOMString |
4586 |
wakaba |
1.6 |
@@@enDesc: |
4587 |
|
|
An unparsed Perl code fragment. |
4588 |
|
|
@@Return: |
4589 |
wakaba |
1.25 |
@@@Type: PerlInlineUnparsedCode |
4590 |
wakaba |
1.6 |
@@@enDesc: |
4591 |
|
|
The newly created Perl code object. |
4592 |
|
|
@@@PerlDef: |
4593 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4594 |
|
|
@@@@@: |
4595 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlInlineUnparsedCode.newObject>; |
4596 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4597 |
|
|
$r->{<H::pc:code>} = $codeArg; |
4598 |
wakaba |
1.6 |
$node-><M::ManakaiDOM:ManakaiDOMNodeObject |
4599 |
|
|
::ManakaiDOM:Perl.importTree> ($r); |
4600 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $r; |
4601 |
|
|
$r->{<H::pc:parent>} = $node; |
4602 |
wakaba |
1.6 |
if (defined wantarray) { |
4603 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
4604 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
4605 |
|
|
$class =>{<ClassName::ManakaiPerlInlineUnparsedCode>}, |
4606 |
|
|
}__; |
4607 |
|
|
} |
4608 |
wakaba |
1.35 |
@@@PerlDef: |
4609 |
|
|
@@@@ForCheck: pc|ForClass |
4610 |
|
|
@@@@@: |
4611 |
|
|
__DEEP{ |
4612 |
|
|
$r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS> |
4613 |
|
|
(<Q::pc:>, 'inlineUnparsed'); |
4614 |
|
|
$r-><AS::Node.textContent> ($codeArg); |
4615 |
|
|
$self-><M::Node.appendChild> ($r); |
4616 |
|
|
}__; |
4617 |
wakaba |
1.6 |
|
4618 |
|
|
@ToStringMethod: |
4619 |
|
|
@@Return: |
4620 |
wakaba |
1.35 |
@@@Type: DOMString |
4621 |
wakaba |
1.6 |
@@@enDesc: |
4622 |
|
|
Perl code. |
4623 |
|
|
@@@PerlDef: |
4624 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4625 |
|
|
@@@@@: |
4626 |
wakaba |
1.30 |
for my $cno (@{$self->{<H::mn:node>}->{<H::pc:childNodes>}}) { |
4627 |
wakaba |
1.7 |
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
4628 |
wakaba |
1.30 |
if ($cno->{<H::pc:nodeType>} eq 'incontainer' and |
4629 |
|
|
\ @{$self->{<H::mn:node>}->{<H::pc:childNodes>}} == 1) { |
4630 |
wakaba |
1.6 |
$r .= '(' . $cn->stringify . ')'; |
4631 |
|
|
} else { |
4632 |
|
|
$r .= $cn->stringify; |
4633 |
|
|
} |
4634 |
|
|
} |
4635 |
wakaba |
1.35 |
@@@PerlDef: |
4636 |
|
|
@@@@ForCheck: pc|ForClass |
4637 |
|
|
@@@@@: |
4638 |
|
|
__DEEP{ |
4639 |
|
|
my @child = @{$self-><AG::Node.childNodes>}; |
4640 |
|
|
for my $child (@child) { |
4641 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
4642 |
|
|
$child-><AG::Node.localName> eq 'inlineContainer' and |
4643 |
|
|
1 == @child) { |
4644 |
|
|
$r .= '(' . $child->stringify . ')'; |
4645 |
|
|
} else { |
4646 |
|
|
$r .= $child->stringify; |
4647 |
|
|
} |
4648 |
|
|
} |
4649 |
|
|
}__; |
4650 |
|
|
##PCCodeInlines |
4651 |
wakaba |
1.6 |
|
4652 |
wakaba |
1.35 |
IFClsETDef: |
4653 |
wakaba |
1.25 |
@IFQName: PerlBlock |
4654 |
wakaba |
1.8 |
@ClsQName: ManakaiPerlBlock |
4655 |
wakaba |
1.35 |
@CQName: ManakaiPCBlock |
4656 |
|
|
@ETQName: pc|block |
4657 |
wakaba |
1.25 |
|
4658 |
|
|
@IFISA: PerlCode |
4659 |
|
|
|
4660 |
|
|
@IFISA: PerlCodeStatements |
4661 |
wakaba |
1.8 |
@ClsISA: ManakaiPerlStatementContainer |
4662 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeStatements |
4663 |
wakaba |
1.25 |
|
4664 |
wakaba |
1.8 |
@enDesc: |
4665 |
|
|
Perl block-level code block. |
4666 |
|
|
|
4667 |
|
|
@IntMethod: |
4668 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
4669 |
wakaba |
1.8 |
@@Name:newObject |
4670 |
|
|
@@ManakaiDOM:isStatic:1 |
4671 |
|
|
@@Description: |
4672 |
|
|
@@@lang:en |
4673 |
|
|
@@@@: |
4674 |
|
|
Creates a new instance object for |
4675 |
|
|
<Class::ManakaiPerlBlock>. |
4676 |
|
|
@@Return: |
4677 |
|
|
@@@Type: |
4678 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4679 |
|
|
@@@Description: |
4680 |
|
|
@@@@lang:en |
4681 |
|
|
@@@@@: |
4682 |
|
|
The newly created node object. |
4683 |
|
|
@@@PerlDef: |
4684 |
|
|
@@@@@: |
4685 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4686 |
|
|
::ManakaiDOM:Perl.new>; |
4687 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4688 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4689 |
|
|
$node->{<H::pc:childNodes>} = []; |
4690 |
|
|
$node->{<H::pc:nodeType>} = 'block'; |
4691 |
wakaba |
1.8 |
@@@@ImplNote: |
4692 |
|
|
@@@@@lang:en |
4693 |
|
|
@@@@@@: |
4694 |
wakaba |
1.9 |
Properties: <Q::pc:nodeType>, <Q::pc:childNodes>, <Q::pc:label>, |
4695 |
wakaba |
1.10 |
<Q::pc:parent>, <Q::pc:sourceFile>, <Q::pc:sourceLine>, |
4696 |
wakaba |
1.22 |
<Q::pc:currentSoruceFile>, <Q::pc:useCharClassName>, |
4697 |
wakaba |
1.14 |
<Q::pc:currentSourceLine>, <Q::pc:useModuleName>, |
4698 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
4699 |
wakaba |
1.9 |
|
4700 |
|
|
@IntCloneMethod: |
4701 |
|
|
@@Return: |
4702 |
|
|
@@@Type: |
4703 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4704 |
|
|
@@@PerlDef: |
4705 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4706 |
|
|
::ManakaiDOM:Perl.new>; |
4707 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4708 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4709 |
|
|
$node->{<H::pc:nodeType>} = 'block'; |
4710 |
|
|
$node->{<H::pc:childNodes>} = []; |
4711 |
|
|
for my $cno (@{$nodeObject->{<H::pc:childNodes>}}) { |
4712 |
wakaba |
1.9 |
my $pack; |
4713 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
4714 |
wakaba |
1.9 |
__CODE{pc:nodeTypeToPackageName:: |
4715 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
4716 |
|
|
## NOTE: Method name written directly |
4717 |
|
|
my $cno_clone = $pack->_make_clone_object ($cno); |
4718 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $cno_clone; |
4719 |
|
|
$cno_clone->{<H::pc:parent>} = $node; |
4720 |
wakaba |
1.9 |
## NOTE: Tree ID is not updated yet. |
4721 |
|
|
} |
4722 |
wakaba |
1.30 |
for my $prop (<H::pc:label>, <H::pc:sourceFile>, <H::pc:sourceLine>, |
4723 |
|
|
<H::pc:currentSourceFile>, <H::pc:currentSourceLine>) { |
4724 |
wakaba |
1.10 |
$node->{$prop} = $nodeObject->{$prop}; |
4725 |
|
|
} |
4726 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
4727 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
4728 |
|
|
$node->{<H::pc:useModuleName>} |
4729 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
4730 |
|
|
$node->{<H::pc:useCharClassName>} |
4731 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
4732 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
4733 |
|
|
$node->{<H::pc:requireModuleName>} |
4734 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
4735 |
wakaba |
1.8 |
|
4736 |
|
|
@ToStringMethod: |
4737 |
|
|
@@Return: |
4738 |
wakaba |
1.35 |
@@@Type: DOMString |
4739 |
wakaba |
1.8 |
@@@enDesc: |
4740 |
|
|
Perl code. |
4741 |
|
|
@@@PerlDef: |
4742 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4743 |
|
|
@@@@@: |
4744 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4745 |
|
|
if (@{$node->{<H::pc:childNodes>}} == 1 and |
4746 |
|
|
$node->{<H::pc:childNodes>}->[0]->{<H::pc:nodeType>} eq 'block') { |
4747 |
wakaba |
1.9 |
my $cn; |
4748 |
wakaba |
1.35 |
__CODE{ManakaiNode:getWeakReference||ManakaiDOM|Perl:: |
4749 |
wakaba |
1.30 |
$object => {$node->{<H::pc:childNodes>}->[0]}, |
4750 |
wakaba |
1.9 |
$ref => $cn, |
4751 |
|
|
$class => {<ClassName::ManakaiPerlBlock>}}__; |
4752 |
|
|
$r = $cn->stringify; |
4753 |
|
|
} else { |
4754 |
wakaba |
1.30 |
for my $cno (@{$node->{<H::pc:childNodes>}}) { |
4755 |
wakaba |
1.9 |
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
4756 |
wakaba |
1.30 |
if ($cno->{<H::pc:nodeType>} eq 'incontainer' and |
4757 |
|
|
\ @{$node->{<H::pc:childNodes>}} == 1) { |
4758 |
wakaba |
1.9 |
$r .= '(' . $cn->stringify . ')'; |
4759 |
|
|
} else { |
4760 |
|
|
$r .= $cn->stringify; |
4761 |
|
|
} |
4762 |
wakaba |
1.8 |
} |
4763 |
wakaba |
1.9 |
__DEEP{ |
4764 |
|
|
my $file = $self-><AG::ManakaiPerlCodeFragment.fileNode>; |
4765 |
wakaba |
1.19 |
$r = sprintf (qq<\n{\n#line %d "%s [b] (Chunk #%d)"\n>, |
4766 |
wakaba |
1.30 |
$node->{<H::pc:sourceLine>} || 1, |
4767 |
|
|
$node->{<H::pc:sourceFile>} || |
4768 |
wakaba |
1.10 |
$file-><AG::ManakaiPerlFile.sourceFile>, |
4769 |
wakaba |
1.9 |
$file-><M::ManakaiPerlFile.getNextChunkNumber>) |
4770 |
|
|
. $r |
4771 |
wakaba |
1.35 |
. sprintf (qq<\n#line 1 "%s [/b] (Chunk #%d)"\n;}\n>, |
4772 |
wakaba |
1.9 |
$file-><AG::ManakaiPerlFile.sourceFile>, |
4773 |
wakaba |
1.21 |
$file-><M::ManakaiPerlFile.getNextChunkNumber>) |
4774 |
|
|
if length $r; |
4775 |
wakaba |
1.9 |
}__; |
4776 |
wakaba |
1.8 |
} |
4777 |
wakaba |
1.35 |
@@@PerlDef: |
4778 |
|
|
@@@@ForCheck: pc|ForClass |
4779 |
|
|
@@@@@: |
4780 |
|
|
my @child = @{$self-><AG::Node.childNodes>}; |
4781 |
|
|
if (@child == 1 and |
4782 |
|
|
$child[0]-><AG::Node.localName> eq 'block') { |
4783 |
|
|
$r = $child[0]->stringify; |
4784 |
|
|
} elsif (@child == 1 and |
4785 |
|
|
$child[0]-><AG::Node.localName> eq 'unparsed' and |
4786 |
|
|
$child[0]-><AG::Node.textContent> =~ /^\s*$/) { |
4787 |
|
|
# |
4788 |
|
|
} else { |
4789 |
|
|
for my $child (@child) { |
4790 |
|
|
if ($child-><AG::Node.localName> eq 'inlineContainer' and |
4791 |
|
|
1 == @child) { |
4792 |
|
|
$r .= '(' . $child->stringify . ')'; |
4793 |
|
|
} else { |
4794 |
|
|
$r .= $child->stringify; |
4795 |
|
|
} |
4796 |
|
|
} |
4797 |
|
|
|
4798 |
|
|
__DEEP{ |
4799 |
|
|
my $file = $self-><AG::PerlCode.fileNode>; |
4800 |
|
|
my $sfile = $file ? $file-><AG::PerlFile.sourceFile> : ''; |
4801 |
|
|
$r = sprintf qq<\n{\n#line %d "%s [b] (Chunk #%d)"\n%s>. |
4802 |
|
|
qq<\n#line 1 "%s [/b] (Chunk #%d)"\n}\n>, |
4803 |
|
|
$self-><AG::PerlCodeStatements.sourceLine> || 1, |
4804 |
|
|
$self-><AG::PerlCodeStatements.sourceFile> || $sfile, |
4805 |
|
|
$file ? $file-><M::PerlFile.getNextChunkNumber> : 0, |
4806 |
|
|
$r, |
4807 |
|
|
$sfile, |
4808 |
|
|
$file ? $file-><M::PerlFile.getNextChunkNumber> : 0 |
4809 |
|
|
if length $r; |
4810 |
|
|
}__; |
4811 |
|
|
} |
4812 |
|
|
##PCBlock |
4813 |
wakaba |
1.8 |
|
4814 |
wakaba |
1.35 |
IFClsETDef: |
4815 |
wakaba |
1.25 |
@IFQName: PerlCodeBlocks |
4816 |
wakaba |
1.9 |
@ClsQName: ManakaiPerlBlockContainer |
4817 |
wakaba |
1.35 |
@CQName: ManakaiPCCodeBlocks |
4818 |
|
|
@ETQName: pc|blockContainer |
4819 |
wakaba |
1.25 |
|
4820 |
|
|
@IFISA: PerlCodeStatements |
4821 |
wakaba |
1.9 |
@ClsISA: ManakaiPerlStatementContainer |
4822 |
wakaba |
1.35 |
@CISA: ManakaiPCCodeStatements |
4823 |
wakaba |
1.25 |
|
4824 |
wakaba |
1.9 |
@enDesc: |
4825 |
|
|
Perl block-level code container whose content may or may |
4826 |
|
|
not semantically be self-contained. |
4827 |
|
|
|
4828 |
|
|
@IntMethod: |
4829 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
4830 |
wakaba |
1.9 |
@@Name:newObject |
4831 |
|
|
@@ManakaiDOM:isStatic:1 |
4832 |
|
|
@@Description: |
4833 |
|
|
@@@lang:en |
4834 |
|
|
@@@@: |
4835 |
|
|
Creates a new instance object for |
4836 |
|
|
<Class::ManakaiPerlBlockContainer>. |
4837 |
|
|
@@Return: |
4838 |
|
|
@@@Type: |
4839 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4840 |
|
|
@@@Description: |
4841 |
|
|
@@@@lang:en |
4842 |
|
|
@@@@@: |
4843 |
|
|
The newly created node object. |
4844 |
|
|
@@@PerlDef: |
4845 |
|
|
@@@@@: |
4846 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4847 |
|
|
::ManakaiDOM:Perl.new>; |
4848 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4849 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4850 |
|
|
$node->{<H::pc:childNodes>} = []; |
4851 |
|
|
$node->{<H::pc:nodeType>} = 'blockcontainer'; |
4852 |
wakaba |
1.9 |
@@@@ImplNote: |
4853 |
|
|
@@@@@lang:en |
4854 |
|
|
@@@@@@: |
4855 |
wakaba |
1.10 |
Properties: <Q::pc:nodeType>, <Q::pc:childNodes>, |
4856 |
|
|
<Q::pc:parent>, <Q::pc:sourceFile>, <Q::pc:sourceLine>, |
4857 |
wakaba |
1.22 |
<Q::pc:currentSourceFile>, <Q::pc:useCharClassName>, |
4858 |
wakaba |
1.14 |
<Q::pc:currentSourceLine>, <Q::pc:useModuleName>, |
4859 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
4860 |
wakaba |
1.9 |
|
4861 |
|
|
@IntCloneMethod: |
4862 |
|
|
@@Return: |
4863 |
|
|
@@@Type: |
4864 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4865 |
|
|
@@@PerlDef: |
4866 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
4867 |
|
|
::ManakaiDOM:Perl.new>; |
4868 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
4869 |
|
|
push @{$node->{<Q::TreeCore:subnode>}}, <H::pc:childNodes>; |
4870 |
|
|
$node->{<H::pc:nodeType>} = 'blockcontainer'; |
4871 |
|
|
$node->{<H::pc:childNodes>} = []; |
4872 |
|
|
for my $cno (@{$nodeObject->{<H::pc:childNodes>}}) { |
4873 |
wakaba |
1.9 |
my $pack; |
4874 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
4875 |
wakaba |
1.9 |
__CODE{pc:nodeTypeToPackageName:: |
4876 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
4877 |
|
|
## NOTE: Method name written directly |
4878 |
|
|
my $cno_clone = $pack->_make_clone_object ($cno); |
4879 |
wakaba |
1.30 |
push @{$node->{<H::pc:childNodes>}}, $cno_clone; |
4880 |
|
|
$cno_clone->{<H::pc:parent>} = $node; |
4881 |
wakaba |
1.9 |
## NOTE: Tree ID is not updated yet. |
4882 |
|
|
} |
4883 |
wakaba |
1.30 |
for my $prop (<H::pc:sourceFile>, <H::pc:sourceLine>, |
4884 |
|
|
<H::pc:currentSourceFile>, <H::pc:currentSourceLine>) { |
4885 |
wakaba |
1.10 |
$node->{$prop} = $nodeObject->{$prop}; |
4886 |
|
|
} |
4887 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
4888 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
4889 |
|
|
$node->{<H::pc:useModuleName>} |
4890 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
4891 |
|
|
$node->{<H::pc:useCharClassName>} |
4892 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
4893 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
4894 |
|
|
$node->{<H::pc:requireModuleName>} |
4895 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
4896 |
wakaba |
1.9 |
|
4897 |
|
|
@ToStringMethod: |
4898 |
|
|
@@Return: |
4899 |
wakaba |
1.35 |
@@@Type: DOMString |
4900 |
wakaba |
1.9 |
@@@enDesc: |
4901 |
|
|
Perl code. |
4902 |
|
|
@@@PerlDef: |
4903 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
4904 |
|
|
@@@@@: |
4905 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
4906 |
|
|
if (@{$node->{<H::pc:childNodes>}} == 1 and |
4907 |
wakaba |
1.9 |
{ |
4908 |
|
|
block => true, blockcontainer => true, |
4909 |
wakaba |
1.30 |
}->{$node->{<H::pc:childNodes>}->[0]->{<H::pc:nodeType>}}) { |
4910 |
wakaba |
1.9 |
my $cn; |
4911 |
wakaba |
1.35 |
__CODE{ManakaiNode:getWeakReference||ManakaiDOM|Perl:: |
4912 |
wakaba |
1.30 |
$object => {$node->{<H::pc:childNodes>}->[0]}, |
4913 |
wakaba |
1.9 |
$ref => $cn, |
4914 |
|
|
$class => {<ClassName::ManakaiPerlBlock>}}__; |
4915 |
|
|
$r = $cn->stringify; |
4916 |
|
|
} else { |
4917 |
wakaba |
1.30 |
for my $cno (@{$node->{<H::pc:childNodes>}}) { |
4918 |
wakaba |
1.9 |
my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno); |
4919 |
wakaba |
1.30 |
if ($cno->{<H::pc:nodeType>} eq 'incontainer' and |
4920 |
|
|
\ @{$node->{<H::pc:childNodes>}} == 1) { |
4921 |
wakaba |
1.9 |
$r .= '(' . $cn->stringify . ')'; |
4922 |
|
|
} else { |
4923 |
|
|
$r .= $cn->stringify; |
4924 |
|
|
} |
4925 |
|
|
} |
4926 |
|
|
__DEEP{ |
4927 |
|
|
my $file = $self-><AG::ManakaiPerlCodeFragment.fileNode>; |
4928 |
wakaba |
1.19 |
$r = sprintf (qq<\n#line %d "%s [bc] (Chunk #%d)"\n>, |
4929 |
wakaba |
1.30 |
$node->{<H::pc:sourceLine>} || 1, |
4930 |
|
|
$node->{<H::pc:sourceFile>} || |
4931 |
wakaba |
1.10 |
$file-><AG::ManakaiPerlFile.sourceFile>, |
4932 |
wakaba |
1.9 |
$file-><M::ManakaiPerlFile.getNextChunkNumber>) |
4933 |
|
|
. $r |
4934 |
wakaba |
1.19 |
. sprintf (qq<\n#line 1 "%s [/bc] (Chunk #%d)"\n>, |
4935 |
wakaba |
1.9 |
$file-><AG::ManakaiPerlFile.sourceFile>, |
4936 |
|
|
$file-><M::ManakaiPerlFile.getNextChunkNumber>); |
4937 |
|
|
}__; |
4938 |
|
|
} |
4939 |
wakaba |
1.35 |
@@@PerlDef: |
4940 |
|
|
@@@@ForCheck: pc|ForClass |
4941 |
|
|
@@@@@: |
4942 |
|
|
my @child = @{$self-><AG::Node.childNodes>}; |
4943 |
|
|
if (@child == 1 and |
4944 |
|
|
{ |
4945 |
|
|
block => true, blockContainer => true, |
4946 |
|
|
}->{$child[0]-><AG::Node.localName>}) { |
4947 |
|
|
$r = $child[0]->stringify; |
4948 |
|
|
} else { |
4949 |
|
|
for my $child (@child) { |
4950 |
|
|
if ($child-><AG::Node.localName> eq 'inlineContainer' and |
4951 |
|
|
1 == @child) { |
4952 |
|
|
$r .= '(' . $child->stringify . ')'; |
4953 |
|
|
} else { |
4954 |
|
|
$r .= $child->stringify; |
4955 |
|
|
} |
4956 |
|
|
} |
4957 |
wakaba |
1.9 |
|
4958 |
wakaba |
1.35 |
__DEEP{ |
4959 |
|
|
my $file = $self-><AG::PerlCode.fileNode>; |
4960 |
|
|
my $sfile = $file ? $file-><AG::PerlFile.sourceFile> : ''; |
4961 |
|
|
$r = sprintf qq<\n#line %d "%s [bc] (Chunk #%d)"\n%s>. |
4962 |
|
|
qq<\n#line 1 "%s [/bc] (Chunk #%d)"\n>, |
4963 |
|
|
$self-><AG::PerlCodeStatements.sourceLine> || 1, |
4964 |
|
|
$self-><AG::PerlCodeStatements.sourceFile> || $sfile, |
4965 |
|
|
$file ? $file-><M::PerlFile.getNextChunkNumber> : 0, |
4966 |
|
|
$r, |
4967 |
|
|
$sfile, |
4968 |
|
|
$file ? $file-><M::PerlFile.getNextChunkNumber> : 0; |
4969 |
|
|
}__; |
4970 |
|
|
} |
4971 |
|
|
##PCCodeBlocks |
4972 |
|
|
|
4973 |
|
|
IFClsETDef: |
4974 |
wakaba |
1.25 |
@IFQName: PerlAssignment |
4975 |
wakaba |
1.11 |
@ClsQName: ManakaiPerlAssignment |
4976 |
wakaba |
1.35 |
@CQName: ManakaiPCAssignment |
4977 |
|
|
@ETQName: pc|assignment |
4978 |
wakaba |
1.25 |
|
4979 |
|
|
@IFISA: PerlCode |
4980 |
wakaba |
1.11 |
@ClsISA: ManakaiPerlCodeFragment |
4981 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
4982 |
wakaba |
1.25 |
|
4983 |
wakaba |
1.11 |
@enDesc: |
4984 |
|
|
Perl variable assignment. |
4985 |
|
|
|
4986 |
|
|
@IntMethod: |
4987 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass !pc|ForClass |
4988 |
wakaba |
1.11 |
@@Name:newObject |
4989 |
|
|
@@ManakaiDOM:isStatic:1 |
4990 |
|
|
@@Description: |
4991 |
|
|
@@@lang:en |
4992 |
|
|
@@@@: |
4993 |
|
|
Creates a new instance object for |
4994 |
|
|
<Class::ManakaiPerlAssignment>. |
4995 |
|
|
@@Return: |
4996 |
|
|
@@@Type: |
4997 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
4998 |
|
|
@@@Description: |
4999 |
|
|
@@@@lang:en |
5000 |
|
|
@@@@@: |
5001 |
|
|
The newly created node object. |
5002 |
|
|
@@@PerlDef: |
5003 |
|
|
@@@@@: |
5004 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
5005 |
|
|
::ManakaiDOM:Perl.new>; |
5006 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
5007 |
|
|
push @{$node->{<Q::TreeCore:subnode0>}}, <H::pc:left>, <H::pc:right>; |
5008 |
|
|
$node->{<H::pc:nodeType>} = 'assign'; |
5009 |
wakaba |
1.11 |
@@@@ImplNote: |
5010 |
|
|
@@@@@lang:en |
5011 |
|
|
@@@@@@: |
5012 |
|
|
Properties: <Q::pc:nodeType>, <Q::pc:left>, <Q::pc:right>, |
5013 |
wakaba |
1.22 |
<Q::pc:parent>, <Q::pc:useModuleName>, <Q::pc:useCharClassName>, |
5014 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
5015 |
wakaba |
1.11 |
|
5016 |
|
|
@IntCloneMethod: |
5017 |
|
|
@@Return: |
5018 |
|
|
@@@Type: |
5019 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
5020 |
|
|
@@@PerlDef: |
5021 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
5022 |
|
|
::ManakaiDOM:Perl.new>; |
5023 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
5024 |
|
|
push @{$node->{<Q::TreeCore:subnode0>}}, <H::pc:left>, <H::pc:right>; |
5025 |
|
|
$node->{<H::pc:nodeType>} = 'assign'; |
5026 |
|
|
for my $prop (<H::pc:left>, <H::pc:right>) { |
5027 |
wakaba |
1.11 |
my $pack; |
5028 |
|
|
my $cno = $nodeObject->{$prop}; |
5029 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
5030 |
wakaba |
1.11 |
__CODE{pc:nodeTypeToPackageName:: |
5031 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
5032 |
|
|
## NOTE: Method name written directly |
5033 |
|
|
my $cno_clone = $pack->_make_clone_object ($cno); |
5034 |
|
|
$node->{$prop} = $cno_clone; |
5035 |
wakaba |
1.30 |
$cno_clone->{<H::pc:parent>} = $node; |
5036 |
wakaba |
1.11 |
## NOTE: Tree ID is not updated yet. |
5037 |
|
|
} |
5038 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
5039 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
5040 |
|
|
$node->{<H::pc:useModuleName>} |
5041 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
5042 |
|
|
$node->{<H::pc:useCharClassName>} |
5043 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
5044 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
5045 |
|
|
$node->{<H::pc:requireModuleName>} |
5046 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
5047 |
wakaba |
1.11 |
|
5048 |
|
|
@ToStringMethod: |
5049 |
|
|
@@Return: |
5050 |
wakaba |
1.35 |
@@@Type: DOMString |
5051 |
wakaba |
1.11 |
@@@enDesc: |
5052 |
|
|
Perl code. |
5053 |
|
|
@@@PerlDef: |
5054 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5055 |
|
|
@@@@@: |
5056 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
5057 |
wakaba |
1.11 |
$r = <ClassM::ManakaiPerlCodeFragment.getNodeReference> |
5058 |
wakaba |
1.30 |
($node->{<H::pc:left>})->stringify . ' = ' . |
5059 |
wakaba |
1.11 |
<ClassM::ManakaiPerlCodeFragment.getNodeReference> |
5060 |
wakaba |
1.30 |
($node->{<H::pc:right>})->stringify; |
5061 |
wakaba |
1.35 |
@@@PerlDef: |
5062 |
|
|
@@@@ForCheck: pc|ForClass |
5063 |
|
|
@@@@@: |
5064 |
|
|
__DEEP{ |
5065 |
|
|
$r = $self-><AG::PerlAssignment.leftCode>->stringify |
5066 |
|
|
. ' = ' |
5067 |
|
|
. $self-><AG::PerlAssignment.rightCode>->stringify; |
5068 |
|
|
}__; |
5069 |
|
|
|
5070 |
|
|
@Attr: |
5071 |
|
|
@@ForCheck: !pc|ForClassCompat |
5072 |
|
|
@@Name: leftCode |
5073 |
|
|
@@enDesc: |
5074 |
|
|
Left-hand expression. |
5075 |
|
|
@@Type: PerlCodeInlines |
5076 |
|
|
@@Get: |
5077 |
|
|
@@@nullCase: |
5078 |
|
|
@@@@enDesc: Left-hand code not yet specified. |
5079 |
|
|
@@@PerlDef: |
5080 |
|
|
__DEEP{ |
5081 |
|
|
F: for my $child (@{$self-><AG::Node.childNodes>}) { |
5082 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5083 |
|
|
$child-><AG::Node.localName> eq 'left') { |
5084 |
|
|
$r = $child-><AG::Node.lastChild>; |
5085 |
|
|
last F; |
5086 |
|
|
} |
5087 |
|
|
} |
5088 |
|
|
}__; |
5089 |
|
|
@@Set: |
5090 |
|
|
@@@PerlDef: |
5091 |
|
|
__DEEP{ |
5092 |
|
|
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given); |
5093 |
|
|
F: { |
5094 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
5095 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5096 |
|
|
$child-><AG::Node.localName> eq 'left') { |
5097 |
|
|
$child-><AS::Node.textContent> (''); |
5098 |
|
|
$child-><M::Node.appendChild> ($given); |
5099 |
|
|
last F; |
5100 |
|
|
} |
5101 |
|
|
} |
5102 |
|
|
my $node = $self-><AG::Node.ownerDocument> |
5103 |
|
|
-><M::Document.createElementNS> |
5104 |
|
|
(<Q::pc:>, 'left'); |
5105 |
|
|
$node-><M::Node.appendChild> ($given); |
5106 |
|
|
$self-><M::Node.appendChild> ($node); |
5107 |
|
|
} |
5108 |
|
|
}__; |
5109 |
|
|
|
5110 |
|
|
@Attr: |
5111 |
|
|
@@ForCheck: !pc|ForClassCompat |
5112 |
|
|
@@Name: rightCode |
5113 |
|
|
@@enDesc: |
5114 |
|
|
Right-hand expression. |
5115 |
|
|
@@Type: PerlCodeInlines |
5116 |
|
|
@@Get: |
5117 |
|
|
@@@nullCase: |
5118 |
|
|
@@@@enDesc: Right-hand code not yet specified. |
5119 |
|
|
@@@PerlDef: |
5120 |
|
|
__DEEP{ |
5121 |
|
|
F: for my $child (@{$self-><AG::Node.childNodes>}) { |
5122 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5123 |
|
|
$child-><AG::Node.localName> eq 'right') { |
5124 |
|
|
$r = $child-><AG::Node.lastChild>; |
5125 |
|
|
last F; |
5126 |
|
|
} |
5127 |
|
|
} |
5128 |
|
|
}__; |
5129 |
|
|
@@Set: |
5130 |
|
|
@@@PerlDef: |
5131 |
|
|
__DEEP{ |
5132 |
|
|
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given); |
5133 |
|
|
F: { |
5134 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
5135 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5136 |
|
|
$child-><AG::Node.localName> eq 'right') { |
5137 |
|
|
$child-><AS::Node.textContent> (''); |
5138 |
|
|
$child-><M::Node.appendChild> ($given); |
5139 |
|
|
last F; |
5140 |
|
|
} |
5141 |
|
|
} |
5142 |
|
|
my $node = $self-><AG::Node.ownerDocument> |
5143 |
|
|
-><M::Document.createElementNS> |
5144 |
|
|
(<Q::pc:>, 'right'); |
5145 |
|
|
$node-><M::Node.appendChild> ($given); |
5146 |
|
|
$self-><M::Node.appendChild> ($node); |
5147 |
|
|
} |
5148 |
|
|
}__; |
5149 |
wakaba |
1.11 |
##PerlAssignment |
5150 |
|
|
|
5151 |
wakaba |
1.35 |
IFClsETDef: |
5152 |
wakaba |
1.26 |
@IFQName: PerlIf |
5153 |
wakaba |
1.12 |
@ClsQName: ManakaiPerlIf |
5154 |
wakaba |
1.35 |
@CQName: ManakaiPCIf |
5155 |
|
|
@ETQName: pc|if |
5156 |
wakaba |
1.25 |
|
5157 |
|
|
@IFISA: PerlCode |
5158 |
wakaba |
1.12 |
@ClsISA: ManakaiPerlCodeFragment |
5159 |
wakaba |
1.35 |
@CISA: ManakaiPCCode |
5160 |
wakaba |
1.25 |
|
5161 |
wakaba |
1.12 |
@enDesc: |
5162 |
|
|
Perl variable assignment. |
5163 |
|
|
|
5164 |
|
|
@IntMethod: |
5165 |
wakaba |
1.35 |
@@ForCheck: !pc|ForClass |
5166 |
wakaba |
1.12 |
@@Name:newObject |
5167 |
|
|
@@ManakaiDOM:isStatic:1 |
5168 |
|
|
@@Description: |
5169 |
|
|
@@@lang:en |
5170 |
|
|
@@@@: |
5171 |
|
|
Creates a new instance object for |
5172 |
|
|
<Class::ManakaiPerlAssignment>. |
5173 |
|
|
@@Return: |
5174 |
|
|
@@@Type: |
5175 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
5176 |
|
|
@@@Description: |
5177 |
|
|
@@@@lang:en |
5178 |
|
|
@@@@@: |
5179 |
|
|
The newly created node object. |
5180 |
|
|
@@@PerlDef: |
5181 |
|
|
@@@@@: |
5182 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
5183 |
|
|
::ManakaiDOM:Perl.new>; |
5184 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
5185 |
|
|
push @{$node->{<Q::TreeCore:subnode0>}}, <H::pc:condition>, |
5186 |
|
|
<H::pc:true>, <H::pc:false>; |
5187 |
|
|
$node->{<H::pc:nodeType>} = 'if'; |
5188 |
wakaba |
1.12 |
@@@@ImplNote: |
5189 |
|
|
@@@@@lang:en |
5190 |
|
|
@@@@@@: |
5191 |
|
|
Properties: <Q::pc:nodeType>, <Q::pc:true>, <Q::pc:false>, |
5192 |
wakaba |
1.22 |
<Q::pc:useCharClassName>, |
5193 |
wakaba |
1.14 |
<Q::pc:parent>, <Q::pc:condition>, <Q::pc:useModuleName>, |
5194 |
wakaba |
1.19 |
<Q::pc:requireResourceURI>, <Q::pc:requireModuleName>. |
5195 |
wakaba |
1.12 |
|
5196 |
|
|
@IntCloneMethod: |
5197 |
|
|
@@Return: |
5198 |
|
|
@@@Type: |
5199 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
5200 |
|
|
@@@PerlDef: |
5201 |
|
|
my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject |
5202 |
|
|
::ManakaiDOM:Perl.new>; |
5203 |
wakaba |
1.30 |
push @{$node->{<Q::TreeCore:origin>}}, <H::pc:parent>; |
5204 |
|
|
push @{$node->{<Q::TreeCore:subnode0>}}, <H::pc:condition>, |
5205 |
|
|
<H::pc:true>, <H::pc:false>; |
5206 |
|
|
$node->{<H::pc:nodeType>} = 'if'; |
5207 |
|
|
for my $prop (<H::pc:true>, <H::pc:false>, <H::pc:condition>) { |
5208 |
wakaba |
1.12 |
my $pack; |
5209 |
|
|
my $cno = $nodeObject->{$prop}; |
5210 |
|
|
next unless $cno; |
5211 |
wakaba |
1.30 |
my $nt = $cno->{<H::pc:nodeType>}; |
5212 |
wakaba |
1.12 |
__CODE{pc:nodeTypeToPackageName:: |
5213 |
|
|
$nodeType => $nt, $packageName => $pack, $object => $cno}__; |
5214 |
|
|
## NOTE: Method name written directly |
5215 |
|
|
my $cno_clone = $pack->_make_clone_object ($cno); |
5216 |
|
|
$node->{$prop} = $cno_clone; |
5217 |
wakaba |
1.30 |
$cno_clone->{<H::pc:parent>} = $node; |
5218 |
wakaba |
1.12 |
## NOTE: Tree ID is not updated yet. |
5219 |
|
|
} |
5220 |
wakaba |
1.30 |
$node->{<H::pc:requireResourceURI>} |
5221 |
|
|
= {%{$nodeObject->{<H::pc:requireResourceURI>} || {}}}; |
5222 |
|
|
$node->{<H::pc:useModuleName>} |
5223 |
|
|
= {%{$nodeObject->{<H::pc:useModuleName>} || {}}}; |
5224 |
|
|
$node->{<H::pc:useCharClassName>} |
5225 |
|
|
= {map {$_ => {%{$nodeObject->{<H::pc:useCharClassName>}->{$_}}}} |
5226 |
|
|
keys %{$nodeObject->{<H::pc:useCharClassName>} || {}}}; |
5227 |
|
|
$node->{<H::pc:requireModuleName>} |
5228 |
|
|
= {%{$nodeObject->{<H::pc:requireModuleName>} || {}}}; |
5229 |
wakaba |
1.12 |
|
5230 |
|
|
@ToStringMethod: |
5231 |
|
|
@@Return: |
5232 |
wakaba |
1.35 |
@@@Type: DOMString |
5233 |
wakaba |
1.12 |
@@@enDesc: |
5234 |
|
|
Perl code. |
5235 |
|
|
@@@PerlDef: |
5236 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5237 |
|
|
@@@@@: |
5238 |
wakaba |
1.30 |
my $node = $self->{<H::mn:node>}; |
5239 |
wakaba |
1.12 |
$r = <ClassM::ManakaiPerlCodeFragment.getNodeReference> |
5240 |
wakaba |
1.30 |
($node->{<H::pc:condition>})->stringify; |
5241 |
wakaba |
1.12 |
my $true_code = <ClassM::ManakaiPerlCodeFragment.getNodeReference> |
5242 |
wakaba |
1.30 |
($node->{<H::pc:true>})->stringify if $node->{<H::pc:true>}; |
5243 |
wakaba |
1.12 |
my $false_code = <ClassM::ManakaiPerlCodeFragment.getNodeReference> |
5244 |
wakaba |
1.30 |
($node->{<H::pc:false>})->stringify if $node->{<H::pc:false>}; |
5245 |
wakaba |
1.12 |
if (defined $true_code) { |
5246 |
|
|
if (defined $false_code) { |
5247 |
|
|
$r = q<if (> . $r . q<) {> . $true_code . |
5248 |
|
|
q<} else {> . $false_code . q<}>; |
5249 |
|
|
} else { |
5250 |
|
|
$r = q<if (> . $r . q<) {> . $true_code . q<}>; |
5251 |
|
|
} |
5252 |
|
|
} else { |
5253 |
|
|
$r = q<unless (> . $r . q<) {> . $false_code . q<}>; |
5254 |
|
|
} |
5255 |
wakaba |
1.35 |
@@@PerlDef: |
5256 |
|
|
@@@@ForCheck: pc|ForClass |
5257 |
|
|
@@@@@: |
5258 |
|
|
__DEEP{ |
5259 |
|
|
my $tcode = $self-><AG::PerlIf.trueCode>; |
5260 |
|
|
my $fcode = $self-><AG::PerlIf.falseCode>; |
5261 |
|
|
my $ccode = $self-><AG::PerlIf.condition>; |
5262 |
|
|
if (defined $tcode) { |
5263 |
|
|
if (defined $fcode) { |
5264 |
|
|
$r = q<if (> . $ccode->stringify . q<) {> . $tcode->stringify . |
5265 |
|
|
q<} else {> . $fcode->stringify . qq<}\n>; |
5266 |
|
|
} else { |
5267 |
|
|
$r = q<if (> . $ccode->strigify . q<) {> . $tcode->stringify . |
5268 |
|
|
qq<}\n>; |
5269 |
|
|
} |
5270 |
|
|
} else { |
5271 |
|
|
$r = q<unless (> . $ccode->stringify . q<) {> . $fcode->stringify . |
5272 |
|
|
qq<}\n>; |
5273 |
|
|
} |
5274 |
|
|
}__; |
5275 |
|
|
|
5276 |
|
|
@Attr: |
5277 |
|
|
@@ForCheck: !pc|ForClassCompat |
5278 |
|
|
@@Name: condition |
5279 |
|
|
@@enDesc: |
5280 |
|
|
Condition expression. |
5281 |
|
|
@@Type: PerlCodeInlines |
5282 |
|
|
@@Get: |
5283 |
|
|
@@@nullCase: |
5284 |
|
|
@@@@enDesc: Condition code not yet specified. |
5285 |
|
|
@@@PerlDef: |
5286 |
|
|
__DEEP{ |
5287 |
|
|
F: for my $child (@{$self-><AG::Node.childNodes>}) { |
5288 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5289 |
|
|
$child-><AG::Node.localName> eq 'condition') { |
5290 |
|
|
$r = $child-><AG::Node.lastChild>; |
5291 |
|
|
last F; |
5292 |
|
|
} |
5293 |
|
|
} |
5294 |
|
|
}__; |
5295 |
|
|
@@Set: |
5296 |
|
|
@@@PerlDef: |
5297 |
|
|
__DEEP{ |
5298 |
|
|
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given); |
5299 |
|
|
F: { |
5300 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
5301 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5302 |
|
|
$child-><AG::Node.localName> eq 'condition') { |
5303 |
|
|
$child-><AS::Node.textContent> (''); |
5304 |
|
|
$child-><M::Node.appendChild> ($given); |
5305 |
|
|
last F; |
5306 |
|
|
} |
5307 |
|
|
} |
5308 |
|
|
my $node = $self-><AG::Node.ownerDocument> |
5309 |
|
|
-><M::Document.createElementNS> |
5310 |
|
|
(<Q::pc:>, 'condition'); |
5311 |
|
|
$node-><M::Node.appendChild> ($given); |
5312 |
|
|
$self-><M::Node.appendChild> ($node); |
5313 |
|
|
} |
5314 |
|
|
}__; |
5315 |
|
|
|
5316 |
|
|
@Attr: |
5317 |
|
|
@@ForCheck: !pc|ForClassCompat |
5318 |
|
|
@@Name: trueCode |
5319 |
|
|
@@enDesc: |
5320 |
|
|
True-case code. |
5321 |
|
|
@@Type: PerlCodeBlocks |
5322 |
|
|
@@Get: |
5323 |
|
|
@@@nullCase: |
5324 |
|
|
@@@@enDesc: True-case code not yet specified. |
5325 |
|
|
@@@PerlDef: |
5326 |
|
|
__DEEP{ |
5327 |
|
|
F: for my $child (@{$self-><AG::Node.childNodes>}) { |
5328 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5329 |
|
|
$child-><AG::Node.localName> eq 'tr'.'ue') { |
5330 |
|
|
$r = $child-><AG::Node.lastChild>; |
5331 |
|
|
last F; |
5332 |
|
|
} |
5333 |
|
|
} |
5334 |
|
|
}__; |
5335 |
|
|
@@Set: |
5336 |
|
|
@@@PerlDef: |
5337 |
|
|
__DEEP{ |
5338 |
|
|
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given); |
5339 |
|
|
F: { |
5340 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
5341 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5342 |
|
|
$child-><AG::Node.localName> eq 'tr'.'ue') { |
5343 |
|
|
$child-><AS::Node.textContent> (''); |
5344 |
|
|
$child-><M::Node.appendChild> ($given); |
5345 |
|
|
last F; |
5346 |
|
|
} |
5347 |
|
|
} |
5348 |
|
|
my $node = $self-><AG::Node.ownerDocument> |
5349 |
|
|
-><M::Document.createElementNS> |
5350 |
|
|
(<Q::pc:>, 'tr'.'ue'); |
5351 |
|
|
$node-><M::Node.appendChild> ($given); |
5352 |
|
|
$self-><M::Node.appendChild> ($node); |
5353 |
|
|
} |
5354 |
|
|
}__; |
5355 |
|
|
|
5356 |
|
|
@Attr: |
5357 |
|
|
@@ForCheck: !pc|ForClassCompat |
5358 |
|
|
@@Name: falseCode |
5359 |
|
|
@@enDesc: |
5360 |
|
|
False-case code. |
5361 |
|
|
@@Type: PerlCodeBlocks |
5362 |
|
|
@@Get: |
5363 |
|
|
@@@nullCase: |
5364 |
|
|
@@@@enDesc: True-case code not yet specified. |
5365 |
|
|
@@@PerlDef: |
5366 |
|
|
__DEEP{ |
5367 |
|
|
F: for my $child (@{$self-><AG::Node.childNodes>}) { |
5368 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5369 |
|
|
$child-><AG::Node.localName> eq 'fal'.'se') { |
5370 |
|
|
$r = $child-><AG::Node.lastChild>; |
5371 |
|
|
last F; |
5372 |
|
|
} |
5373 |
|
|
} |
5374 |
|
|
}__; |
5375 |
|
|
@@Set: |
5376 |
|
|
@@@PerlDef: |
5377 |
|
|
__DEEP{ |
5378 |
|
|
$self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given); |
5379 |
|
|
F: { |
5380 |
|
|
for my $child (@{$self-><AG::Node.childNodes>}) { |
5381 |
|
|
if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and |
5382 |
|
|
$child-><AG::Node.localName> eq 'fal'.'se') { |
5383 |
|
|
$child-><AS::Node.textContent> (''); |
5384 |
|
|
$child-><M::Node.appendChild> ($given); |
5385 |
|
|
last F; |
5386 |
|
|
} |
5387 |
|
|
} |
5388 |
|
|
my $node = $self-><AG::Node.ownerDocument> |
5389 |
|
|
-><M::Document.createElementNS> |
5390 |
|
|
(<Q::pc:>, 'fal'.'se'); |
5391 |
|
|
$node-><M::Node.appendChild> ($given); |
5392 |
|
|
$self-><M::Node.appendChild> ($node); |
5393 |
|
|
} |
5394 |
|
|
}__; |
5395 |
wakaba |
1.12 |
##PerlIf |
5396 |
|
|
|
5397 |
|
|
PropDef: |
5398 |
|
|
@QName:condition |
5399 |
|
|
@enDesc: |
5400 |
|
|
Condition. |
5401 |
|
|
PropDef: |
5402 |
|
|
@QName:true |
5403 |
|
|
@enDesc: |
5404 |
|
|
If true. |
5405 |
|
|
PropDef: |
5406 |
|
|
@QName:false |
5407 |
|
|
@enDesc: |
5408 |
|
|
If false. |
5409 |
|
|
|
5410 |
wakaba |
1.11 |
PropDef: |
5411 |
|
|
@QName:left |
5412 |
|
|
@FullName: |
5413 |
|
|
@@lang:en |
5414 |
|
|
@@@: Left hand side |
5415 |
|
|
PropDef: |
5416 |
|
|
@QName:right |
5417 |
|
|
@FullName: |
5418 |
|
|
@@lang:en |
5419 |
|
|
@@@: Right hand side |
5420 |
|
|
|
5421 |
wakaba |
1.8 |
PropDef: |
5422 |
|
|
@QName:label |
5423 |
|
|
@enDesc: |
5424 |
|
|
Perl statement / block label. |
5425 |
|
|
|
5426 |
wakaba |
1.6 |
ElementTypeBinding: |
5427 |
|
|
@Name: RaiseException |
5428 |
|
|
@ElementType: |
5429 |
|
|
ManakaiDOM:raises |
5430 |
|
|
|
5431 |
wakaba |
1.25 |
IFClsDef: |
5432 |
|
|
@IFQName: PCImplementation |
5433 |
wakaba |
1.6 |
@ClsQName: ManakaiPerlCodeImplementation |
5434 |
wakaba |
1.35 |
@CQName: ManakaiPCImplementation |
5435 |
wakaba |
1.25 |
|
5436 |
wakaba |
1.1 |
@enDesc: |
5437 |
|
|
The class that provides factory methods. |
5438 |
wakaba |
1.20 |
|
5439 |
wakaba |
1.26 |
@ClsISA: DOMFeature|ManakaiMinimumImplementation||ManakaiDOM|ManakaiDOMLatest |
5440 |
wakaba |
1.20 |
@ClsISA: |
5441 |
|
|
dx:ManakaiDefaultExceptionHandler::ManakaiDOM:Perl |
5442 |
wakaba |
1.35 |
@CISA: DOMCore|ManakaiDOMImplementation||ManakaiDOM|ManakaiDOMLatest |
5443 |
|
|
@CISA: dx|ManakaiDefaultExceptionHandler||ManakaiDOM|Perl |
5444 |
wakaba |
1.17 |
|
5445 |
wakaba |
1.35 |
@f:provides: pc|CoreFeature10 |
5446 |
wakaba |
1.1 |
|
5447 |
|
|
@Method: |
5448 |
|
|
@@Name: createPerlFile |
5449 |
|
|
@@enDesc: |
5450 |
|
|
Creates a Perl code file. |
5451 |
|
|
@@Return: |
5452 |
wakaba |
1.25 |
@@@Type: PerlFile |
5453 |
wakaba |
1.1 |
@@@enDesc: A newly created Perl source file object. |
5454 |
|
|
@@@PerlDef: |
5455 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5456 |
|
|
@@@@@: |
5457 |
wakaba |
1.1 |
$r = <ClassM::ManakaiPerlFile.newObject>; |
5458 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5459 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5460 |
|
|
$class => {<ClassName::ManakaiPerlFile>}}__; |
5461 |
wakaba |
1.35 |
@@@PerlDef: |
5462 |
|
|
@@@@ForCheck: pc|ForClass |
5463 |
|
|
@@@@@: |
5464 |
|
|
__DEEP{ |
5465 |
|
|
$r = $self-><M::DOMImpl.createDocument> (<Q::pc:>, 'file') |
5466 |
|
|
-><AG::Document.documentElement>; |
5467 |
|
|
}__; |
5468 |
wakaba |
1.1 |
|
5469 |
wakaba |
1.13 |
@Method: |
5470 |
|
|
@@Name: createPerlPackage |
5471 |
|
|
@@enDesc: |
5472 |
|
|
Creates a new package scope block. |
5473 |
|
|
@@Param: |
5474 |
|
|
@@@Name: packageName |
5475 |
wakaba |
1.35 |
@@@Type: DOMString |
5476 |
wakaba |
1.13 |
@@@enDesc: |
5477 |
|
|
The fully-qualified name of the package to create. |
5478 |
|
|
@@Return: |
5479 |
wakaba |
1.25 |
@@@Type: PerlPackage |
5480 |
wakaba |
1.13 |
@@@enDesc: |
5481 |
|
|
The newly created package scope object. |
5482 |
|
|
@@@PerlDef: |
5483 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5484 |
|
|
@@@@@: |
5485 |
wakaba |
1.13 |
$r = <ClassM::ManakaiPerlPackageScope.newObject>; |
5486 |
wakaba |
1.30 |
$r->{<H::pc:packageName>} = $packageName; |
5487 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5488 |
wakaba |
1.13 |
$object => $r, $ref => $r, |
5489 |
|
|
$class => {<ClassName::ManakaiPerlPackageScope>}}__; |
5490 |
wakaba |
1.35 |
@@@PerlDef: |
5491 |
|
|
@@@@ForCheck: pc|ForClass |
5492 |
|
|
@@@@@: |
5493 |
|
|
__DEEP{ |
5494 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5495 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'package'); |
5496 |
|
|
$r-><AS::PerlPackage.packageName> ($packageName); |
5497 |
|
|
}__; |
5498 |
wakaba |
1.13 |
|
5499 |
wakaba |
1.1 |
@IntMethod: |
5500 |
wakaba |
1.25 |
@@ForCheck: ManakaiDOM|ForClass |
5501 |
wakaba |
1.1 |
@@Name: perlComment |
5502 |
|
|
@@ManakaiDOM:isStatic:1 |
5503 |
|
|
@@enDesc: |
5504 |
|
|
Generates a Perl comment string. |
5505 |
|
|
@@Param: |
5506 |
|
|
@@@Name: str |
5507 |
wakaba |
1.35 |
@@@Type: DOMString |
5508 |
wakaba |
1.1 |
@@@enDesc: |
5509 |
|
|
A comment text. |
5510 |
|
|
@@Return: |
5511 |
wakaba |
1.35 |
@@@Type: DOMString |
5512 |
wakaba |
1.1 |
@@@enDesc: |
5513 |
|
|
A Perl comment string. |
5514 |
|
|
@@@PerlDef: |
5515 |
|
|
$r = $str; |
5516 |
|
|
$r =~ s/\n/\n## /g; |
5517 |
|
|
$r =~ s/\n## $/\n/s; |
5518 |
|
|
$r .= "\n" unless $r =~ /\n$/; |
5519 |
|
|
$r = q<## > . $r; |
5520 |
|
|
|
5521 |
|
|
@IntMethod: |
5522 |
wakaba |
1.25 |
@@ForCheck: ManakaiDOM|ForClass |
5523 |
wakaba |
1.1 |
@@Name: rfc3339DateTime |
5524 |
|
|
@@ManakaiDOM:isStatic:1 |
5525 |
|
|
@@enDesc: |
5526 |
|
|
Returns RFC 3339 <CODE::date-time> representation of a date. |
5527 |
|
|
@@Param: |
5528 |
|
|
@@@Name: perlDate |
5529 |
wakaba |
1.35 |
@@@Type: idl|unsignedLong||ManakaiDOM|all |
5530 |
wakaba |
1.1 |
@@@enDesc: |
5531 |
|
|
A Perl representation of date. |
5532 |
|
|
@@Return: |
5533 |
wakaba |
1.35 |
@@@Type: DOMString |
5534 |
wakaba |
1.1 |
@@@enDesc: |
5535 |
|
|
RFC 3339 date string. |
5536 |
|
|
@@@PerlDef: |
5537 |
|
|
my @time = gmtime $perlDate; |
5538 |
|
|
$r = sprintf q<%04d-%02d-%02dT%02d:%02d:%02d+00:00>, |
5539 |
|
|
$time[5] + 1900, $time[4] + 1, @time[3,2,1,0]; |
5540 |
|
|
|
5541 |
|
|
@IntMethod: |
5542 |
wakaba |
1.25 |
@@ForCheck: ManakaiDOM|ForClass |
5543 |
wakaba |
1.1 |
@@Name: versionDateTime |
5544 |
|
|
@@ManakaiDOM:isStatic:1 |
5545 |
|
|
@@enDesc: |
5546 |
|
|
Returns date for version. |
5547 |
|
|
@@Param: |
5548 |
|
|
@@@Name: perlDate |
5549 |
wakaba |
1.35 |
@@@Type: idl|unsignedLong||ManakaiDOM|all |
5550 |
wakaba |
1.1 |
@@@enDesc: |
5551 |
|
|
A Perl representation of date. |
5552 |
|
|
@@Return: |
5553 |
wakaba |
1.35 |
@@@Type: DOMString |
5554 |
wakaba |
1.1 |
@@@enDesc: |
5555 |
|
|
A Perl number literal. |
5556 |
|
|
@@@PerlDef: |
5557 |
|
|
my @time = gmtime $perlDate; |
5558 |
|
|
$r = sprintf q<%04d%02d%02d.%02d%02d>, |
5559 |
|
|
$time[5] + 1900, $time[4] + 1, @time[3,2,1]; |
5560 |
|
|
|
5561 |
|
|
@Method: |
5562 |
|
|
@@Name: perlLiteral |
5563 |
|
|
@@enDesc: |
5564 |
|
|
Perl code representation. |
5565 |
|
|
@@Param: |
5566 |
|
|
@@@Name: val |
5567 |
wakaba |
1.35 |
@@@Type: DISPerl|Any||ManakaiDOM|all |
5568 |
wakaba |
1.1 |
@@@enDesc: |
5569 |
|
|
A Perl value. |
5570 |
|
|
@@Return: |
5571 |
wakaba |
1.35 |
@@@Type: DOMString |
5572 |
wakaba |
1.1 |
@@@enDesc: |
5573 |
|
|
A Perl lexical representation of <P::val>. |
5574 |
|
|
@@@PerlDef: |
5575 |
|
|
unless (defined $val) { |
5576 |
|
|
$r = q<undef>; |
5577 |
|
|
} elsif (ref $val eq 'ARRAY') { |
5578 |
|
|
__DEEP{ |
5579 |
|
|
$r = q<[> . <ClassM::ManakaiPerlCodeImplementation |
5580 |
wakaba |
1.14 |
.perlList> ($val) . q<]>; |
5581 |
wakaba |
1.1 |
}__; |
5582 |
|
|
} elsif (ref $val eq 'HASH') { |
5583 |
|
|
__DEEP{ |
5584 |
wakaba |
1.31 |
$r = q<{> |
5585 |
|
|
. <ClassM::ManakaiPerlCodeImplementation.perlList> |
5586 |
|
|
([map {$_ => $val->{$_}} sort {$a cmp $b} keys %$val]) |
5587 |
|
|
. q<}>; |
5588 |
wakaba |
1.1 |
}__; |
5589 |
|
|
} else { |
5590 |
|
|
$val =~ s/(['\\])/\\$1/g; |
5591 |
|
|
$r = q<'> . $val . q<'>; |
5592 |
|
|
} |
5593 |
|
|
|
5594 |
|
|
@Method: |
5595 |
|
|
@@Name: perlList |
5596 |
|
|
@@enDesc: |
5597 |
|
|
Perl code representation of a list. |
5598 |
|
|
@@Param: |
5599 |
|
|
@@@Name: val |
5600 |
wakaba |
1.35 |
@@@Type: DISPerl|ARRAY||ManakaiDOM|all |
5601 |
wakaba |
1.1 |
@@@enDesc: |
5602 |
|
|
A Perl array reference. |
5603 |
|
|
@@Return: |
5604 |
wakaba |
1.35 |
@@@Type: DOMString |
5605 |
wakaba |
1.1 |
@@@enDesc: |
5606 |
|
|
A Perl lexical representation of <CODE::@$val>. |
5607 |
|
|
@@@PerlDef: |
5608 |
|
|
__DEEP{ |
5609 |
|
|
$r = join (q<, >, map {<ClassM::ManakaiPerlCodeImplementation |
5610 |
|
|
.perlLiteral> ($_)} @{$val}); |
5611 |
|
|
}__; |
5612 |
wakaba |
1.5 |
|
5613 |
|
|
@Method: |
5614 |
|
|
@@Name: createPerlSub |
5615 |
|
|
@@enDesc: |
5616 |
wakaba |
1.35 |
Creates a new <IF::PerlSub> object. |
5617 |
wakaba |
1.5 |
@@Param: |
5618 |
|
|
@@@Name: subName |
5619 |
wakaba |
1.35 |
@@@Type: DOMString |
5620 |
wakaba |
1.5 |
@@@enDesc: |
5621 |
|
|
The name of the subroutine to create. |
5622 |
|
|
@@@nullCase: |
5623 |
|
|
@@@@enDesc: |
5624 |
|
|
The subroutine created has no name. |
5625 |
|
|
@@Return: |
5626 |
wakaba |
1.25 |
@@@Type: PerlSub |
5627 |
wakaba |
1.5 |
@@@enDesc: |
5628 |
|
|
Newly created Perl subroutine object. |
5629 |
|
|
@@@PerlDef: |
5630 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5631 |
|
|
@@@@@: |
5632 |
wakaba |
1.5 |
__DEEP{ |
5633 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlSub.newObject>; |
5634 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5635 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5636 |
|
|
$class => {<ClassName::ManakaiPerlSub>}}__; |
5637 |
wakaba |
1.35 |
$r-><AS::ManakaiPerlSub.pcLocalName> ($subName) if defined $subName; |
5638 |
wakaba |
1.5 |
}__; |
5639 |
wakaba |
1.35 |
@@@PerlDef: |
5640 |
|
|
@@@@ForCheck: pc|ForClass |
5641 |
|
|
@@@@@: |
5642 |
|
|
__DEEP{ |
5643 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5644 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'sub'); |
5645 |
|
|
$r-><M::PerlSub.addPerlName> ($subName) if defined $subName; |
5646 |
|
|
}__; |
5647 |
wakaba |
1.5 |
|
5648 |
|
|
@Method: |
5649 |
|
|
@@Name: createPerlUnparsedCode |
5650 |
|
|
@@enDesc: |
5651 |
|
|
Creates a new <Class::ManakaiPerlUnparsedCode> object. |
5652 |
|
|
@@Param: |
5653 |
|
|
@@@Name: codeArg |
5654 |
wakaba |
1.35 |
@@@Type: DOMString |
5655 |
wakaba |
1.5 |
@@@enDesc: |
5656 |
|
|
The code fragment. |
5657 |
|
|
@@@nullCase: |
5658 |
|
|
@@@@enDesc: |
5659 |
|
|
The fragment initially has no code. |
5660 |
|
|
@@Return: |
5661 |
wakaba |
1.25 |
@@@Type: PerlUnparsedCode |
5662 |
wakaba |
1.5 |
@@@enDesc: |
5663 |
|
|
Newly created Perl code object. |
5664 |
|
|
@@@PerlDef: |
5665 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5666 |
|
|
@@@@@: |
5667 |
wakaba |
1.5 |
__DEEP{ |
5668 |
wakaba |
1.6 |
$r = <ClassM::ManakaiPerlUnparsedCode.newObject>; |
5669 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5670 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5671 |
|
|
$class => {<ClassName::ManakaiPerlUnparsedCode>}}__; |
5672 |
wakaba |
1.7 |
$r-><AS::ManakaiPerlUnparsedCode.code> ($codeArg) if defined $codeArg; |
5673 |
wakaba |
1.6 |
}__; |
5674 |
wakaba |
1.35 |
@@@PerlDef: |
5675 |
|
|
@@@@ForCheck: pc|ForClass |
5676 |
|
|
@@@@@: |
5677 |
|
|
__DEEP{ |
5678 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5679 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'unparsed'); |
5680 |
|
|
$r-><AS::Node.textContent> ($codeArg) if defined $codeArg; |
5681 |
|
|
}__; |
5682 |
wakaba |
1.6 |
|
5683 |
|
|
@Method: |
5684 |
|
|
@@Name: createPerlInlineContainer |
5685 |
|
|
@@enDesc: |
5686 |
wakaba |
1.35 |
Creates a new <IF::PerlInlineContainer> object. |
5687 |
wakaba |
1.6 |
@@Return: |
5688 |
wakaba |
1.25 |
@@@Type: PerlCodeInlines |
5689 |
wakaba |
1.6 |
@@@enDesc: |
5690 |
|
|
Newly created Perl code object. |
5691 |
|
|
@@@PerlDef: |
5692 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5693 |
|
|
@@@@@: |
5694 |
wakaba |
1.6 |
__DEEP{ |
5695 |
|
|
$r = <ClassM::ManakaiPerlInlineContainer.newObject>; |
5696 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5697 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5698 |
|
|
$class => {<ClassName::ManakaiPerlInlineContainer>}}__; |
5699 |
|
|
}__; |
5700 |
wakaba |
1.35 |
@@@PerlDef: |
5701 |
|
|
@@@@ForCheck: pc|ForClass |
5702 |
|
|
@@@@@: |
5703 |
|
|
__DEEP{ |
5704 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5705 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'inlineContainer'); |
5706 |
|
|
}__; |
5707 |
wakaba |
1.6 |
|
5708 |
|
|
@Method: |
5709 |
|
|
@@Name: createPerlInlineUnparsedCode |
5710 |
|
|
@@enDesc: |
5711 |
wakaba |
1.35 |
Creates a new <IF::PerlInlineUnparsedCode> object. |
5712 |
wakaba |
1.6 |
@@Param: |
5713 |
|
|
@@@Name: codeArg |
5714 |
wakaba |
1.35 |
@@@Type: DOMString |
5715 |
wakaba |
1.6 |
@@@enDesc: |
5716 |
|
|
The code fragment. |
5717 |
|
|
@@@nullCase: |
5718 |
|
|
@@@@enDesc: |
5719 |
|
|
The fragment initially has no code. |
5720 |
|
|
@@Return: |
5721 |
wakaba |
1.25 |
@@@Type: PerlInlineUnparsedCode |
5722 |
wakaba |
1.6 |
@@@enDesc: |
5723 |
|
|
Newly created Perl code object. |
5724 |
|
|
@@@PerlDef: |
5725 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5726 |
|
|
@@@@@: |
5727 |
wakaba |
1.6 |
__DEEP{ |
5728 |
|
|
$r = <ClassM::ManakaiPerlInlineUnparsedCode.newObject>; |
5729 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5730 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5731 |
|
|
$class => {<ClassName::ManakaiPerlInlineUnparsedCode>}}__; |
5732 |
wakaba |
1.7 |
$r-><AS::ManakaiPerlInlineUnparsedCode.code> ($codeArg) |
5733 |
wakaba |
1.6 |
if defined $codeArg; |
5734 |
|
|
}__; |
5735 |
wakaba |
1.35 |
@@@PerlDef: |
5736 |
|
|
@@@@ForCheck: pc|ForClass |
5737 |
|
|
@@@@@: |
5738 |
|
|
__DEEP{ |
5739 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5740 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'inlineUnparsed'); |
5741 |
|
|
$r-><AS::Node.textContent> ($codeArg) if defined $codeArg; |
5742 |
|
|
}__; |
5743 |
wakaba |
1.6 |
|
5744 |
|
|
@Method: |
5745 |
|
|
@@Name: createPerlBare |
5746 |
|
|
@@enDesc: |
5747 |
wakaba |
1.35 |
Creates a new <IF::PerlTokens> object. |
5748 |
wakaba |
1.6 |
@@Param: |
5749 |
|
|
@@@Name: codeArg |
5750 |
wakaba |
1.35 |
@@@Type: DOMString |
5751 |
wakaba |
1.6 |
@@@enDesc: |
5752 |
|
|
The code fragment. |
5753 |
|
|
@@Return: |
5754 |
wakaba |
1.25 |
@@@Type: PerlTokens |
5755 |
wakaba |
1.6 |
@@@enDesc: |
5756 |
|
|
Newly created Perl code object. |
5757 |
|
|
@@@PerlDef: |
5758 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5759 |
|
|
@@@@@: |
5760 |
wakaba |
1.6 |
__DEEP{ |
5761 |
|
|
$r = <ClassM::ManakaiPerlBare.newObject>; |
5762 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5763 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5764 |
|
|
$class => {<ClassName::ManakaiPerlBare>}}__; |
5765 |
wakaba |
1.7 |
$r-><AS::ManakaiPerlBare.code> ($codeArg); |
5766 |
wakaba |
1.6 |
}__; |
5767 |
wakaba |
1.35 |
@@@PerlDef: |
5768 |
|
|
@@@@ForCheck: pc|ForClass |
5769 |
|
|
@@@@@: |
5770 |
|
|
__DEEP{ |
5771 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5772 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'tokens'); |
5773 |
|
|
$r-><AS::Node.textContent> ($codeArg) if defined $codeArg; |
5774 |
|
|
}__; |
5775 |
wakaba |
1.6 |
|
5776 |
|
|
@Method: |
5777 |
|
|
@@Name: createPerlAtom |
5778 |
|
|
@@enDesc: |
5779 |
wakaba |
1.35 |
Creates a new <IF::PerlAtom> object. |
5780 |
wakaba |
1.6 |
@@Param: |
5781 |
|
|
@@@Name: codeArg |
5782 |
wakaba |
1.35 |
@@@Type: DOMString |
5783 |
wakaba |
1.6 |
@@@enDesc: |
5784 |
|
|
The code fragment. |
5785 |
|
|
@@Return: |
5786 |
wakaba |
1.25 |
@@@Type: PerlAtom |
5787 |
wakaba |
1.6 |
@@@enDesc: |
5788 |
|
|
Newly created Perl code object. |
5789 |
|
|
@@@PerlDef: |
5790 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5791 |
|
|
@@@@@: |
5792 |
wakaba |
1.6 |
__DEEP{ |
5793 |
|
|
$r = <ClassM::ManakaiPerlAtom.newObject>; |
5794 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5795 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5796 |
|
|
$class => {<ClassName::ManakaiPerlAtom>}}__; |
5797 |
wakaba |
1.7 |
$r-><AS::ManakaiPerlBare.code> ($codeArg); |
5798 |
wakaba |
1.6 |
}__; |
5799 |
wakaba |
1.35 |
@@@PerlDef: |
5800 |
|
|
@@@@ForCheck: pc|ForClass |
5801 |
|
|
@@@@@: |
5802 |
|
|
__DEEP{ |
5803 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5804 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'atom'); |
5805 |
|
|
$r-><AS::Node.textContent> ($codeArg) if defined $codeArg; |
5806 |
|
|
}__; |
5807 |
wakaba |
1.6 |
|
5808 |
|
|
@Method: |
5809 |
|
|
@@Name: createPerlStringLiteral |
5810 |
|
|
@@enDesc: |
5811 |
wakaba |
1.35 |
Creates a new <IF::PerlStringLiteral> object. |
5812 |
wakaba |
1.6 |
@@Param: |
5813 |
|
|
@@@Name: stringArg |
5814 |
wakaba |
1.35 |
@@@Type: DOMString |
5815 |
wakaba |
1.6 |
@@@enDesc: A string. |
5816 |
|
|
@@Return: |
5817 |
wakaba |
1.25 |
@@@Type: PerlStringLiteral |
5818 |
wakaba |
1.6 |
@@@enDesc: |
5819 |
|
|
Newly created Perl code object. |
5820 |
|
|
@@@PerlDef: |
5821 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5822 |
|
|
@@@@@: |
5823 |
wakaba |
1.6 |
__DEEP{ |
5824 |
|
|
$r = <ClassM::ManakaiPerlStringLiteral.newObject>; |
5825 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5826 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5827 |
|
|
$class => {<ClassName::ManakaiPerlStringLiteral>}}__; |
5828 |
wakaba |
1.7 |
$r-><AS::ManakaiPerlStringLiteral.data> ($stringArg); |
5829 |
wakaba |
1.6 |
}__; |
5830 |
wakaba |
1.35 |
@@@PerlDef: |
5831 |
|
|
@@@@ForCheck: pc|ForClass |
5832 |
|
|
@@@@@: |
5833 |
|
|
__DEEP{ |
5834 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5835 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'stringLiteral'); |
5836 |
|
|
$r-><AS::Node.textContent> ($stringArg); |
5837 |
|
|
}__; |
5838 |
wakaba |
1.6 |
|
5839 |
|
|
@Method: |
5840 |
|
|
@@Name: createPerlVariable |
5841 |
|
|
@@enDesc: |
5842 |
wakaba |
1.35 |
Creates a new <IF::PerlVariable> object. |
5843 |
wakaba |
1.6 |
@@Param: |
5844 |
|
|
@@@Name: variableType |
5845 |
wakaba |
1.35 |
@@@Type: DOMString |
5846 |
wakaba |
1.6 |
@@@enDesc: |
5847 |
|
|
Variable prefix. |
5848 |
wakaba |
1.16 |
@@@nullCase: |
5849 |
|
|
@@@@enDesc: |
5850 |
|
|
If the <P::packageName> is <DOM::null>, then |
5851 |
|
|
the <P::variableType> is detected by the prefix of |
5852 |
|
|
<P::localName>. Otherwise, it is an unprefixed variable |
5853 |
|
|
such as file handle. |
5854 |
wakaba |
1.6 |
@@Param: |
5855 |
|
|
@@@Name: packageName |
5856 |
wakaba |
1.35 |
@@@Type: DOMString |
5857 |
wakaba |
1.6 |
@@@enDesc: |
5858 |
|
|
Package name. |
5859 |
|
|
@@@nullCase: |
5860 |
|
|
@@@@enDesc: |
5861 |
|
|
The variable belongs to the current package or a |
5862 |
|
|
lexical-scoped variable. |
5863 |
|
|
@@Param: |
5864 |
|
|
@@@Name: localName |
5865 |
wakaba |
1.35 |
@@@Type: DOMString |
5866 |
wakaba |
1.6 |
@@@enDesc: |
5867 |
wakaba |
1.16 |
Variable name. If both <P::variableType> and <P::packageName> |
5868 |
|
|
is <DOM::null>, the <P::localName> value may be prefixed |
5869 |
|
|
by any possible <P::variableType> value. |
5870 |
wakaba |
1.6 |
@@Return: |
5871 |
wakaba |
1.25 |
@@@Type: PerlVariable |
5872 |
wakaba |
1.6 |
@@@enDesc: |
5873 |
|
|
Newly created Perl variable object. |
5874 |
|
|
@@@PerlDef: |
5875 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5876 |
|
|
@@@@@: |
5877 |
wakaba |
1.6 |
__DEEP{ |
5878 |
|
|
$r = <ClassM::ManakaiPerlVariable.newObject>; |
5879 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5880 |
wakaba |
1.6 |
$object => $r, $ref => $r, |
5881 |
|
|
$class => {<ClassName::ManakaiPerlVariable>}}__; |
5882 |
wakaba |
1.16 |
if (not $variableType and not $packageName and |
5883 |
|
|
$localName =~ s/^(\\?[\$\@%&*])//) { |
5884 |
|
|
$variableType = $1; |
5885 |
|
|
} |
5886 |
wakaba |
1.7 |
$r-><AS::ManakaiPerlVariable.variableType> ($variableType); |
5887 |
|
|
$r-><AS::ManakaiPerlVariable.packageName> ($packageName); |
5888 |
|
|
$r-><AS::ManakaiPerlVariable.localName> ($localName); |
5889 |
wakaba |
1.8 |
}__; |
5890 |
wakaba |
1.35 |
@@@PerlDef: |
5891 |
|
|
@@@@ForCheck: pc|ForClass |
5892 |
|
|
@@@@@: |
5893 |
|
|
__DEEP{ |
5894 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5895 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'variable'); |
5896 |
|
|
if (not $variableType and not $packageName and |
5897 |
|
|
$localName =~ s/^(\\?[\$\@%&*])//) { |
5898 |
|
|
$variableType = $1; |
5899 |
|
|
} |
5900 |
|
|
$r-><AS::PerlVariable.variableType> ($variableType) |
5901 |
|
|
if defined $variableType; |
5902 |
|
|
$r-><AS::PerlVariable.packageName> ($packageName) |
5903 |
|
|
if defined $packageName; |
5904 |
|
|
$r-><AS::PerlVariable.pcLocalName> ($localName); |
5905 |
|
|
}__; |
5906 |
wakaba |
1.8 |
|
5907 |
|
|
@Method: |
5908 |
|
|
@@Name: createPerlBlock |
5909 |
|
|
@@enDesc: |
5910 |
wakaba |
1.35 |
Creates a new <IF::PerlBlock> object. |
5911 |
wakaba |
1.8 |
@@Return: |
5912 |
wakaba |
1.25 |
@@@Type: PerlBlock |
5913 |
wakaba |
1.8 |
@@@enDesc: |
5914 |
|
|
Newly created Perl code object. |
5915 |
|
|
@@@PerlDef: |
5916 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5917 |
|
|
@@@@@: |
5918 |
wakaba |
1.8 |
__DEEP{ |
5919 |
|
|
$r = <ClassM::ManakaiPerlBlock.newObject>; |
5920 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5921 |
wakaba |
1.8 |
$object => $r, $ref => $r, |
5922 |
|
|
$class => {<ClassName::ManakaiPerlBlock>}}__; |
5923 |
wakaba |
1.5 |
}__; |
5924 |
wakaba |
1.35 |
@@@PerlDef: |
5925 |
|
|
@@@@ForCheck: pc|ForClass |
5926 |
|
|
@@@@@: |
5927 |
|
|
__DEEP{ |
5928 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5929 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'block'); |
5930 |
|
|
}__; |
5931 |
wakaba |
1.9 |
|
5932 |
|
|
@Method: |
5933 |
|
|
@@Name: createPerlBlockContainer |
5934 |
|
|
@@enDesc: |
5935 |
|
|
Creates a new <Class::ManakaiPerlBlockContainer> object. |
5936 |
|
|
@@Return: |
5937 |
wakaba |
1.25 |
@@@Type: PerlCodeBlocks |
5938 |
wakaba |
1.9 |
@@@enDesc: |
5939 |
|
|
Newly created Perl code object. |
5940 |
|
|
@@@PerlDef: |
5941 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5942 |
|
|
@@@@@: |
5943 |
wakaba |
1.9 |
__DEEP{ |
5944 |
|
|
$r = <ClassM::ManakaiPerlBlockContainer.newObject>; |
5945 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5946 |
wakaba |
1.9 |
$object => $r, $ref => $r, |
5947 |
|
|
$class => {<ClassName::ManakaiPerlBlockContainer>}}__; |
5948 |
|
|
}__; |
5949 |
wakaba |
1.35 |
@@@PerlDef: |
5950 |
|
|
@@@@ForCheck: pc|ForClass |
5951 |
|
|
@@@@@: |
5952 |
|
|
__DEEP{ |
5953 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5954 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'blockContainer'); |
5955 |
|
|
}__; |
5956 |
wakaba |
1.11 |
|
5957 |
|
|
@Method: |
5958 |
|
|
@@Name: createPerlStatement |
5959 |
|
|
@@enDesc: |
5960 |
|
|
Creates a new Perl statement. |
5961 |
|
|
@@Param: |
5962 |
|
|
@@@Name: codeArg |
5963 |
wakaba |
1.35 |
@@@Type: DOMString |
5964 |
wakaba |
1.11 |
@@@enDesc: |
5965 |
|
|
A Perl statement without terminating <Perl::;>. |
5966 |
|
|
@@@nullCase: |
5967 |
|
|
@@@@enDesc: |
5968 |
|
|
No initial content. |
5969 |
|
|
@@Return: |
5970 |
wakaba |
1.25 |
@@@Type: PerlStatement |
5971 |
wakaba |
1.11 |
@@@enDesc: |
5972 |
|
|
The newly created Perl code object. |
5973 |
|
|
@@@PerlDef: |
5974 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
5975 |
|
|
@@@@@: |
5976 |
wakaba |
1.11 |
$r = <ClassM::ManakaiPerlStatement.newObject>; |
5977 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
5978 |
wakaba |
1.11 |
$object => $r, $ref => $r, |
5979 |
|
|
$class =>{<ClassName::ManakaiPerlStatement>}, |
5980 |
|
|
}__; |
5981 |
|
|
if (defined $codeArg) { |
5982 |
|
|
__DEEP{ |
5983 |
|
|
$r-><M::ManakaiPerlAnyContainer.appendBare> ($codeArg); |
5984 |
|
|
}__; |
5985 |
|
|
} |
5986 |
wakaba |
1.35 |
@@@PerlDef: |
5987 |
|
|
@@@@ForCheck: pc|ForClass |
5988 |
|
|
@@@@@: |
5989 |
|
|
__DEEP{ |
5990 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
5991 |
|
|
-><M::Document.createElementNS> (<Q::pc:>, 'statement'); |
5992 |
|
|
if (defined $codeArg) { |
5993 |
|
|
$r-><M::PerlCodeUnits.appendBare> ($codeArg); |
5994 |
|
|
} |
5995 |
|
|
}__; |
5996 |
wakaba |
1.12 |
|
5997 |
|
|
@Method: |
5998 |
|
|
@@Name: createPerlIf |
5999 |
|
|
@@enDesc: |
6000 |
wakaba |
1.35 |
Creates a <IF::PerlIf> object. |
6001 |
wakaba |
1.12 |
@@Param: |
6002 |
|
|
@@@Name: conditionArg |
6003 |
wakaba |
1.35 |
@@@Type: PerlCodeInlines |
6004 |
wakaba |
1.12 |
@@@enDesc: |
6005 |
|
|
Conditoon code fragment object. |
6006 |
|
|
@@Param: |
6007 |
|
|
@@@Name: trueArg |
6008 |
wakaba |
1.35 |
@@@Type: PerlCodeBlocks |
6009 |
wakaba |
1.12 |
@@@enDesc: |
6010 |
|
|
A true code fragment object. |
6011 |
|
|
@@@nullCase: |
6012 |
|
|
@@@@enDesc: No true code. |
6013 |
|
|
@@Param: |
6014 |
|
|
@@@Name: falseArg |
6015 |
wakaba |
1.35 |
@@@Type: PerlCodeBlocks |
6016 |
wakaba |
1.12 |
@@@enDesc: |
6017 |
|
|
A false code fragment object. |
6018 |
|
|
@@@nullCase: |
6019 |
|
|
@@@@enDesc: No false code. |
6020 |
|
|
@@Return: |
6021 |
wakaba |
1.25 |
@@@Type: PerlIf |
6022 |
wakaba |
1.12 |
@@@RaiseException: |
6023 |
|
|
@@@@@:BAD_CHILD_ERR |
6024 |
|
|
@@@@enDesc: |
6025 |
|
|
An attempt is made to append a child |
6026 |
|
|
that is not valid type. |
6027 |
|
|
@@@RaiseException: |
6028 |
|
|
@@@@@:IN_USE_NODE_ERR |
6029 |
|
|
@@@@enDesc: |
6030 |
|
|
An attempt is made to append a node that is |
6031 |
|
|
already used elsewhere. |
6032 |
|
|
@@@PerlDef: |
6033 |
wakaba |
1.35 |
@@@@ForCheck: !pc|ForClass |
6034 |
|
|
@@@@@: |
6035 |
wakaba |
1.12 |
for my $arg ([conditionArg => $conditionArg]) { |
6036 |
|
|
if ({ |
6037 |
|
|
atom => 1, bare => 1, incontainer => 1, assign => true, |
6038 |
|
|
inunparsed => 1, variable => 1, string => true, |
6039 |
wakaba |
1.30 |
}->{$arg->[1]->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
6040 |
|
|
if ($arg->[1]->{<H::mn:node>}->{<H::pc:parent>}) { |
6041 |
wakaba |
1.12 |
__EXCEPTION{IN_USE_NODE_ERR:: |
6042 |
|
|
pc:childNode => {$arg->[1]}, |
6043 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6044 |
|
|
}__; |
6045 |
|
|
} |
6046 |
|
|
} else { |
6047 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
6048 |
|
|
pc:parentNode => {$self}, |
6049 |
|
|
pc:childNode => {$arg->[1]}, |
6050 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6051 |
|
|
}__; |
6052 |
|
|
} |
6053 |
|
|
} # c |
6054 |
|
|
|
6055 |
|
|
for my $arg ([trueArg => $trueArg], |
6056 |
|
|
[falseArg => $falseArg]) { |
6057 |
|
|
next unless $arg->[1]; |
6058 |
|
|
if ({ |
6059 |
|
|
blockcontainer => true, |
6060 |
wakaba |
1.30 |
}->{$arg->[1]->{<H::mn:node>}->{<H::pc:nodeType>}}) { |
6061 |
|
|
if ($arg->[1]->{<H::mn:node>}->{<H::pc:parent>}) { |
6062 |
wakaba |
1.12 |
__EXCEPTION{IN_USE_NODE_ERR:: |
6063 |
|
|
pc:childNode => {$arg->[1]}, |
6064 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6065 |
|
|
}__; |
6066 |
|
|
} |
6067 |
|
|
} else { |
6068 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
6069 |
|
|
pc:parentNode => {$self}, |
6070 |
|
|
pc:childNode => {$arg->[1]}, |
6071 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6072 |
|
|
}__; |
6073 |
|
|
} |
6074 |
|
|
} # t/f |
6075 |
|
|
|
6076 |
|
|
my $assign = <ClassM::ManakaiPerlIf.newObject>; |
6077 |
wakaba |
1.30 |
$assign->{<H::pc:condition>} = $conditionArg->{<H::mn:node>}; |
6078 |
|
|
$assign->{<H::pc:true>} = $trueArg->{<H::mn:node>} if $trueArg; |
6079 |
|
|
$assign->{<H::pc:false>} = $falseArg->{<H::mn:node>} if $falseArg; |
6080 |
wakaba |
1.21 |
$assign-><M::MNodeObject.importTree> ($_) |
6081 |
wakaba |
1.12 |
for (grep {$_} |
6082 |
wakaba |
1.30 |
$assign->{<H::pc:condition>}, $assign->{<H::pc:true>}, |
6083 |
|
|
$assign->{<H::pc:false>}); |
6084 |
|
|
$conditionArg->{<H::mn:node>}->{<H::pc:parent>} = $assign; |
6085 |
|
|
$trueArg->{<H::mn:node>}->{<H::pc:parent>} = $assign if $trueArg; |
6086 |
|
|
$falseArg->{<H::mn:node>}->{<H::pc:parent>} = $assign if $falseArg; |
6087 |
wakaba |
1.21 |
if (defined wantarray) { |
6088 |
wakaba |
1.35 |
__CODE{ManakaiNode:getNewReference||ManakaiDOM|Perl:: |
6089 |
wakaba |
1.21 |
$object => $assign, $ref => $r, |
6090 |
|
|
$class =>{<ClassName::ManakaiPerlIf>}, |
6091 |
|
|
}__; |
6092 |
|
|
} |
6093 |
wakaba |
1.35 |
@@@PerlDef: |
6094 |
|
|
@@@@ForCheck: pc|ForClass |
6095 |
|
|
@@@@@: |
6096 |
|
|
for my $arg ([conditionArg => $conditionArg]) { |
6097 |
|
|
if ({ |
6098 |
|
|
atom => 1, tokens => 1, inlineContainer => 1, assignment => true, |
6099 |
|
|
inlineUnparsed => 1, variable => 1, stringLiteral => true, |
6100 |
|
|
}->{$arg->[1]-><AG::Node.localName>}) { |
6101 |
|
|
if ($arg->[1]-><AG::Node.parentNode>) { |
6102 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
6103 |
|
|
pc:childNode => {$arg->[1]}, |
6104 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6105 |
|
|
}__; |
6106 |
|
|
} |
6107 |
|
|
} else { |
6108 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
6109 |
|
|
pc:parentNode => {$self}, |
6110 |
|
|
pc:childNode => {$arg->[1]}, |
6111 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6112 |
|
|
}__; |
6113 |
|
|
} |
6114 |
|
|
} # c |
6115 |
|
|
|
6116 |
|
|
for my $arg ([trueArg => $trueArg], |
6117 |
|
|
[falseArg => $falseArg]) { |
6118 |
|
|
next unless $arg->[1]; |
6119 |
|
|
if ({ |
6120 |
|
|
blockContainer => true, |
6121 |
|
|
}->{$arg->[1]-><AG::Node.localName>}) { |
6122 |
|
|
if ($arg->[1]-><AG::Node.parentNode>) { |
6123 |
|
|
__EXCEPTION{IN_USE_NODE_ERR:: |
6124 |
|
|
pc:childNode => {$arg->[1]}, |
6125 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6126 |
|
|
}__; |
6127 |
|
|
} |
6128 |
|
|
} else { |
6129 |
|
|
__EXCEPTION{BAD_CHILD_ERR:: |
6130 |
|
|
pc:parentNode => {$self}, |
6131 |
|
|
pc:childNode => {$arg->[1]}, |
6132 |
|
|
MDOMX:param-name => {$arg->[0]}, |
6133 |
|
|
}__; |
6134 |
|
|
} |
6135 |
|
|
} # t/f |
6136 |
|
|
|
6137 |
|
|
__DEEP{ |
6138 |
|
|
$r = $self-><M::DOMImpl.createDocument> |
6139 |
|
|
-><M::Document.createElementNS> |
6140 |
|
|
(<Q::pc:>, 'if'); |
6141 |
|
|
$r-><AS::PerlIf.condition> ($conditionArg) if $conditionArg; |
6142 |
|
|
$r-><AS::PerlIf.trueCode> ($trueArg) if $trueArg; |
6143 |
|
|
$r-><AS::PerlIf.falseCode> ($falseArg) if $falseArg; |
6144 |
|
|
}__; |
6145 |
wakaba |
1.25 |
##PCImplementation |
6146 |
wakaba |
1.1 |
|
6147 |
wakaba |
1.5 |
ResourceDef: |
6148 |
|
|
@QName: MNodeObject |
6149 |
|
|
@AliasFor: |
6150 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
6151 |
wakaba |
1.27 |
@For: ManakaiDOM|Perl |
6152 |
wakaba |
1.5 |
|
6153 |
wakaba |
1.1 |
PropDef: |
6154 |
|
|
@QName: code |
6155 |
|
|
@enDesc: Perl code. |
6156 |
|
|
|
6157 |
|
|
PropDef: |
6158 |
|
|
@QName: sourceFile |
6159 |
|
|
@enDesc: |
6160 |
|
|
Source file. |
6161 |
|
|
|
6162 |
|
|
PropDef: |
6163 |
|
|
@QName: sourceLine |
6164 |
|
|
@enDesc: |
6165 |
|
|
Source line number. |
6166 |
wakaba |
1.10 |
|
6167 |
|
|
PropDef: |
6168 |
|
|
@QName: currentSourceFile |
6169 |
|
|
@enDesc: |
6170 |
|
|
<QUOTE::Current> source file. |
6171 |
|
|
|
6172 |
|
|
PropDef: |
6173 |
|
|
@QName: currentSourceLine |
6174 |
|
|
@enDesc: |
6175 |
|
|
<QUOTE::Current> source line number. |
6176 |
wakaba |
1.1 |
|
6177 |
|
|
PropDef: |
6178 |
|
|
@QName: prototype |
6179 |
|
|
@enDesc: |
6180 |
|
|
Prototype of subroutine. |
6181 |
|
|
|
6182 |
|
|
PropDef: |
6183 |
|
|
@QName: parent |
6184 |
|
|
@enDesc: |
6185 |
|
|
Higher-level object. |
6186 |
|
|
|
6187 |
|
|
PropDef: |
6188 |
|
|
@QName: sub |
6189 |
|
|
@enDesc: |
6190 |
|
|
Perl subroutines. |
6191 |
|
|
|
6192 |
|
|
PropDef: |
6193 |
|
|
@QName: packageName |
6194 |
|
|
@Type: |
6195 |
wakaba |
1.12 |
Perl:package-name::ManakaiDOM:all |
6196 |
wakaba |
1.1 |
@enDesc: |
6197 |
|
|
The fully qualified names of packages. |
6198 |
|
|
|
6199 |
|
|
PropDef: |
6200 |
|
|
@QName: childNodes |
6201 |
|
|
@enDesc: |
6202 |
|
|
Child code fragments. |
6203 |
|
|
|
6204 |
|
|
PropDef: |
6205 |
|
|
@QName: localName |
6206 |
|
|
@enDesc: |
6207 |
|
|
Scoped names. |
6208 |
wakaba |
1.4 |
|
6209 |
wakaba |
1.35 |
ResourceDef: |
6210 |
|
|
@QName: DOMImpl |
6211 |
|
|
@AliasFor: DOMCore|DOMImplementation |
6212 |
|
|
@For: ManakaiDOM|DOM |
6213 |
|
|
|
6214 |
|
|
ResourceDef: |
6215 |
|
|
@QName: Node |
6216 |
|
|
@AliasFor: DOMCore|Node |
6217 |
|
|
@For: ManakaiDOM|DOM |
6218 |
|
|
|
6219 |
|
|
ResourceDef: |
6220 |
|
|
@QName: Element |
6221 |
|
|
@AliasFor: DOMCore|Element |
6222 |
|
|
@For: ManakaiDOM|DOM |
6223 |
|
|
|
6224 |
|
|
ResourceDef: |
6225 |
|
|
@QName: Document |
6226 |
|
|
@AliasFor: DOMCore|Document |
6227 |
|
|
@For: ManakaiDOM|DOM |
6228 |
|
|
|
6229 |
wakaba |
1.4 |
## -- Exceptions |
6230 |
|
|
|
6231 |
wakaba |
1.25 |
ResourceDef: |
6232 |
|
|
@rdf:type: |
6233 |
|
|
@@@: dis|MultipleResource |
6234 |
|
|
@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass |
6235 |
|
|
@resourceFor: ManakaiDOM|ForIF |
6236 |
|
|
@resourceFor: ManakaiDOM|ForClass |
6237 |
|
|
|
6238 |
|
|
@For: ManakaiDOM|Perl |
6239 |
|
|
|
6240 |
|
|
@rdf:type: |
6241 |
wakaba |
1.33 |
@@@: dx|Interface |
6242 |
wakaba |
1.25 |
@@ForCheck: ManakaiDOM|ForIF |
6243 |
|
|
|
6244 |
|
|
@rdf:type: |
6245 |
wakaba |
1.33 |
@@@: dx|Class |
6246 |
wakaba |
1.25 |
@@ForCheck: ManakaiDOM|ForClass |
6247 |
|
|
|
6248 |
|
|
@Implement: |
6249 |
wakaba |
1.35 |
@@@: ||ManakaiDOM|ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF |
6250 |
|
|
@@ContentType: DISCore|TFPQNames |
6251 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
6252 |
|
|
@Implement: |
6253 |
|
|
@@@: ||ManakaiDOM|ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF |
6254 |
wakaba |
1.25 |
@@ContentType: DISCore|TFPQNames |
6255 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
6256 |
wakaba |
1.35 |
@dx:implementedBy: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForClass |
6257 |
wakaba |
1.25 |
|
6258 |
wakaba |
1.35 |
@f:implements: pc|CoreFeature10 |
6259 |
wakaba |
1.25 |
|
6260 |
|
|
@ISA: |
6261 |
wakaba |
1.33 |
@@@: dx|Exception||ManakaiDOM|Perl |
6262 |
wakaba |
1.25 |
@@ForCheck: ManakaiDOM|ForClass |
6263 |
|
|
|
6264 |
|
|
@IFQName: PCException |
6265 |
wakaba |
1.35 |
@QName: |
6266 |
|
|
@@@: ManakaiPCException |
6267 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
6268 |
wakaba |
1.25 |
|
6269 |
wakaba |
1.4 |
@enDesc: |
6270 |
wakaba |
1.25 |
Exceptions for the <Module::Util:PerlCode> module. |
6271 |
|
|
|
6272 |
|
|
@ResourceDef: |
6273 |
wakaba |
1.33 |
@@ForCheck: ManakaiDOM|ForIF |
6274 |
|
|
@@rdf:type: DISLang|ConstGroup |
6275 |
wakaba |
1.25 |
|
6276 |
|
|
@@IFQName: PCExceptionCode |
6277 |
|
|
|
6278 |
wakaba |
1.4 |
@@enDesc: |
6279 |
wakaba |
1.25 |
Exception codes for <IF::PCException>. |
6280 |
|
|
|
6281 |
wakaba |
1.33 |
@@Type: idl|unsignedShort||ManakaiDOM|all |
6282 |
|
|
@@rdfs:subClassOf: idl|unsignedShort||ManakaiDOM|all |
6283 |
wakaba |
1.25 |
|
6284 |
wakaba |
1.5 |
@@XConstDef: |
6285 |
|
|
@@@Name: HIERARCHY_REQUEST_ERR |
6286 |
wakaba |
1.27 |
@@@Value: |
6287 |
|
|
@@@@@:3 |
6288 |
|
|
@@@@ContentType: DISCore|Integer |
6289 |
wakaba |
1.5 |
@@@enDesc: |
6290 |
|
|
An attempt is made to break the hierarchy. |
6291 |
|
|
@@@XSubTypeDef: |
6292 |
|
|
@@@@QName: BAD_CHILD_ERR |
6293 |
|
|
@@@@enDesc: |
6294 |
|
|
An attempt is made to append a node as a child whose type |
6295 |
|
|
is not allowed. |
6296 |
|
|
@@@@XParam: |
6297 |
|
|
@@@@@QName: childNode |
6298 |
|
|
@@@@@enDesc: |
6299 |
|
|
The node attempted to append. |
6300 |
|
|
@@@@XParam: |
6301 |
|
|
@@@@@QName: parentNode |
6302 |
|
|
@@@@@enDesc: |
6303 |
|
|
The node to whose child list an attempt to append is made. |
6304 |
|
|
@@@XSubTypeDef: |
6305 |
|
|
@@@@QName: IN_USE_NODE_ERR |
6306 |
|
|
@@@@enDesc: |
6307 |
|
|
An attempt is made to append a node that has already been used |
6308 |
|
|
elsewhere. |
6309 |
|
|
@@@@XParam: |
6310 |
|
|
@@@@@QName: childNode |
6311 |
|
|
@@@@@enDesc: |
6312 |
|
|
The node attempted to append. |
6313 |
|
|
@@@@XParam: |
6314 |
|
|
@@@@@QName: parentNode |
6315 |
|
|
@@@@@enDesc: |
6316 |
|
|
The parent node of the <XP::childNode>. |
6317 |
wakaba |
1.4 |
@@XConstDef: |
6318 |
|
|
@@@Name: NOT_SUPPORTED_ERR |
6319 |
wakaba |
1.27 |
@@@Value: |
6320 |
|
|
@@@@@:9 |
6321 |
|
|
@@@@ContentType: DISCore|Integer |
6322 |
wakaba |
1.4 |
@@@enDesc: |
6323 |
|
|
An attempt is made to do something the implementation does not support. |
6324 |
|
|
@@@XSubTypeDef: |
6325 |
|
|
@@@@QName: UNSUPPORTED_OPERATOR_ERR |
6326 |
|
|
@@@@enDesc: |
6327 |
|
|
The implementation does not support the specified operator. |
6328 |
|
|
@@@@XParam: |
6329 |
|
|
@@@@@QName: operator |
6330 |
|
|
@@@@@enDesc: |
6331 |
|
|
The operator that is not supported. |
6332 |
|
|
@@@@enMufDef: |
6333 |
|
|
Operator "%p (name => {<Q::pc:operator>});" is not supported |
6334 |
wakaba |
1.25 |
##PCException |
6335 |
wakaba |
1.4 |
|
6336 |
|
|
ElementTypeBinding: |
6337 |
|
|
@Name: XConstDef |
6338 |
|
|
@ElementType: |
6339 |
|
|
dis:ResourceDef |
6340 |
|
|
@ShadowContent: |
6341 |
wakaba |
1.33 |
@@rdf:type: dx|ErrorCode |
6342 |
wakaba |
1.4 |
|
6343 |
|
|
ElementTypeBinding: |
6344 |
|
|
@Name: XSubTypeDef |
6345 |
|
|
@ElementType: |
6346 |
|
|
dis:ResourceDef |
6347 |
|
|
@ShadowContent: |
6348 |
wakaba |
1.33 |
@@rdf:type: dx|ErrorSubCode |
6349 |
wakaba |
1.4 |
|
6350 |
|
|
ElementTypeBinding: |
6351 |
|
|
@Name: XParam |
6352 |
|
|
@ElementType: |
6353 |
wakaba |
1.33 |
ecore:hasParameter |
6354 |
wakaba |
1.4 |
|
6355 |
|
|
ElementTypeBinding: |
6356 |
|
|
@Name: XParamDef |
6357 |
|
|
@ElementType: |
6358 |
|
|
dis:ResourceDef |
6359 |
|
|
@ShadowContent: |
6360 |
wakaba |
1.33 |
@@rdf:type: ecore|Parameter |
6361 |
wakaba |
1.27 |
@@For: =ManakaiDOM|all |
6362 |
wakaba |
1.4 |
|
6363 |
|
|
ElementTypeBinding: |
6364 |
|
|
@Name: enMufDef |
6365 |
|
|
@ElementType: |
6366 |
|
|
dis:Def |
6367 |
|
|
@ShadowContent: |
6368 |
|
|
@@ContentType: |
6369 |
|
|
lang:muf |
6370 |
|
|
@@lang:en |
6371 |
|
|
|
6372 |
wakaba |
1.1 |
ElementTypeBinding: |
6373 |
|
|
@Name: Method |
6374 |
|
|
@ElementType: |
6375 |
|
|
dis:ResourceDef |
6376 |
|
|
@ShadowContent: |
6377 |
|
|
@@rdf:type: |
6378 |
|
|
DISLang:Method |
6379 |
|
|
|
6380 |
|
|
ElementTypeBinding: |
6381 |
|
|
@Name: ToStringMethod |
6382 |
|
|
@ElementType: |
6383 |
|
|
dis:ResourceDef |
6384 |
|
|
@ShadowContent: |
6385 |
|
|
@@rdf:type: |
6386 |
|
|
DISLang:Method |
6387 |
|
|
@@Operator: |
6388 |
|
|
@@@@: |
6389 |
|
|
DISPerl:AsStringMethod |
6390 |
wakaba |
1.35 |
@@@ContentType: DISCore|QName |
6391 |
wakaba |
1.1 |
@@Description: |
6392 |
|
|
@@@lang:en |
6393 |
|
|
@@@@: |
6394 |
|
|
Returns the textual Perl source code representation of this object. |
6395 |
wakaba |
1.9 |
|
6396 |
wakaba |
1.14 |
ElementTypeBinding: |
6397 |
|
|
@Name: NumValMethod |
6398 |
|
|
@ElementType: |
6399 |
|
|
dis:ResourceDef |
6400 |
|
|
@ShadowContent: |
6401 |
|
|
@@rdf:type: |
6402 |
|
|
DISLang:Method |
6403 |
|
|
@@Operator: |
6404 |
|
|
@@@@: 0+ |
6405 |
|
|
@@@ContentType: |
6406 |
|
|
lang:Perl |
6407 |
|
|
@@Description: |
6408 |
|
|
@@@lang:en |
6409 |
|
|
@@@@: |
6410 |
|
|
Returns the numeric value of this object. |
6411 |
wakaba |
1.9 |
|
6412 |
|
|
ElementTypeBinding: |
6413 |
|
|
@Name: IntCloneMethod |
6414 |
|
|
@ElementType: |
6415 |
|
|
dis:ResourceDef |
6416 |
|
|
@ShadowContent: |
6417 |
|
|
@@rdf:type: |
6418 |
|
|
DISLang:Method |
6419 |
|
|
@@Name: makeCloneObject |
6420 |
|
|
@@Description: |
6421 |
|
|
@@@lang:en |
6422 |
|
|
@@@@: |
6423 |
|
|
Returns the node object of a deep clone of a node object. |
6424 |
|
|
@@ManakaiDOM:isStatic:1 |
6425 |
|
|
@@ManakaiDOM:isForInternal:1 |
6426 |
wakaba |
1.35 |
@@ForCheck: ManakaiDOM|ForClass pc|ForClassCompat |
6427 |
wakaba |
1.9 |
@@ResourceDef: |
6428 |
|
|
@@@rdf:type: |
6429 |
|
|
DISLang:MethodParameter |
6430 |
|
|
@@@Name: nodeObject |
6431 |
|
|
@@@Type: |
6432 |
|
|
ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl |
6433 |
|
|
@@@Description: |
6434 |
|
|
@@@@lang:en |
6435 |
|
|
@@@@@: Node object to copy. |
6436 |
|
|
@ShadowSibling: |
6437 |
|
|
@@ResourceDef: |
6438 |
wakaba |
1.35 |
@@@ForCheck: pc|ForClassCompat |
6439 |
wakaba |
1.9 |
@@@rdf:type: |
6440 |
|
|
DISLang:Method |
6441 |
|
|
@@@Operator: |
6442 |
|
|
@@@@@: |
6443 |
|
|
DISPerl:CloneMethod |
6444 |
|
|
@@@@ContentType: |
6445 |
|
|
dis:TypeQName |
6446 |
|
|
@@@Description: |
6447 |
|
|
@@@@lang:en |
6448 |
|
|
@@@@@: |
6449 |
|
|
Generates a deep clone of this node and returns it. |
6450 |
|
|
@@@ResourceDef: |
6451 |
|
|
@@@@rdf:type: |
6452 |
|
|
DISLang:MethodReturn |
6453 |
|
|
@@@@Type: ManakaiPerlCodeFragment |
6454 |
|
|
@@@@Description: |
6455 |
|
|
@@@@@lang:en |
6456 |
|
|
@@@@@@: |
6457 |
|
|
The newly created clone node. |
6458 |
|
|
\ |
6459 |
|
|
{NOTE:: The <A::.parentNode> attribute of the clone |
6460 |
|
|
is set to <DOM::null>. |
6461 |
|
|
\ |
6462 |
|
|
} |
6463 |
|
|
@@@@Def: |
6464 |
wakaba |
1.27 |
@@@@@ForCheck: ManakaiDOM|ForClass |
6465 |
wakaba |
1.9 |
@@@@@ContentType: |
6466 |
|
|
lang:Perl |
6467 |
|
|
@@@@@@: |
6468 |
|
|
## NOTE: Method name directly written |
6469 |
wakaba |
1.30 |
my $ro = $self->_make_clone_object ($self->{<H::mn:node>}); |
6470 |
wakaba |
1.9 |
$ro-><M::ManakaiDOM:ManakaiDOMNodeObject |
6471 |
|
|
::ManakaiDOM:Perl.changeTreeID> |
6472 |
|
|
(<Code::ManakaiDOM:generateUniqueID |
6473 |
wakaba |
1.35 |
||ManakaiDOM:Perl>); |
6474 |
wakaba |
1.9 |
$r = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($ro); |
6475 |
wakaba |
1.1 |
|
6476 |
|
|
ElementTypeBinding: |
6477 |
|
|
@Name: IntMethod |
6478 |
|
|
@ElementType: |
6479 |
|
|
dis:ResourceDef |
6480 |
|
|
@ShadowContent: |
6481 |
|
|
@@rdf:type: |
6482 |
|
|
DISLang:Method |
6483 |
|
|
@@ManakaiDOM:isForInternal:1 |
6484 |
|
|
|
6485 |
|
|
ElementTypeBinding: |
6486 |
|
|
@Name: Attr |
6487 |
|
|
@ElementType: |
6488 |
|
|
dis:ResourceDef |
6489 |
|
|
@ShadowContent: |
6490 |
|
|
@@rdf:type: |
6491 |
|
|
DISLang:Attribute |
6492 |
|
|
|
6493 |
|
|
ElementTypeBinding: |
6494 |
|
|
@Name: Return |
6495 |
|
|
@ElementType: |
6496 |
|
|
dis:ResourceDef |
6497 |
|
|
@ShadowContent: |
6498 |
|
|
@@rdf:type: |
6499 |
|
|
DISLang:MethodReturn |
6500 |
|
|
|
6501 |
|
|
ElementTypeBinding: |
6502 |
|
|
@Name: Get |
6503 |
|
|
@ElementType: |
6504 |
|
|
dis:ResourceDef |
6505 |
|
|
@ShadowContent: |
6506 |
|
|
@@rdf:type: |
6507 |
|
|
DISLang:AttributeGet |
6508 |
|
|
|
6509 |
|
|
ElementTypeBinding: |
6510 |
|
|
@Name: Set |
6511 |
|
|
@ElementType: |
6512 |
|
|
dis:ResourceDef |
6513 |
|
|
@ShadowContent: |
6514 |
|
|
@@rdf:type: |
6515 |
|
|
DISLang:AttributeSet |
6516 |
|
|
|
6517 |
|
|
ElementTypeBinding: |
6518 |
|
|
@Name: Param |
6519 |
|
|
@ElementType: |
6520 |
|
|
dis:ResourceDef |
6521 |
|
|
@ShadowContent: |
6522 |
|
|
@@rdf:type: |
6523 |
|
|
DISLang:MethodParameter |
6524 |
wakaba |
1.26 |
|
6525 |
|
|
ElementTypeBinding: |
6526 |
wakaba |
1.29 |
@Name: plCName |
6527 |
wakaba |
1.26 |
@ElementType: |
6528 |
wakaba |
1.29 |
DISPerl:exportTagName |
6529 |
wakaba |
1.1 |
|
6530 |
|
|
ElementTypeBinding: |
6531 |
|
|
@Name: PerlDef |
6532 |
|
|
@ElementType: |
6533 |
|
|
dis:Def |
6534 |
|
|
@ShadowContent: |
6535 |
|
|
@@ContentType: |
6536 |
|
|
lang:Perl |
6537 |
wakaba |
1.27 |
@@ForCheck: ManakaiDOM|ForClass |
6538 |
wakaba |
1.28 |
|
6539 |
|
|
ElementTypeBinding: |
6540 |
|
|
@Name: PerlCDef |
6541 |
|
|
@ElementType: |
6542 |
|
|
dis:Def |
6543 |
|
|
@ShadowContent: |
6544 |
|
|
@@ContentType: |
6545 |
|
|
lang:Perl |
6546 |
wakaba |
1.1 |
|
6547 |
|
|
ElementTypeBinding: |
6548 |
|
|
@Name: disDef |
6549 |
|
|
@ElementType: |
6550 |
|
|
dis:Def |
6551 |
|
|
@ShadowContent: |
6552 |
|
|
@@ContentType: |
6553 |
|
|
lang:dis |
6554 |
wakaba |
1.27 |
@@ForCheck: ManakaiDOM|ForClass |
6555 |
wakaba |
1.1 |
|
6556 |
|
|
ElementTypeBinding: |
6557 |
|
|
@Name: InCase |
6558 |
|
|
@ElementType: |
6559 |
|
|
dis:ResourceDef |
6560 |
|
|
@ShadowContent: |
6561 |
|
|
@@rdf:type: |
6562 |
|
|
ManakaiDOM:InCase |
6563 |
|
|
|
6564 |
|
|
ElementTypeBinding: |
6565 |
|
|
@Name: nullCase |
6566 |
|
|
@ElementType: |
6567 |
|
|
dis:ResourceDef |
6568 |
|
|
@ShadowContent: |
6569 |
|
|
@@rdf:type: |
6570 |
|
|
ManakaiDOM:InCase |
6571 |
|
|
@@Value: |
6572 |
|
|
@@@is-null:1 |
6573 |
|
|
|
6574 |
|
|
ElementTypeBinding: |
6575 |
|
|
@Name: TrueCase |
6576 |
|
|
@ElementType: |
6577 |
|
|
dis:ResourceDef |
6578 |
|
|
@ShadowContent: |
6579 |
|
|
@@rdf:type: |
6580 |
|
|
ManakaiDOM:InCase |
6581 |
wakaba |
1.27 |
@@Value: |
6582 |
|
|
@@@@:1 |
6583 |
|
|
@@@ContentType: DISCore|Boolean |
6584 |
wakaba |
1.1 |
@@Type: |
6585 |
wakaba |
1.12 |
DOMMain:boolean::ManakaiDOM:all |
6586 |
wakaba |
1.1 |
|
6587 |
|
|
|
6588 |
|
|
ElementTypeBinding: |
6589 |
|
|
@Name: FalseCase |
6590 |
|
|
@ElementType: |
6591 |
|
|
dis:ResourceDef |
6592 |
|
|
@ShadowContent: |
6593 |
|
|
@@rdf:type: |
6594 |
|
|
ManakaiDOM:InCase |
6595 |
wakaba |
1.27 |
@@Value: |
6596 |
|
|
@@@@:0 |
6597 |
|
|
@@@ContentType: DISCore|Boolean |
6598 |
wakaba |
1.1 |
@@Type: |
6599 |
wakaba |
1.12 |
DOMMain:boolean::ManakaiDOM:all |
6600 |
wakaba |
1.1 |
|
6601 |
|
|
ElementTypeBinding: |
6602 |
|
|
@Name: enDesc |
6603 |
|
|
@ElementType: |
6604 |
|
|
dis:Description |
6605 |
|
|
@ShadowContent: |
6606 |
|
|
@@lang:en |
6607 |
|
|
|
6608 |
|
|
ElementTypeBinding: |
6609 |
|
|
@Name: PropDef |
6610 |
|
|
@ElementType: |
6611 |
|
|
dis:ResourceDef |
6612 |
|
|
@ShadowContent: |
6613 |
|
|
@@rdf:type: |
6614 |
|
|
rdf:Property |
6615 |
wakaba |
1.27 |
@@For: =ManakaiDOM|all |
6616 |
wakaba |
1.1 |
|
6617 |
|
|
ElementTypeBinding: |
6618 |
|
|
@Name: NamedParam |
6619 |
|
|
@ElementType: |
6620 |
|
|
dis:ResourceDef |
6621 |
|
|
@ShadowContent: |
6622 |
|
|
@@rdf:type: |
6623 |
|
|
DISLang:MethodParameter |
6624 |
|
|
@@DISPerl:isNamedParameter:1 |
6625 |
|
|
|