/[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.38 - (hide annotations) (download)
Sat Oct 15 15:28:11 2005 UTC (19 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.37: +10 -5 lines
++ manakai/lib/Message/Util/ChangeLog	15 Oct 2005 14:07:35 -0000
2005-10-14  Wakaba  <wakaba@suika.fam.cx>

	* ManakaiNode.dis (anydata0): New property type.

	* PerlCode.dis (stringify): Prints node id if file name
	is not available.
	(perlLiteral): Prints as is if the value is blessed
	with "manakai::code" package.

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

	* Perl.dis (plCodeFragment): Output processor ("DISLang:OutputProcessor")
	supported for methods.  "idl:void" type supported.

2005-10-14  Wakaba  <wakaba@suika.fam.cx>

	* Perl.dis (plGeneratePerlModule): Don't generate information
	on anydata* and irefnode0 properties since they are not used in fact.
	(plGeneratePerlModule, plCodeFragment): The
	"DOMCore:DOMConfigurationParameter" type supported.

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

	* DOMCore.dis (Require): References "DOMLS.dis" module.
	(CParam): Definitions for LS module added.

	* DOMLS.dis (ManakaiDOMLSInput): The input processor
	is also an output processor now.
	(ManakaiDOMLSResourceResolver): Implemented.
	(CParam): Definitions updated.

2005-10-14  Wakaba  <wakaba@suika.fam.cx>

	* DOMCore.dis (NOT_RECOGNIZED_CONFIG_PARAM_ERR,
	NOT_SUPPORTED_CONFIG_VALUE_ERR,
	INCOMPATIBLE_CONFIG_VALUE_ERR): New error subcodes.
	(DOMConfiguration): Implemented.
	(CParam): Definitions updated.

	* DOMMain.dis (DOMURIs): New data type.

++ manakai/lib/manakai/ChangeLog	15 Oct 2005 14:10:15 -0000
2005-10-15  Wakaba  <wakaba@suika.fam.cx>

	* DISLang.dis (DISLang:OutputProcessor): New type.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24