/[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.37 - (hide annotations) (download)
Thu Oct 13 08:16:41 2005 UTC (19 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.36: +33 -10 lines
++ manakai/lib/Message/Util/ChangeLog	13 Oct 2005 08:14:30 -0000
2005-10-13  Wakaba  <wakaba@suika.fam.cx>

	* PerlCode.dis (CDATADOMString): Changed to use code
	fragment defined in DOMCore module directly.

++ manakai/lib/Message/Util/DIS/ChangeLog	13 Oct 2005 08:15:20 -0000
2005-10-13  Wakaba  <wakaba@suika.fam.cx>

	* Perl.dis (plIsFeatureImplemented): Don't check whether features
	are implemented for aliases.

++ manakai/lib/Message/DOM/ChangeLog	13 Oct 2005 08:13:32 -0000
2005-10-13  Wakaba  <wakaba@suika.fam.cx>

	* DOMCore.dis (setAttrValueNS): New code.

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.37 $Date: 2005/10/12 14:46:06 $
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     $r = $self-><AG::Node.textContent>;
1983     my $file = $self-><AG::PerlCode.fileNode>;
1984     my $src_file = $file ? $file-><AG::PerlFile.sourceFile> : '';
1985     my $nxt_cnum = $file ? $file-><M::PerlFile.getNextChunkNumber> : 0;
1986     $r = sprintf qq<\n#line %d "%s [u] (Chunk #%d)"\n%s>.
1987     qq<\n#line 1 "%s [/u] (Chunk #%d)"\n>,
1988     $self-><AG::PerlUnparsedCode.sourceLine> || 1,
1989     $self-><AG::PerlUnparsedCode.sourceFile> || $src_file,
1990     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0,
1991     $self-><AG::Node.textContent>,
1992     $src_file,
1993     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0;
1994     }__;
1995 wakaba 1.1 ##PerlUnparsedCode
1996    
1997 wakaba 1.35 IFClsETDef:
1998 wakaba 1.25 @IFQName: PerlInlineUnparsedCode
1999 wakaba 1.35 @CQName: ManakaiPCInlineUnparsedCode
2000     @ETQName: pc|inlineUnparsed
2001 wakaba 1.25
2002     @IFISA: PerlCode
2003 wakaba 1.35 @CISA: ManakaiPCCode
2004 wakaba 1.25
2005 wakaba 1.6 @enDesc:
2006 wakaba 1.36 Unparsed Perl inline code fragments.
2007 wakaba 1.6
2008 wakaba 1.36 @ToStringMethod:
2009 wakaba 1.9 @@Return:
2010 wakaba 1.36 @@@Type: DOMString
2011     @@@enDesc:
2012     Perl code.
2013 wakaba 1.35 @@@disDef:
2014     @@@@DISPerl:cloneCode: DOMCore|ManakaiDOMNode.textContent.get
2015 wakaba 1.36 ##PCInlineUnparsedCode
2016 wakaba 1.6
2017 wakaba 1.35 IFClsETDef:
2018 wakaba 1.25 @IFQName: PerlStringLiteral
2019 wakaba 1.35 @CQName: ManakaiPCPerlStringLiteral
2020     @ETQName: pc|stringLiteral
2021 wakaba 1.25
2022     @IFISA: PerlCode
2023 wakaba 1.35 @CISA: ManakaiPCCode
2024 wakaba 1.25
2025 wakaba 1.6 @enDesc:
2026 wakaba 1.36 Perl string literal.
2027 wakaba 1.6
2028 wakaba 1.14 @NumValMethod:
2029     @@Return:
2030 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
2031 wakaba 1.14 @@@enDesc:
2032     Numeric value of the Perl code.
2033     @@@PerlDef:
2034 wakaba 1.35 __DEEP{
2035     $r = 0 + $self-><AG::Node.textContent>;
2036     }__;
2037 wakaba 1.14
2038 wakaba 1.6 @ToStringMethod:
2039     @@Return:
2040 wakaba 1.35 @@@Type: DOMString
2041 wakaba 1.6 @@@enDesc:
2042     Perl code.
2043     @@@PerlDef:
2044 wakaba 1.35 __DEEP{
2045     $r = $self-><AG::Node.textContent>;
2046     $r =~ s/(['\\])/\\$1/g;
2047     $r = q<'> . $r . q<'>;
2048     }__;
2049 wakaba 1.6 ##PerlStringLiteral
2050    
2051 wakaba 1.35 IFClsETDef:
2052 wakaba 1.25 @IFQName: PerlTokens
2053 wakaba 1.35 @CQName: ManakaiPCTokens
2054     @ETQName: pc|tokens
2055 wakaba 1.12
2056 wakaba 1.25 @IFISA: PerlCode
2057 wakaba 1.35 @CISA: ManakaiPCCode
2058 wakaba 1.25
2059 wakaba 1.6 @enDesc:
2060 wakaba 1.36 Unparsed Perl inline code fragments.
2061 wakaba 1.6
2062     @ToStringMethod:
2063     @@Return:
2064     @@@Type:
2065 wakaba 1.12 DISLang:String::ManakaiDOM:all
2066 wakaba 1.6 @@@enDesc:
2067     Perl code.
2068     @@@PerlDef:
2069 wakaba 1.35 __DEEP{
2070     $r = $self-><AG::Node.textContent>;
2071     }__;
2072     ##PCTokens
2073 wakaba 1.6
2074 wakaba 1.35 IFClsETDef:
2075 wakaba 1.25 @IFQName: PerlAtom
2076 wakaba 1.35 @CQName: ManakaiPCAtom
2077     @ETQName: pc|atom
2078 wakaba 1.25
2079     @IFISA: PerlCode
2080 wakaba 1.35 @CISA: ManakaiPCTokens
2081 wakaba 1.25
2082 wakaba 1.6 @enDesc:
2083     Unparsed Perl atomic code fragments (such as numeric literal).
2084    
2085 wakaba 1.14 @NumValMethod:
2086     @@Return:
2087 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
2088 wakaba 1.14 @@@enDesc:
2089     Numeric value of the Perl code.
2090     @@@PerlDef:
2091 wakaba 1.35 __DEEP{
2092     $r = 0 + $self-><AG::Node.textContent>;
2093     }__;
2094 wakaba 1.9
2095 wakaba 1.6 @ToStringMethod:
2096     @@Return:
2097 wakaba 1.35 @@@Type: DOMString
2098 wakaba 1.6 @@@enDesc:
2099     Perl code.
2100     @@@PerlDef:
2101 wakaba 1.35 __DEEP{
2102     $r = $self-><AG::Node.textContent>;
2103     }__;
2104 wakaba 1.6 ##PerlAtom
2105    
2106 wakaba 1.35 IFClsETDef:
2107 wakaba 1.25 @IFQName: PerlVariable
2108 wakaba 1.35 @CQName: ManakaiPCVariable
2109     @ETQName: pc|variable
2110 wakaba 1.25
2111     @IFISA: PerlCode
2112 wakaba 1.35 @CISA: ManakaiPCCode
2113 wakaba 1.25
2114 wakaba 1.6 @enDesc:
2115     Unparsed Perl variable.
2116     \
2117     {NOTE:: Future version of the implementation may
2118     support to specify array index or hash key.
2119     \
2120 wakaba 1.36 }
2121 wakaba 1.6
2122 wakaba 1.35 @ATTR:
2123 wakaba 1.6 @@Name: variableType
2124 wakaba 1.35 @@ATTRQName: pc|variableType
2125 wakaba 1.6 @@enDesc:
2126     Perl variable type (<CODE::$>, <CODE::@>, <CODE::%>,
2127     <CODE::&> or empty string).
2128 wakaba 1.35 @@ReflectCDATA:
2129 wakaba 1.6 @@Get:
2130     @@Set:
2131    
2132 wakaba 1.35 @ATTR:
2133 wakaba 1.6 @@Name: packageName
2134 wakaba 1.35 @@ATTRQName: pc|packageName
2135 wakaba 1.6 @@enDesc:
2136     The name of the package to which this variable belongs.
2137 wakaba 1.35 @@ReflectCDATA:
2138 wakaba 1.6 @@Get:
2139     @@@nullCase:
2140     @@@@enDesc:
2141     This package belongs to the current package or
2142     does not belong to any package.
2143     @@Set:
2144     @@@nullCase:
2145     @@@@enDesc:
2146     This package belongs to the current package or
2147     does not belong to any package.
2148    
2149 wakaba 1.35 @ATTR:
2150 wakaba 1.36 @@Name: pcLocalName
2151 wakaba 1.35 @@ATTRQName: pc|localName
2152 wakaba 1.6 @@enDesc:
2153     The local variable name.
2154 wakaba 1.35 @@ReflectCDATA:
2155 wakaba 1.6 @@Get:
2156     @@Set:
2157    
2158 wakaba 1.35 @ATTR:
2159 wakaba 1.6 @@Name: variableScope
2160 wakaba 1.35 @@ATTRQName: pc|variableScope
2161 wakaba 1.6 @@enDesc:
2162     Scope modifier (<CODE::my> or <CODE::our> or <CODE::local>).
2163 wakaba 1.35 @@ReflectCDATA:
2164 wakaba 1.6 @@Get:
2165     @@@nullCase:
2166     @@@@enDesc:
2167     This variable does not have scope modifier.
2168     @@Set:
2169     @@@nullCase:
2170     @@@@enDesc:
2171     This variable does not have scope modifier.
2172    
2173     @ToStringMethod:
2174     @@Return:
2175 wakaba 1.35 @@@Type: DOMString
2176 wakaba 1.6 @@@enDesc:
2177     Perl code.
2178     @@@PerlDef:
2179 wakaba 1.35 __DEEP{
2180     my $t = $self-><AG::PerlVariable.variableScope>;
2181     $r .= $t . ' ' if length $t;
2182     $r .= $self-><AG::PerlVariable.variableType>;
2183     my $v = $self-><AG::PerlVariable.packageName>;
2184     $r .= $v . '::' if length $v;
2185     $r .= $self-><AG::PerlVariable.pcLocalName>;
2186     $v = $self-><AG::PerlVariable.hashKey>;
2187     if ($t eq '$' and length $v) {
2188     $v =~ s/(['\\])/\\$1/g;
2189     $r .= q<{'> . $v . q<'}>;
2190     }
2191     }__;
2192 wakaba 1.6
2193 wakaba 1.35 @ATTR:
2194 wakaba 1.6 @@Name: hashKey
2195 wakaba 1.35 @@ATTRQName: pc|hashKey
2196 wakaba 1.6 @@enDesc:
2197     The key for hash.
2198     \
2199     {NOTE:: Using Perl code for key is not supported in the current
2200     version of the implementation.
2201     \
2202     }
2203 wakaba 1.35 @@ReflectCDATA:
2204 wakaba 1.6 @@Get:
2205     @@@nullCase:
2206     @@@@enDesc:
2207     This variable is not for hash value access.
2208     @@Set:
2209     @@@nullCase:
2210     @@@@enDesc:
2211     This variable is not for hash value access.
2212 wakaba 1.15 ##PerlVariable
2213 wakaba 1.6
2214 wakaba 1.25 IFClsDef:
2215     @IFQName: PerlCodeUnits
2216 wakaba 1.35 @CQName: ManakaiPCCodeUnits
2217 wakaba 1.25
2218 wakaba 1.35 @CISA: ManakaiPCCode
2219 wakaba 1.25
2220 wakaba 1.6 @enDesc:
2221     A base class implemented by both inline container and
2222     block-level container.
2223    
2224     @Attr:
2225     @@Name: length
2226     @@enDesc:
2227     The number of child code fragments.
2228 wakaba 1.35 @@Type: idl|unsignedLong||ManakaiDOM|all
2229 wakaba 1.6 @@Get:
2230     @@@PerlDef:
2231 wakaba 1.35 __DEEP{
2232     $r = @{$self-><AG::Node.childNodes>};
2233     }__;
2234 wakaba 1.6
2235     @Method:
2236     @@Name: appendStringLiteral
2237     @@enDesc:
2238     Appends a Perl string literal (<CODE::q>).
2239     @@Param:
2240     @@@Name: stringArg
2241 wakaba 1.35 @@@Type: DOMString
2242 wakaba 1.6 @@@enDesc:
2243     A string.
2244     @@Return:
2245 wakaba 1.35 @@@Type: PerlStringLiteral
2246 wakaba 1.6 @@@enDesc:
2247     The newly created Perl string literal object.
2248     @@@PerlDef:
2249 wakaba 1.35 __DEEP{
2250     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2251     (<Q::pc:>, 'stringLiteral');
2252     $r-><AS::Node.textContent> ($stringArg);
2253     $self-><M::Node.appendChild> ($r);
2254     }__;
2255 wakaba 1.6
2256     @Method:
2257     @@Name: appendAtom
2258     @@enDesc:
2259     Appends a Perl atomic code fragment.
2260     @@Param:
2261     @@@Name: codeArg
2262 wakaba 1.35 @@@Type: DOMString
2263 wakaba 1.6 @@@enDesc:
2264     An atom.
2265     @@Return:
2266 wakaba 1.35 @@@Type: PerlAtom
2267 wakaba 1.6 @@@enDesc:
2268     The newly created Perl code object.
2269     @@@PerlDef:
2270 wakaba 1.35 __DEEP{
2271     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2272     (<Q::pc:>, 'atom');
2273     $r-><AS::Node.textContent> ($codeArg);
2274     $self-><M::Node.appendChild> ($r);
2275     }__;
2276 wakaba 1.6
2277     @Method:
2278     @@Name: appendBare
2279     @@enDesc:
2280     Appends a Perl bare code fragment.
2281     @@Param:
2282     @@@Name: codeArg
2283 wakaba 1.35 @@@Type: DOMString
2284 wakaba 1.6 @@@enDesc:
2285 wakaba 1.7 An bare code.
2286 wakaba 1.6 @@Return:
2287 wakaba 1.35 @@@Type: PerlBare
2288 wakaba 1.6 @@@enDesc:
2289     The newly created Perl code object.
2290     @@@PerlDef:
2291 wakaba 1.35 __DEEP{
2292     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2293     (<Q::pc:>, 'tokens');
2294     $r-><AS::Node.textContent> ($codeArg);
2295     $self-><M::Node.appendChild> ($r);
2296     }__;
2297 wakaba 1.11
2298     @Method:
2299     @@Name: appendNewAssignment
2300     @@enDesc:
2301     Appends a newly created <Class::ManakaiPerlAssign> object.
2302     @@Param:
2303     @@@Name: leftArg
2304 wakaba 1.35 @@@Type: PerlCode
2305 wakaba 1.11 @@@enDesc:
2306     A left hand side code fragment object.
2307     @@Param:
2308     @@@Name: rightArg
2309 wakaba 1.35 @@@Type: PerlCode
2310 wakaba 1.11 @@@enDesc:
2311     A right hand side code fragment object.
2312     @@Return:
2313 wakaba 1.36 @@@Type: PerlAssignment
2314 wakaba 1.11 @@@RaiseException:
2315     @@@@@:BAD_CHILD_ERR
2316     @@@@enDesc:
2317     An attempt is made to append a child
2318     that is not valid type.
2319     @@@RaiseException:
2320     @@@@@:IN_USE_NODE_ERR
2321     @@@@enDesc:
2322     An attempt is made to append a node that is
2323     already used elsewhere.
2324     @@@PerlDef:
2325 wakaba 1.35 for my $arg ([leftArg => $leftArg], [rightArg => $rightArg]) {
2326     if ({
2327     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
2328     inlineUnparsed => 1, variable => 1, stringLiteral => true,
2329     }->{$arg->[1]-><AG::Node.localName>}) {
2330     if ($arg->[1]-><AG::Node.parentNode>) {
2331     __EXCEPTION{IN_USE_NODE_ERR::
2332     pc:childNode => {$arg->[1]},
2333     MDOMX:param-name => {$arg->[0]},
2334     }__;
2335     }
2336     } else {
2337     __EXCEPTION{BAD_CHILD_ERR::
2338     pc:parentNode => {$self},
2339     pc:childNode => {$arg->[1]},
2340     MDOMX:param-name => {$arg->[0]},
2341     }__;
2342     }
2343     } # left/right
2344    
2345     __DEEP{
2346     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2347     (<Q::pc:>, 'assignment');
2348     $r-><AS::PerlAssignment.leftCode> ($leftArg);
2349     $r-><AS::PerlAssignment.rightCode> ($rightArg);
2350     $self-><M::Node.appendChild> ($r);
2351     }__;
2352     ##PCAssignment
2353 wakaba 1.6
2354 wakaba 1.35 IFClsETDef:
2355 wakaba 1.25 @IFQName: PerlStatement
2356 wakaba 1.35 @CQName: ManakaiPCStatement
2357     @ETQName: pc|statement
2358 wakaba 1.25
2359     @IFISA: PerlCode
2360     @IFISA: PerlCodeInlines
2361 wakaba 1.35 @CISA: ManakaiPCCodeInlines
2362 wakaba 1.25
2363 wakaba 1.8 @enDesc:
2364 wakaba 1.36 Perl statements.
2365 wakaba 1.8
2366     @ToStringMethod:
2367     @@Return:
2368 wakaba 1.35 @@@Type: DOMString
2369 wakaba 1.8 @@@enDesc:
2370     Perl code.
2371     @@@PerlDef:
2372     $r = $self->SUPER::stringify;
2373 wakaba 1.16 $r .= ";\n" if length $r;
2374 wakaba 1.8 ##PerlStatement
2375 wakaba 1.6
2376 wakaba 1.35 IFClsETDef:
2377 wakaba 1.25 @IFQName: PerlCodeInlines
2378 wakaba 1.35 @CQName: ManakaiPCCodeInlines
2379     @ETQName: pc|inlineContainer
2380 wakaba 1.25
2381 wakaba 1.35 @CISA: ManakaiPCCodeUnits
2382 wakaba 1.25
2383 wakaba 1.6 @enDesc:
2384 wakaba 1.36 Unparsed Perl inline code block.
2385 wakaba 1.6
2386     @Method:
2387     @@Name: appendCodeFragment
2388     @@enDesc:
2389 wakaba 1.35 Appends a <IF::PerlCode> object.
2390 wakaba 1.6 @@Param:
2391     @@@Name: codeArg
2392 wakaba 1.25 @@@Type: PerlCode
2393 wakaba 1.6 @@@enDesc:
2394     A code fragment object.
2395     @@Return:
2396     @@@RaiseException:
2397     @@@@@:BAD_CHILD_ERR
2398     @@@@enDesc:
2399     An attempt is made to append a child
2400     that is not a <Class::ManakaiPerlUnparsedCode>.
2401     @@@RaiseException:
2402     @@@@@:IN_USE_NODE_ERR
2403     @@@@enDesc:
2404     An attempt is made to append a node that is
2405     already used elsewhere.
2406     @@@PerlDef:
2407 wakaba 1.35 if ({
2408     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
2409     inlineUnparsed => 1, variable => 1, stringLiteral => true,
2410     }->{$codeArg-><AG::Node.localName>}) {
2411     if ($codeArg-><AG::Node.parentNode>) {
2412     __EXCEPTION{IN_USE_NODE_ERR::
2413     pc:childNode => {$codeArg},
2414     }__;
2415     }
2416     __DEEP{
2417     $self-><AG::Node.ownerDocument>
2418     -><M::Document.adoptNode> ($codeArg);
2419     $self-><M::Node.appendChild> ($codeArg);
2420     }__;
2421     } else {
2422     __EXCEPTION{BAD_CHILD_ERR::
2423     pc:parentNode => {$self},
2424     pc:childNode => {$codeArg},
2425     }__;
2426     }
2427 wakaba 1.6
2428     @Method:
2429     @@Name: appendCode
2430     @@enDesc:
2431     Appends an unparsed Perl code fragment.
2432     @@Param:
2433     @@@Name: codeArg
2434 wakaba 1.35 @@@Type: DOMString
2435 wakaba 1.6 @@@enDesc:
2436     An unparsed Perl code fragment.
2437     @@Return:
2438 wakaba 1.25 @@@Type: PerlInlineUnparsedCode
2439 wakaba 1.6 @@@enDesc:
2440     The newly created Perl code object.
2441     @@@PerlDef:
2442 wakaba 1.35 __DEEP{
2443     $r = $self-><AG::Node.ownerDocument>-><M::Document.createElementNS>
2444     (<Q::pc:>, 'inlineUnparsed');
2445     $r-><AS::Node.textContent> ($codeArg);
2446     $self-><M::Node.appendChild> ($r);
2447     }__;
2448 wakaba 1.6
2449     @ToStringMethod:
2450     @@Return:
2451 wakaba 1.35 @@@Type: DOMString
2452 wakaba 1.6 @@@enDesc:
2453     Perl code.
2454     @@@PerlDef:
2455 wakaba 1.35 __DEEP{
2456     my @child = @{$self-><AG::Node.childNodes>};
2457     for my $child (@child) {
2458     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2459     $child-><AG::Node.localName> eq 'inlineContainer' and
2460     1 == @child) {
2461     $r .= '(' . $child->stringify . ')';
2462     } else {
2463     $r .= $child->stringify;
2464     }
2465     }
2466     }__;
2467     ##PCCodeInlines
2468 wakaba 1.6
2469 wakaba 1.35 IFClsETDef:
2470 wakaba 1.25 @IFQName: PerlBlock
2471 wakaba 1.35 @CQName: ManakaiPCBlock
2472     @ETQName: pc|block
2473 wakaba 1.25
2474     @IFISA: PerlCode
2475     @IFISA: PerlCodeStatements
2476 wakaba 1.35 @CISA: ManakaiPCCodeStatements
2477 wakaba 1.25
2478 wakaba 1.8 @enDesc:
2479 wakaba 1.36 Perl block-level code block.
2480 wakaba 1.8
2481     @ToStringMethod:
2482     @@Return:
2483 wakaba 1.35 @@@Type: DOMString
2484 wakaba 1.8 @@@enDesc:
2485     Perl code.
2486     @@@PerlDef:
2487 wakaba 1.35 my @child = @{$self-><AG::Node.childNodes>};
2488     if (@child == 1 and
2489     $child[0]-><AG::Node.localName> eq 'block') {
2490     $r = $child[0]->stringify;
2491     } elsif (@child == 1 and
2492     $child[0]-><AG::Node.localName> eq 'unparsed' and
2493     $child[0]-><AG::Node.textContent> =~ /^\s*$/) {
2494     #
2495     } else {
2496     for my $child (@child) {
2497     if ($child-><AG::Node.localName> eq 'inlineContainer' and
2498     1 == @child) {
2499     $r .= '(' . $child->stringify . ')';
2500     } else {
2501     $r .= $child->stringify;
2502     }
2503     }
2504    
2505     __DEEP{
2506     my $file = $self-><AG::PerlCode.fileNode>;
2507     my $sfile = $file ? $file-><AG::PerlFile.sourceFile> : '';
2508     $r = sprintf qq<\n{\n#line %d "%s [b] (Chunk #%d)"\n%s>.
2509     qq<\n#line 1 "%s [/b] (Chunk #%d)"\n}\n>,
2510     $self-><AG::PerlCodeStatements.sourceLine> || 1,
2511     $self-><AG::PerlCodeStatements.sourceFile> || $sfile,
2512     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0,
2513     $r,
2514     $sfile,
2515     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0
2516     if length $r;
2517     }__;
2518     }
2519     ##PCBlock
2520 wakaba 1.8
2521 wakaba 1.35 IFClsETDef:
2522 wakaba 1.25 @IFQName: PerlCodeBlocks
2523 wakaba 1.35 @CQName: ManakaiPCCodeBlocks
2524     @ETQName: pc|blockContainer
2525 wakaba 1.25
2526     @IFISA: PerlCodeStatements
2527 wakaba 1.35 @CISA: ManakaiPCCodeStatements
2528 wakaba 1.25
2529 wakaba 1.9 @enDesc:
2530     Perl block-level code container whose content may or may
2531     not semantically be self-contained.
2532    
2533     @ToStringMethod:
2534     @@Return:
2535 wakaba 1.35 @@@Type: DOMString
2536 wakaba 1.9 @@@enDesc:
2537     Perl code.
2538     @@@PerlDef:
2539 wakaba 1.35 my @child = @{$self-><AG::Node.childNodes>};
2540     if (@child == 1 and
2541     {
2542     block => true, blockContainer => true,
2543     }->{$child[0]-><AG::Node.localName>}) {
2544     $r = $child[0]->stringify;
2545     } else {
2546     for my $child (@child) {
2547     if ($child-><AG::Node.localName> eq 'inlineContainer' and
2548     1 == @child) {
2549     $r .= '(' . $child->stringify . ')';
2550     } else {
2551     $r .= $child->stringify;
2552     }
2553     }
2554 wakaba 1.9
2555 wakaba 1.35 __DEEP{
2556     my $file = $self-><AG::PerlCode.fileNode>;
2557     my $sfile = $file ? $file-><AG::PerlFile.sourceFile> : '';
2558     $r = sprintf qq<\n#line %d "%s [bc] (Chunk #%d)"\n%s>.
2559     qq<\n#line 1 "%s [/bc] (Chunk #%d)"\n>,
2560     $self-><AG::PerlCodeStatements.sourceLine> || 1,
2561     $self-><AG::PerlCodeStatements.sourceFile> || $sfile,
2562     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0,
2563     $r,
2564     $sfile,
2565     $file ? $file-><M::PerlFile.getNextChunkNumber> : 0;
2566     }__;
2567     }
2568     ##PCCodeBlocks
2569    
2570     IFClsETDef:
2571 wakaba 1.25 @IFQName: PerlAssignment
2572 wakaba 1.35 @CQName: ManakaiPCAssignment
2573     @ETQName: pc|assignment
2574 wakaba 1.25
2575     @IFISA: PerlCode
2576 wakaba 1.35 @CISA: ManakaiPCCode
2577 wakaba 1.25
2578 wakaba 1.11 @enDesc:
2579 wakaba 1.36 Perl variable assignment.
2580 wakaba 1.11
2581     @ToStringMethod:
2582     @@Return:
2583 wakaba 1.35 @@@Type: DOMString
2584 wakaba 1.11 @@@enDesc:
2585     Perl code.
2586     @@@PerlDef:
2587 wakaba 1.35 __DEEP{
2588     $r = $self-><AG::PerlAssignment.leftCode>->stringify
2589     . ' = '
2590     . $self-><AG::PerlAssignment.rightCode>->stringify;
2591     }__;
2592    
2593     @Attr:
2594     @@Name: leftCode
2595     @@enDesc:
2596     Left-hand expression.
2597     @@Type: PerlCodeInlines
2598     @@Get:
2599     @@@nullCase:
2600     @@@@enDesc: Left-hand code not yet specified.
2601     @@@PerlDef:
2602     __DEEP{
2603     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2604     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2605     $child-><AG::Node.localName> eq 'left') {
2606     $r = $child-><AG::Node.lastChild>;
2607     last F;
2608     }
2609     }
2610     }__;
2611     @@Set:
2612     @@@PerlDef:
2613     __DEEP{
2614     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2615     F: {
2616     for my $child (@{$self-><AG::Node.childNodes>}) {
2617     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2618     $child-><AG::Node.localName> eq 'left') {
2619     $child-><AS::Node.textContent> ('');
2620     $child-><M::Node.appendChild> ($given);
2621     last F;
2622     }
2623     }
2624     my $node = $self-><AG::Node.ownerDocument>
2625     -><M::Document.createElementNS>
2626     (<Q::pc:>, 'left');
2627     $node-><M::Node.appendChild> ($given);
2628     $self-><M::Node.appendChild> ($node);
2629     }
2630     }__;
2631    
2632     @Attr:
2633     @@Name: rightCode
2634     @@enDesc:
2635     Right-hand expression.
2636     @@Type: PerlCodeInlines
2637     @@Get:
2638     @@@nullCase:
2639     @@@@enDesc: Right-hand code not yet specified.
2640     @@@PerlDef:
2641     __DEEP{
2642     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2643     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2644     $child-><AG::Node.localName> eq 'right') {
2645     $r = $child-><AG::Node.lastChild>;
2646     last F;
2647     }
2648     }
2649     }__;
2650     @@Set:
2651     @@@PerlDef:
2652     __DEEP{
2653     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2654     F: {
2655     for my $child (@{$self-><AG::Node.childNodes>}) {
2656     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2657     $child-><AG::Node.localName> eq 'right') {
2658     $child-><AS::Node.textContent> ('');
2659     $child-><M::Node.appendChild> ($given);
2660     last F;
2661     }
2662     }
2663     my $node = $self-><AG::Node.ownerDocument>
2664     -><M::Document.createElementNS>
2665     (<Q::pc:>, 'right');
2666     $node-><M::Node.appendChild> ($given);
2667     $self-><M::Node.appendChild> ($node);
2668     }
2669     }__;
2670 wakaba 1.11 ##PerlAssignment
2671    
2672 wakaba 1.35 IFClsETDef:
2673 wakaba 1.26 @IFQName: PerlIf
2674 wakaba 1.35 @CQName: ManakaiPCIf
2675     @ETQName: pc|if
2676 wakaba 1.25
2677     @IFISA: PerlCode
2678 wakaba 1.35 @CISA: ManakaiPCCode
2679 wakaba 1.25
2680 wakaba 1.12 @enDesc:
2681     Perl variable assignment.
2682    
2683     @ToStringMethod:
2684     @@Return:
2685 wakaba 1.35 @@@Type: DOMString
2686 wakaba 1.12 @@@enDesc:
2687     Perl code.
2688     @@@PerlDef:
2689 wakaba 1.35 __DEEP{
2690     my $tcode = $self-><AG::PerlIf.trueCode>;
2691     my $fcode = $self-><AG::PerlIf.falseCode>;
2692     my $ccode = $self-><AG::PerlIf.condition>;
2693     if (defined $tcode) {
2694     if (defined $fcode) {
2695     $r = q<if (> . $ccode->stringify . q<) {> . $tcode->stringify .
2696     q<} else {> . $fcode->stringify . qq<}\n>;
2697     } else {
2698 wakaba 1.36 $r = q<if (> . $ccode->stringify . q<) {> . $tcode->stringify .
2699 wakaba 1.35 qq<}\n>;
2700     }
2701     } else {
2702     $r = q<unless (> . $ccode->stringify . q<) {> . $fcode->stringify .
2703     qq<}\n>;
2704     }
2705     }__;
2706    
2707     @Attr:
2708     @@Name: condition
2709     @@enDesc:
2710     Condition expression.
2711     @@Type: PerlCodeInlines
2712     @@Get:
2713     @@@nullCase:
2714     @@@@enDesc: Condition code not yet specified.
2715     @@@PerlDef:
2716     __DEEP{
2717     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2718     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2719     $child-><AG::Node.localName> eq 'condition') {
2720     $r = $child-><AG::Node.lastChild>;
2721     last F;
2722     }
2723     }
2724     }__;
2725     @@Set:
2726     @@@PerlDef:
2727     __DEEP{
2728     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2729     F: {
2730     for my $child (@{$self-><AG::Node.childNodes>}) {
2731     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2732     $child-><AG::Node.localName> eq 'condition') {
2733     $child-><AS::Node.textContent> ('');
2734     $child-><M::Node.appendChild> ($given);
2735     last F;
2736     }
2737     }
2738     my $node = $self-><AG::Node.ownerDocument>
2739     -><M::Document.createElementNS>
2740     (<Q::pc:>, 'condition');
2741     $node-><M::Node.appendChild> ($given);
2742     $self-><M::Node.appendChild> ($node);
2743     }
2744     }__;
2745    
2746     @Attr:
2747     @@Name: trueCode
2748     @@enDesc:
2749     True-case code.
2750     @@Type: PerlCodeBlocks
2751     @@Get:
2752     @@@nullCase:
2753     @@@@enDesc: True-case code not yet specified.
2754     @@@PerlDef:
2755     __DEEP{
2756     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2757     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2758     $child-><AG::Node.localName> eq 'tr'.'ue') {
2759     $r = $child-><AG::Node.lastChild>;
2760     last F;
2761     }
2762     }
2763     }__;
2764     @@Set:
2765     @@@PerlDef:
2766     __DEEP{
2767     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2768     F: {
2769     for my $child (@{$self-><AG::Node.childNodes>}) {
2770     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2771     $child-><AG::Node.localName> eq 'tr'.'ue') {
2772     $child-><AS::Node.textContent> ('');
2773     $child-><M::Node.appendChild> ($given);
2774     last F;
2775     }
2776     }
2777     my $node = $self-><AG::Node.ownerDocument>
2778     -><M::Document.createElementNS>
2779     (<Q::pc:>, 'tr'.'ue');
2780     $node-><M::Node.appendChild> ($given);
2781     $self-><M::Node.appendChild> ($node);
2782     }
2783     }__;
2784    
2785     @Attr:
2786     @@Name: falseCode
2787     @@enDesc:
2788     False-case code.
2789     @@Type: PerlCodeBlocks
2790     @@Get:
2791     @@@nullCase:
2792     @@@@enDesc: True-case code not yet specified.
2793     @@@PerlDef:
2794     __DEEP{
2795     F: for my $child (@{$self-><AG::Node.childNodes>}) {
2796     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2797     $child-><AG::Node.localName> eq 'fal'.'se') {
2798     $r = $child-><AG::Node.lastChild>;
2799     last F;
2800     }
2801     }
2802     }__;
2803     @@Set:
2804     @@@PerlDef:
2805     __DEEP{
2806     $self-><AG::Node.ownerDocument>-><M::Document.adoptNode> ($given);
2807     F: {
2808     for my $child (@{$self-><AG::Node.childNodes>}) {
2809     if ($child-><AG::Node.namespaceURI> eq <Q::pc:> and
2810     $child-><AG::Node.localName> eq 'fal'.'se') {
2811     $child-><AS::Node.textContent> ('');
2812     $child-><M::Node.appendChild> ($given);
2813     last F;
2814     }
2815     }
2816     my $node = $self-><AG::Node.ownerDocument>
2817     -><M::Document.createElementNS>
2818     (<Q::pc:>, 'fal'.'se');
2819     $node-><M::Node.appendChild> ($given);
2820     $self-><M::Node.appendChild> ($node);
2821     }
2822     }__;
2823 wakaba 1.12 ##PerlIf
2824    
2825     PropDef:
2826     @QName:condition
2827     @enDesc:
2828     Condition.
2829     PropDef:
2830     @QName:true
2831     @enDesc:
2832     If true.
2833     PropDef:
2834     @QName:false
2835     @enDesc:
2836     If false.
2837    
2838 wakaba 1.11 PropDef:
2839     @QName:left
2840     @FullName:
2841     @@lang:en
2842     @@@: Left hand side
2843     PropDef:
2844     @QName:right
2845     @FullName:
2846     @@lang:en
2847     @@@: Right hand side
2848    
2849 wakaba 1.8 PropDef:
2850     @QName:label
2851     @enDesc:
2852     Perl statement / block label.
2853    
2854 wakaba 1.6 ElementTypeBinding:
2855     @Name: RaiseException
2856     @ElementType:
2857     ManakaiDOM:raises
2858    
2859 wakaba 1.25 IFClsDef:
2860     @IFQName: PCImplementation
2861 wakaba 1.35 @CQName: ManakaiPCImplementation
2862 wakaba 1.25
2863 wakaba 1.1 @enDesc:
2864     The class that provides factory methods.
2865 wakaba 1.20
2866 wakaba 1.35 @CISA: DOMCore|ManakaiDOMImplementation||ManakaiDOM|ManakaiDOMLatest
2867     @CISA: dx|ManakaiDefaultExceptionHandler||ManakaiDOM|Perl
2868 wakaba 1.17
2869 wakaba 1.35 @f:provides: pc|CoreFeature10
2870 wakaba 1.1
2871     @Method:
2872     @@Name: createPerlFile
2873     @@enDesc:
2874     Creates a Perl code file.
2875     @@Return:
2876 wakaba 1.25 @@@Type: PerlFile
2877 wakaba 1.1 @@@enDesc: A newly created Perl source file object.
2878     @@@PerlDef:
2879 wakaba 1.35 __DEEP{
2880     $r = $self-><M::DOMImpl.createDocument> (<Q::pc:>, 'file')
2881     -><AG::Document.documentElement>;
2882     }__;
2883 wakaba 1.1
2884 wakaba 1.13 @Method:
2885     @@Name: createPerlPackage
2886     @@enDesc:
2887     Creates a new package scope block.
2888     @@Param:
2889     @@@Name: packageName
2890 wakaba 1.35 @@@Type: DOMString
2891 wakaba 1.13 @@@enDesc:
2892     The fully-qualified name of the package to create.
2893     @@Return:
2894 wakaba 1.25 @@@Type: PerlPackage
2895 wakaba 1.13 @@@enDesc:
2896     The newly created package scope object.
2897     @@@PerlDef:
2898 wakaba 1.35 __DEEP{
2899     $r = $self-><M::DOMImpl.createDocument>
2900     -><M::Document.createElementNS> (<Q::pc:>, 'package');
2901     $r-><AS::PerlPackage.packageName> ($packageName);
2902     }__;
2903 wakaba 1.13
2904 wakaba 1.1 @IntMethod:
2905 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
2906 wakaba 1.1 @@Name: perlComment
2907     @@ManakaiDOM:isStatic:1
2908     @@enDesc:
2909     Generates a Perl comment string.
2910     @@Param:
2911     @@@Name: str
2912 wakaba 1.35 @@@Type: DOMString
2913 wakaba 1.1 @@@enDesc:
2914     A comment text.
2915     @@Return:
2916 wakaba 1.35 @@@Type: DOMString
2917 wakaba 1.1 @@@enDesc:
2918     A Perl comment string.
2919     @@@PerlDef:
2920     $r = $str;
2921     $r =~ s/\n/\n## /g;
2922     $r =~ s/\n## $/\n/s;
2923     $r .= "\n" unless $r =~ /\n$/;
2924     $r = q<## > . $r;
2925    
2926     @IntMethod:
2927 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
2928 wakaba 1.1 @@Name: rfc3339DateTime
2929     @@ManakaiDOM:isStatic:1
2930     @@enDesc:
2931     Returns RFC 3339 <CODE::date-time> representation of a date.
2932     @@Param:
2933     @@@Name: perlDate
2934 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
2935 wakaba 1.1 @@@enDesc:
2936     A Perl representation of date.
2937     @@Return:
2938 wakaba 1.35 @@@Type: DOMString
2939 wakaba 1.1 @@@enDesc:
2940     RFC 3339 date string.
2941     @@@PerlDef:
2942     my @time = gmtime $perlDate;
2943     $r = sprintf q<%04d-%02d-%02dT%02d:%02d:%02d+00:00>,
2944     $time[5] + 1900, $time[4] + 1, @time[3,2,1,0];
2945    
2946     @IntMethod:
2947 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
2948 wakaba 1.1 @@Name: versionDateTime
2949     @@ManakaiDOM:isStatic:1
2950     @@enDesc:
2951     Returns date for version.
2952     @@Param:
2953     @@@Name: perlDate
2954 wakaba 1.35 @@@Type: idl|unsignedLong||ManakaiDOM|all
2955 wakaba 1.1 @@@enDesc:
2956     A Perl representation of date.
2957     @@Return:
2958 wakaba 1.35 @@@Type: DOMString
2959 wakaba 1.1 @@@enDesc:
2960     A Perl number literal.
2961     @@@PerlDef:
2962     my @time = gmtime $perlDate;
2963     $r = sprintf q<%04d%02d%02d.%02d%02d>,
2964     $time[5] + 1900, $time[4] + 1, @time[3,2,1];
2965    
2966     @Method:
2967     @@Name: perlLiteral
2968     @@enDesc:
2969     Perl code representation.
2970     @@Param:
2971     @@@Name: val
2972 wakaba 1.35 @@@Type: DISPerl|Any||ManakaiDOM|all
2973 wakaba 1.1 @@@enDesc:
2974     A Perl value.
2975     @@Return:
2976 wakaba 1.35 @@@Type: DOMString
2977 wakaba 1.1 @@@enDesc:
2978     A Perl lexical representation of <P::val>.
2979     @@@PerlDef:
2980     unless (defined $val) {
2981     $r = q<undef>;
2982     } elsif (ref $val eq 'ARRAY') {
2983     __DEEP{
2984 wakaba 1.36 $r = q<[> . <ClassM::ManakaiPCImplementation
2985 wakaba 1.14 .perlList> ($val) . q<]>;
2986 wakaba 1.1 }__;
2987     } elsif (ref $val eq 'HASH') {
2988     __DEEP{
2989 wakaba 1.31 $r = q<{>
2990 wakaba 1.36 . <ClassM::ManakaiPCImplementation.perlList>
2991 wakaba 1.31 ([map {$_ => $val->{$_}} sort {$a cmp $b} keys %$val])
2992     . q<}>;
2993 wakaba 1.1 }__;
2994     } else {
2995     $val =~ s/(['\\])/\\$1/g;
2996     $r = q<'> . $val . q<'>;
2997     }
2998    
2999     @Method:
3000     @@Name: perlList
3001     @@enDesc:
3002     Perl code representation of a list.
3003     @@Param:
3004     @@@Name: val
3005 wakaba 1.35 @@@Type: DISPerl|ARRAY||ManakaiDOM|all
3006 wakaba 1.1 @@@enDesc:
3007     A Perl array reference.
3008     @@Return:
3009 wakaba 1.35 @@@Type: DOMString
3010 wakaba 1.1 @@@enDesc:
3011     A Perl lexical representation of <CODE::@$val>.
3012     @@@PerlDef:
3013     __DEEP{
3014 wakaba 1.36 $r = join (q<, >, map {<ClassM::ManakaiPCImplementation
3015 wakaba 1.1 .perlLiteral> ($_)} @{$val});
3016     }__;
3017 wakaba 1.5
3018     @Method:
3019     @@Name: createPerlSub
3020     @@enDesc:
3021 wakaba 1.35 Creates a new <IF::PerlSub> object.
3022 wakaba 1.5 @@Param:
3023     @@@Name: subName
3024 wakaba 1.35 @@@Type: DOMString
3025 wakaba 1.5 @@@enDesc:
3026     The name of the subroutine to create.
3027     @@@nullCase:
3028     @@@@enDesc:
3029     The subroutine created has no name.
3030     @@Return:
3031 wakaba 1.25 @@@Type: PerlSub
3032 wakaba 1.5 @@@enDesc:
3033     Newly created Perl subroutine object.
3034     @@@PerlDef:
3035 wakaba 1.35 __DEEP{
3036     $r = $self-><M::DOMImpl.createDocument>
3037     -><M::Document.createElementNS> (<Q::pc:>, 'sub');
3038     $r-><M::PerlSub.addPerlName> ($subName) if defined $subName;
3039     }__;
3040 wakaba 1.5
3041     @Method:
3042     @@Name: createPerlUnparsedCode
3043     @@enDesc:
3044     Creates a new <Class::ManakaiPerlUnparsedCode> object.
3045     @@Param:
3046     @@@Name: codeArg
3047 wakaba 1.35 @@@Type: DOMString
3048 wakaba 1.5 @@@enDesc:
3049     The code fragment.
3050     @@@nullCase:
3051     @@@@enDesc:
3052     The fragment initially has no code.
3053     @@Return:
3054 wakaba 1.25 @@@Type: PerlUnparsedCode
3055 wakaba 1.5 @@@enDesc:
3056     Newly created Perl code object.
3057     @@@PerlDef:
3058 wakaba 1.35 __DEEP{
3059     $r = $self-><M::DOMImpl.createDocument>
3060     -><M::Document.createElementNS> (<Q::pc:>, 'unparsed');
3061     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3062     }__;
3063 wakaba 1.6
3064     @Method:
3065     @@Name: createPerlInlineContainer
3066     @@enDesc:
3067 wakaba 1.35 Creates a new <IF::PerlInlineContainer> object.
3068 wakaba 1.6 @@Return:
3069 wakaba 1.25 @@@Type: PerlCodeInlines
3070 wakaba 1.6 @@@enDesc:
3071     Newly created Perl code object.
3072     @@@PerlDef:
3073 wakaba 1.35 __DEEP{
3074     $r = $self-><M::DOMImpl.createDocument>
3075     -><M::Document.createElementNS> (<Q::pc:>, 'inlineContainer');
3076     }__;
3077 wakaba 1.6
3078     @Method:
3079     @@Name: createPerlInlineUnparsedCode
3080     @@enDesc:
3081 wakaba 1.35 Creates a new <IF::PerlInlineUnparsedCode> object.
3082 wakaba 1.6 @@Param:
3083     @@@Name: codeArg
3084 wakaba 1.35 @@@Type: DOMString
3085 wakaba 1.6 @@@enDesc:
3086     The code fragment.
3087     @@@nullCase:
3088     @@@@enDesc:
3089     The fragment initially has no code.
3090     @@Return:
3091 wakaba 1.25 @@@Type: PerlInlineUnparsedCode
3092 wakaba 1.6 @@@enDesc:
3093     Newly created Perl code object.
3094     @@@PerlDef:
3095 wakaba 1.35 __DEEP{
3096     $r = $self-><M::DOMImpl.createDocument>
3097     -><M::Document.createElementNS> (<Q::pc:>, 'inlineUnparsed');
3098     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3099     }__;
3100 wakaba 1.6
3101     @Method:
3102     @@Name: createPerlBare
3103     @@enDesc:
3104 wakaba 1.35 Creates a new <IF::PerlTokens> object.
3105 wakaba 1.6 @@Param:
3106     @@@Name: codeArg
3107 wakaba 1.35 @@@Type: DOMString
3108 wakaba 1.6 @@@enDesc:
3109     The code fragment.
3110     @@Return:
3111 wakaba 1.25 @@@Type: PerlTokens
3112 wakaba 1.6 @@@enDesc:
3113     Newly created Perl code object.
3114     @@@PerlDef:
3115 wakaba 1.35 __DEEP{
3116     $r = $self-><M::DOMImpl.createDocument>
3117     -><M::Document.createElementNS> (<Q::pc:>, 'tokens');
3118     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3119     }__;
3120 wakaba 1.6
3121     @Method:
3122     @@Name: createPerlAtom
3123     @@enDesc:
3124 wakaba 1.35 Creates a new <IF::PerlAtom> object.
3125 wakaba 1.6 @@Param:
3126     @@@Name: codeArg
3127 wakaba 1.35 @@@Type: DOMString
3128 wakaba 1.6 @@@enDesc:
3129     The code fragment.
3130     @@Return:
3131 wakaba 1.25 @@@Type: PerlAtom
3132 wakaba 1.6 @@@enDesc:
3133     Newly created Perl code object.
3134     @@@PerlDef:
3135 wakaba 1.35 __DEEP{
3136     $r = $self-><M::DOMImpl.createDocument>
3137     -><M::Document.createElementNS> (<Q::pc:>, 'atom');
3138     $r-><AS::Node.textContent> ($codeArg) if defined $codeArg;
3139     }__;
3140 wakaba 1.6
3141     @Method:
3142     @@Name: createPerlStringLiteral
3143     @@enDesc:
3144 wakaba 1.35 Creates a new <IF::PerlStringLiteral> object.
3145 wakaba 1.6 @@Param:
3146     @@@Name: stringArg
3147 wakaba 1.35 @@@Type: DOMString
3148 wakaba 1.6 @@@enDesc: A string.
3149     @@Return:
3150 wakaba 1.25 @@@Type: PerlStringLiteral
3151 wakaba 1.6 @@@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:>, 'stringLiteral');
3157     $r-><AS::Node.textContent> ($stringArg);
3158     }__;
3159 wakaba 1.6
3160     @Method:
3161     @@Name: createPerlVariable
3162     @@enDesc:
3163 wakaba 1.35 Creates a new <IF::PerlVariable> object.
3164 wakaba 1.6 @@Param:
3165     @@@Name: variableType
3166 wakaba 1.35 @@@Type: DOMString
3167 wakaba 1.6 @@@enDesc:
3168     Variable prefix.
3169 wakaba 1.16 @@@nullCase:
3170     @@@@enDesc:
3171     If the <P::packageName> is <DOM::null>, then
3172     the <P::variableType> is detected by the prefix of
3173     <P::localName>. Otherwise, it is an unprefixed variable
3174     such as file handle.
3175 wakaba 1.6 @@Param:
3176     @@@Name: packageName
3177 wakaba 1.35 @@@Type: DOMString
3178 wakaba 1.6 @@@enDesc:
3179     Package name.
3180     @@@nullCase:
3181     @@@@enDesc:
3182     The variable belongs to the current package or a
3183     lexical-scoped variable.
3184     @@Param:
3185     @@@Name: localName
3186 wakaba 1.35 @@@Type: DOMString
3187 wakaba 1.6 @@@enDesc:
3188 wakaba 1.16 Variable name. If both <P::variableType> and <P::packageName>
3189     is <DOM::null>, the <P::localName> value may be prefixed
3190     by any possible <P::variableType> value.
3191 wakaba 1.6 @@Return:
3192 wakaba 1.25 @@@Type: PerlVariable
3193 wakaba 1.6 @@@enDesc:
3194     Newly created Perl variable object.
3195     @@@PerlDef:
3196 wakaba 1.35 __DEEP{
3197     $r = $self-><M::DOMImpl.createDocument>
3198     -><M::Document.createElementNS> (<Q::pc:>, 'variable');
3199     if (not $variableType and not $packageName and
3200     $localName =~ s/^(\\?[\$\@%&*])//) {
3201     $variableType = $1;
3202     }
3203     $r-><AS::PerlVariable.variableType> ($variableType)
3204     if defined $variableType;
3205     $r-><AS::PerlVariable.packageName> ($packageName)
3206     if defined $packageName;
3207     $r-><AS::PerlVariable.pcLocalName> ($localName);
3208     }__;
3209 wakaba 1.8
3210     @Method:
3211     @@Name: createPerlBlock
3212     @@enDesc:
3213 wakaba 1.35 Creates a new <IF::PerlBlock> object.
3214 wakaba 1.8 @@Return:
3215 wakaba 1.25 @@@Type: PerlBlock
3216 wakaba 1.8 @@@enDesc:
3217     Newly created Perl code object.
3218     @@@PerlDef:
3219 wakaba 1.35 __DEEP{
3220     $r = $self-><M::DOMImpl.createDocument>
3221     -><M::Document.createElementNS> (<Q::pc:>, 'block');
3222     }__;
3223 wakaba 1.9
3224     @Method:
3225     @@Name: createPerlBlockContainer
3226     @@enDesc:
3227     Creates a new <Class::ManakaiPerlBlockContainer> object.
3228     @@Return:
3229 wakaba 1.25 @@@Type: PerlCodeBlocks
3230 wakaba 1.9 @@@enDesc:
3231     Newly created Perl code object.
3232     @@@PerlDef:
3233 wakaba 1.35 __DEEP{
3234     $r = $self-><M::DOMImpl.createDocument>
3235     -><M::Document.createElementNS> (<Q::pc:>, 'blockContainer');
3236     }__;
3237 wakaba 1.11
3238     @Method:
3239     @@Name: createPerlStatement
3240     @@enDesc:
3241     Creates a new Perl statement.
3242     @@Param:
3243     @@@Name: codeArg
3244 wakaba 1.35 @@@Type: DOMString
3245 wakaba 1.11 @@@enDesc:
3246     A Perl statement without terminating <Perl::;>.
3247     @@@nullCase:
3248     @@@@enDesc:
3249     No initial content.
3250     @@Return:
3251 wakaba 1.25 @@@Type: PerlStatement
3252 wakaba 1.11 @@@enDesc:
3253     The newly created Perl code object.
3254     @@@PerlDef:
3255 wakaba 1.35 __DEEP{
3256     $r = $self-><M::DOMImpl.createDocument>
3257     -><M::Document.createElementNS> (<Q::pc:>, 'statement');
3258     if (defined $codeArg) {
3259     $r-><M::PerlCodeUnits.appendBare> ($codeArg);
3260     }
3261     }__;
3262 wakaba 1.12
3263     @Method:
3264     @@Name: createPerlIf
3265     @@enDesc:
3266 wakaba 1.35 Creates a <IF::PerlIf> object.
3267 wakaba 1.12 @@Param:
3268     @@@Name: conditionArg
3269 wakaba 1.35 @@@Type: PerlCodeInlines
3270 wakaba 1.12 @@@enDesc:
3271     Conditoon code fragment object.
3272     @@Param:
3273     @@@Name: trueArg
3274 wakaba 1.35 @@@Type: PerlCodeBlocks
3275 wakaba 1.12 @@@enDesc:
3276     A true code fragment object.
3277     @@@nullCase:
3278     @@@@enDesc: No true code.
3279     @@Param:
3280     @@@Name: falseArg
3281 wakaba 1.35 @@@Type: PerlCodeBlocks
3282 wakaba 1.12 @@@enDesc:
3283     A false code fragment object.
3284     @@@nullCase:
3285     @@@@enDesc: No false code.
3286     @@Return:
3287 wakaba 1.25 @@@Type: PerlIf
3288 wakaba 1.12 @@@RaiseException:
3289     @@@@@:BAD_CHILD_ERR
3290     @@@@enDesc:
3291     An attempt is made to append a child
3292     that is not valid type.
3293     @@@RaiseException:
3294     @@@@@:IN_USE_NODE_ERR
3295     @@@@enDesc:
3296     An attempt is made to append a node that is
3297     already used elsewhere.
3298     @@@PerlDef:
3299 wakaba 1.35 for my $arg ([conditionArg => $conditionArg]) {
3300     if ({
3301     atom => 1, tokens => 1, inlineContainer => 1, assignment => true,
3302     inlineUnparsed => 1, variable => 1, stringLiteral => true,
3303     }->{$arg->[1]-><AG::Node.localName>}) {
3304     if ($arg->[1]-><AG::Node.parentNode>) {
3305     __EXCEPTION{IN_USE_NODE_ERR::
3306     pc:childNode => {$arg->[1]},
3307     MDOMX:param-name => {$arg->[0]},
3308     }__;
3309     }
3310     } else {
3311     __EXCEPTION{BAD_CHILD_ERR::
3312     pc:parentNode => {$self},
3313     pc:childNode => {$arg->[1]},
3314     MDOMX:param-name => {$arg->[0]},
3315     }__;
3316     }
3317     } # c
3318    
3319     for my $arg ([trueArg => $trueArg],
3320     [falseArg => $falseArg]) {
3321     next unless $arg->[1];
3322     if ({
3323     blockContainer => true,
3324     }->{$arg->[1]-><AG::Node.localName>}) {
3325     if ($arg->[1]-><AG::Node.parentNode>) {
3326     __EXCEPTION{IN_USE_NODE_ERR::
3327     pc:childNode => {$arg->[1]},
3328     MDOMX:param-name => {$arg->[0]},
3329     }__;
3330     }
3331     } else {
3332     __EXCEPTION{BAD_CHILD_ERR::
3333     pc:parentNode => {$self},
3334     pc:childNode => {$arg->[1]},
3335     MDOMX:param-name => {$arg->[0]},
3336     }__;
3337     }
3338     } # t/f
3339    
3340     __DEEP{
3341     $r = $self-><M::DOMImpl.createDocument>
3342     -><M::Document.createElementNS>
3343     (<Q::pc:>, 'if');
3344     $r-><AS::PerlIf.condition> ($conditionArg) if $conditionArg;
3345     $r-><AS::PerlIf.trueCode> ($trueArg) if $trueArg;
3346     $r-><AS::PerlIf.falseCode> ($falseArg) if $falseArg;
3347     }__;
3348 wakaba 1.25 ##PCImplementation
3349 wakaba 1.1
3350 wakaba 1.5 ResourceDef:
3351 wakaba 1.35 @QName: DOMImpl
3352     @AliasFor: DOMCore|DOMImplementation
3353     @For: ManakaiDOM|DOM
3354    
3355     ResourceDef:
3356     @QName: Node
3357     @AliasFor: DOMCore|Node
3358     @For: ManakaiDOM|DOM
3359    
3360     ResourceDef:
3361     @QName: Element
3362     @AliasFor: DOMCore|Element
3363     @For: ManakaiDOM|DOM
3364    
3365     ResourceDef:
3366     @QName: Document
3367     @AliasFor: DOMCore|Document
3368     @For: ManakaiDOM|DOM
3369    
3370 wakaba 1.4 ## -- Exceptions
3371    
3372 wakaba 1.25 ResourceDef:
3373     @rdf:type:
3374     @@@: dis|MultipleResource
3375     @@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
3376     @resourceFor: ManakaiDOM|ForIF
3377     @resourceFor: ManakaiDOM|ForClass
3378    
3379     @For: ManakaiDOM|Perl
3380    
3381     @rdf:type:
3382 wakaba 1.33 @@@: dx|Interface
3383 wakaba 1.25 @@ForCheck: ManakaiDOM|ForIF
3384    
3385     @rdf:type:
3386 wakaba 1.33 @@@: dx|Class
3387 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3388    
3389     @Implement:
3390 wakaba 1.35 @@@: ||ManakaiDOM|ManakaiDOM|ManakaiDOM||ManakaiDOM|ForIF
3391     @@ContentType: DISCore|TFPQNames
3392     @@ForCheck: ManakaiDOM|ForClass
3393     @Implement:
3394     @@@: ||ManakaiDOM|ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF
3395 wakaba 1.25 @@ContentType: DISCore|TFPQNames
3396     @@ForCheck: ManakaiDOM|ForClass
3397 wakaba 1.35 @dx:implementedBy: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForClass
3398 wakaba 1.25
3399 wakaba 1.35 @f:implements: pc|CoreFeature10
3400 wakaba 1.25
3401     @ISA:
3402 wakaba 1.33 @@@: dx|Exception||ManakaiDOM|Perl
3403 wakaba 1.25 @@ForCheck: ManakaiDOM|ForClass
3404    
3405     @IFQName: PCException
3406 wakaba 1.35 @QName:
3407     @@@: ManakaiPCException
3408     @@ForCheck: ManakaiDOM|ForClass
3409 wakaba 1.25
3410 wakaba 1.4 @enDesc:
3411 wakaba 1.25 Exceptions for the <Module::Util:PerlCode> module.
3412    
3413     @ResourceDef:
3414 wakaba 1.33 @@ForCheck: ManakaiDOM|ForIF
3415     @@rdf:type: DISLang|ConstGroup
3416 wakaba 1.25
3417     @@IFQName: PCExceptionCode
3418    
3419 wakaba 1.4 @@enDesc:
3420 wakaba 1.25 Exception codes for <IF::PCException>.
3421    
3422 wakaba 1.33 @@Type: idl|unsignedShort||ManakaiDOM|all
3423     @@rdfs:subClassOf: idl|unsignedShort||ManakaiDOM|all
3424 wakaba 1.25
3425 wakaba 1.5 @@XConstDef:
3426     @@@Name: HIERARCHY_REQUEST_ERR
3427 wakaba 1.27 @@@Value:
3428     @@@@@:3
3429     @@@@ContentType: DISCore|Integer
3430 wakaba 1.5 @@@enDesc:
3431     An attempt is made to break the hierarchy.
3432     @@@XSubTypeDef:
3433     @@@@QName: BAD_CHILD_ERR
3434     @@@@enDesc:
3435     An attempt is made to append a node as a child whose type
3436     is not allowed.
3437     @@@@XParam:
3438     @@@@@QName: childNode
3439     @@@@@enDesc:
3440     The node attempted to append.
3441     @@@@XParam:
3442     @@@@@QName: parentNode
3443     @@@@@enDesc:
3444     The node to whose child list an attempt to append is made.
3445     @@@XSubTypeDef:
3446     @@@@QName: IN_USE_NODE_ERR
3447     @@@@enDesc:
3448     An attempt is made to append a node that has already been used
3449     elsewhere.
3450     @@@@XParam:
3451     @@@@@QName: childNode
3452     @@@@@enDesc:
3453     The node attempted to append.
3454     @@@@XParam:
3455     @@@@@QName: parentNode
3456     @@@@@enDesc:
3457     The parent node of the <XP::childNode>.
3458 wakaba 1.4 @@XConstDef:
3459     @@@Name: NOT_SUPPORTED_ERR
3460 wakaba 1.27 @@@Value:
3461     @@@@@:9
3462     @@@@ContentType: DISCore|Integer
3463 wakaba 1.4 @@@enDesc:
3464     An attempt is made to do something the implementation does not support.
3465     @@@XSubTypeDef:
3466     @@@@QName: UNSUPPORTED_OPERATOR_ERR
3467     @@@@enDesc:
3468     The implementation does not support the specified operator.
3469     @@@@XParam:
3470     @@@@@QName: operator
3471     @@@@@enDesc:
3472     The operator that is not supported.
3473     @@@@enMufDef:
3474     Operator "%p (name => {<Q::pc:operator>});" is not supported
3475 wakaba 1.25 ##PCException
3476 wakaba 1.4
3477     ElementTypeBinding:
3478     @Name: XConstDef
3479     @ElementType:
3480     dis:ResourceDef
3481     @ShadowContent:
3482 wakaba 1.33 @@rdf:type: dx|ErrorCode
3483 wakaba 1.4
3484     ElementTypeBinding:
3485     @Name: XSubTypeDef
3486     @ElementType:
3487     dis:ResourceDef
3488     @ShadowContent:
3489 wakaba 1.33 @@rdf:type: dx|ErrorSubCode
3490 wakaba 1.4
3491     ElementTypeBinding:
3492     @Name: XParam
3493     @ElementType:
3494 wakaba 1.33 ecore:hasParameter
3495 wakaba 1.4
3496     ElementTypeBinding:
3497     @Name: XParamDef
3498     @ElementType:
3499     dis:ResourceDef
3500     @ShadowContent:
3501 wakaba 1.33 @@rdf:type: ecore|Parameter
3502 wakaba 1.27 @@For: =ManakaiDOM|all
3503 wakaba 1.4
3504     ElementTypeBinding:
3505     @Name: enMufDef
3506     @ElementType:
3507     dis:Def
3508     @ShadowContent:
3509     @@ContentType:
3510     lang:muf
3511     @@lang:en
3512    
3513 wakaba 1.1 ElementTypeBinding:
3514     @Name: Method
3515     @ElementType:
3516     dis:ResourceDef
3517     @ShadowContent:
3518     @@rdf:type:
3519     DISLang:Method
3520    
3521     ElementTypeBinding:
3522     @Name: ToStringMethod
3523     @ElementType:
3524     dis:ResourceDef
3525     @ShadowContent:
3526     @@rdf:type:
3527     DISLang:Method
3528     @@Operator:
3529     @@@@:
3530     DISPerl:AsStringMethod
3531 wakaba 1.35 @@@ContentType: DISCore|QName
3532 wakaba 1.1 @@Description:
3533     @@@lang:en
3534     @@@@:
3535     Returns the textual Perl source code representation of this object.
3536 wakaba 1.9
3537 wakaba 1.14 ElementTypeBinding:
3538     @Name: NumValMethod
3539     @ElementType:
3540     dis:ResourceDef
3541     @ShadowContent:
3542     @@rdf:type:
3543     DISLang:Method
3544     @@Operator:
3545     @@@@: 0+
3546     @@@ContentType:
3547     lang:Perl
3548     @@Description:
3549     @@@lang:en
3550     @@@@:
3551     Returns the numeric value of this object.
3552 wakaba 1.9
3553     ElementTypeBinding:
3554 wakaba 1.1 @Name: IntMethod
3555     @ElementType:
3556     dis:ResourceDef
3557     @ShadowContent:
3558     @@rdf:type:
3559     DISLang:Method
3560     @@ManakaiDOM:isForInternal:1
3561    
3562     ElementTypeBinding:
3563     @Name: Attr
3564     @ElementType:
3565     dis:ResourceDef
3566     @ShadowContent:
3567     @@rdf:type:
3568     DISLang:Attribute
3569    
3570     ElementTypeBinding:
3571     @Name: Return
3572     @ElementType:
3573     dis:ResourceDef
3574     @ShadowContent:
3575     @@rdf:type:
3576     DISLang:MethodReturn
3577    
3578     ElementTypeBinding:
3579     @Name: Get
3580     @ElementType:
3581     dis:ResourceDef
3582     @ShadowContent:
3583     @@rdf:type:
3584     DISLang:AttributeGet
3585    
3586     ElementTypeBinding:
3587     @Name: Set
3588     @ElementType:
3589     dis:ResourceDef
3590     @ShadowContent:
3591     @@rdf:type:
3592     DISLang:AttributeSet
3593    
3594     ElementTypeBinding:
3595     @Name: Param
3596     @ElementType:
3597     dis:ResourceDef
3598     @ShadowContent:
3599     @@rdf:type:
3600     DISLang:MethodParameter
3601    
3602     ElementTypeBinding:
3603     @Name: PerlDef
3604     @ElementType:
3605     dis:Def
3606     @ShadowContent:
3607     @@ContentType:
3608     lang:Perl
3609 wakaba 1.27 @@ForCheck: ManakaiDOM|ForClass
3610 wakaba 1.28
3611     ElementTypeBinding:
3612     @Name: PerlCDef
3613     @ElementType:
3614     dis:Def
3615     @ShadowContent:
3616     @@ContentType:
3617     lang:Perl
3618 wakaba 1.1
3619     ElementTypeBinding:
3620     @Name: disDef
3621     @ElementType:
3622     dis:Def
3623     @ShadowContent:
3624     @@ContentType:
3625     lang:dis
3626 wakaba 1.27 @@ForCheck: ManakaiDOM|ForClass
3627 wakaba 1.1
3628     ElementTypeBinding:
3629     @Name: InCase
3630     @ElementType:
3631     dis:ResourceDef
3632     @ShadowContent:
3633     @@rdf:type:
3634     ManakaiDOM:InCase
3635    
3636     ElementTypeBinding:
3637     @Name: nullCase
3638     @ElementType:
3639     dis:ResourceDef
3640     @ShadowContent:
3641     @@rdf:type:
3642     ManakaiDOM:InCase
3643     @@Value:
3644     @@@is-null:1
3645    
3646     ElementTypeBinding:
3647     @Name: TrueCase
3648     @ElementType:
3649     dis:ResourceDef
3650     @ShadowContent:
3651     @@rdf:type:
3652     ManakaiDOM:InCase
3653 wakaba 1.27 @@Value:
3654     @@@@:1
3655     @@@ContentType: DISCore|Boolean
3656 wakaba 1.1 @@Type:
3657 wakaba 1.12 DOMMain:boolean::ManakaiDOM:all
3658 wakaba 1.1
3659    
3660     ElementTypeBinding:
3661     @Name: FalseCase
3662     @ElementType:
3663     dis:ResourceDef
3664     @ShadowContent:
3665     @@rdf:type:
3666     ManakaiDOM:InCase
3667 wakaba 1.27 @@Value:
3668     @@@@:0
3669     @@@ContentType: DISCore|Boolean
3670 wakaba 1.1 @@Type:
3671 wakaba 1.12 DOMMain:boolean::ManakaiDOM:all
3672 wakaba 1.1
3673     ElementTypeBinding:
3674     @Name: enDesc
3675     @ElementType:
3676     dis:Description
3677     @ShadowContent:
3678     @@lang:en
3679    
3680     ElementTypeBinding:
3681     @Name: PropDef
3682     @ElementType:
3683     dis:ResourceDef
3684     @ShadowContent:
3685     @@rdf:type:
3686     rdf:Property
3687 wakaba 1.27 @@For: =ManakaiDOM|all
3688 wakaba 1.1
3689     ElementTypeBinding:
3690     @Name: NamedParam
3691     @ElementType:
3692     dis:ResourceDef
3693     @ShadowContent:
3694     @@rdf:type:
3695     DISLang:MethodParameter
3696     @@DISPerl:isNamedParameter:1
3697    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24