/[suikacvs]/messaging/manakai/lib/Message/Util/PerlCode.dis
Suika

Contents of /messaging/manakai/lib/Message/Util/PerlCode.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.39 - (hide annotations) (download)
Sun Oct 16 06:08:25 2005 UTC (19 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.38: +110 -19 lines
++ manakai/bin/ChangeLog	16 Oct 2005 06:05:54 -0000
2005-10-16  Wakaba  <wakaba@suika.fam.cx>

	* dac2pm.pl (--output-line): New option.

++ manakai/lib/Message/Util/ChangeLog	16 Oct 2005 06:07:43 -0000
2005-10-16  Wakaba  <wakaba@suika.fam.cx>

	* PerlCode.dis (pc:line): New configuration parameter.
	(stringify): Don't output "#line" directive
	unless "pc:line" parameter is set to "true".
	(pc:split-resolver): New configuration parameter.

++ manakai/lib/Message/DOM/ChangeLog	16 Oct 2005 06:06:20 -0000
2005-10-16  Wakaba  <wakaba@suika.fam.cx>

	* DOMCore.dis (DOMConfiguration): Extends "ManakaiDOM:ManakaiDOMObject".

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.39 $Date: 2005/10/15 15:28:11 $
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 wakaba 1.20 @dx:
45     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
46 wakaba 1.33 @ecore:
47     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
48     @f:
49     http://suika.fam.cx/~wakaba/archive/2004/dom/feature#
50     @idl:
51     http://suika.fam.cx/~wakaba/archive/2004/dis/IDL#
52 wakaba 1.25 @kwd:
53     http://suika.fam.cx/~wakaba/archive/2005/rfc2119/
54 wakaba 1.1 @lang:
55     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
56     @license:
57     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
58     @ManakaiDOM:
59     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
60 wakaba 1.5 @MDOM:
61     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
62 wakaba 1.1 @MDOMX:
63     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
64 wakaba 1.30 @mn:
65     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
66 wakaba 1.1 @pc:
67     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/PerlCode#
68     @rdf:
69     http://www.w3.org/1999/02/22-rdf-syntax-ns#
70     @rdfs:
71     http://www.w3.org/2000/01/rdf-schema#
72 wakaba 1.35 @s:
73     http://suika.fam.cx/~wakaba/archive/2004/dis/Markup#
74 wakaba 1.1 @Util:
75     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
76    
77 wakaba 1.35 ## -- Module sets
78    
79     ResourceDef:
80     @QName: Util|
81     @For: ManakaiDOM|DOM
82     @rdf:type: dis|ModuleGroup
83     @FullName:
84     @@lang:en
85     @@@:
86     Manakai support modules
87     @DISPerl:packageName:
88     Message::Util::
89     @DISPerl:interfacePackageName:
90     @@@:
91     Message::Util::IF::
92     @@For: ManakaiDOM|ManakaiDOM !ManakaiDOM|ManakaiDOMLatest
93     @DISPerl:interfacePackageName:
94     @@@:
95     Message::Util::IFLatest::
96     @@For: ManakaiDOM|ManakaiDOMLatest
97     @ImplNote:
98     @@lang:en
99     @@@:
100     Resources <Q::Util|> for <Q::ManakaiDOM|all> and for <Q::ManakaiDOM|Perl>
101     is defined in module <Module::Util|ManakaiNode>.
102    
103 wakaba 1.1 ## -- Features
104    
105     ElementTypeBinding:
106     @Name: FeatureDef
107     @ElementType:
108     dis:ResourceDef
109     @ShadowContent:
110 wakaba 1.29 @@rdf:type: DOMFeature|Feature
111 wakaba 1.27 @@For: =ManakaiDOM|all
112 wakaba 1.1
113     ElementTypeBinding:
114     @Name: FeatureVerDef
115     @ElementType:
116     dis:ResourceDef
117     @ShadowContent:
118 wakaba 1.29 @@rdf:type: DOMFeature|Feature
119 wakaba 1.1
120     ElementTypeBinding:
121     @Name: featureQName
122     @ElementType:
123 wakaba 1.29 DOMFeature:name
124 wakaba 1.1 @ShadowContent:
125 wakaba 1.29 @@ContentType: DISCore|QName
126 wakaba 1.1
127     FeatureDef:
128     @QName: CoreFeature
129     @featureQName:
130     Util:PerlCode
131     @FeatureVerDef:
132     @@QName: CoreFeature10
133     @@Version: 1.0
134     @@ISA: CoreFeature
135     @@FullName:
136     @@@lang:en
137     @@@@:
138     Perl Code Constructor, version 1.0
139     @@Description:
140     @@@lang:en
141     @@@@:
142     Perl Code Constructor, version 1.0.
143    
144 wakaba 1.25 ElementTypeBinding:
145     @Name: IFClsDef
146     @ElementType:
147     dis:ResourceDef
148     @ShadowContent:
149     @@rdf:type:
150     @@@@: dis|MultipleResource
151     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
152     @@resourceFor: ManakaiDOM|ForIF
153 wakaba 1.36 @@resourceFor: ManakaiDOM|ForClass
154     @@For: ManakaiDOM|ManakaiDOM
155 wakaba 1.35
156     @@rdf:type:
157     @@@@: DISLang|Interface
158     @@@ForCheck: ManakaiDOM|ForIF
159    
160     @@rdf:type:
161     @@@@: DISLang|Class
162     @@@ForCheck: ManakaiDOM|ForClass
163     @@Implement:
164     @@@@: ||ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF
165     @@@ContentType: DISCore|TFPQNames
166     @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOM
167     @@Implement:
168     @@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF
169     @@@ContentType: DISCore|TFPQNames
170     @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest
171    
172     @@f:implements: pc|CoreFeature10
173    
174     ElementTypeBinding:
175     @Name: IFClsETDef
176     @ElementType:
177     dis:ResourceDef
178     @ShadowContent:
179     @@rdf:type:
180     @@@@: dis|MultipleResource
181     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass !s|ForML
182     @@resourceFor: ManakaiDOM|ForIF
183 wakaba 1.36 @@resourceFor: ManakaiDOM|ForClass
184 wakaba 1.35 @@resourceFor: s|ForML
185 wakaba 1.36 @@For: ManakaiDOM|ManakaiDOM
186 wakaba 1.25
187     @@rdf:type:
188 wakaba 1.35 @@@@: DISLang|Interface
189     @@@ForCheck: ManakaiDOM|ForIF
190 wakaba 1.25
191     @@rdf:type:
192 wakaba 1.35 @@@@: DISLang|Class
193 wakaba 1.25 @@@ForCheck: ManakaiDOM|ForClass
194     @@Implement:
195 wakaba 1.35 @@@@: ||ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF
196     @@@ContentType: DISCore|TFPQNames
197     @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOM
198     @@Implement:
199     @@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF
200 wakaba 1.25 @@@ContentType: DISCore|TFPQNames
201 wakaba 1.35 @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest
202 wakaba 1.36
203 wakaba 1.35 @@s:elementType:
204     @@@@: ||+||s|ForML
205     @@@ContentType: DISCore|TFPQNames
206     @@@DISCore:stopISARecursive:1
207    
208     @@rdf:type:
209     @@@@: s|ElementType
210     @@@ForCheck: s|ForML
211 wakaba 1.25
212 wakaba 1.35 @@f:implements: pc|CoreFeature10
213 wakaba 1.25
214     ElementTypeBinding:
215     @Name: IFQName
216     @ElementType:
217     dis:QName
218     @ShadowContent:
219     @@ForCheck: ManakaiDOM|ForIF
220    
221     ElementTypeBinding:
222 wakaba 1.35 @Name: CQName
223     @ElementType:
224     dis:QName
225     @ShadowContent:
226 wakaba 1.36 @@ForCheck: ManakaiDOM|ForClass
227 wakaba 1.25
228     ElementTypeBinding:
229     @Name: IFISA
230     @ElementType:
231     dis:ISA
232     @ShadowContent:
233     @@ForCheck: ManakaiDOM|ForIF
234    
235     ElementTypeBinding:
236 wakaba 1.35 @Name: CISA
237     @ElementType:
238     dis:ISA
239     @ShadowContent:
240 wakaba 1.36 @@ForCheck: ManakaiDOM|ForClass
241 wakaba 1.25
242 wakaba 1.1 ## -- Classes
243    
244 wakaba 1.25 IFClsDef:
245     @IFQName: PerlCode
246 wakaba 1.35 @CQName: ManakaiPCCode
247 wakaba 1.25
248 wakaba 1.35 @CISA: DOMCore|ManakaiDOMElement
249 wakaba 1.25
250 wakaba 1.1 @enDesc:
251     A class on which another Perl code classes are constructed based.
252    
253     @Attr:
254 wakaba 1.6 @@Name: fileNode
255     @@enDesc:
256     The root <QUOTE::file> node of the tree to which this node belongs.
257 wakaba 1.25 @@Type: PerlCode
258 wakaba 1.6 @@Get:
259     @@@enDesc:
260     The <QUOTE::file> node of the tree.
261     @@@nullCase:
262     @@@@enDesc:
263     This node does not belong to any file tree.
264     @@@PerlDef:
265 wakaba 1.35 __DEEP{
266     $r = $self-><AG::Node.ownerDocument>
267     -><AG::Document.documentElement>;
268     if ($r) {
269     unless (defined $r-><AG::Node.namespaceURI> and
270     $r-><AG::Node.namespaceURI> eq <Q::pc:> and
271     $r-><AG::Node.localName> eq 'file') {
272     $r = null;
273     }
274     }
275     }__;
276 wakaba 1.6
277     @Method:
278     @@Name: replaceVariable
279     @@enDesc:
280     Replaces a variable.
281     \
282     {NOTE:: For objects of type <Class::ManakaiPerlFile>,
283 wakaba 1.11 <Class::ManakaiPerlPackageScope>,
284     <Class::ManakaiPerlSub> and
285     <Class::ManakaiPerlVariable>, the result is undefined.
286 wakaba 1.6 \
287     }
288     @@Param:
289     @@@Name: originalVariable
290     @@@Type:
291     lang:Perl::ManakaiDOM:all
292     @@@enDesc:
293     Original variable specification, including prefix.
294     \
295     {NOTE:: Qualified name variable and hash key is not supported.
296     \
297     }
298     @@Param:
299     @@@Name: newValue
300 wakaba 1.11 @@@Type:
301     DOMMain:any::ManakaiDOM:all
302 wakaba 1.6 @@@enDesc:
303     New value to replace.
304 wakaba 1.11 @@@InCase:
305 wakaba 1.25 @@@@Type: PerlCode
306 wakaba 1.11 @@@@enDesc:
307     New Perl code fragment to replace by.
308     @@@InCase:
309     @@@@Type:
310     lang:Perl::ManakaiDOM:all
311     @@@@enDesc:
312     Inline Perl code fragment string to replace by.
313 wakaba 1.6 @@Return:
314     @@@PerlDef:
315 wakaba 1.35 my $ln = $self-><AG::Node.localName>;
316     if ($ln eq 'unparsed' or
317     $ln eq 'inlineUnparsed') {
318     my $new_var = ref $newValue ? $newValue->stringify : ''.$newValue;
319     my $val = $self-><AG::Node.textContent>;
320     $val =~ s/\Q$originalVariable\E\b/$new_var/g;
321     $self-><AS::Node.textContent> ($val);
322     } elsif ($ln eq 'stringLiteral' or $ln eq 'atom' or
323     $ln eq 'tokens') {
324     #
325     } elsif ($self-><M::Node.hasChildNodes>) {
326     __DEEP{
327     my @child_nodes = @{$self-><AG::Node.childNodes>};
328     for my $child_node (@child_nodes) {
329     if (defined $child_node-><AG::Node.namespaceURI> and
330     $child_node-><AG::Node.namespaceURI> eq <Q::pc:>) {
331     if ($child_node-><AG::Node.localName> eq 'variable') {
332     if (substr ($originalVariable, 0, 1) eq
333     $child_node-><AG::PerlVariable.variableType> and
334     not defined $child_node-><AG::PerlVariable.packageName> and
335     substr ($originalVariable, 1) eq
336     $child_node-><AG::PerlVariable.pcLocalName> and
337     not defined $child_node-><AG::PerlVariable.hashKey>) {
338     if (ref $newValue) {
339     $self-><M::Node.replaceChild> ($child_node => $newValue);
340     } else { ## ISSUE: Is this correct?
341     $child_node-><M::PerlCodeInlines.appendCode> ($newValue);
342     }
343     }
344     } else { ## Non-variable child
345     $child_node-><M::PerlCode.replaceVariable>
346     ($originalVariable => $newValue);
347     }
348     } else {
349     #
350     }
351     }
352     }__;
353     } # has child
354    
355     @ResourceDef:
356 wakaba 1.36 @@ForCheck: ManakaiDOM|ForClass
357 wakaba 1.35 @@QName: addNameListAttr
358     @@rdf:type: DISPerl|BlockCode
359     @@PerlDef:
360     my %__mn = map {$_ => true}
361     split /\s+/, $node-><M::Element.getAttributeNS>
362     (<Q::pc:>, $attrName);
363     $__mn{$newName} = true;
364     $node-><M::Element.setAttributeNS>
365     (<Q::pc:>, 'pc:'.$attrName => join ' ', keys %__mn);
366    
367 wakaba 1.13
368     @Method:
369     @@Name: addUsePerlModuleName
370     @@enDesc:
371     Adds a Perl module into the list of Perl modules
372     <Perl::use>d by this code fragment.
373     @@Param:
374     @@@Name: moduleName
375 wakaba 1.35 @@@Type: DOMString
376 wakaba 1.13 @@@enDesc:
377     The name of the module package that should be <Perl::use>d.
378     @@Return:
379     @@@PerlDef:
380 wakaba 1.35 __DEEP{
381     __CODE{addNameListAttr::
382     $node => {$self},
383     $attrName => 'useModuleName',
384     $newName => {$moduleName},
385     }__;
386     }__;
387 wakaba 1.13
388     @Method:
389 wakaba 1.22 @@Name: addUseCharClassName
390     @@enDesc:
391     Adds a Perl module into the list of Perl character classes
392     <Perl::use>d by this code fragment.
393     @@Param:
394     @@@Name: moduleName
395 wakaba 1.35 @@@Type: DOMString
396 wakaba 1.22 @@@enDesc:
397     The name of the module package that should be <Perl::use>d.
398     @@Param:
399     @@@Name: charClassName
400 wakaba 1.35 @@@Type: DOMString
401 wakaba 1.22 @@@enDesc:
402     The name of the character class.
403     @@Return:
404     @@@PerlDef:
405 wakaba 1.35 __DEEP{
406     __CODE{addNameListAttr::
407     $node => {$self},
408     $attrName => 'useCharClassName',
409     $newName => {$moduleName.'.'.$charClassName},
410     }__;
411     }__;
412 wakaba 1.22
413     @Method:
414 wakaba 1.19 @@Name: addRequirePerlModuleName
415     @@enDesc:
416     Adds a Perl module into the list of Perl modules
417     <Perl::require>d by this code fragment.
418     @@Param:
419     @@@Name: moduleName
420 wakaba 1.35 @@@Type: DOMString
421 wakaba 1.19 @@@enDesc:
422     The name of the module package that should be <Perl::require>d.
423     @@Return:
424     @@@PerlDef:
425 wakaba 1.35 __DEEP{
426     __CODE{addNameListAttr::
427     $node => {$self},
428     $attrName => 'requireModuleName',
429     $newName => {$moduleName},
430     }__;
431     }__;
432 wakaba 1.19
433     @Method:
434 wakaba 1.33 @@Name: addExceptionInterfacePackageName
435     @@enDesc:
436     Adds a Perl exception interface into the list of Perl packages.
437     @@Param:
438     @@@Name: moduleName
439 wakaba 1.35 @@@Type: DOMString
440 wakaba 1.33 @@@enDesc:
441     The name of the interface package.
442     @@Return:
443     @@@PerlDef:
444 wakaba 1.35 __DEEP{
445     __CODE{addNameListAttr::
446     $node => {$self},
447     $attrName => 'exceptionInterfaceName',
448     $newName => {$moduleName},
449     }__;
450     }__;
451    
452     @ResourceDef:
453 wakaba 1.36 @@ForCheck: ManakaiDOM|ForClass
454 wakaba 1.35 @@QName: getNameListAttrR
455     @@rdf:type: DISPerl|BlockCode
456     @@PerlDef:
457     my @__nodes = ($node);
458     my %__result;
459     while (@__nodes) {
460     my $__cnode = shift @__nodes;
461     if ($__cnode-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
462     defined $__cnode-><AG::Node.namespaceURI> and
463     $__cnode-><AG::Node.namespaceURI> eq <Q::pc:>) {
464     for (split /\s+/, $__cnode-><M::Element.getAttributeNS>
465     (<Q::pc:>, $attrName)) {
466     $__result{$_} = true;
467     }
468     push @__nodes, @{$__cnode-><AG::Node.childNodes>};
469     }
470     }
471     $result = [sort {$a cmp $b} keys %__result];
472     @ResourceDef:
473 wakaba 1.36 @@ForCheck: ManakaiDOM|ForClass
474 wakaba 1.35 @@QName: getNameListAttr
475     @@rdf:type: DISPerl|BlockCode
476     @@PerlDef:
477     my %__result;
478     for (split /\s+/,
479     $node-><M::Element.getAttributeNS> (<Q::pc:>, $attrName)) {
480     $__result{$_} = true;
481     }
482     $result = [sort {$a cmp $b} keys %__result];
483 wakaba 1.33
484     @Method:
485 wakaba 1.15 @@Name: getUsePerlModuleNameList
486     @@enDesc:
487     Returns a list of Perl modules names that is <Perl::use>d
488     by this code fragment, including all descendant nodes.
489     @@Return:
490 wakaba 1.35 @@@Type: DISPerl|ARRAY||ManakaiDOM|all
491 wakaba 1.15 @@@enDesc:
492     A list of module names. Note that the list is <EM::dead>;
493     any modification to it does not affect to the code fragment
494     and vice versa.
495     @@@PerlDef:
496 wakaba 1.35 __DEEP{
497     __CODE{getNameListAttrR::
498     $node => {$self},
499     $attrName => 'useModuleName',
500     $result => {$r},
501     }__;
502     }__;
503 wakaba 1.15
504     @Method:
505 wakaba 1.22 @@Name: getUseCharClassNameList
506     @@enDesc:
507     Returns a list of Perl character class names that is <Perl::use>d
508     by this code fragment, including all descendant nodes.
509     @@Return:
510 wakaba 1.35 @@@Type: DISPerl|HASH||ManakaiDOM|all
511 wakaba 1.22 @@@enDesc:
512     A list of module names. Note that the list is <EM::dead>;
513     any modification to it does not affect to the code fragment
514     and vice versa.
515     @@@PerlDef:
516 wakaba 1.35 my $mc;
517     __DEEP{
518     __CODE{getNameListAttrR::
519     $node => {$self},
520     $attrName => 'useCharClassName',
521     $result => {$mc},
522     }__;
523     }__;
524     for (@$mc) {
525     my ($m, $c) = split /\./, $_, 2;
526     $r->{$m}->{$c} = true;
527     }
528 wakaba 1.22
529     @Method:
530 wakaba 1.19 @@Name: getRequirePerlModuleNameList
531     @@enDesc:
532     Returns a list of Perl modules names that is <Perl::require>d
533     by this code fragment, including all descendant nodes.
534     @@Return:
535 wakaba 1.35 @@@Type: DISPerl|ARRAY||ManakaiDOM|all
536 wakaba 1.19 @@@enDesc:
537     A list of module names. Note that the list is <EM::dead>;
538     any modification to it does not affect to the code fragment
539     and vice versa.
540     @@@PerlDef:
541 wakaba 1.35 __DEEP{
542     __CODE{getNameListAttrR::
543     $node => {$self},
544     $attrName => 'requireModuleName',
545     $result => {$r},
546     }__;
547     }__;
548 wakaba 1.19
549     @Method:
550 wakaba 1.33 @@Name: getExceptionInterfacePackageNameList
551     @@enDesc:
552     Returns a list of Perl exception interface package names
553     by this code fragment, including all descendant nodes.
554     @@Return:
555 wakaba 1.35 @@@Type: DISPerl|ARRAY||ManakaiDOM|all
556 wakaba 1.33 @@@enDesc:
557     A list of package names. Note that the list is <EM::dead>;
558     any modification to it does not affect to the code fragment
559     and vice versa.
560     @@@PerlDef:
561 wakaba 1.35 __DEEP{
562     __CODE{getNameListAttrR::
563     $node => {$self},
564     $attrName => 'exceptionInterfaceName',
565     $result => {$r},
566     }__;
567     }__;
568 wakaba 1.33
569     @Method:
570 wakaba 1.13 @@Name: disAddRequireURI
571     @@enDesc:
572     Adds a <QUOTE::dis> resource into the list of <Perl::require>d
573     resources of this code fragment.
574     @@Param:
575     @@@Name: uriArg
576 wakaba 1.35 @@@Type: DOMString
577 wakaba 1.13 @@@enDesc:
578     The URI reference of the resource to add.
579     @@Return:
580     @@@PerlDef:
581 wakaba 1.35 __DEEP{
582     __CODE{addNameListAttr::
583     $node => {$self},
584     $attrName => 'requireResourceURI',
585     $newName => {$uriArg},
586     }__;
587     }__;
588 wakaba 1.15
589     @Method:
590     @@Name: disGetRequireURIList
591     @@enDesc:
592     Returns a list of <QUOTE::dis> resource URI references that is
593     <Perl::require>d by this code fragment, including all descendant nodes.
594     @@Return:
595 wakaba 1.35 @@@Type: DISPerl|ARRAY||ManakaiDOM|all
596 wakaba 1.15 @@@enDesc:
597     A list of resource URI references. Note that the list is <EM::dead>;
598     any modification to it does not affect to the code fragment
599     and vice versa.
600     @@@PerlDef:
601 wakaba 1.35 __DEEP{
602     __CODE{getNameListAttrR::
603     $node => {$self},
604     $attrName => 'requireResourceURI',
605     $result => {$r},
606     }__;
607     }__;
608    
609     @Method:
610 wakaba 1.36 @@ForCheck: ManakaiDOM|ForClass
611 wakaba 1.35 @@Operator: DISPerl|CloneMethod
612     @@Return:
613     @@@Type: PerlCode
614     @@@PerlDef:
615     __DEEP{
616     $r = $self-><M::Node.cloneNode> (true);
617     }__;
618 wakaba 1.25 ##PerlCode
619 wakaba 1.1
620 wakaba 1.13 PropDef:
621     @QName: useModuleName
622     @enDesc:
623     The list of modules.
624    
625     PropDef:
626 wakaba 1.33 @QName: pc|exceptionInterfaceName
627     @enDesc:
628     The list of exception interface packages.
629    
630     PropDef:
631 wakaba 1.22 @QName: useCharClassName
632     @enDesc:
633     The list of modules.
634    
635     PropDef:
636 wakaba 1.13 @QName: requireResourceURI
637     @enDesc:
638     The list of resources.
639    
640 wakaba 1.35 ElementTypeBinding:
641     @Name: ETQName
642     @ElementType:
643     dis:AppName
644     @ShadowContent:
645     @@ForCheck: s|ForML
646     @@ContentType: DISCore|QName
647    
648     IFClsETDef:
649 wakaba 1.25 @IFQName: PerlFile
650 wakaba 1.35 @CQName: ManakaiPCFile
651     @ETQName: pc|file
652 wakaba 1.25
653     @IFISA: PerlCode
654    
655     @IFISA: PerlCodeStatements
656 wakaba 1.35 @CISA: ManakaiPCCodeStatements
657 wakaba 1.25
658 wakaba 1.1 @enDesc:
659     Perl source code files.
660    
661     @Method:
662     @@Name: appendNewPackage
663     @@enDesc:
664     Appends a new package scope block.
665     @@Param:
666     @@@Name: packageName
667 wakaba 1.35 @@@Type: DOMString
668 wakaba 1.1 @@@enDesc:
669     The fully-qualified name of the package to create.
670     @@Return:
671 wakaba 1.25 @@@Type: PerlPackage
672 wakaba 1.1 @@@enDesc:
673     The newly created package scope object.
674     @@@PerlDef:
675 wakaba 1.35 __DEEP{
676     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
677     (<Q::pc:>, 'package');
678     $r-><AS::PerlPackage.packageName> ($packageName);
679     $self-><M::Node.appendChild> ($r);
680     }__;
681 wakaba 1.1
682     @Method:
683 wakaba 1.13 @@Name: appendPackage
684     @@enDesc:
685     Appends a Perl package scope object.
686     @@Param:
687     @@@Name: codeArg
688 wakaba 1.25 @@@Type: PerlPackage
689 wakaba 1.13 @@@enDesc:
690     The package to append.
691     @@Return:
692     @@@RaiseException:
693     @@@@@:IN_USE_NODE_ERR
694     @@@@enDesc:
695     An attempt is made to set a subroutine that is
696     already used elsewhere.
697     @@@PerlDef:
698 wakaba 1.35 if ($codeArg-><AG::Node.parentNode>) {
699     __EXCEPTION{IN_USE_NODE_ERR::
700     pc:childNode => {$codeArg},
701     MDOMX:param-name => 'codeArg',
702     }__;
703 wakaba 1.1 }
704     __DEEP{
705 wakaba 1.35 $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($codeArg);
706     $self-><M::Node.appendChild> ($codeArg);
707 wakaba 1.1 }__;
708    
709     @Method:
710     @@Name: getLastPackage
711     @@enDesc:
712     Gets the last package scope block of a name.
713     @@Param:
714     @@@Name: packageName
715 wakaba 1.36 @@@@Type: DOMString
716 wakaba 1.1 @@@@enDesc:
717     The fully-qualified name of the package to get.
718     @@NamedParam:
719     @@@Name: makeNewPackage
720 wakaba 1.36 @@@Type: idl|boolean||ManakaiDOM|all
721 wakaba 1.1 @@@enDesc:
722     Whether a new package scope object should be created if
723     no package of <P::packageName> found.
724     @@@TrueCase:
725     @@@@enDesc:
726     Makes a new object if not found.
727     @@@FalseCase:
728     @@@@enDesc:
729     Don't make a new object.
730     @@Return:
731 wakaba 1.25 @@@Type: PerlPackage
732 wakaba 1.1 @@@enDesc:
733     The last package scope object whose name is equal to
734     <P::packageName>.
735     @@@nullCase:
736     @@@@enDesc:
737     There is no <P::packageName> package object and
738     the <P::makeNewPackage> parameter is set to <DOM::false>.
739     @@@PerlDef:
740 wakaba 1.35 __DEEP{
741     for my $child (@{$self-><AG::Node.childNodes>}) {
742     if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
743     defined $child-><AG::Node.namespaceURI> and
744     $child-><AG::Node.namespaceURI> eq <Q::pc:> and
745     $child-><AG::Node.localName> eq 'package') {
746     if ($child-><M::Element.getAttributeNS>
747     (<Q::pc:>, 'packageName') eq $packageName) {
748     $r = $child;
749     }
750     }
751     }
752     if (not $r and $makeNewPackage) {
753     $r = $self-><M::PerlFile.appendNewPackage> ($packageName);
754     }
755     }__;
756 wakaba 1.1
757 wakaba 1.35 @ATTR:
758 wakaba 1.1 @@Name: sourceFile
759 wakaba 1.35 @@ATTRQName: pc|sourceFile
760 wakaba 1.1 @@enDesc:
761     The file name of the source file from which this
762     Perl code is primary generated.
763 wakaba 1.35 @@ReflectCDATA:
764 wakaba 1.1 @@Get:
765     @@Set:
766    
767 wakaba 1.35 @ATTR:
768 wakaba 1.1 @@Name: sourceModule
769 wakaba 1.35 @@ATTRQName: pc|sourceModule
770 wakaba 1.1 @@enDesc:
771     The name URI reference of the source module that this package defines.
772 wakaba 1.35 @@ReflectCDATA:
773 wakaba 1.1 @@Get:
774     @@Set:
775    
776 wakaba 1.35 @ATTR:
777 wakaba 1.1 @@Name: sourceFor
778 wakaba 1.35 @@ATTRQName: pc|sourceFor
779 wakaba 1.1 @@enDesc:
780     The URI reference of the source module <QUOTE::for> for which this
781     package is.
782 wakaba 1.35 @@ReflectCDATA:
783 wakaba 1.1 @@Get:
784     @@Set:
785    
786     @ToStringMethod:
787     @@Return:
788 wakaba 1.35 @@@Type: DOMString
789 wakaba 1.1 @@@enDesc:
790     The Perl code generated.
791     @@@PerlDef:
792 wakaba 1.35 __DEEP{
793     ## -- Header
794     $r = qq<#!/usr/bin/perl \n>;
795 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
796 wakaba 1.35 (q<This file is automatically generated>);
797 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
798     (q< at >.<ClassM::ManakaiPCImplementation
799 wakaba 1.35 .rfc3339DateTime> (time).q<,>);
800 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
801 wakaba 1.35 (q< from file ">.$self-><AG::PerlFile.sourceFile>.q<",>);
802 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
803 wakaba 1.35 (q[ module <].$self-><AG::PerlFile.sourceModule>.q[>,]);
804 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
805 wakaba 1.35 (q[ for <].$self-><AG::PerlFile.sourceFor>.q[>.]);
806 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
807 wakaba 1.35 (q<Don't edit by hand!>);
808     $r .= qq<use strict;\n>;
809     $self-><AS::PerlFile.currentPackage> ('main');
810     $self-><AS::PerlFile.currentChunkNumber> (0);
811    
812     ## -- Requires
813     my $req = $self-><M::PerlCode.getRequirePerlModuleNameList>;
814     for my $pack (sort {$a cmp $b} @$req) {
815     $r .= qq<require $pack;\n>;
816     }
817    
818     ## -- Packages and global objects
819     my $pack = {};
820     for my $child (@{$self-><AG::Node.childNodes>}) {
821     $r .= $child->stringify;
822     if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
823     defined $child-><AG::Node.namespaceURI> and
824     $child-><AG::Node.namespaceURI> eq <Q::pc:> and
825     $child-><AG::Node.localName> eq 'package') {
826     for my $ipack (@{$child-><M::PerlPackage
827     .getImplementPackageNameList>}) {
828     $pack->{$ipack} ||= true; # not defined
829     }
830     $pack->{$child-><AG::PerlPackage.packageName>} = []; # defined
831     }
832     }
833    
834     ## -- Exception interface packages
835     for (sort {$a cmp $b} @{$self-><M::PerlCode
836     .getExceptionInterfacePackageNameList>}) {
837     next if ref $pack->{$_};
838     $pack->{$_} = [];
839     $r .= sprintf q<push @%s::ISA, 'Message::Util::Error' >.
840     q<unless @%s::ISA;%s>, $_, $_, "\n";
841     }
842    
843     ## -- Enables interface packages
844     my @packs = map {'$' . $_ . '::'}
845     sort {$a cmp $b}
846     grep {not ref $pack->{$_} and $pack->{$_}}
847     keys %$pack;
848     $r .= q<for (>. join (', ', @packs) . qq<){}\n> if @packs;
849    
850     ## -- Footer
851 wakaba 1.36 $r .= <ClassM::ManakaiPCImplementation.perlComment>
852 wakaba 1.35 (q[License: <].$self-><AG::PerlFile.licenseURI>.qq[>\n]);
853     $r .= qq<1;\n>;
854     }__;
855 wakaba 1.1
856     @Attr:
857     @@Name: currentPackage
858     @@enDesc:
859     The current Perl package (used in stringify method).
860 wakaba 1.35
861     {NOTE:: This attribute is not preserved by the <Perl::clone> operation.
862     }
863     @@Type: DOMString
864 wakaba 1.1 @@Get:
865     @@@disDef:
866     @@@@GetProp: currentPackage
867     @@Set:
868     @@@disDef:
869     @@@@SetProp: currentPackage
870    
871     @Attr:
872 wakaba 1.6 @@Name: currentChunkNumber
873 wakaba 1.1 @@enDesc:
874 wakaba 1.6 The current code chunk number (used in stringify method).
875 wakaba 1.35
876     {NOTE:: This attribute is not preserved by the <Perl::clone> operation.
877     }
878     @@Type: idl|unsignedLong||ManakaiDOM|all
879 wakaba 1.1 @@Get:
880     @@@disDef:
881     @@@@GetProp: currentChunk
882     @@Set:
883     @@@disDef:
884     @@@@SetProp: currentChunk
885 wakaba 1.6
886     @Method:
887     @@Name: getNextChunkNumber
888     @@enDesc:
889     Increments the current chunk number of this file
890     and returns it.
891     @@Return:
892 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
893 wakaba 1.6 @@@enDesc:
894     The next chunk number.
895     @@@PerlDef:
896 wakaba 1.30 $r = ++$self->{<H::mn:node>}->{<H::pc:currentChunk>};
897 wakaba 1.2
898 wakaba 1.35 @ATTR:
899 wakaba 1.2 @@Name: licenseURI
900 wakaba 1.36 @@ATTRQName: pc|license
901 wakaba 1.2 @@enDesc:
902     The license term URI reference for this code.
903 wakaba 1.35 @@ReflectCDATA:
904 wakaba 1.2 @@Get:
905     @@Set:
906 wakaba 1.1 ##PerlFile
907    
908     PropDef:
909 wakaba 1.36 @QName: pc|currentChunk
910 wakaba 1.1 @enDesc:
911 wakaba 1.36 The current chunk number.
912 wakaba 1.1
913     PropDef:
914 wakaba 1.36 @QName: pc|currentPackage
915 wakaba 1.1 @enDesc:
916 wakaba 1.36 The current package fully qualified name.
917 wakaba 1.1
918 wakaba 1.35 ElementTypeBinding:
919     @Name: ReflectCDATA
920     @ElementType:
921     dis:Type
922     @ShadowContent:
923     @@@: DOMString
924     @ShadowSibling:
925     @@actualType: CDATADOMString
926    
927     ResourceDef:
928     @QName: DOMString
929     @For: ManakaiDOM|Perl
930     @AliasFor: DOMMain|DOMString||ManakaiDOM|ManakaiDOMLatest
931    
932     ReflectTypeDef:
933     @QName: CDATADOMString
934     @enDesc:
935     <IF::DOMMain:DOMString> for DOM attributes reflecting
936     <SGML::CDATA> element attributes.
937     @rdfs:subClassOf: DOMString
938     @ResourceDef:
939     @@rdf:type: DOMMain|ReflectGet
940     @@enDesc:
941     The DOM attribute returns the current value of the element attribute
942     in a transparent, case-sensitive manner.
943     \
944     If the element attribute is absent, the default value, if any,
945     or an empty string is returned.
946     @@PerlCDef:
947 wakaba 1.37 my $attr_stem;
948     __CODE{DOMCore:selectAttrNodeObjectNS::
949     $namespaceURI => $NS_URI_NO_NULL,
950     $localName => $LOCAL_NAME,
951     $r => $attr_stem,
952 wakaba 1.35 }__;
953 wakaba 1.37 if ($attr_stem) {
954     my $attr;
955     __CODE{ManakaiNode:getWeakReference||ManakaiDOM:Perl::
956     $object => $attr_stem,
957     $ref => $attr,
958     $class => {<ClassName::DOMCore:ManakaiDOMAttr>},
959     }__;
960     __CODE{DOMCore:getNodeTextContent::
961     $node => $attr,
962     $result => $r,
963     }__;
964     }
965     # else : default : empty string
966    
967 wakaba 1.35 @ResourceDef:
968     @@QName: CDATADOMStringSet
969     @@rdf:type: DOMMain|ReflectSet
970     @@enDesc:
971     The corresponding element attribute is set to the given value,
972     in a transparent, case-sensitive manner.
973     @@ImplNote:
974     @@@lang:en
975     @@@@:
976     What will happen if the <DOM::null> value is given?
977     @@PerlCDef:
978 wakaba 1.37 if (defined $given) {
979     my $prefix;
980     __CODE{DOMCore:setAttrValueNS::
981     $namespaceURI => $NS_URI_NO_NULL,
982     $localName => $LOCAL_NAME,
983     $prefix => $prefix,
984     $element => $self,
985     $value => $given,
986     }__;
987     } else {
988     __DEEP{
989 wakaba 1.35 $self-><M::Element.removeAttributeNS> ($NS_URI_NO_NULL, $LOCAL_NAME);
990 wakaba 1.37 }__;
991     }
992 wakaba 1.35
993     ElementTypeBinding:
994     @Name: ReflectTypeDef
995     @ElementType:
996     dis:ResourceDef
997     @ShadowContent:
998     @@rdf:type: DISLang|DataType
999     @@ForCheck: !ManakaiDOM|IDL
1000     @@For: ManakaiDOM|DOM
1001    
1002     ElementTypeBinding:
1003     @Name: ATTR
1004     @ElementType:
1005     dis:ResourceDef
1006     @ShadowContent:
1007     @@rdf:type:
1008     @@@@: s|Attribute
1009     @@@ForCheck: s|ForML
1010     @@rdf:type:
1011     @@@@: DISLang|Attribute
1012     @@@ForCheck: ManakaiDOM|ForClass
1013     @@rdf:type:
1014     @@@@: DISLang|Attribute
1015     @@@ForCheck: ManakaiDOM|ForIF
1016     @@DocAttr:
1017     @@@@: ||+||s|ForML
1018     @@@ContentType: DISCore|TFPQNames
1019     @@@ForCheck: ManakaiDOM|ForClass
1020     @@DocAttr:
1021     @@@@: ||+||s|ForML
1022     @@@ContentType: DISCore|TFPQNames
1023     @@@ForCheck: ManakaiDOM|ForIF
1024     @@ForCheck: !=ManakaiDOM|ManakaiDOM
1025    
1026     ElementTypeBinding:
1027     @Name: ATTRQName
1028     @ElementType:
1029     dis:AppName
1030     @ShadowContent:
1031     @@ForCheck: s|ForML
1032     @@ContentType: DISCore|QName
1033    
1034     IFClsETDef:
1035 wakaba 1.25 @IFQName: PerlPackage
1036 wakaba 1.35 @CQName: ManakaiPCPackage
1037     @ETQName: pc|package
1038 wakaba 1.25
1039     @IFISA: PerlCode
1040    
1041     @IFISA: PerlCodeStatements
1042 wakaba 1.35 @CISA: ManakaiPCCodeStatements
1043 wakaba 1.16
1044     @enDesc:
1045     A Perl lexical lines for which a <Perl::package> declaration
1046     in effect.
1047 wakaba 1.1
1048 wakaba 1.35 @ATTR:
1049 wakaba 1.1 @@Name: packageName
1050 wakaba 1.35 @@ATTRQName: pc|packageName
1051     @@ReflectCDATA:
1052 wakaba 1.1 @@enDesc:
1053     The fully-qualified package name.
1054     @@Get:
1055 wakaba 1.35 @@Set:
1056 wakaba 1.1
1057     @Method:
1058     @@Name: getSub
1059     @@enDesc:
1060     Gets a subroutine.
1061     @@Param:
1062     @@@Name: subName
1063 wakaba 1.36 @@@Type: DOMString
1064 wakaba 1.1 @@@enDesc:
1065     The name of subroutine to get.
1066     @@NamedParam:
1067     @@@Name: makeNewNode
1068 wakaba 1.36 @@@Type: idl|boolean||ManakaiDOM|all
1069 wakaba 1.1 @@@enDesc:
1070     Whether a new subroutine object should be created,
1071     if it is not exist, or not.
1072     @@Return:
1073 wakaba 1.25 @@@Type: PerlSub
1074 wakaba 1.1 @@@enDesc:
1075     The subroutine object.
1076 wakaba 1.4 @@@nullCase:
1077     @@@@enDesc:
1078     Either the specified subroutine is not found and
1079     the <P::makeNewNode> parameter is set to <DOM::false> or
1080     the subroutine is defined as an alias.
1081 wakaba 1.1 @@@PerlDef:
1082 wakaba 1.35 __DEEP{
1083     F: {
1084     for my $child (@{$self-><AG::Node.childNodes>}) {
1085     if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
1086     defined $child-><AG::Node.namespaceURI> and
1087     $child-><AG::Node.namespaceURI> eq <Q::pc:> and
1088     $child-><AG::Node.localName> eq 'sub') {
1089     if ($child-><M::PerlSub.hasPerlName> ($subName)) {
1090     $r = $child;
1091     last F;
1092     }
1093     }
1094     }
1095     if ($makeNewNode) {
1096     $r = $self-><AG::Node.ownerDocument>
1097     -><M::Document.createElementNS>
1098     (<Q::pc:>, 'sub');
1099     $r-><M::PerlSub.addPerlName> ($subName);
1100     $self-><M::Node.appendChild> ($r);
1101     }
1102     } # F
1103     }__;
1104 wakaba 1.1
1105 wakaba 1.4 @Method:
1106 wakaba 1.35 @@Name: setSubNode
1107     @@enDesc:
1108     Sets a subrotine.
1109     @@Param:
1110     @@@Name: subArg
1111     @@@Type: PerlSub
1112     @@@enDesc:
1113     The subroutine object.
1114     @@Return:
1115     @@@RaiseException:
1116     @@@@@:IN_USE_NODE_ERR
1117     @@@@enDesc:
1118     An attempt is made to set a subroutine that is
1119     already used elsewhere.
1120     @@@PerlDef:
1121     __DEEP{
1122     if ($subArg-><AG::Node.parentNode>) {
1123     __UNDEEP{__EXCEPTION{IN_USE_NODE_ERR::
1124     pc:childNode => {$subArg},
1125     }__}__;
1126     }
1127     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($subArg);
1128     $self-><M::Node.appendChild> ($subArg);
1129     }__;
1130    
1131     @Method:
1132 wakaba 1.4 @@Name: getOverloadSub
1133     @@enDesc:
1134     Gets an overloading subroutine.
1135     @@Param:
1136     @@@Name: opName
1137     @@@Type:
1138     DISLang:String::ManakaiDOM:all
1139     @@@enDesc:
1140     The name of the overloaded operator.
1141     @@NamedParam:
1142     @@@Name: makeNewNode
1143     @@@Type:
1144 wakaba 1.12 DOMMain:boolean::ManakaiDOM:all
1145 wakaba 1.4 @@@enDesc:
1146     Whether a new subroutine object should be created,
1147     if it is not exist, or not.
1148     @@Return:
1149 wakaba 1.25 @@@Type: PerlSub
1150 wakaba 1.4 @@@enDesc:
1151     The subroutine object.
1152     @@@nullCase:
1153     @@@@enDesc:
1154     Either the specified subroutine is not found and
1155     the <P::makeNewNode> parameter is set to <DOM::false> or
1156     the specified operator is overloaded by specifying method name.
1157     @@@UnknownOperatorException:
1158     @@@PerlDef:
1159 wakaba 1.35 unless (<Code::operatorNameList>->{$opName}) {
1160     __EXCEPTION{UNSUPPORTED_OPERATOR_ERR::
1161     pc:operator => {$opName},
1162     MDOMX:param-name => 'opName',
1163     }__;
1164     }
1165     __DEEP{
1166     F: {
1167     for my $child (@{$self-><AG::Node.childNodes>}) {
1168     if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
1169     defined $child-><AG::Node.namespaceURI> and
1170     $child-><AG::Node.namespaceURI> eq <Q::pc:> and
1171     $child-><AG::Node.localName> eq 'sub') {
1172     if ($child-><M::PerlSub.hasPerlOperator> ($opName)) {
1173     $r = $child;
1174     last F;
1175     }
1176     }
1177     }
1178     if ($makeNewNode) {
1179     $r = $self-><AG::Node.ownerDocument>
1180     -><M::Document.createElementNS>
1181     (<Q::pc:>, 'sub');
1182     $r-><M::PerlSub.addPerlOperator> ($opName);
1183     $self-><M::Node.appendChild> ($r);
1184     }
1185     } # F
1186     }__;
1187 wakaba 1.4
1188     @Method:
1189 wakaba 1.13 @@Name: addISAPackage
1190 wakaba 1.1 @@enDesc:
1191     Adds a class package that this class inherits.
1192     @@Param:
1193     @@@Name: packageName
1194 wakaba 1.35 @@@Type: DOMString
1195 wakaba 1.1 @@@enDesc:
1196     The name of package to add.
1197     @@Return:
1198     @@@PerlDef:
1199 wakaba 1.35 __DEEP{
1200     $self-><M::Element.setAttributeNS>
1201     (<Q::pc:>, 'pc:extends' =>
1202     join ' ', (split /\s+/, $self-><M::Element.getAttributeNS>
1203     (<Q::pc:>, 'extends')), $packageName);
1204     }__;
1205    
1206     @Method:
1207     @@Name: getISAPackageNameList
1208     @@enDesc:
1209     Returns a list of names of packages extended by the package.
1210     @@Return:
1211     @@@Type: DISPerl|ARRAY||ManakaiDOM|all
1212     @@@enDesc:
1213     An ordered snapshot list of superpackage names.
1214     @@@PerlDef:
1215     __DEEP{
1216     $r = [split /\s+/, $self-><M::Element.getAttributeNS>
1217     (<Q::pc:>, 'extends')];
1218     }__;
1219 wakaba 1.1
1220     @Method:
1221     @@Name: addImplementPackage
1222     @@enDesc:
1223     Adds a interface package that this class implements.
1224     @@Param:
1225     @@@Name: packageName
1226 wakaba 1.35 @@@Type: DOMString
1227 wakaba 1.1 @@@enDesc:
1228     The name of package to add.
1229     @@Return:
1230     @@@PerlDef:
1231 wakaba 1.35 __DEEP{
1232     __CODE{addNameListAttr::
1233     $node => {$self},
1234     $attrName => 'implements',
1235     $newName => {$packageName},
1236     }__;
1237     }__;
1238    
1239     @Method:
1240     @@Name: getImplementPackageNameList
1241     @@enDesc:
1242     Returns a list of names of packages implemented by the package.
1243     @@Return:
1244     @@@Type: DISPerl|ARRAY||ManakaiDOM|all
1245     @@@enDesc:
1246     An unordered snapshot list of interface packages.
1247     @@@PerlDef:
1248     __DEEP{
1249     __CODE{getNameListAttr::
1250     $node => {$self},
1251     $attrName => 'implements',
1252     $result => {$r},
1253     }__;
1254     }__;
1255 wakaba 1.1
1256     @ToStringMethod:
1257     @@Return:
1258 wakaba 1.35 @@@Type: DOMString
1259 wakaba 1.1 @@@enDesc:
1260     Perl code.
1261     @@@PerlDef:
1262 wakaba 1.35 __DEEP{
1263     my $file = $self-><AG::PerlCode.fileNode>;
1264    
1265     ## Package name
1266     my $pn = $self-><AG::PerlPackage.packageName>;
1267     $r .= q<package > . $pn . ";\n";
1268     $file-><AS::PerlFile.currentPackage> ($pn) if $file;
1269    
1270     ## Package version
1271     $r .= 'our $VERSION = '.
1272 wakaba 1.36 <ClassM::ManakaiPCImplementation.versionDateTime> (time).
1273 wakaba 1.35 ";\n";
1274    
1275     ## Inheritance
1276     my @isa = (@{$self-><M::PerlPackage.getISAPackageNameList>},
1277     sort {$a cmp $b} @{$self-><M::PerlPackage
1278     .getImplementPackageNameList>});
1279     if (@isa) {
1280     $r .= 'push our @ISA, ' .
1281 wakaba 1.36 <ClassM::ManakaiPCImplementation.perlList> (\@isa) .
1282 wakaba 1.35 ";\n";
1283     }
1284    
1285     ## Use'ing modules
1286     for my $pack (sort {$a cmp $b} @{$self-><M::PerlCode
1287     .getUsePerlModuleNameList>}) {
1288     $r .= 'use ' . $pack . ";\n";
1289     }
1290    
1291     my $cls = $self-><M::PerlCode.getUseCharClassNameList>;
1292     for my $pack (sort {$a cmp $b} keys %$cls) {
1293     $r .= 'use ' . $pack . ' ' .
1294 wakaba 1.36 <ClassM::ManakaiPCImplementation.perlList>
1295 wakaba 1.35 ([sort {$a cmp $b} grep {$cls->{$pack}->{$_}}
1296     keys %{$cls->{$pack}}]) . ";\n";
1297     }
1298    
1299     ## Package-scope objects
1300     my $has_bool;
1301     my $op = '';
1302     for my $child (@{$self-><AG::Node.childNodes>}) {
1303     if ($child-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
1304     defined $child-><AG::Node.namespaceURI> and
1305     $child-><AG::Node.namespaceURI> eq <Q::pc:>) {
1306     my $ln = $child-><AG::Node.localName>;
1307     if ($ln eq 'sub') {
1308     my $names = $child-><M::PerlSub.getPerlNameList>;
1309     my $ops = $child-><M::PerlSub.getPerlOperatorList>;
1310     if (@$names) {
1311     $r .= $child->stringify;
1312     if (@$names > 1) {
1313     $r .= sprintf q<*%s = \&%s;%s>,
1314     $_, $names->[0], "\n" for @$names[1..$#$names];
1315     }
1316     for (@$ops) {
1317     $op .= sprintf q['%s' => '%s', %s],
1318     $_ => $names->[0], "\n";
1319     $has_bool = true if $_ eq 'bool';
1320     }
1321     } else {
1322     my $v = $child->stringify;
1323     for (@$ops) {
1324     $op .= sprintf q['%s' => %s, %s], $_ => $v, "\n";
1325     $has_bool = true if $_ eq 'bool';
1326     }
1327     }
1328     } else {
1329     $r .= $child->stringify;
1330     }
1331     } # pc:*
1332     } # children
1333    
1334     if (length $op) {
1335     $r .= "use overload \n";
1336     $r .= "bool => sub () {1}, \n" unless $has_bool;
1337     $r .= $op . "fallback => 1;\n";
1338     }
1339    
1340     ## -- Exports
1341     my $xport = $self-><M::PerlPackage.getExportList>;
1342     if (map {values %$_} values %$xport) {
1343     $r .= q[our %EXPORT_TAG = (] .
1344 wakaba 1.36 <ClassM::ManakaiPCImplementation.perlList>
1345 wakaba 1.35 ([map {$_ => [sort {$a cmp $b} keys %{$xport->{$_}}]}
1346     sort {$a cmp $b} grep {length}
1347     keys %$xport]) . qq[);\n];
1348     $r .= q[our @EXPORT_OK = (] .
1349 wakaba 1.36 <ClassM::ManakaiPCImplementation.perlList>
1350 wakaba 1.35 ([map {sort {$a cmp $b} keys %{$xport->{$_}}}
1351     sort {$a cmp $b} keys %$xport]) . qq[);\n];
1352     $r .= q[use Exporter; push our @ISA, 'Exporter';] . qq[\n];
1353     }
1354     }__;
1355    
1356     @Method:
1357     @@Name: getExportList
1358     @@enDesc:
1359     Returns a list of export tag and names.
1360     @@Return:
1361     @@@Type: DISPerl|HASH||ManakaiDOM|all
1362     @@@enDesc:
1363     Snapshot list of lists.
1364     @@@PerlDef:
1365     my $mc;
1366     __DEEP{
1367     __CODE{getNameListAttr::
1368     $node => {$self},
1369     $attrName => 'export',
1370     $result => {$mc},
1371     }__;
1372     }__;
1373     for (@$mc) {
1374     my ($m, $c) = split /\./, $_, 2;
1375     $r->{$m}->{$c} = true;
1376     }
1377 wakaba 1.18
1378     @Method:
1379     @@Name: addExport
1380     @@enDesc:
1381 wakaba 1.26 Adds a name to the list of exported items (<Perl::@EXPORT_OK>).
1382 wakaba 1.18 @@Param:
1383     @@@Name: exportTag
1384 wakaba 1.35 @@@Type: DOMString
1385 wakaba 1.18 @@@enDesc:
1386     The name of the tag (without <CHAR::COLON> prefix).
1387     The <P::exportName> is added both to <Perl::@EXPORT_OK>
1388     and <Perl::$EXPORT_OK{<P::exportTag>}>.
1389     @@@nullCase:
1390     @@@@enDesc:
1391     The <P::exportName> is added only to the <Perl::@EXPORT_OK>.
1392     @@Param:
1393     @@@Name: exportName
1394 wakaba 1.35 @@@Type: DOMString
1395 wakaba 1.18 @@@enDesc:
1396     The name to be exported.
1397     @@Return:
1398     @@@PerlDef:
1399 wakaba 1.35 __DEEP{
1400     __CODE{addNameListAttr::
1401     $node => {$self},
1402     $attrName => 'export',
1403     $newName => {$exportTag.'.'.$exportName},
1404     }__;
1405     }__;
1406 wakaba 1.36 ##PCPackage
1407 wakaba 1.4
1408     ElementTypeBinding:
1409     @Name: UnknownOperatorException
1410     @ElementType:
1411     ManakaiDOM:raises
1412     @ShadowContent:
1413     @@@:UNSUPPORTED_OPERATOR_ERR
1414     @@enDesc:
1415     An attempt is made to overload an unknown operator.
1416    
1417     XParamDef:
1418     @QName:
1419     pc:operator
1420     @enDesc:
1421     An operator to overload.
1422    
1423     ResourceDef:
1424 wakaba 1.28 @For: ManakaiDOM|Perl
1425 wakaba 1.4 @QName: operatorNameList
1426     @enDesc:
1427     The list of valid operators for <PerlModule::operator> pragma.
1428 wakaba 1.36 @rdf:type: DISPerl|InlineCode
1429 wakaba 1.28 @PerlCDef:
1430 wakaba 1.4 {qw[
1431     + 1 - 1 * 1 / 1 % 1 ** 1 << 1 >> 1 x 1 . 1
1432     += 1 -= 1 *= 1 /= 1 %= 1 **= 1 <<= 1 >>= 1 x= 1 .= 1
1433     < 1 <= 1 > 1 >= 1 == 1 != 1 <=> 1
1434     lt 1 le 1 gt 1 ge 1 eq 1 ne 1 cmp 1
1435     & 1 | 1 ^ 1 neg 1 ! 1 ~ 1
1436     ++ 1 -- 1 = 1
1437     atan2 1 cos 1 sin 1 exp 1 abs 1 log 1 sqrt 1
1438     bool 1 "" 1 0+ 1 ${} 1 @{} 1 %{} 1 &{} 1 *{} 1 <> 1
1439     nomethod 1
1440     ]}
1441    
1442 wakaba 1.35 IFClsETDef:
1443 wakaba 1.25 @IFQName: PerlCodeStatements
1444 wakaba 1.35 @CQName: ManakaiPCCodeStatements
1445     @ETQName:
1446     @@@: pc|statementContainer
1447     @@ImplNote:
1448     @@@lang:en
1449     @@@@: Dummy.
1450 wakaba 1.25
1451     @IFISA: PerlCodeUnits
1452 wakaba 1.35 @CISA: ManakaiPCCodeUnits
1453 wakaba 1.36
1454 wakaba 1.1 @enDesc:
1455 wakaba 1.6 A base class for node types that contains zero or more
1456     statements and/or blocks.
1457 wakaba 1.1
1458 wakaba 1.35 @ATTR:
1459 wakaba 1.10 @@Name: sourceFile
1460 wakaba 1.35 @@ATTRQName: pc|sourceFile
1461 wakaba 1.10 @@enDesc:
1462     The source file name of this fragment.
1463 wakaba 1.35 @@ReflectCDATA:
1464 wakaba 1.10 @@Get:
1465     @@@enDesc:
1466     Any string identifying the source.
1467     @@@nullCase:
1468     @@@@enDesc: No source file name is set.
1469     @@Set:
1470     @@@nullCase:
1471     @@@@enDesc: No (or unknown) source file.
1472    
1473 wakaba 1.35 @ATTR:
1474 wakaba 1.10 @@Name: sourceLine
1475 wakaba 1.35 @@ATTRQName: pc|sourceLine
1476 wakaba 1.10 @@enDesc:
1477     Source file line number of the first line of this fragment.
1478 wakaba 1.35 @@ReflectCDATA:
1479 wakaba 1.10 @@Get:
1480     @@Set:
1481    
1482 wakaba 1.35 @ATTR:
1483 wakaba 1.1 @@Name: currentSourceFile
1484 wakaba 1.35 @@ATTRQName: pc|currentSourceFile
1485 wakaba 1.1 @@enDesc:
1486     The current source file name that is referred when
1487     a code fragment is added.
1488 wakaba 1.35 @@ReflectCDATA:
1489 wakaba 1.1 @@Get:
1490     @@@nullCase:
1491     @@@@enDesc: No source file name is set.
1492     @@Set:
1493     @@@nullCase:
1494     @@@@enDesc: No (or unknown) source file.
1495    
1496 wakaba 1.35 @ATTR:
1497 wakaba 1.1 @@Name: currentSourceLine
1498 wakaba 1.35 @@ATTRQName: pc|currentSourceLine
1499 wakaba 1.1 @@enDesc:
1500     The current line number in source file that is referred when
1501     a code fragment is added.
1502 wakaba 1.35 @@ReflectCDATA:
1503 wakaba 1.1 @@Get:
1504     @@Set:
1505    
1506     @Method:
1507 wakaba 1.5 @@Name: appendCodeFragment
1508     @@enDesc:
1509     Appends a <Class::ManakaiPerlCodeFragment> object.
1510     @@Param:
1511     @@@Name: codeArg
1512 wakaba 1.25 @@@Type: PerlCode
1513 wakaba 1.5 @@@enDesc:
1514     A code fragment object.
1515     @@Return:
1516     @@@RaiseException:
1517     @@@@@:BAD_CHILD_ERR
1518     @@@@enDesc:
1519     An attempt is made to append a child
1520     that is not a <Class::ManakaiPerlUnparsedCode>.
1521     @@@RaiseException:
1522     @@@@@:IN_USE_NODE_ERR
1523     @@@@enDesc:
1524     An attempt is made to append a node that is
1525     already used elsewhere.
1526     @@@PerlDef:
1527 wakaba 1.35 if ({
1528     unparsed => 1, if => 1, statement => 1, block => 1,
1529     blockContainer => true,
1530     inlineUnparsed => 1, variable => 1, tokens => 1, atom => 1,
1531     inlineContainer => 1, stringLiteral => 1, assignment => 1,
1532     }->{$codeArg-><AG::Node.localName>}) {
1533     if ($codeArg-><AG::Node.parentNode>) {
1534     __EXCEPTION{IN_USE_NODE_ERR::
1535     pc:childNode => {$codeArg},
1536     MDOMX:param-name => 'codeArg',
1537     }__;
1538     }
1539     __DEEP{
1540     $self-><AG::Node.ownerDocument>
1541     -><M::Document.adoptNode> ($codeArg);
1542     $self-><M::Node.appendChild> ($codeArg);
1543     }__;
1544     } else {
1545     __EXCEPTION{BAD_CHILD_ERR::
1546     pc:parentNode => {$self},
1547     pc:childNode => {$codeArg},
1548     MDOMX:param-name => 'codeArg',
1549     }__;
1550     }
1551 wakaba 1.5
1552     @Method:
1553 wakaba 1.1 @@Name: appendCode
1554     @@enDesc:
1555     Appends an unparsed Perl code fragment.
1556     @@Param:
1557     @@@Name: codeArg
1558 wakaba 1.35 @@@Type: DOMString
1559 wakaba 1.1 @@@enDesc:
1560     An unparsed Perl code fragment.
1561     @@Return:
1562 wakaba 1.25 @@@Type: PerlUnparsedCode
1563 wakaba 1.1 @@@enDesc:
1564     The newly created Perl code object.
1565     @@@PerlDef:
1566 wakaba 1.35 __DEEP{
1567     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
1568     (<Q::pc:>, 'unparsed');
1569     $r-><AS::Node.textContent> ($codeArg);
1570     $r-><AS::PerlCodeStatements.sourceFile>
1571     ($self-><AG::PerlCodeStatements.currentSourceFile>);
1572     my $sl = $self-><AG::PerlCodeStatements.currentSourceLine>;
1573     $r-><AS::PerlCodeStatements.sourceLine> ($sl);
1574     $self-><AG::PerlCodeStatements.currentSourceLine>
1575     ($sl + ($codeArg =~ tr/\x0A/\x0A/));
1576     $self-><M::Node.appendChild> ($r);
1577     }__;
1578 wakaba 1.1
1579     @Method:
1580     @@Name: skipLines
1581     @@enDesc:
1582     Skips lines in a code.
1583     @@Param:
1584     @@@Name: codeArg
1585 wakaba 1.35 @@@Type: DOMString
1586 wakaba 1.1 @@@enDesc:
1587     A code fragment, which is counted lines.
1588     @@Return:
1589     @@@PerlDef:
1590 wakaba 1.30 $self->{<H::mn:node>}->{<H::pc:currentSourceLine>}
1591 wakaba 1.1 += ($codeArg =~ tr/\x0A/\x0A/);
1592 wakaba 1.4
1593 wakaba 1.35 @ATTR:
1594 wakaba 1.8 @@Name: label
1595 wakaba 1.35 @@ATTRQName: pc|label
1596 wakaba 1.8 @@enDesc:
1597     Label for this block.
1598 wakaba 1.35 @@ReflectCDATA:
1599 wakaba 1.8 @@Get:
1600     @@@nullCase:
1601     @@@@enDesc:
1602     No label.
1603     @@Set:
1604     @@@nullCase:
1605     @@@@enDesc:
1606     No label.
1607    
1608     @Method:
1609     @@Name: appendBlock
1610     @@enDesc:
1611     Appends a Perl block code.
1612     @@Return:
1613 wakaba 1.25 @@@Type: PerlBlock
1614 wakaba 1.8 @@@enDesc:
1615     The newly created Perl code object.
1616     @@@PerlDef:
1617 wakaba 1.35 __DEEP{
1618     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
1619     (<Q::pc:>, 'block');
1620     $self-><M::Node.appendChild> ($r);
1621     }__;
1622 wakaba 1.8
1623     @Method:
1624     @@Name: appendStatement
1625     @@enDesc:
1626     Appends a Perl statement.
1627     @@Param:
1628     @@@Name: codeArg
1629 wakaba 1.36 @@@Type: DOMString
1630 wakaba 1.8 @@@enDesc:
1631     A Perl statement without terminating <Perl::;>.
1632     @@@nullCase:
1633     @@@@enDesc:
1634     No initial content.
1635     @@Return:
1636 wakaba 1.25 @@@Type: PerlStatement
1637 wakaba 1.8 @@@enDesc:
1638     The newly created Perl code object.
1639     @@@PerlDef:
1640 wakaba 1.35 __DEEP{
1641     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
1642     (<Q::pc:>, 'statement');
1643     if (defined $codeArg) {
1644     $r-><M::PerlCodeUnits.appendBare> ($codeArg);
1645     }
1646     $self-><M::Node.appendChild> ($r);
1647     }__;
1648 wakaba 1.12
1649     @Method:
1650     @@Name: appendNewIf
1651     @@enDesc:
1652     Appends a newly created <Class::ManakaiPerlIf> object.
1653     @@Param:
1654     @@@Name: conditionArg
1655 wakaba 1.25 @@@Type: PerlCode
1656 wakaba 1.12 @@@enDesc:
1657     Conditoon code fragment object.
1658     @@Param:
1659     @@@Name: trueArg
1660 wakaba 1.25 @@@Type: PerlCode
1661 wakaba 1.12 @@@enDesc:
1662     A true code fragment object.
1663     @@@nullCase:
1664     @@@@enDesc: No true code.
1665     @@Param:
1666     @@@Name: falseArg
1667 wakaba 1.25 @@@Type: PerlCode
1668 wakaba 1.12 @@@enDesc:
1669     A false code fragment object.
1670     @@@nullCase:
1671     @@@@enDesc: No false code.
1672     @@Return:
1673 wakaba 1.36 @@@Type: PerlIf
1674 wakaba 1.35 @@@enDesc:
1675     The newly created element.
1676 wakaba 1.12 @@@RaiseException:
1677     @@@@@:BAD_CHILD_ERR
1678     @@@@enDesc:
1679     An attempt is made to append a child
1680     that is not valid type.
1681     @@@RaiseException:
1682     @@@@@:IN_USE_NODE_ERR
1683     @@@@enDesc:
1684     An attempt is made to append a node that is
1685     already used elsewhere.
1686     @@@PerlDef:
1687 wakaba 1.35 for my $arg ([conditionArg => $conditionArg]) {
1688     if ({
1689     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
1690     inlineUnparsed => 1, variable => 1, stringLiteral => true,
1691     }->{$arg->[1]-><AG::Node.localName>}) {
1692     if ($arg->[1]-><AG::Node.parentNode>) {
1693     __EXCEPTION{IN_USE_NODE_ERR::
1694     pc:childNode => {$arg->[1]},
1695     MDOMX:param-name => {$arg->[0]},
1696     }__;
1697     }
1698     } else {
1699     __EXCEPTION{BAD_CHILD_ERR::
1700     pc:parentNode => {$self},
1701     pc:childNode => {$arg->[1]},
1702     MDOMX:param-name => {$arg->[0]},
1703     }__;
1704     }
1705     } # c
1706 wakaba 1.6
1707 wakaba 1.35 for my $arg ([trueArg => $trueArg],
1708     [falseArg => $falseArg]) {
1709     next unless $arg->[1];
1710     if ({
1711     blockContainer => true,
1712     }->{$arg->[1]-><AG::Node.localName>}) {
1713     if ($arg->[1]-><AG::Node.parentNode>) {
1714     __EXCEPTION{IN_USE_NODE_ERR::
1715     pc:childNode => {$arg->[1]},
1716     MDOMX:param-name => {$arg->[0]},
1717     }__;
1718     }
1719     } else {
1720     __EXCEPTION{BAD_CHILD_ERR::
1721     pc:parentNode => {$self},
1722     pc:childNode => {$arg->[1]},
1723     MDOMX:param-name => {$arg->[0]},
1724     }__;
1725     }
1726     } # t/f
1727    
1728     __DEEP{
1729     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
1730     (<Q::pc:>, 'if');
1731     $r-><AS::PerlIf.condition> ($conditionArg);
1732     $r-><AS::PerlIf.trueCode> ($trueArg) if $trueArg;
1733     $r-><AS::PerlIf.falseCode> ($falseArg) if $falseArg;
1734     $self-><M::Node.appendChild> ($r);
1735     }__;
1736     ##PCIf
1737    
1738     IFClsETDef:
1739 wakaba 1.25 @IFQName: PerlSub
1740 wakaba 1.35 @CQName: ManakaiPCSub
1741     @ETQName: pc|sub
1742 wakaba 1.25
1743     @IFISA: PerlCode
1744    
1745     @IFISA: PerlCodeStatements
1746 wakaba 1.35 @CISA: ManakaiPCCodeStatements
1747 wakaba 1.25
1748 wakaba 1.6 @enDesc:
1749 wakaba 1.36 Perl subroutines.
1750 wakaba 1.20
1751 wakaba 1.6 @Attr:
1752 wakaba 1.35 @@Name: pcLocalName
1753 wakaba 1.6 @@enDesc:
1754     The name of this subroutine.
1755 wakaba 1.35 @@Type: DOMString
1756 wakaba 1.6 @@Get:
1757     @@@nullCase:
1758     @@@@enDesc:
1759     This subroutine has no name.
1760 wakaba 1.35 @@@PerlDef:
1761     __DEEP{
1762     $r = $self-><M::PerlSub.getPerlNameList>->[0];
1763     }__;
1764 wakaba 1.6
1765 wakaba 1.35 @Method:
1766     @@Name: addPerlName
1767     @@enDesc:
1768     Adds a subroutine name.
1769     @@Param:
1770     @@@Name: subName
1771     @@@Type: DOMString
1772     @@@enDesc: The name to add.
1773     @@Return:
1774     @@@PerlDef:
1775     __DEEP{
1776     __CODE{addNameListAttr::
1777     $node => {$self},
1778     $attrName => 'localName',
1779     $newName => {$subName},
1780     }__;
1781     }__;
1782    
1783     @Method:
1784     @@Name: getPerlNameList
1785     @@enDesc:
1786     Returns a list of names of the subroutine.
1787     @@Return:
1788     @@@Type: DISPerl|ARRAY||ManakaiDOM|all
1789     @@@enDesc:
1790     An unordered snapshot list of names.
1791     @@@PerlDef:
1792     __DEEP{
1793     __CODE{getNameListAttr::
1794     $node => {$self},
1795     $attrName => 'localName',
1796     $result => {$r},
1797     }__;
1798     }__;
1799    
1800     @Method:
1801     @@Name: hasPerlName
1802     @@enDesc:
1803     Returns whether the subroutine has a name or not.
1804     @@Param:
1805     @@@Name: subName
1806     @@@Type: DOMString
1807     @@@enDesc: The name.
1808     @@Return:
1809     @@@Type: idl|boolean||ManakaiDOM|all
1810     @@@PerlDef:
1811     __DEEP{
1812     my $l;
1813     __CODE{getNameListAttr::
1814     $node => {$self},
1815     $attrName => 'localName',
1816     $result => {$l},
1817     }__;
1818     F: for (@$l) {
1819     if ($_ eq $subName) {
1820     $r = true;
1821     last F;
1822     }
1823     }
1824     }__;
1825    
1826     @Method:
1827     @@Name: addPerlOperator
1828     @@enDesc:
1829     Adds an operator overloaded by the method.
1830     @@Param:
1831     @@@Name: op
1832     @@@Type: DOMString
1833     @@@enDesc: The operator to add.
1834     @@Return:
1835     @@@PerlDef:
1836     __DEEP{
1837     __CODE{addNameListAttr::
1838     $node => {$self},
1839     $attrName => 'operator',
1840     $newName => {$op},
1841     }__;
1842     }__;
1843    
1844     @Method:
1845     @@Name: getPerlOperatorList
1846     @@enDesc:
1847     Returns a list of operators of the subroutine.
1848     @@Return:
1849     @@@Type: DISPerl|ARRAY||ManakaiDOM|all
1850     @@@enDesc:
1851     An unordered snapshot list of operators.
1852     @@@PerlDef:
1853     __DEEP{
1854     __CODE{getNameListAttr::
1855     $node => {$self},
1856     $attrName => 'operator',
1857     $result => {$r},
1858     }__;
1859     }__;
1860    
1861     @Method:
1862     @@Name: hasPerlOperator
1863     @@enDesc:
1864     Returns whether the subroutine has an operator or not.
1865     @@Param:
1866     @@@Name: op
1867     @@@Type: DOMString
1868     @@@enDesc: The operator.
1869     @@Return:
1870     @@@Type: idl|boolean||ManakaiDOM|all
1871     @@@PerlDef:
1872     __DEEP{
1873     my $l;
1874     __CODE{getNameListAttr::
1875     $node => {$self},
1876     $attrName => 'operator',
1877     $result => {$l},
1878     }__;
1879     F: for (@$l) {
1880     if ($_ eq $op) {
1881     $r = true;
1882     last F;
1883     }
1884     }
1885     }__;
1886    
1887     @ATTR:
1888 wakaba 1.6 @@Name: prototype
1889 wakaba 1.35 @@ATTRQName: pc|prototype
1890 wakaba 1.6 @@enDesc:
1891     The prototype of this subroutine.
1892 wakaba 1.35 @@ReflectCDATA:
1893 wakaba 1.6 @@Get:
1894     @@@nullCase:
1895     @@@@enDesc:
1896     No prototype is set.
1897     @@Set:
1898     @@@nullCase:
1899     @@@@enDesc:
1900     No prototype declaration.
1901    
1902 wakaba 1.4 @ToStringMethod:
1903     @@Return:
1904 wakaba 1.35 @@@Type: DOMString
1905 wakaba 1.4 @@@enDesc:
1906     Perl code.
1907     @@@PerlDef:
1908 wakaba 1.35 __DEEP{
1909     $r = q<sub>;
1910     my $nm = $self-><M::PerlSub.getPerlNameList>;
1911     $r .= q< > . $nm->[0] if @$nm;
1912     my $pt = $self-><AG::PerlSub.prototype>;
1913     $r .= q< (> . $pt . q<)> if length $pt;
1914     $r .= qq< {\n>;
1915     for my $child (@{$self-><AG::Node.childNodes>}) {
1916     $r .= $child->stringify;
1917     }
1918     $r .= qq<}\n>;
1919     }__;
1920 wakaba 1.14
1921     @NumValMethod:
1922     @@Return:
1923 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
1924 wakaba 1.14 @@@PerlDef:
1925 wakaba 1.35 __DEEP{
1926     $r = 0 + $self-><AG::Node.lastChild>;
1927     }__;
1928     ##PCSub
1929 wakaba 1.1
1930 wakaba 1.5 XParamDef:
1931     @QName: parentNode
1932     @enDesc:
1933     Parent node.
1934    
1935     XParamDef:
1936     @QName: childNode
1937     @enDesc:
1938     Child node.
1939    
1940 wakaba 1.35 IFClsETDef:
1941 wakaba 1.25 @IFQName: PerlUnparsedCode
1942 wakaba 1.35 @CQName: ManakaiPCUnparsedCode
1943     @ETQName: pc|unparsed
1944 wakaba 1.25
1945     @IFISA: PerlCode
1946 wakaba 1.35 @CISA: ManakaiPCCode
1947 wakaba 1.25
1948 wakaba 1.1 @enDesc:
1949     Unparsed Perl code fragments.
1950 wakaba 1.5
1951 wakaba 1.35 @ATTR:
1952 wakaba 1.5 @@Name: sourceFile
1953 wakaba 1.35 @@ATTRQName: pc|sourceFile
1954 wakaba 1.5 @@enDesc:
1955     The source file name of this fragment.
1956 wakaba 1.35 @@ReflectCDATA:
1957 wakaba 1.5 @@Get:
1958     @@@enDesc:
1959     Any string identifying the source.
1960     @@@nullCase:
1961     @@@@enDesc: No source file name is set.
1962     @@Set:
1963     @@@nullCase:
1964     @@@@enDesc: No (or unknown) source file.
1965    
1966 wakaba 1.35 @ATTR:
1967 wakaba 1.5 @@Name: sourceLine
1968 wakaba 1.35 @@ATTRQName: pc|sourceLine
1969 wakaba 1.5 @@enDesc:
1970     Source file line number of the first line of this fragment.
1971 wakaba 1.35 @@ReflectCDATA:
1972 wakaba 1.5 @@Get:
1973     @@Set:
1974 wakaba 1.6
1975     @ToStringMethod:
1976     @@Return:
1977 wakaba 1.35 @@@Type: DOMString
1978 wakaba 1.6 @@@enDesc:
1979     Perl code.
1980     @@@PerlDef:
1981 wakaba 1.35 __DEEP{
1982 wakaba 1.39 $r = "\x0A" . $self-><AG::Node.textContent> . "\x0A";
1983 wakaba 1.35 my $file = $self-><AG::PerlCode.fileNode>;
1984 wakaba 1.38 my $src_file = $file ? $file-><AG::PerlFile.sourceFile>
1985     : $self->{<H::mn:node>}->{<H::mn:nodeID>};
1986 wakaba 1.39 if ($self-><AG::Node.ownerDocument>
1987     -><AG::Document.domConfig>
1988     -><M::DOMCore:DOMConfiguration.getParameter>
1989     (<Q::pc:line>)) {
1990     my $nxt_cnum = $file ? $file-><M::PerlFile.getNextChunkNumber> : 0;
1991     $r = sprintf qq<\n#line %d "%s [u] (Chunk #%d)"%s>.
1992     qq<#line 1 "%s [/u] (Chunk #%d)"\n>,
1993 wakaba 1.35 $self-><AG::PerlUnparsedCode.sourceLine> || 1,
1994     $self-><AG::PerlUnparsedCode.sourceFile> || $src_file,
1995     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0,
1996 wakaba 1.39 $r,
1997 wakaba 1.35 $src_file,
1998     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0;
1999 wakaba 1.39 }
2000 wakaba 1.35 }__;
2001 wakaba 1.1 ##PerlUnparsedCode
2002    
2003 wakaba 1.35 IFClsETDef:
2004 wakaba 1.25 @IFQName: PerlInlineUnparsedCode
2005 wakaba 1.35 @CQName: ManakaiPCInlineUnparsedCode
2006     @ETQName: pc|inlineUnparsed
2007 wakaba 1.25
2008     @IFISA: PerlCode
2009 wakaba 1.35 @CISA: ManakaiPCCode
2010 wakaba 1.25
2011 wakaba 1.6 @enDesc:
2012 wakaba 1.36 Unparsed Perl inline code fragments.
2013 wakaba 1.6
2014 wakaba 1.36 @ToStringMethod:
2015 wakaba 1.9 @@Return:
2016 wakaba 1.36 @@@Type: DOMString
2017     @@@enDesc:
2018     Perl code.
2019 wakaba 1.35 @@@disDef:
2020     @@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.get
2021 wakaba 1.36 ##PCInlineUnparsedCode
2022 wakaba 1.6
2023 wakaba 1.35 IFClsETDef:
2024 wakaba 1.25 @IFQName: PerlStringLiteral
2025 wakaba 1.35 @CQName: ManakaiPCPerlStringLiteral
2026     @ETQName: pc|stringLiteral
2027 wakaba 1.25
2028     @IFISA: PerlCode
2029 wakaba 1.35 @CISA: ManakaiPCCode
2030 wakaba 1.25
2031 wakaba 1.6 @enDesc:
2032 wakaba 1.36 Perl string literal.
2033 wakaba 1.6
2034 wakaba 1.14 @NumValMethod:
2035     @@Return:
2036 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
2037 wakaba 1.14 @@@enDesc:
2038     Numeric value of the Perl code.
2039     @@@PerlDef:
2040 wakaba 1.35 __DEEP{
2041     $r = 0 + $self-><AG::Node.textContent>;
2042     }__;
2043 wakaba 1.14
2044 wakaba 1.6 @ToStringMethod:
2045     @@Return:
2046 wakaba 1.35 @@@Type: DOMString
2047 wakaba 1.6 @@@enDesc:
2048     Perl code.
2049     @@@PerlDef:
2050 wakaba 1.35 __DEEP{
2051     $r = $self-><AG::Node.textContent>;
2052     $r =~ s/(['\\])/\\$1/g;
2053     $r = q<'> . $r . q<'>;
2054     }__;
2055 wakaba 1.6 ##PerlStringLiteral
2056    
2057 wakaba 1.35 IFClsETDef:
2058 wakaba 1.25 @IFQName: PerlTokens
2059 wakaba 1.35 @CQName: ManakaiPCTokens
2060     @ETQName: pc|tokens
2061 wakaba 1.12
2062 wakaba 1.25 @IFISA: PerlCode
2063 wakaba 1.35 @CISA: ManakaiPCCode
2064 wakaba 1.25
2065 wakaba 1.6 @enDesc:
2066 wakaba 1.36 Unparsed Perl inline code fragments.
2067 wakaba 1.6
2068     @ToStringMethod:
2069     @@Return:
2070     @@@Type:
2071 wakaba 1.12 DISLang:String::ManakaiDOM:all
2072 wakaba 1.6 @@@enDesc:
2073     Perl code.
2074     @@@PerlDef:
2075 wakaba 1.35 __DEEP{
2076     $r = $self-><AG::Node.textContent>;
2077     }__;
2078     ##PCTokens
2079 wakaba 1.6
2080 wakaba 1.35 IFClsETDef:
2081 wakaba 1.25 @IFQName: PerlAtom
2082 wakaba 1.35 @CQName: ManakaiPCAtom
2083     @ETQName: pc|atom
2084 wakaba 1.25
2085     @IFISA: PerlCode
2086 wakaba 1.35 @CISA: ManakaiPCTokens
2087 wakaba 1.25
2088 wakaba 1.6 @enDesc:
2089     Unparsed Perl atomic code fragments (such as numeric literal).
2090    
2091 wakaba 1.14 @NumValMethod:
2092     @@Return:
2093 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
2094 wakaba 1.14 @@@enDesc:
2095     Numeric value of the Perl code.
2096     @@@PerlDef:
2097 wakaba 1.35 __DEEP{
2098     $r = 0 + $self-><AG::Node.textContent>;
2099     }__;
2100 wakaba 1.9
2101 wakaba 1.6 @ToStringMethod:
2102     @@Return:
2103 wakaba 1.35 @@@Type: DOMString
2104 wakaba 1.6 @@@enDesc:
2105     Perl code.
2106     @@@PerlDef:
2107 wakaba 1.35 __DEEP{
2108     $r = $self-><AG::Node.textContent>;
2109     }__;
2110 wakaba 1.6 ##PerlAtom
2111    
2112 wakaba 1.35 IFClsETDef:
2113 wakaba 1.25 @IFQName: PerlVariable
2114 wakaba 1.35 @CQName: ManakaiPCVariable
2115     @ETQName: pc|variable
2116 wakaba 1.25
2117     @IFISA: PerlCode
2118 wakaba 1.35 @CISA: ManakaiPCCode
2119 wakaba 1.25
2120 wakaba 1.6 @enDesc:
2121     Unparsed Perl variable.
2122     \
2123     {NOTE:: Future version of the implementation may
2124     support to specify array index or hash key.
2125     \
2126 wakaba 1.36 }
2127 wakaba 1.6
2128 wakaba 1.35 @ATTR:
2129 wakaba 1.6 @@Name: variableType
2130 wakaba 1.35 @@ATTRQName: pc|variableType
2131 wakaba 1.6 @@enDesc:
2132     Perl variable type (<CODE::$>, <CODE::@>, <CODE::%>,
2133     <CODE::&> or empty string).
2134 wakaba 1.35 @@ReflectCDATA:
2135 wakaba 1.6 @@Get:
2136     @@Set:
2137    
2138 wakaba 1.35 @ATTR:
2139 wakaba 1.6 @@Name: packageName
2140 wakaba 1.35 @@ATTRQName: pc|packageName
2141 wakaba 1.6 @@enDesc:
2142     The name of the package to which this variable belongs.
2143 wakaba 1.35 @@ReflectCDATA:
2144 wakaba 1.6 @@Get:
2145     @@@nullCase:
2146     @@@@enDesc:
2147     This package belongs to the current package or
2148     does not belong to any package.
2149     @@Set:
2150     @@@nullCase:
2151     @@@@enDesc:
2152     This package belongs to the current package or
2153     does not belong to any package.
2154    
2155 wakaba 1.35 @ATTR:
2156 wakaba 1.36 @@Name: pcLocalName
2157 wakaba 1.35 @@ATTRQName: pc|localName
2158 wakaba 1.6 @@enDesc:
2159     The local variable name.
2160 wakaba 1.35 @@ReflectCDATA:
2161 wakaba 1.6 @@Get:
2162     @@Set:
2163    
2164 wakaba 1.35 @ATTR:
2165 wakaba 1.6 @@Name: variableScope
2166 wakaba 1.35 @@ATTRQName: pc|variableScope
2167 wakaba 1.6 @@enDesc:
2168     Scope modifier (<CODE::my> or <CODE::our> or <CODE::local>).
2169 wakaba 1.35 @@ReflectCDATA:
2170 wakaba 1.6 @@Get:
2171     @@@nullCase:
2172     @@@@enDesc:
2173     This variable does not have scope modifier.
2174     @@Set:
2175     @@@nullCase:
2176     @@@@enDesc:
2177     This variable does not have scope modifier.
2178    
2179     @ToStringMethod:
2180     @@Return:
2181 wakaba 1.35 @@@Type: DOMString
2182 wakaba 1.6 @@@enDesc:
2183     Perl code.
2184     @@@PerlDef:
2185 wakaba 1.35 __DEEP{
2186     my $t = $self-><AG::PerlVariable.variableScope>;
2187     $r .= $t . ' ' if length $t;
2188     $r .= $self-><AG::PerlVariable.variableType>;
2189     my $v = $self-><AG::PerlVariable.packageName>;
2190     $r .= $v . '::' if length $v;
2191     $r .= $self-><AG::PerlVariable.pcLocalName>;
2192     $v = $self-><AG::PerlVariable.hashKey>;
2193     if ($t eq '$' and length $v) {
2194     $v =~ s/(['\\])/\\$1/g;
2195     $r .= q<{'> . $v . q<'}>;
2196     }
2197     }__;
2198 wakaba 1.6
2199 wakaba 1.35 @ATTR:
2200 wakaba 1.6 @@Name: hashKey
2201 wakaba 1.35 @@ATTRQName: pc|hashKey
2202 wakaba 1.6 @@enDesc:
2203     The key for hash.
2204     \
2205     {NOTE:: Using Perl code for key is not supported in the current
2206     version of the implementation.
2207     \
2208     }
2209 wakaba 1.35 @@ReflectCDATA:
2210 wakaba 1.6 @@Get:
2211     @@@nullCase:
2212     @@@@enDesc:
2213     This variable is not for hash value access.
2214     @@Set:
2215     @@@nullCase:
2216     @@@@enDesc:
2217     This variable is not for hash value access.
2218 wakaba 1.15 ##PerlVariable
2219 wakaba 1.6
2220 wakaba 1.25 IFClsDef:
2221     @IFQName: PerlCodeUnits
2222 wakaba 1.35 @CQName: ManakaiPCCodeUnits
2223 wakaba 1.25
2224 wakaba 1.35 @CISA: ManakaiPCCode
2225 wakaba 1.25
2226 wakaba 1.6 @enDesc:
2227     A base class implemented by both inline container and
2228     block-level container.
2229    
2230     @Attr:
2231     @@Name: length
2232     @@enDesc:
2233     The number of child code fragments.
2234 wakaba 1.35 @@Type: idl|unsignedLong||ManakaiDOM|all
2235 wakaba 1.6 @@Get:
2236     @@@PerlDef:
2237 wakaba 1.35 __DEEP{
2238     $r = @{$self-><AG::Node.childNodes>};
2239     }__;
2240 wakaba 1.6
2241     @Method:
2242     @@Name: appendStringLiteral
2243     @@enDesc:
2244     Appends a Perl string literal (<CODE::q>).
2245     @@Param:
2246     @@@Name: stringArg
2247 wakaba 1.35 @@@Type: DOMString
2248 wakaba 1.6 @@@enDesc:
2249     A string.
2250     @@Return:
2251 wakaba 1.35 @@@Type: PerlStringLiteral
2252 wakaba 1.6 @@@enDesc:
2253     The newly created Perl string literal object.
2254     @@@PerlDef:
2255 wakaba 1.35 __DEEP{
2256     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2257     (<Q::pc:>, 'stringLiteral');
2258     $r-><AS::Node.textContent> ($stringArg);
2259     $self-><M::Node.appendChild> ($r);
2260     }__;
2261 wakaba 1.6
2262     @Method:
2263     @@Name: appendAtom
2264     @@enDesc:
2265     Appends a Perl atomic code fragment.
2266     @@Param:
2267     @@@Name: codeArg
2268 wakaba 1.35 @@@Type: DOMString
2269 wakaba 1.6 @@@enDesc:
2270     An atom.
2271     @@Return:
2272 wakaba 1.35 @@@Type: PerlAtom
2273 wakaba 1.6 @@@enDesc:
2274     The newly created Perl code object.
2275     @@@PerlDef:
2276 wakaba 1.35 __DEEP{
2277     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2278     (<Q::pc:>, 'atom');
2279     $r-><AS::Node.textContent> ($codeArg);
2280     $self-><M::Node.appendChild> ($r);
2281     }__;
2282 wakaba 1.6
2283     @Method:
2284     @@Name: appendBare
2285     @@enDesc:
2286     Appends a Perl bare code fragment.
2287     @@Param:
2288     @@@Name: codeArg
2289 wakaba 1.35 @@@Type: DOMString
2290 wakaba 1.6 @@@enDesc:
2291 wakaba 1.7 An bare code.
2292 wakaba 1.6 @@Return:
2293 wakaba 1.35 @@@Type: PerlBare
2294 wakaba 1.6 @@@enDesc:
2295     The newly created Perl code object.
2296     @@@PerlDef:
2297 wakaba 1.35 __DEEP{
2298     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2299     (<Q::pc:>, 'tokens');
2300     $r-><AS::Node.textContent> ($codeArg);
2301     $self-><M::Node.appendChild> ($r);
2302     }__;
2303 wakaba 1.11
2304     @Method:
2305     @@Name: appendNewAssignment
2306     @@enDesc:
2307     Appends a newly created <Class::ManakaiPerlAssign> object.
2308     @@Param:
2309     @@@Name: leftArg
2310 wakaba 1.35 @@@Type: PerlCode
2311 wakaba 1.11 @@@enDesc:
2312     A left hand side code fragment object.
2313     @@Param:
2314     @@@Name: rightArg
2315 wakaba 1.35 @@@Type: PerlCode
2316 wakaba 1.11 @@@enDesc:
2317     A right hand side code fragment object.
2318     @@Return:
2319 wakaba 1.36 @@@Type: PerlAssignment
2320 wakaba 1.11 @@@RaiseException:
2321     @@@@@:BAD_CHILD_ERR
2322     @@@@enDesc:
2323     An attempt is made to append a child
2324     that is not valid type.
2325     @@@RaiseException:
2326     @@@@@:IN_USE_NODE_ERR
2327     @@@@enDesc:
2328     An attempt is made to append a node that is
2329     already used elsewhere.
2330     @@@PerlDef:
2331 wakaba 1.35 for my $arg ([leftArg => $leftArg], [rightArg => $rightArg]) {
2332     if ({
2333     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
2334     inlineUnparsed => 1, variable => 1, stringLiteral => true,
2335     }->{$arg->[1]-><AG::Node.localName>}) {
2336     if ($arg->[1]-><AG::Node.parentNode>) {
2337     __EXCEPTION{IN_USE_NODE_ERR::
2338     pc:childNode => {$arg->[1]},
2339     MDOMX:param-name => {$arg->[0]},
2340     }__;
2341     }
2342     } else {
2343     __EXCEPTION{BAD_CHILD_ERR::
2344     pc:parentNode => {$self},
2345     pc:childNode => {$arg->[1]},
2346     MDOMX:param-name => {$arg->[0]},
2347     }__;
2348     }
2349     } # left/right
2350    
2351     __DEEP{
2352     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2353     (<Q::pc:>, 'assignment');
2354     $r-><AS::PerlAssignment.leftCode> ($leftArg);
2355     $r-><AS::PerlAssignment.rightCode> ($rightArg);
2356     $self-><M::Node.appendChild> ($r);
2357     }__;
2358     ##PCAssignment
2359 wakaba 1.6
2360 wakaba 1.35 IFClsETDef:
2361 wakaba 1.25 @IFQName: PerlStatement
2362 wakaba 1.35 @CQName: ManakaiPCStatement
2363     @ETQName: pc|statement
2364 wakaba 1.25
2365     @IFISA: PerlCode
2366     @IFISA: PerlCodeInlines
2367 wakaba 1.35 @CISA: ManakaiPCCodeInlines
2368 wakaba 1.25
2369 wakaba 1.8 @enDesc:
2370 wakaba 1.36 Perl statements.
2371 wakaba 1.8
2372     @ToStringMethod:
2373     @@Return:
2374 wakaba 1.35 @@@Type: DOMString
2375 wakaba 1.8 @@@enDesc:
2376     Perl code.
2377     @@@PerlDef:
2378     $r = $self->SUPER::stringify;
2379 wakaba 1.16 $r .= ";\n" if length $r;
2380 wakaba 1.8 ##PerlStatement
2381 wakaba 1.6
2382 wakaba 1.35 IFClsETDef:
2383 wakaba 1.25 @IFQName: PerlCodeInlines
2384 wakaba 1.35 @CQName: ManakaiPCCodeInlines
2385     @ETQName: pc|inlineContainer
2386 wakaba 1.25
2387 wakaba 1.35 @CISA: ManakaiPCCodeUnits
2388 wakaba 1.25
2389 wakaba 1.6 @enDesc:
2390 wakaba 1.36 Unparsed Perl inline code block.
2391 wakaba 1.6
2392     @Method:
2393     @@Name: appendCodeFragment
2394     @@enDesc:
2395 wakaba 1.35 Appends a <IF::PerlCode> object.
2396 wakaba 1.6 @@Param:
2397     @@@Name: codeArg
2398 wakaba 1.25 @@@Type: PerlCode
2399 wakaba 1.6 @@@enDesc:
2400     A code fragment object.
2401     @@Return:
2402     @@@RaiseException:
2403     @@@@@:BAD_CHILD_ERR
2404     @@@@enDesc:
2405     An attempt is made to append a child
2406     that is not a <Class::ManakaiPerlUnparsedCode>.
2407     @@@RaiseException:
2408     @@@@@:IN_USE_NODE_ERR
2409     @@@@enDesc:
2410     An attempt is made to append a node that is
2411     already used elsewhere.
2412     @@@PerlDef:
2413 wakaba 1.35 if ({
2414     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
2415     inlineUnparsed => 1, variable => 1, stringLiteral => true,
2416     }->{$codeArg-><AG::Node.localName>}) {
2417     if ($codeArg-><AG::Node.parentNode>) {
2418     __EXCEPTION{IN_USE_NODE_ERR::
2419     pc:childNode => {$codeArg},
2420     }__;
2421     }
2422     __DEEP{
2423     $self-><AG::Node.ownerDocument>
2424     -><M::Document.adoptNode> ($codeArg);
2425     $self-><M::Node.appendChild> ($codeArg);
2426     }__;
2427     } else {
2428     __EXCEPTION{BAD_CHILD_ERR::
2429     pc:parentNode => {$self},
2430     pc:childNode => {$codeArg},
2431     }__;
2432     }
2433 wakaba 1.6
2434     @Method:
2435     @@Name: appendCode
2436     @@enDesc:
2437     Appends an unparsed Perl code fragment.
2438     @@Param:
2439     @@@Name: codeArg
2440 wakaba 1.35 @@@Type: DOMString
2441 wakaba 1.6 @@@enDesc:
2442     An unparsed Perl code fragment.
2443     @@Return:
2444 wakaba 1.25 @@@Type: PerlInlineUnparsedCode
2445 wakaba 1.6 @@@enDesc:
2446     The newly created Perl code object.
2447     @@@PerlDef:
2448 wakaba 1.35 __DEEP{
2449     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2450     (<Q::pc:>, 'inlineUnparsed');
2451     $r-><AS::Node.textContent> ($codeArg);
2452     $self-><M::Node.appendChild> ($r);
2453     }__;
2454 wakaba 1.6
2455     @ToStringMethod:
2456     @@Return:
2457 wakaba 1.35 @@@Type: DOMString
2458 wakaba 1.6 @@@enDesc:
2459     Perl code.
2460     @@@PerlDef:
2461 wakaba 1.35 __DEEP{
2462     my @child = @{$self-><AG::Node.childNodes>};
2463     for my $child (@child) {
2464     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2465     $child-><AG::Node.localName> eq 'inlineContainer' and
2466     1 == @child) {
2467     $r .= '(' . $child->stringify . ')';
2468     } else {
2469     $r .= $child->stringify;
2470     }
2471     }
2472     }__;
2473     ##PCCodeInlines
2474 wakaba 1.6
2475 wakaba 1.35 IFClsETDef:
2476 wakaba 1.25 @IFQName: PerlBlock
2477 wakaba 1.35 @CQName: ManakaiPCBlock
2478     @ETQName: pc|block
2479 wakaba 1.25
2480     @IFISA: PerlCode
2481     @IFISA: PerlCodeStatements
2482 wakaba 1.35 @CISA: ManakaiPCCodeStatements
2483 wakaba 1.25
2484 wakaba 1.8 @enDesc:
2485 wakaba 1.36 Perl block-level code block.
2486 wakaba 1.8
2487     @ToStringMethod:
2488     @@Return:
2489 wakaba 1.35 @@@Type: DOMString
2490 wakaba 1.8 @@@enDesc:
2491     Perl code.
2492     @@@PerlDef:
2493 wakaba 1.35 my @child = @{$self-><AG::Node.childNodes>};
2494     if (@child == 1 and
2495     $child[0]-><AG::Node.localName> eq 'block') {
2496 wakaba 1.39 $r = "\x0A" . $child[0]->stringify . "\x0A";
2497 wakaba 1.35 } elsif (@child == 1 and
2498     $child[0]-><AG::Node.localName> eq 'unparsed' and
2499     $child[0]-><AG::Node.textContent> =~ /^\s*$/) {
2500     #
2501     } else {
2502 wakaba 1.39 $r = "\x0A";
2503 wakaba 1.35 for my $child (@child) {
2504     if ($child-><AG::Node.localName> eq 'inlineContainer' and
2505     1 == @child) {
2506     $r .= '(' . $child->stringify . ')';
2507     } else {
2508     $r .= $child->stringify;
2509     }
2510     }
2511 wakaba 1.39 $r .= "\x0A";
2512 wakaba 1.35
2513     __DEEP{
2514 wakaba 1.39 if ($self-><AG::Node.ownerDocument>
2515     -><AG::Document.domConfig>
2516     -><M::DOMCore:DOMConfiguration.getParameter>
2517     (<Q::pc:line>)) {
2518     my $file = $self-><AG::PerlCode.fileNode>;
2519     my $sfile = $file ? $file-><AG::PerlFile.sourceFile>
2520     : $self->{<H::mn:node>}->{<H::mn:nodeID>};
2521     $r = sprintf qq<\n{\n#line %d "%s [b] (Chunk #%d)"%s>.
2522     qq<#line 1 "%s [/b] (Chunk #%d)"\n;}\n>,
2523 wakaba 1.35 $self-><AG::PerlCodeStatements.sourceLine> || 1,
2524     $self-><AG::PerlCodeStatements.sourceFile> || $sfile,
2525     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0,
2526     $r,
2527     $sfile,
2528     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0
2529 wakaba 1.39 if 2 < length $r;
2530     }
2531 wakaba 1.35 }__;
2532     }
2533     ##PCBlock
2534 wakaba 1.8
2535 wakaba 1.35 IFClsETDef:
2536 wakaba 1.25 @IFQName: PerlCodeBlocks
2537 wakaba 1.35 @CQName: ManakaiPCCodeBlocks
2538     @ETQName: pc|blockContainer
2539 wakaba 1.25
2540     @IFISA: PerlCodeStatements
2541 wakaba 1.35 @CISA: ManakaiPCCodeStatements
2542 wakaba 1.25
2543 wakaba 1.9 @enDesc:
2544     Perl block-level code container whose content may or may
2545     not semantically be self-contained.
2546    
2547     @ToStringMethod:
2548     @@Return:
2549 wakaba 1.35 @@@Type: DOMString
2550 wakaba 1.9 @@@enDesc:
2551     Perl code.
2552     @@@PerlDef:
2553 wakaba 1.35 my @child = @{$self-><AG::Node.childNodes>};
2554     if (@child == 1 and
2555     {
2556     block => true, blockContainer => true,
2557     }->{$child[0]-><AG::Node.localName>}) {
2558     $r = $child[0]->stringify;
2559     } else {
2560     for my $child (@child) {
2561     if ($child-><AG::Node.localName> eq 'inlineContainer' and
2562     1 == @child) {
2563     $r .= '(' . $child->stringify . ')';
2564     } else {
2565     $r .= $child->stringify;
2566     }
2567     }
2568 wakaba 1.9
2569 wakaba 1.35 __DEEP{
2570 wakaba 1.39 if ($self-><AG::Node.ownerDocument>
2571     -><AG::Document.domConfig>
2572     -><M::DOMCore:DOMConfiguration.getParameter>
2573     (<Q::pc:line>)) {
2574     my $file = $self-><AG::PerlCode.fileNode>;
2575     my $sfile = $file ? $file-><AG::PerlFile.sourceFile>
2576     : $self->{<H::mn:node>}->{<H::mn:nodeID>};
2577     $r = sprintf qq<\n#line %d "%s [bc] (Chunk #%d)"\n%s>.
2578     qq<\n#line 1 "%s [/bc] (Chunk #%d)"\n>,
2579 wakaba 1.35 $self-><AG::PerlCodeStatements.sourceLine> || 1,
2580     $self-><AG::PerlCodeStatements.sourceFile> || $sfile,
2581     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0,
2582     $r,
2583     $sfile,
2584     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0;
2585 wakaba 1.39 }
2586 wakaba 1.35 }__;
2587     }
2588     ##PCCodeBlocks
2589    
2590     IFClsETDef:
2591 wakaba 1.25 @IFQName: PerlAssignment
2592 wakaba 1.35 @CQName: ManakaiPCAssignment
2593     @ETQName: pc|assignment
2594 wakaba 1.25
2595     @IFISA: PerlCode
2596 wakaba 1.35 @CISA: ManakaiPCCode
2597 wakaba 1.25
2598 wakaba 1.11 @enDesc:
2599 wakaba 1.36 Perl variable assignment.
2600 wakaba 1.11
2601     @ToStringMethod:
2602     @@Return:
2603 wakaba 1.35 @@@Type: DOMString
2604 wakaba 1.11 @@@enDesc:
2605     Perl code.
2606     @@@PerlDef:
2607 wakaba 1.35 __DEEP{
2608     $r = $self-><AG::PerlAssignment.leftCode>->stringify
2609     . ' = '
2610     . $self-><AG::PerlAssignment.rightCode>->stringify;
2611     }__;
2612    
2613     @Attr:
2614     @@Name: leftCode
2615     @@enDesc:
2616     Left-hand expression.
2617     @@Type: PerlCodeInlines
2618     @@Get:
2619     @@@nullCase:
2620     @@@@enDesc: Left-hand code not yet specified.
2621     @@@PerlDef:
2622     __DEEP{
2623     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2624     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2625     $child-><AG::Node.localName> eq 'left') {
2626     $r = $child-><AG::Node.lastChild>;
2627     last F;
2628     }
2629     }
2630     }__;
2631     @@Set:
2632     @@@PerlDef:
2633     __DEEP{
2634     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2635     F: {
2636     for my $child (@{$self-><AG::Node.childNodes>}) {
2637     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2638     $child-><AG::Node.localName> eq 'left') {
2639     $child-><AS::Node.textContent> ('');
2640     $child-><M::Node.appendChild> ($given);
2641     last F;
2642     }
2643     }
2644     my $node = $self-><AG::Node.ownerDocument>
2645     -><M::Document.createElementNS>
2646     (<Q::pc:>, 'left');
2647     $node-><M::Node.appendChild> ($given);
2648     $self-><M::Node.appendChild> ($node);
2649     }
2650     }__;
2651    
2652     @Attr:
2653     @@Name: rightCode
2654     @@enDesc:
2655     Right-hand expression.
2656     @@Type: PerlCodeInlines
2657     @@Get:
2658     @@@nullCase:
2659     @@@@enDesc: Right-hand code not yet specified.
2660     @@@PerlDef:
2661     __DEEP{
2662     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2663     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2664     $child-><AG::Node.localName> eq 'right') {
2665     $r = $child-><AG::Node.lastChild>;
2666     last F;
2667     }
2668     }
2669     }__;
2670     @@Set:
2671     @@@PerlDef:
2672     __DEEP{
2673     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2674     F: {
2675     for my $child (@{$self-><AG::Node.childNodes>}) {
2676     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2677     $child-><AG::Node.localName> eq 'right') {
2678     $child-><AS::Node.textContent> ('');
2679     $child-><M::Node.appendChild> ($given);
2680     last F;
2681     }
2682     }
2683     my $node = $self-><AG::Node.ownerDocument>
2684     -><M::Document.createElementNS>
2685     (<Q::pc:>, 'right');
2686     $node-><M::Node.appendChild> ($given);
2687     $self-><M::Node.appendChild> ($node);
2688     }
2689     }__;
2690 wakaba 1.11 ##PerlAssignment
2691    
2692 wakaba 1.35 IFClsETDef:
2693 wakaba 1.26 @IFQName: PerlIf
2694 wakaba 1.35 @CQName: ManakaiPCIf
2695     @ETQName: pc|if
2696 wakaba 1.25
2697     @IFISA: PerlCode
2698 wakaba 1.35 @CISA: ManakaiPCCode
2699 wakaba 1.25
2700 wakaba 1.12 @enDesc:
2701     Perl variable assignment.
2702    
2703     @ToStringMethod:
2704     @@Return:
2705 wakaba 1.35 @@@Type: DOMString
2706 wakaba 1.12 @@@enDesc:
2707     Perl code.
2708     @@@PerlDef:
2709 wakaba 1.35 __DEEP{
2710     my $tcode = $self-><AG::PerlIf.trueCode>;
2711     my $fcode = $self-><AG::PerlIf.falseCode>;
2712     my $ccode = $self-><AG::PerlIf.condition>;
2713     if (defined $tcode) {
2714     if (defined $fcode) {
2715     $r = q<if (> . $ccode->stringify . q<) {> . $tcode->stringify .
2716     q<} else {> . $fcode->stringify . qq<}\n>;
2717     } else {
2718 wakaba 1.36 $r = q<if (> . $ccode->stringify . q<) {> . $tcode->stringify .
2719 wakaba 1.35 qq<}\n>;
2720     }
2721     } else {
2722     $r = q<unless (> . $ccode->stringify . q<) {> . $fcode->stringify .
2723     qq<}\n>;
2724     }
2725     }__;
2726    
2727     @Attr:
2728     @@Name: condition
2729     @@enDesc:
2730     Condition expression.
2731     @@Type: PerlCodeInlines
2732     @@Get:
2733     @@@nullCase:
2734     @@@@enDesc: Condition code not yet specified.
2735     @@@PerlDef:
2736     __DEEP{
2737     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2738     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2739     $child-><AG::Node.localName> eq 'condition') {
2740     $r = $child-><AG::Node.lastChild>;
2741     last F;
2742     }
2743     }
2744     }__;
2745     @@Set:
2746     @@@PerlDef:
2747     __DEEP{
2748     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2749     F: {
2750     for my $child (@{$self-><AG::Node.childNodes>}) {
2751     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2752     $child-><AG::Node.localName> eq 'condition') {
2753     $child-><AS::Node.textContent> ('');
2754     $child-><M::Node.appendChild> ($given);
2755     last F;
2756     }
2757     }
2758     my $node = $self-><AG::Node.ownerDocument>
2759     -><M::Document.createElementNS>
2760     (<Q::pc:>, 'condition');
2761     $node-><M::Node.appendChild> ($given);
2762     $self-><M::Node.appendChild> ($node);
2763     }
2764     }__;
2765    
2766     @Attr:
2767     @@Name: trueCode
2768     @@enDesc:
2769     True-case code.
2770     @@Type: PerlCodeBlocks
2771     @@Get:
2772     @@@nullCase:
2773     @@@@enDesc: True-case code not yet specified.
2774     @@@PerlDef:
2775     __DEEP{
2776     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2777     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2778     $child-><AG::Node.localName> eq 'tr'.'ue') {
2779     $r = $child-><AG::Node.lastChild>;
2780     last F;
2781     }
2782     }
2783     }__;
2784     @@Set:
2785     @@@PerlDef:
2786     __DEEP{
2787     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2788     F: {
2789     for my $child (@{$self-><AG::Node.childNodes>}) {
2790     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2791     $child-><AG::Node.localName> eq 'tr'.'ue') {
2792     $child-><AS::Node.textContent> ('');
2793     $child-><M::Node.appendChild> ($given);
2794     last F;
2795     }
2796     }
2797     my $node = $self-><AG::Node.ownerDocument>
2798     -><M::Document.createElementNS>
2799     (<Q::pc:>, 'tr'.'ue');
2800     $node-><M::Node.appendChild> ($given);
2801     $self-><M::Node.appendChild> ($node);
2802     }
2803     }__;
2804    
2805     @Attr:
2806     @@Name: falseCode
2807     @@enDesc:
2808     False-case code.
2809     @@Type: PerlCodeBlocks
2810     @@Get:
2811     @@@nullCase:
2812     @@@@enDesc: True-case code not yet specified.
2813     @@@PerlDef:
2814     __DEEP{
2815     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2816     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2817     $child-><AG::Node.localName> eq 'fal'.'se') {
2818     $r = $child-><AG::Node.lastChild>;
2819     last F;
2820     }
2821     }
2822     }__;
2823     @@Set:
2824     @@@PerlDef:
2825     __DEEP{
2826     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2827     F: {
2828     for my $child (@{$self-><AG::Node.childNodes>}) {
2829     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2830     $child-><AG::Node.localName> eq 'fal'.'se') {
2831     $child-><AS::Node.textContent> ('');
2832     $child-><M::Node.appendChild> ($given);
2833     last F;
2834     }
2835     }
2836     my $node = $self-><AG::Node.ownerDocument>
2837     -><M::Document.createElementNS>
2838     (<Q::pc:>, 'fal'.'se');
2839     $node-><M::Node.appendChild> ($given);
2840     $self-><M::Node.appendChild> ($node);
2841     }
2842     }__;
2843 wakaba 1.12 ##PerlIf
2844    
2845     PropDef:
2846     @QName:condition
2847     @enDesc:
2848     Condition.
2849     PropDef:
2850     @QName:true
2851     @enDesc:
2852     If true.
2853     PropDef:
2854     @QName:false
2855     @enDesc:
2856     If false.
2857    
2858 wakaba 1.11 PropDef:
2859     @QName:left
2860     @FullName:
2861     @@lang:en
2862     @@@: Left hand side
2863     PropDef:
2864     @QName:right
2865     @FullName:
2866     @@lang:en
2867     @@@: Right hand side
2868    
2869 wakaba 1.8 PropDef:
2870     @QName:label
2871     @enDesc:
2872     Perl statement / block label.
2873    
2874 wakaba 1.6 ElementTypeBinding:
2875     @Name: RaiseException
2876     @ElementType:
2877 wakaba 1.39 dx:raises
2878    
2879     ## -- Configuration Parameters
2880    
2881     boolCParam:
2882     @QName: pc|line
2883     @nodeProp: pcline
2884     @IsSupportRequired:1
2885     @DOMCore:targetType: DOMCore|Document
2886     @TrueCase:
2887     @@DOMCore:isSupported:1
2888     @@enDesc:
2889     Inserts <Perl::#line> directives.
2890     @FalseCase:
2891     @@DOMCore:isSupported:1
2892     @@IsSupportRequired:1
2893     @@IsDefault:1
2894     Does not insert any <Perl::#line> directive.
2895    
2896     CParam:
2897     @QName: pc|split-resolver
2898     @nodeProp: pcsres
2899     @IsSupportRequired:1
2900     @DOMCore:targetType: DOMCore|Document
2901     @Type: DISPerl|CODE||ManakaiDOM|all
2902     @enDesc:
2903     Splits module file. The parameter value <kwd:MUST> be
2904     a Perl code reference. The serializer would invoke
2905     the code with arguments: a reserved parameter, a <IF::PerlFile>
2906     whose serialization is being split, and a string
2907     that identifies the split part. The code is expected
2908     to return a <IF::DOMLS:LSOutput> object to which the module part
2909     is written. Note that splitting serialized module file
2910     does not affect to the <IF::PerlFile> tree.
2911     @nullCase:
2912     @@enDesc:
2913     Does not split module file.
2914    
2915     ElementTypeBinding:
2916     @Name: nodeProp
2917     @ElementType:
2918     DOMCore:nodeProp
2919     @ShadowContent:
2920     @@For: =ManakaiDOM|all
2921    
2922     ElementTypeBinding:
2923     @Name: CParam
2924     @ElementType:
2925     dis:ResourceDef
2926     @ShadowContent:
2927     @@rdf:type:
2928     @@@@: DOMCore|DOMConfigurationParameter
2929     @@@For: ManakaiDOM|DOM
2930     @@rdf:type:
2931     @@@@: DISCore|Property
2932     @@@For: =ManakaiDOM|all
2933     @@For: ManakaiDOM|DOM3
2934     @@For: =ManakaiDOM|all
2935    
2936     ElementTypeBinding:
2937     @Name: boolCParam
2938     @ElementType:
2939     dis:ResourceDef
2940     @ShadowContent:
2941     @@rdf:type:
2942     @@@@: DOMCore|DOMConfigurationParameter
2943     @@@For: ManakaiDOM|DOM
2944     @@rdf:type:
2945     @@@@: DISCore|Property
2946     @@@For: =ManakaiDOM|all
2947     @@For: ManakaiDOM|DOM3
2948     @@For: =ManakaiDOM|all
2949     @@Type: idl|boolean||ManakaiDOM|all
2950    
2951     ## -- Implementation
2952 wakaba 1.6
2953 wakaba 1.25 IFClsDef:
2954     @IFQName: PCImplementation
2955 wakaba 1.35 @CQName: ManakaiPCImplementation
2956 wakaba 1.25
2957 wakaba 1.1 @enDesc:
2958     The class that provides factory methods.
2959 wakaba 1.20
2960 wakaba 1.35 @CISA: DOMCore|ManakaiDOMImplementation||ManakaiDOM|ManakaiDOMLatest
2961     @CISA: dx|ManakaiDefaultExceptionHandler||ManakaiDOM|Perl
2962 wakaba 1.17
2963 wakaba 1.35 @f:provides: pc|CoreFeature10
2964 wakaba 1.1
2965     @Method:
2966     @@Name: createPerlFile
2967     @@enDesc:
2968     Creates a Perl code file.
2969     @@Return:
2970 wakaba 1.25 @@@Type: PerlFile
2971 wakaba 1.1 @@@enDesc: A newly created Perl source file object.
2972     @@@PerlDef:
2973 wakaba 1.35 __DEEP{
2974     $r = $self-><M::DOMImpl.createDocument> (<Q::pc:>, 'file')
2975     -><AG::Document.documentElement>;
2976     }__;
2977 wakaba 1.1
2978 wakaba 1.13 @Method:
2979     @@Name: createPerlPackage
2980     @@enDesc:
2981     Creates a new package scope block.
2982     @@Param:
2983     @@@Name: packageName
2984 wakaba 1.35 @@@Type: DOMString
2985 wakaba 1.13 @@@enDesc:
2986     The fully-qualified name of the package to create.
2987     @@Return:
2988 wakaba 1.25 @@@Type: PerlPackage
2989 wakaba 1.13 @@@enDesc:
2990     The newly created package scope object.
2991     @@@PerlDef:
2992 wakaba 1.35 __DEEP{
2993     $r = $self-><M::DOMImpl.createDocument>
2994     -><M::Document.createElementNS> (<Q::pc:>, 'package');
2995     $r-><AS::PerlPackage.packageName> ($packageName);
2996     }__;
2997 wakaba 1.13
2998 wakaba 1.1 @IntMethod:
2999 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3000 wakaba 1.1 @@Name: perlComment
3001     @@ManakaiDOM:isStatic:1
3002     @@enDesc:
3003     Generates a Perl comment string.
3004     @@Param:
3005     @@@Name: str
3006 wakaba 1.35 @@@Type: DOMString
3007 wakaba 1.1 @@@enDesc:
3008     A comment text.
3009     @@Return:
3010 wakaba 1.35 @@@Type: DOMString
3011 wakaba 1.1 @@@enDesc:
3012     A Perl comment string.
3013     @@@PerlDef:
3014     $r = $str;
3015     $r =~ s/\n/\n## /g;
3016     $r =~ s/\n## $/\n/s;
3017     $r .= "\n" unless $r =~ /\n$/;
3018     $r = q<## > . $r;
3019    
3020     @IntMethod:
3021 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3022 wakaba 1.1 @@Name: rfc3339DateTime
3023     @@ManakaiDOM:isStatic:1
3024     @@enDesc:
3025     Returns RFC 3339 <CODE::date-time> representation of a date.
3026     @@Param:
3027     @@@Name: perlDate
3028 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
3029 wakaba 1.1 @@@enDesc:
3030     A Perl representation of date.
3031     @@Return:
3032 wakaba 1.35 @@@Type: DOMString
3033 wakaba 1.1 @@@enDesc:
3034     RFC 3339 date string.
3035     @@@PerlDef:
3036     my @time = gmtime $perlDate;
3037     $r = sprintf q<%04d-%02d-%02dT%02d:%02d:%02d+00:00>,
3038     $time[5] + 1900, $time[4] + 1, @time[3,2,1,0];
3039    
3040     @IntMethod:
3041 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3042 wakaba 1.1 @@Name: versionDateTime
3043     @@ManakaiDOM:isStatic:1
3044     @@enDesc:
3045     Returns date for version.
3046     @@Param:
3047     @@@Name: perlDate
3048 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
3049 wakaba 1.1 @@@enDesc:
3050     A Perl representation of date.
3051     @@Return:
3052 wakaba 1.35 @@@Type: DOMString
3053 wakaba 1.1 @@@enDesc:
3054     A Perl number literal.
3055     @@@PerlDef:
3056     my @time = gmtime $perlDate;
3057     $r = sprintf q<%04d%02d%02d.%02d%02d>,
3058     $time[5] + 1900, $time[4] + 1, @time[3,2,1];
3059    
3060     @Method:
3061     @@Name: perlLiteral
3062     @@enDesc:
3063     Perl code representation.
3064     @@Param:
3065     @@@Name: val
3066 wakaba 1.35 @@@Type: DISPerl|Any||ManakaiDOM|all
3067 wakaba 1.1 @@@enDesc:
3068     A Perl value.
3069     @@Return:
3070 wakaba 1.35 @@@Type: DOMString
3071 wakaba 1.1 @@@enDesc:
3072     A Perl lexical representation of <P::val>.
3073     @@@PerlDef:
3074     unless (defined $val) {
3075     $r = q<undef>;
3076     } elsif (ref $val eq 'ARRAY') {
3077     __DEEP{
3078 wakaba 1.36 $r = q<[> . <ClassM::ManakaiPCImplementation
3079 wakaba 1.14 .perlList> ($val) . q<]>;
3080 wakaba 1.1 }__;
3081     } elsif (ref $val eq 'HASH') {
3082     __DEEP{
3083 wakaba 1.31 $r = q<{>
3084 wakaba 1.36 . <ClassM::ManakaiPCImplementation.perlList>
3085 wakaba 1.31 ([map {$_ => $val->{$_}} sort {$a cmp $b} keys %$val])
3086     . q<}>;
3087 wakaba 1.1 }__;
3088 wakaba 1.38 } elsif (ref $val eq 'manakai::code') {
3089     $r = $$val;
3090 wakaba 1.1 } else {
3091     $val =~ s/(['\\])/\\$1/g;
3092     $r = q<'> . $val . q<'>;
3093     }
3094    
3095     @Method:
3096     @@Name: perlList
3097     @@enDesc:
3098     Perl code representation of a list.
3099     @@Param:
3100     @@@Name: val
3101 wakaba 1.35 @@@Type: DISPerl|ARRAY||ManakaiDOM|all
3102 wakaba 1.1 @@@enDesc:
3103     A Perl array reference.
3104     @@Return:
3105 wakaba 1.35 @@@Type: DOMString
3106 wakaba 1.1 @@@enDesc:
3107     A Perl lexical representation of <CODE::@$val>.
3108     @@@PerlDef:
3109     __DEEP{
3110 wakaba 1.36 $r = join (q<, >, map {<ClassM::ManakaiPCImplementation
3111 wakaba 1.1 .perlLiteral> ($_)} @{$val});
3112     }__;
3113 wakaba 1.5
3114     @Method:
3115     @@Name: createPerlSub
3116     @@enDesc:
3117 wakaba 1.35 Creates a new <IF::PerlSub> object.
3118 wakaba 1.5 @@Param:
3119     @@@Name: subName
3120 wakaba 1.35 @@@Type: DOMString
3121 wakaba 1.5 @@@enDesc:
3122     The name of the subroutine to create.
3123     @@@nullCase:
3124     @@@@enDesc:
3125     The subroutine created has no name.
3126     @@Return:
3127 wakaba 1.25 @@@Type: PerlSub
3128 wakaba 1.5 @@@enDesc:
3129     Newly created Perl subroutine object.
3130     @@@PerlDef:
3131 wakaba 1.35 __DEEP{
3132     $r = $self-><M::DOMImpl.createDocument>
3133     -><M::Document.createElementNS> (<Q::pc:>, 'sub');
3134     $r-><M::PerlSub.addPerlName> ($subName) if defined $subName;
3135     }__;
3136 wakaba 1.5
3137     @Method:
3138     @@Name: createPerlUnparsedCode
3139     @@enDesc:
3140     Creates a new <Class::ManakaiPerlUnparsedCode> object.
3141     @@Param:
3142     @@@Name: codeArg
3143 wakaba 1.35 @@@Type: DOMString
3144 wakaba 1.5 @@@enDesc:
3145     The code fragment.
3146     @@@nullCase:
3147     @@@@enDesc:
3148     The fragment initially has no code.
3149     @@Return:
3150 wakaba 1.25 @@@Type: PerlUnparsedCode
3151 wakaba 1.5 @@@enDesc:
3152     Newly created Perl code object.
3153     @@@PerlDef:
3154 wakaba 1.35 __DEEP{
3155     $r = $self-><M::DOMImpl.createDocument>
3156     -><M::Document.createElementNS> (<Q::pc:>, 'unparsed');
3157     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3158     }__;
3159 wakaba 1.6
3160     @Method:
3161     @@Name: createPerlInlineContainer
3162     @@enDesc:
3163 wakaba 1.35 Creates a new <IF::PerlInlineContainer> object.
3164 wakaba 1.6 @@Return:
3165 wakaba 1.25 @@@Type: PerlCodeInlines
3166 wakaba 1.6 @@@enDesc:
3167     Newly created Perl code object.
3168     @@@PerlDef:
3169 wakaba 1.35 __DEEP{
3170     $r = $self-><M::DOMImpl.createDocument>
3171     -><M::Document.createElementNS> (<Q::pc:>, 'inlineContainer');
3172     }__;
3173 wakaba 1.6
3174     @Method:
3175     @@Name: createPerlInlineUnparsedCode
3176     @@enDesc:
3177 wakaba 1.35 Creates a new <IF::PerlInlineUnparsedCode> object.
3178 wakaba 1.6 @@Param:
3179     @@@Name: codeArg
3180 wakaba 1.35 @@@Type: DOMString
3181 wakaba 1.6 @@@enDesc:
3182     The code fragment.
3183     @@@nullCase:
3184     @@@@enDesc:
3185     The fragment initially has no code.
3186     @@Return:
3187 wakaba 1.25 @@@Type: PerlInlineUnparsedCode
3188 wakaba 1.6 @@@enDesc:
3189     Newly created Perl code object.
3190     @@@PerlDef:
3191 wakaba 1.35 __DEEP{
3192     $r = $self-><M::DOMImpl.createDocument>
3193     -><M::Document.createElementNS> (<Q::pc:>, 'inlineUnparsed');
3194     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3195     }__;
3196 wakaba 1.6
3197     @Method:
3198     @@Name: createPerlBare
3199     @@enDesc:
3200 wakaba 1.35 Creates a new <IF::PerlTokens> object.
3201 wakaba 1.6 @@Param:
3202     @@@Name: codeArg
3203 wakaba 1.35 @@@Type: DOMString
3204 wakaba 1.6 @@@enDesc:
3205     The code fragment.
3206     @@Return:
3207 wakaba 1.25 @@@Type: PerlTokens
3208 wakaba 1.6 @@@enDesc:
3209     Newly created Perl code object.
3210     @@@PerlDef:
3211 wakaba 1.35 __DEEP{
3212     $r = $self-><M::DOMImpl.createDocument>
3213     -><M::Document.createElementNS> (<Q::pc:>, 'tokens');
3214     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3215     }__;
3216 wakaba 1.6
3217     @Method:
3218     @@Name: createPerlAtom
3219     @@enDesc:
3220 wakaba 1.35 Creates a new <IF::PerlAtom> object.
3221 wakaba 1.6 @@Param:
3222     @@@Name: codeArg
3223 wakaba 1.35 @@@Type: DOMString
3224 wakaba 1.6 @@@enDesc:
3225     The code fragment.
3226     @@Return:
3227 wakaba 1.25 @@@Type: PerlAtom
3228 wakaba 1.6 @@@enDesc:
3229     Newly created Perl code object.
3230     @@@PerlDef:
3231 wakaba 1.35 __DEEP{
3232     $r = $self-><M::DOMImpl.createDocument>
3233     -><M::Document.createElementNS> (<Q::pc:>, 'atom');
3234     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3235     }__;
3236 wakaba 1.6
3237     @Method:
3238     @@Name: createPerlStringLiteral
3239     @@enDesc:
3240 wakaba 1.35 Creates a new <IF::PerlStringLiteral> object.
3241 wakaba 1.6 @@Param:
3242     @@@Name: stringArg
3243 wakaba 1.35 @@@Type: DOMString
3244 wakaba 1.6 @@@enDesc: A string.
3245     @@Return:
3246 wakaba 1.25 @@@Type: PerlStringLiteral
3247 wakaba 1.6 @@@enDesc:
3248     Newly created Perl code object.
3249     @@@PerlDef:
3250 wakaba 1.35 __DEEP{
3251     $r = $self-><M::DOMImpl.createDocument>
3252     -><M::Document.createElementNS> (<Q::pc:>, 'stringLiteral');
3253     $r-><AS::Node.textContent> ($stringArg);
3254     }__;
3255 wakaba 1.6
3256     @Method:
3257     @@Name: createPerlVariable
3258     @@enDesc:
3259 wakaba 1.35 Creates a new <IF::PerlVariable> object.
3260 wakaba 1.6 @@Param:
3261     @@@Name: variableType
3262 wakaba 1.35 @@@Type: DOMString
3263 wakaba 1.6 @@@enDesc:
3264     Variable prefix.
3265 wakaba 1.16 @@@nullCase:
3266     @@@@enDesc:
3267     If the <P::packageName> is <DOM::null>, then
3268     the <P::variableType> is detected by the prefix of
3269     <P::localName>. Otherwise, it is an unprefixed variable
3270     such as file handle.
3271 wakaba 1.6 @@Param:
3272     @@@Name: packageName
3273 wakaba 1.35 @@@Type: DOMString
3274 wakaba 1.6 @@@enDesc:
3275     Package name.
3276     @@@nullCase:
3277     @@@@enDesc:
3278     The variable belongs to the current package or a
3279     lexical-scoped variable.
3280     @@Param:
3281     @@@Name: localName
3282 wakaba 1.35 @@@Type: DOMString
3283 wakaba 1.6 @@@enDesc:
3284 wakaba 1.16 Variable name. If both <P::variableType> and <P::packageName>
3285     is <DOM::null>, the <P::localName> value may be prefixed
3286     by any possible <P::variableType> value.
3287 wakaba 1.6 @@Return:
3288 wakaba 1.25 @@@Type: PerlVariable
3289 wakaba 1.6 @@@enDesc:
3290     Newly created Perl variable object.
3291     @@@PerlDef:
3292 wakaba 1.35 __DEEP{
3293     $r = $self-><M::DOMImpl.createDocument>
3294     -><M::Document.createElementNS> (<Q::pc:>, 'variable');
3295     if (not $variableType and not $packageName and
3296     $localName =~ s/^(\\?[\$\@%&*])//) {
3297     $variableType = $1;
3298     }
3299     $r-><AS::PerlVariable.variableType> ($variableType)
3300     if defined $variableType;
3301     $r-><AS::PerlVariable.packageName> ($packageName)
3302     if defined $packageName;
3303     $r-><AS::PerlVariable.pcLocalName> ($localName);
3304     }__;
3305 wakaba 1.8
3306     @Method:
3307     @@Name: createPerlBlock
3308     @@enDesc:
3309 wakaba 1.35 Creates a new <IF::PerlBlock> object.
3310 wakaba 1.8 @@Return:
3311 wakaba 1.25 @@@Type: PerlBlock
3312 wakaba 1.8 @@@enDesc:
3313     Newly created Perl code object.
3314     @@@PerlDef:
3315 wakaba 1.35 __DEEP{
3316     $r = $self-><M::DOMImpl.createDocument>
3317     -><M::Document.createElementNS> (<Q::pc:>, 'block');
3318     }__;
3319 wakaba 1.9
3320     @Method:
3321     @@Name: createPerlBlockContainer
3322     @@enDesc:
3323     Creates a new <Class::ManakaiPerlBlockContainer> object.
3324     @@Return:
3325 wakaba 1.25 @@@Type: PerlCodeBlocks
3326 wakaba 1.9 @@@enDesc:
3327     Newly created Perl code object.
3328     @@@PerlDef:
3329 wakaba 1.35 __DEEP{
3330     $r = $self-><M::DOMImpl.createDocument>
3331     -><M::Document.createElementNS> (<Q::pc:>, 'blockContainer');
3332     }__;
3333 wakaba 1.11
3334     @Method:
3335     @@Name: createPerlStatement
3336     @@enDesc:
3337     Creates a new Perl statement.
3338     @@Param:
3339     @@@Name: codeArg
3340 wakaba 1.35 @@@Type: DOMString
3341 wakaba 1.11 @@@enDesc:
3342     A Perl statement without terminating <Perl::;>.
3343     @@@nullCase:
3344     @@@@enDesc:
3345     No initial content.
3346     @@Return:
3347 wakaba 1.25 @@@Type: PerlStatement
3348 wakaba 1.11 @@@enDesc:
3349     The newly created Perl code object.
3350     @@@PerlDef:
3351 wakaba 1.35 __DEEP{
3352     $r = $self-><M::DOMImpl.createDocument>
3353     -><M::Document.createElementNS> (<Q::pc:>, 'statement');
3354     if (defined $codeArg) {
3355     $r-><M::PerlCodeUnits.appendBare> ($codeArg);
3356     }
3357     }__;
3358 wakaba 1.12
3359     @Method:
3360     @@Name: createPerlIf
3361     @@enDesc:
3362 wakaba 1.35 Creates a <IF::PerlIf> object.
3363 wakaba 1.12 @@Param:
3364     @@@Name: conditionArg
3365 wakaba 1.35 @@@Type: PerlCodeInlines
3366 wakaba 1.12 @@@enDesc:
3367     Conditoon code fragment object.
3368     @@Param:
3369     @@@Name: trueArg
3370 wakaba 1.35 @@@Type: PerlCodeBlocks
3371 wakaba 1.12 @@@enDesc:
3372     A true code fragment object.
3373     @@@nullCase:
3374     @@@@enDesc: No true code.
3375     @@Param:
3376     @@@Name: falseArg
3377 wakaba 1.35 @@@Type: PerlCodeBlocks
3378 wakaba 1.12 @@@enDesc:
3379     A false code fragment object.
3380     @@@nullCase:
3381     @@@@enDesc: No false code.
3382     @@Return:
3383 wakaba 1.25 @@@Type: PerlIf
3384 wakaba 1.12 @@@RaiseException:
3385     @@@@@:BAD_CHILD_ERR
3386     @@@@enDesc:
3387     An attempt is made to append a child
3388     that is not valid type.
3389     @@@RaiseException:
3390     @@@@@:IN_USE_NODE_ERR
3391     @@@@enDesc:
3392     An attempt is made to append a node that is
3393     already used elsewhere.
3394     @@@PerlDef:
3395 wakaba 1.35 for my $arg ([conditionArg => $conditionArg]) {
3396     if ({
3397     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
3398     inlineUnparsed => 1, variable => 1, stringLiteral => true,
3399     }->{$arg->[1]-><AG::Node.localName>}) {
3400     if ($arg->[1]-><AG::Node.parentNode>) {
3401     __EXCEPTION{IN_USE_NODE_ERR::
3402     pc:childNode => {$arg->[1]},
3403     MDOMX:param-name => {$arg->[0]},
3404     }__;
3405     }
3406     } else {
3407     __EXCEPTION{BAD_CHILD_ERR::
3408     pc:parentNode => {$self},
3409     pc:childNode => {$arg->[1]},
3410     MDOMX:param-name => {$arg->[0]},
3411     }__;
3412     }
3413     } # c
3414    
3415     for my $arg ([trueArg => $trueArg],
3416     [falseArg => $falseArg]) {
3417     next unless $arg->[1];
3418     if ({
3419     blockContainer => true,
3420     }->{$arg->[1]-><AG::Node.localName>}) {
3421     if ($arg->[1]-><AG::Node.parentNode>) {
3422     __EXCEPTION{IN_USE_NODE_ERR::
3423     pc:childNode => {$arg->[1]},
3424     MDOMX:param-name => {$arg->[0]},
3425     }__;
3426     }
3427     } else {
3428     __EXCEPTION{BAD_CHILD_ERR::
3429     pc:parentNode => {$self},
3430     pc:childNode => {$arg->[1]},
3431     MDOMX:param-name => {$arg->[0]},
3432     }__;
3433     }
3434     } # t/f
3435    
3436     __DEEP{
3437     $r = $self-><M::DOMImpl.createDocument>
3438     -><M::Document.createElementNS>
3439     (<Q::pc:>, 'if');
3440     $r-><AS::PerlIf.condition> ($conditionArg) if $conditionArg;
3441     $r-><AS::PerlIf.trueCode> ($trueArg) if $trueArg;
3442     $r-><AS::PerlIf.falseCode> ($falseArg) if $falseArg;
3443     }__;
3444 wakaba 1.25 ##PCImplementation
3445 wakaba 1.1
3446 wakaba 1.5 ResourceDef:
3447 wakaba 1.35 @QName: DOMImpl
3448     @AliasFor: DOMCore|DOMImplementation
3449     @For: ManakaiDOM|DOM
3450    
3451     ResourceDef:
3452     @QName: Node
3453     @AliasFor: DOMCore|Node
3454     @For: ManakaiDOM|DOM
3455    
3456     ResourceDef:
3457     @QName: Element
3458     @AliasFor: DOMCore|Element
3459     @For: ManakaiDOM|DOM
3460    
3461     ResourceDef:
3462     @QName: Document
3463     @AliasFor: DOMCore|Document
3464     @For: ManakaiDOM|DOM
3465    
3466 wakaba 1.4 ## -- Exceptions
3467    
3468 wakaba 1.25 ResourceDef:
3469     @rdf:type:
3470     @@@: dis|MultipleResource
3471     @@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
3472     @resourceFor: ManakaiDOM|ForIF
3473     @resourceFor: ManakaiDOM|ForClass
3474    
3475     @For: ManakaiDOM|Perl
3476    
3477     @rdf:type:
3478 wakaba 1.33 @@@: dx|Interface
3479 wakaba 1.25 @@ForCheck: ManakaiDOM|ForIF
3480    
3481     @rdf:type:
3482 wakaba 1.33 @@@: dx|Class
3483 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3484    
3485     @Implement:
3486 wakaba 1.35 @@@: ||ManakaiDOM|ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF
3487     @@ContentType: DISCore|TFPQNames
3488     @@ForCheck: ManakaiDOM|ForClass
3489     @Implement:
3490     @@@: ||ManakaiDOM|ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF
3491 wakaba 1.25 @@ContentType: DISCore|TFPQNames
3492     @@ForCheck: ManakaiDOM|ForClass
3493 wakaba 1.35 @dx:implementedBy: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForClass
3494 wakaba 1.25
3495 wakaba 1.35 @f:implements: pc|CoreFeature10
3496 wakaba 1.25
3497     @ISA:
3498 wakaba 1.33 @@@: dx|Exception||ManakaiDOM|Perl
3499 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3500    
3501     @IFQName: PCException
3502 wakaba 1.35 @QName:
3503     @@@: ManakaiPCException
3504     @@ForCheck: ManakaiDOM|ForClass
3505 wakaba 1.25
3506 wakaba 1.4 @enDesc:
3507 wakaba 1.25 Exceptions for the <Module::Util:PerlCode> module.
3508    
3509     @ResourceDef:
3510 wakaba 1.33 @@ForCheck: ManakaiDOM|ForIF
3511     @@rdf:type: DISLang|ConstGroup
3512 wakaba 1.25
3513     @@IFQName: PCExceptionCode
3514    
3515 wakaba 1.4 @@enDesc:
3516 wakaba 1.25 Exception codes for <IF::PCException>.
3517    
3518 wakaba 1.33 @@Type: idl|unsignedShort||ManakaiDOM|all
3519     @@rdfs:subClassOf: idl|unsignedShort||ManakaiDOM|all
3520 wakaba 1.25
3521 wakaba 1.5 @@XConstDef:
3522     @@@Name: HIERARCHY_REQUEST_ERR
3523 wakaba 1.27 @@@Value:
3524     @@@@@:3
3525     @@@@ContentType: DISCore|Integer
3526 wakaba 1.5 @@@enDesc:
3527     An attempt is made to break the hierarchy.
3528     @@@XSubTypeDef:
3529     @@@@QName: BAD_CHILD_ERR
3530     @@@@enDesc:
3531     An attempt is made to append a node as a child whose type
3532     is not allowed.
3533     @@@@XParam:
3534     @@@@@QName: childNode
3535     @@@@@enDesc:
3536     The node attempted to append.
3537     @@@@XParam:
3538     @@@@@QName: parentNode
3539     @@@@@enDesc:
3540     The node to whose child list an attempt to append is made.
3541     @@@XSubTypeDef:
3542     @@@@QName: IN_USE_NODE_ERR
3543     @@@@enDesc:
3544     An attempt is made to append a node that has already been used
3545     elsewhere.
3546     @@@@XParam:
3547     @@@@@QName: childNode
3548     @@@@@enDesc:
3549     The node attempted to append.
3550     @@@@XParam:
3551     @@@@@QName: parentNode
3552     @@@@@enDesc:
3553     The parent node of the <XP::childNode>.
3554 wakaba 1.4 @@XConstDef:
3555     @@@Name: NOT_SUPPORTED_ERR
3556 wakaba 1.27 @@@Value:
3557     @@@@@:9
3558     @@@@ContentType: DISCore|Integer
3559 wakaba 1.4 @@@enDesc:
3560     An attempt is made to do something the implementation does not support.
3561     @@@XSubTypeDef:
3562     @@@@QName: UNSUPPORTED_OPERATOR_ERR
3563     @@@@enDesc:
3564     The implementation does not support the specified operator.
3565     @@@@XParam:
3566     @@@@@QName: operator
3567     @@@@@enDesc:
3568     The operator that is not supported.
3569     @@@@enMufDef:
3570     Operator "%p (name => {<Q::pc:operator>});" is not supported
3571 wakaba 1.25 ##PCException
3572 wakaba 1.4
3573     ElementTypeBinding:
3574     @Name: XConstDef
3575     @ElementType:
3576     dis:ResourceDef
3577     @ShadowContent:
3578 wakaba 1.33 @@rdf:type: dx|ErrorCode
3579 wakaba 1.4
3580     ElementTypeBinding:
3581     @Name: XSubTypeDef
3582     @ElementType:
3583     dis:ResourceDef
3584     @ShadowContent:
3585 wakaba 1.33 @@rdf:type: dx|ErrorSubCode
3586 wakaba 1.4
3587     ElementTypeBinding:
3588     @Name: XParam
3589     @ElementType:
3590 wakaba 1.33 ecore:hasParameter
3591 wakaba 1.4
3592     ElementTypeBinding:
3593     @Name: XParamDef
3594     @ElementType:
3595     dis:ResourceDef
3596     @ShadowContent:
3597 wakaba 1.33 @@rdf:type: ecore|Parameter
3598 wakaba 1.27 @@For: =ManakaiDOM|all
3599 wakaba 1.4
3600     ElementTypeBinding:
3601     @Name: enMufDef
3602     @ElementType:
3603     dis:Def
3604     @ShadowContent:
3605     @@ContentType:
3606     lang:muf
3607     @@lang:en
3608    
3609 wakaba 1.1 ElementTypeBinding:
3610     @Name: Method
3611     @ElementType:
3612     dis:ResourceDef
3613     @ShadowContent:
3614     @@rdf:type:
3615     DISLang:Method
3616    
3617     ElementTypeBinding:
3618     @Name: ToStringMethod
3619     @ElementType:
3620     dis:ResourceDef
3621     @ShadowContent:
3622     @@rdf:type:
3623     DISLang:Method
3624     @@Operator:
3625     @@@@:
3626     DISPerl:AsStringMethod
3627 wakaba 1.35 @@@ContentType: DISCore|QName
3628 wakaba 1.1 @@Description:
3629     @@@lang:en
3630     @@@@:
3631     Returns the textual Perl source code representation of this object.
3632 wakaba 1.9
3633 wakaba 1.14 ElementTypeBinding:
3634     @Name: NumValMethod
3635     @ElementType:
3636     dis:ResourceDef
3637     @ShadowContent:
3638     @@rdf:type:
3639     DISLang:Method
3640     @@Operator:
3641     @@@@: 0+
3642     @@@ContentType:
3643     lang:Perl
3644     @@Description:
3645     @@@lang:en
3646     @@@@:
3647     Returns the numeric value of this object.
3648 wakaba 1.9
3649     ElementTypeBinding:
3650 wakaba 1.1 @Name: IntMethod
3651     @ElementType:
3652     dis:ResourceDef
3653     @ShadowContent:
3654     @@rdf:type:
3655     DISLang:Method
3656     @@ManakaiDOM:isForInternal:1
3657    
3658     ElementTypeBinding:
3659     @Name: Attr
3660     @ElementType:
3661     dis:ResourceDef
3662     @ShadowContent:
3663     @@rdf:type:
3664     DISLang:Attribute
3665    
3666     ElementTypeBinding:
3667     @Name: Return
3668     @ElementType:
3669     dis:ResourceDef
3670     @ShadowContent:
3671     @@rdf:type:
3672     DISLang:MethodReturn
3673    
3674     ElementTypeBinding:
3675     @Name: Get
3676     @ElementType:
3677     dis:ResourceDef
3678     @ShadowContent:
3679     @@rdf:type:
3680     DISLang:AttributeGet
3681    
3682     ElementTypeBinding:
3683     @Name: Set
3684     @ElementType:
3685     dis:ResourceDef
3686     @ShadowContent:
3687     @@rdf:type:
3688     DISLang:AttributeSet
3689    
3690     ElementTypeBinding:
3691     @Name: Param
3692     @ElementType:
3693     dis:ResourceDef
3694     @ShadowContent:
3695     @@rdf:type:
3696     DISLang:MethodParameter
3697    
3698     ElementTypeBinding:
3699     @Name: PerlDef
3700     @ElementType:
3701     dis:Def
3702     @ShadowContent:
3703     @@ContentType:
3704     lang:Perl
3705 wakaba 1.27 @@ForCheck: ManakaiDOM|ForClass
3706 wakaba 1.28
3707     ElementTypeBinding:
3708     @Name: PerlCDef
3709     @ElementType:
3710     dis:Def
3711     @ShadowContent:
3712     @@ContentType:
3713     lang:Perl
3714 wakaba 1.1
3715     ElementTypeBinding:
3716     @Name: disDef
3717     @ElementType:
3718     dis:Def
3719     @ShadowContent:
3720     @@ContentType:
3721     lang:dis
3722 wakaba 1.27 @@ForCheck: ManakaiDOM|ForClass
3723 wakaba 1.1
3724     ElementTypeBinding:
3725     @Name: InCase
3726     @ElementType:
3727     dis:ResourceDef
3728     @ShadowContent:
3729     @@rdf:type:
3730     ManakaiDOM:InCase
3731    
3732     ElementTypeBinding:
3733     @Name: nullCase
3734     @ElementType:
3735     dis:ResourceDef
3736     @ShadowContent:
3737     @@rdf:type:
3738     ManakaiDOM:InCase
3739     @@Value:
3740     @@@is-null:1
3741    
3742     ElementTypeBinding:
3743     @Name: TrueCase
3744     @ElementType:
3745     dis:ResourceDef
3746     @ShadowContent:
3747     @@rdf:type:
3748     ManakaiDOM:InCase
3749 wakaba 1.27 @@Value:
3750     @@@@:1
3751     @@@ContentType: DISCore|Boolean
3752 wakaba 1.1 @@Type:
3753 wakaba 1.12 DOMMain:boolean::ManakaiDOM:all
3754 wakaba 1.1
3755    
3756     ElementTypeBinding:
3757     @Name: FalseCase
3758     @ElementType:
3759     dis:ResourceDef
3760     @ShadowContent:
3761     @@rdf:type:
3762     ManakaiDOM:InCase
3763 wakaba 1.27 @@Value:
3764     @@@@:0
3765     @@@ContentType: DISCore|Boolean
3766 wakaba 1.1 @@Type:
3767 wakaba 1.12 DOMMain:boolean::ManakaiDOM:all
3768 wakaba 1.1
3769     ElementTypeBinding:
3770     @Name: enDesc
3771     @ElementType:
3772     dis:Description
3773     @ShadowContent:
3774     @@lang:en
3775    
3776     ElementTypeBinding:
3777     @Name: PropDef
3778     @ElementType:
3779     dis:ResourceDef
3780     @ShadowContent:
3781     @@rdf:type:
3782     rdf:Property
3783 wakaba 1.27 @@For: =ManakaiDOM|all
3784 wakaba 1.1
3785     ElementTypeBinding:
3786     @Name: NamedParam
3787     @ElementType:
3788     dis:ResourceDef
3789     @ShadowContent:
3790     @@rdf:type:
3791     DISLang:MethodParameter
3792     @@DISPerl:isNamedParameter:1
3793    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24