/[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.14 - (hide annotations) (download)
Wed Apr 27 12:32:39 2005 UTC (20 years, 2 months ago) by wakaba
Branch: MAIN
Changes since 1.13: +137 -23 lines
bin/cdis2pm.pl: Overloads 'bool' if some other operator is overloaded; lib/Message/Util/DIS.dis: Outputting of contants and exception codes implemented

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24