/[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.6 - (hide annotations) (download)
Wed Mar 16 09:08:14 2005 UTC (20 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.5: +1122 -143 lines
Perl inline preprocessing implemented (but not tested whether it does work or not)

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.6 $Date: 2005/03/06 11:12:42 $
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     if ($nt eq 'unparsed') {
271     $pack = <ClassName::ManakaiPerlUnparsedCode>;
272     } elsif ($nt eq 'bare') {
273     $pack = <ClassName::ManakaiPerlBare>;
274     } elsif ($nt eq 'atom') {
275     $pack = <ClassName::ManakaiPerlAtom>;
276     } elsif ($nt eq 'variable') {
277     $pack = <ClassName::ManakaiPerlVariable>;
278     } elsif ($nt eq 'inunparsed') {
279     $pack = <ClassName::ManakaiPerlInlineUnparsedCode>;
280     } elsif ($nt eq 'incontainer') {
281     $pack = <ClassName::ManakaiPerlInlineContainer>;
282     } elsif ($nt eq 'string') {
283     $pack = <ClassName::ManakaiPerlStringLiteral>;
284     } elsif ($nt eq 'sub') {
285     $pack = <ClassName::ManakaiPerlSub>;
286     } elsif ($nt eq 'package') {
287     $pack = <ClassName::ManakaiPerlPackageScope>;
288     } elsif ($nt eq 'file') {
289     $pack = <ClassName::ManakaiPerlFile>;
290     } else {
291     __ASSERT{DISPerl:invariant::
292     msg => {qq[Node type: "$nt" ].
293     qq[(ref: "@{[ref $object]}")]},
294     }__;
295     }
296     __CODE{ManakaiNode:getNewReference::
297     $object => $object, $ref => $r, $class => $pack}__;
298    
299     @Method:
300     @@Name: replaceVariable
301     @@enDesc:
302     Replaces a variable.
303     \
304     {NOTE:: For objects of type <Class::ManakaiPerlFile>,
305     <Class::ManakaiPerlPackageScope> and
306     <Class::ManakaiPerlSub>, the result is undefined.
307     \
308     }
309     @@Param:
310     @@@Name: originalVariable
311     @@@Type:
312     lang:Perl::ManakaiDOM:all
313     @@@enDesc:
314     Original variable specification, including prefix.
315     \
316     {NOTE:: Qualified name variable and hash key is not supported.
317     \
318     }
319     @@Param:
320     @@@Name: newValue
321     @@@Type: ManakaiPerlCodeFragment
322     @@@enDesc:
323     New value to replace.
324     @@Return:
325     @@@PerlDef:
326     my $node = $self->{<Q::TreeCore:node>};
327     if ($node->{<Q::pc:nodeType>} eq 'unparsed' or
328     $node->{<Q::pc:nodeType>} eq 'inunparsed') {
329     my $newVariable = $newValue->stringify;
330     $node->{<Q::pc:code>} =~ s/\Q$originalVariable\E\b/$newVariable/g;
331     } elsif ($node->{<Q::pc:nodeType>} eq 'variable') {
332     if (substr ($originalVariable, 0, 1) eq
333     $node->{<Q::pc:variableType>} and
334     not $node->{<Q::pc:packageName>} and
335     substr ($originalVariable, 1) eq
336     $node->{<Q::pc:localName>} and
337     not $node->{<Q::pc:hashKey>}) {
338     $node->{<Q::pc:localName>} = substr ($originalVariable, 1);
339     }
340     } elsif ($node->{<Q::pc:childNodes>}) {
341     __DEEP{
342     for my $cno (@{$node->{<Q::pc:childNodes>}}) {
343     my $cn;
344     __CODE{ManakaiNode:getWeakReference::
345     $object => $cno, $ref => $cn,
346     $class => {<ClassName::ManakaiPerlCodeFragment>},
347     }__;
348     $cn-><M::ManakaiPerlCodeFragment.replaceVariable>
349     ($originalVariable => $newValue);
350     }
351     }__;
352     }
353 wakaba 1.1 ##PerlCodeFragment
354    
355 wakaba 1.6 PropDef:
356     @QName: nodeType
357     @enDesc:
358     Node type.
359    
360 wakaba 1.1 ClsDef:
361     @ClsQName: ManakaiPerlFile
362     @ClsISA: ManakaiPerlCodeFragment
363     @enDesc:
364     Perl source code files.
365    
366     @IntMethod:
367     @@Name:newObject
368     @@ManakaiDOM:isStatic:1
369     @@Description:
370     @@@lang:en
371     @@@@:
372     Creates a new instance object for <Class::ManakaiPerlFile>.
373     @@Return:
374     @@@Type:
375     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
376     @@@Description:
377     @@@@lang:en
378     @@@@@:
379     The newly created node object.
380     @@@PerlDef:
381     @@@@@:
382     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
383     ::ManakaiDOM:Perl.new>;
384     push @{$node->{<Q::TreeCore:subnode>}}, <Q::pc:childNodes>;
385     $node->{<Q::pc:childNodes>} = [];
386     $node->{<Q::pc:sourceFile>} = '';
387     $node->{<Q::pc:sourceModule>} = '';
388     $node->{<Q::pc:sourceFor>} = '';
389     $node->{<Q::pc:currentPackage>} = 'main';
390     $node->{<Q::pc:currentChunk>} = 0;
391 wakaba 1.6 $node->{<Q::pc:nodeType>} = 'file';
392 wakaba 1.1 @@@@ImplNote:
393     @@@@@lang:en
394     @@@@@@:
395     Properties: <Q::pc:sourceFile>,
396     <Q::pc:sourceModule>, <Q::pc:sourceFor>, <Q::childNodes>,
397 wakaba 1.6 <Q::pc:currentPackage>, <Q::pc:currentChunk>,
398     <Q::pc:nodeType>.
399 wakaba 1.1
400     @Method:
401     @@Name: appendNewPackage
402     @@enDesc:
403     Appends a new package scope block.
404     @@Param:
405     @@@Name: packageName
406     @@@Type:
407     Perl:package-name::ManakaiDOM:all
408     @@@enDesc:
409     The fully-qualified name of the package to create.
410     @@Return:
411     @@@Type: ManakaiPerlPackageScope
412     @@@enDesc:
413     The newly created package scope object.
414     @@@PerlDef:
415     $r = <ClassM::ManakaiPerlPackageScope.newObject>;
416     $r->{<Q::pc:packageName>} = $packageName;
417     $self->{<Q::TreeCore:node>}
418     -><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
419     .importTree> ($r);
420     push @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}}, $r;
421     $r->{<Q::pc:parent>} = $self->{<Q::TreeCore:node>};
422 wakaba 1.6 __CODE{ManakaiNode:getNewReference::
423     $object => $r, $ref => $r,
424     $class => {<ClassName::ManakaiPerlPackageScope>}}__;
425 wakaba 1.1
426     @Method:
427     @@Name: getFirstPackage
428     @@enDesc:
429     Gets the first package scope block of a name.
430     @@Param:
431     @@@Name: packageName
432     @@@@Type:
433     Perl:package-name::ManakaiDOM:all
434     @@@@enDesc:
435     The fully-qualified name of the package to get.
436     @@NamedParam:
437     @@@Name: makeNewPackage
438     @@@Type:
439     DOMMain:boolean
440     @@@enDesc:
441     Whether a new package scope object should be created if
442     no package of <P::packageName> found.
443     @@@TrueCase:
444     @@@@enDesc:
445     Makes a new object if not found.
446     @@@FalseCase:
447     @@@@enDesc:
448     Don't make a new object.
449     @@Return:
450     @@@Type: ManakaiPerlPackageScope
451     @@@enDesc:
452     The first package scope object whose name is equal to
453     <P::packageName>.
454     @@@nullCase:
455     @@@@enDesc:
456     There is no <P::packageName> package object and
457     the <P::makeNewPackage> parameter is set to <DOM::false>.
458     @@@PerlDef:
459     for my $cn (@{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}}) {
460     if ($cn->{<Q::pc:packageName>} eq $packageName) {
461     $r = $cn;
462     last;
463     }
464     }
465     if ($r) {
466 wakaba 1.6 __CODE{ManakaiNode:getNewReference::
467     $object => $r, $ref => $r,
468     $class => {<ClassName::ManakaiPerlPackageScope>}}__;
469 wakaba 1.1 } elsif ($makeNewPackage) {
470     __DEEP{
471     $r = $self-><M::ManakaiPerlFile.appendNewPackage> ($packageName);
472     }__;
473     }
474    
475     @Method:
476     @@Name: getLastPackage
477     @@enDesc:
478     Gets the last package scope block of a name.
479     @@Param:
480     @@@Name: packageName
481     @@@@Type:
482     Perl:package-name::ManakaiDOM:all
483     @@@@enDesc:
484     The fully-qualified name of the package to get.
485     @@NamedParam:
486     @@@Name: makeNewPackage
487     @@@Type:
488     DOMMain:boolean
489     @@@enDesc:
490     Whether a new package scope object should be created if
491     no package of <P::packageName> found.
492     @@@TrueCase:
493     @@@@enDesc:
494     Makes a new object if not found.
495     @@@FalseCase:
496     @@@@enDesc:
497     Don't make a new object.
498     @@Return:
499     @@@Type: ManakaiPerlPackageScope
500     @@@enDesc:
501     The last package scope object whose name is equal to
502     <P::packageName>.
503     @@@nullCase:
504     @@@@enDesc:
505     There is no <P::packageName> package object and
506     the <P::makeNewPackage> parameter is set to <DOM::false>.
507     @@@PerlDef:
508     for my $cn (reverse @{$self->{<Q::TreeCore:node>}
509     ->{<Q::pc:childNodes>}}) {
510     if ($cn->{<Q::pc:packageName>} eq $packageName) {
511     $r = $cn;
512     last;
513     }
514     }
515     if ($r) {
516 wakaba 1.6 __CODE{ManakaiNode:getNewReference::
517     $object => $r, $ref => $r,
518     $class => {<ClassName::ManakaiPerlPackageScope>}}__;
519 wakaba 1.1 } elsif ($makeNewPackage) {
520     __DEEP{
521     $r = $self-><M::ManakaiPerlFile.appendNewPackage> ($packageName);
522     }__;
523     }
524    
525     @Attr:
526     @@Name: length
527     @@enDesc:
528     The number of child code fragments.
529     @@Type:
530     DOMMain:unsigned-long
531     @@Get:
532     @@@PerlDef:
533 wakaba 1.4 $r = @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}};
534 wakaba 1.1
535     @Attr:
536     @@Name: sourceFile
537     @@enDesc:
538     The file name of the source file from which this
539     Perl code is primary generated.
540     @@Get:
541     @@@Type:
542     DISLang:String
543     @@@disDef:
544     @@@@GetProp: sourceFile
545     @@Set:
546     @@@Type:
547     DISLang:String
548     @@@disDef:
549     @@@@SetProp: sourceFile
550    
551     @Attr:
552     @@Name: sourceModule
553     @@enDesc:
554     The name URI reference of the source module that this package defines.
555     @@Get:
556     @@@Type:
557     DISLang:String
558     @@@disDef:
559     @@@@GetProp: sourceModule
560     @@Set:
561     @@@Type:
562     DISLang:String
563     @@@disDef:
564     @@@@SetProp: sourceModule
565    
566     @Attr:
567     @@Name: sourceFor
568     @@enDesc:
569     The URI reference of the source module <QUOTE::for> for which this
570     package is.
571     @@Get:
572     @@@Type:
573     DISLang:String
574     @@@disDef:
575     @@@@GetProp: sourceFor
576     @@Set:
577     @@@Type:
578     DISLang:String
579     @@@disDef:
580     @@@@SetProp: sourceFor
581    
582     @ToStringMethod:
583     @@Return:
584     @@@Type:
585     DISLang:String
586     @@@enDesc:
587     The Perl code generated.
588     @@@PerlDef:
589     __DEEP{
590     my $node = $self->{<Q::TreeCore:node>};
591     ## -- Header
592     $r = qq<#!/usr/bin/perl \n>;
593     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
594     (q<This file is automatically generated>);
595     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
596     (q< at >.<ClassM::ManakaiPerlCodeImplementation
597     .rfc3339DateTime> (time).q<,>);
598     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
599     (q< from file ">.$node->{<Q::sourceFile>}.q<",>);
600     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
601     (q[ module <].$node->{<Q::sourceModule>}.q[>,]);
602     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
603     (q[ for <].$node->{<Q::sourceFor>}.q[>.]);
604     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
605     (q<Don't edit by hand!>);
606     $r .= qq<use strict;\n>;
607     $self-><AS::ManakaiPerlFile.currentPackage> ('main');
608 wakaba 1.6 $self-><AS::ManakaiPerlFile.currentChunkNumber> (0);
609 wakaba 1.1
610     ## -- Packages
611     my $pack = {};
612     for my $sp (@{$node->{<Q::pc:childNodes>}}) {
613 wakaba 1.6 my $spe;
614     __CODE{ManakaiNode:getWeakReference::
615     $object => $sp, $ref => $spe,
616     $class => {<ClassName::ManakaiPerlPackageScope>}}__;
617 wakaba 1.1 $r .= $spe->stringify;
618     for my $ipack (keys %{$sp->{<Q::dis:Implement>}}) {
619     $pack->{$ipack} ||= true; # not defined
620     }
621     $pack->{$sp->{<Q::pc:packageName>}} = []; # defined
622     }
623    
624     ## -- Enables interface packages
625 wakaba 1.3 my @packs = map {'$' . $_ . '::'}
626     grep {not ref $pack->{$_} and $pack->{$_}}
627     keys %$pack;
628     $r .= q<for (>. join (', ', @packs) . qq<){}\n> if @packs;
629 wakaba 1.1
630     ## -- Footer
631     $r .= <ClassM::ManakaiPerlCodeImplementation.perlComment>
632 wakaba 1.2 (q[License: <].$node->{<Q::dis:License>}.qq[>\n]);
633 wakaba 1.1 $r .= qq<1;\n>;
634     }__;
635    
636     @Attr:
637     @@Name: currentPackage
638     @@enDesc:
639     The current Perl package (used in stringify method).
640     @@Type:
641     Perl:package-name::ManakaiDOM:all
642     @@Get:
643     @@@disDef:
644     @@@@GetProp: currentPackage
645     @@Set:
646     @@@disDef:
647     @@@@SetProp: currentPackage
648    
649     @Attr:
650 wakaba 1.6 @@Name: currentChunkNumber
651 wakaba 1.1 @@enDesc:
652 wakaba 1.6 The current code chunk number (used in stringify method).
653 wakaba 1.1 @@Type:
654     DOMMain:unsigned-long::ManakaiDOM:all
655     @@Get:
656     @@@disDef:
657     @@@@GetProp: currentChunk
658     @@Set:
659     @@@disDef:
660     @@@@SetProp: currentChunk
661 wakaba 1.6
662     @Method:
663     @@Name: getNextChunkNumber
664     @@enDesc:
665     Increments the current chunk number of this file
666     and returns it.
667     @@Return:
668     @@@Type:
669     DOMMain:unsigned-long::ManakaiDOM:all
670     @@@enDesc:
671     The next chunk number.
672     @@@PerlDef:
673     $r = ++$self->{<Q::TreeCore:node>}->{<Q::pc:currentChunk>};
674 wakaba 1.2
675     @Attr:
676     @@Name: licenseURI
677     @@enDesc:
678     The license term URI reference for this code.
679     @@Type:
680     DISLang:String::ManakaiDOM:all
681     @@Get:
682     @@@disDef:
683     @@@@GetProp:
684     dis:License
685     @@Set:
686     @@@disDef:
687     @@@@SetProp:
688     dis:License
689 wakaba 1.1 ##PerlFile
690    
691     PropDef:
692     @QName: sourceModule
693     @enDesc:
694     The soruce module name URI reference.
695    
696     PropDef:
697     @QName: sourceFor
698     @enDesc:
699     The source module <QUOTE::for> URI reference.
700    
701     PropDef:
702     @QName: currentPackage
703     @enDesc:
704     The current Perl package name (used for stringify).
705    
706     PropDef:
707     @QName: currentChunk
708     @enDesc:
709     The current code chunk (used for stringify).
710    
711     ClsDef:
712     @ClsQName: ManakaiPerlPackageScope
713     @ClsISA: ManakaiPerlCodeFragment
714    
715     @Attr:
716     @@Name: packageName
717     @@Type:
718     Perl:package-name
719     @@enDesc:
720     The fully-qualified package name.
721     @@Get:
722     @@@disDef:
723     @@@@GetProp: packageName
724    
725     @IntMethod:
726     @@Name:newObject
727     @@ManakaiDOM:isStatic:1
728     @@Description:
729     @@@lang:en
730     @@@@:
731     Creates a new instance object for <Class::ManakaiPerlPackageScope>.
732     @@Return:
733     @@@Type:
734     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
735     @@@Description:
736     @@@@lang:en
737     @@@@@:
738     The newly created node object.
739     @@@PerlDef:
740     @@@@@:
741     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
742     ::ManakaiDOM:Perl.new>;
743 wakaba 1.4 push @{$node->{<Q::TreeCore:subnode2>}}, <Q::pc:sub>,
744     <Q::dis2pm:overload>;
745 wakaba 1.1 push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
746     $node->{<Q::pc:sub>} = {};
747     $node->{<Q::dis:ISA>} = [];
748     $node->{<Q::dis:Implement>} = {};
749 wakaba 1.4 $node->{<Q::dis2pm:overload>} = {};
750 wakaba 1.6 $node->{<Q::pc:nodeType>} = 'package';
751     @@@@ImplNote:
752     @@@@@lang:en
753     @@@@@@:
754     Properties: <Q::pc:sub>, <Q::dis2pm:overload>,
755     <Q::dis:ISA>, <Q::dis:Implement>,
756     <Q::pc:nodeType>.
757 wakaba 1.1
758     @Method:
759     @@Name: getSub
760     @@enDesc:
761     Gets a subroutine.
762     @@Param:
763     @@@Name: subName
764     @@@Type:
765     DISPerl:SubName::ManakaiDOM:all
766     @@@enDesc:
767     The name of subroutine to get.
768     @@NamedParam:
769     @@@Name: makeNewNode
770     @@@Type:
771     DOMMain:boolean
772     @@@enDesc:
773     Whether a new subroutine object should be created,
774     if it is not exist, or not.
775     @@Return:
776     @@@Type: ManakaiPerlSub
777     @@@enDesc:
778     The subroutine object.
779 wakaba 1.4 @@@nullCase:
780     @@@@enDesc:
781     Either the specified subroutine is not found and
782     the <P::makeNewNode> parameter is set to <DOM::false> or
783     the subroutine is defined as an alias.
784 wakaba 1.1 @@@PerlDef:
785     if ($self->{<Q::TreeCore:node>}->{<Q::pc:sub>}->{$subName}) {
786 wakaba 1.4 $r = ref $self->{<Q::TreeCore:node>}->{<Q::pc:sub>}->{$subName}
787     ? $self->{<Q::TreeCore:node>}->{<Q::pc:sub>}->{$subName} : null;
788 wakaba 1.1 } elsif ($makeNewNode) {
789     $r = $self->{<Q::TreeCore:node>}->{<Q::pc:sub>}->{$subName}
790     = <ClassM::ManakaiPerlSub.newObject>;
791     $self->{<Q::TreeCore:node>}
792     -><M::ManakaiDOM:ManakaiDOMNodeObject
793     ::ManakaiDOM:Perl.importTree> ($r);
794     $r->{<Q::pc:parent>} = $self->{<Q::TreeCore:node>};
795     $r->{<Q::pc:localName>} = $subName;
796     }
797 wakaba 1.6 if ($r) {
798     __CODE{ManakaiNode:getNewReference::
799     $object => $r, $ref => $r,
800     $class => {<ClassName::ManakaiPerlSub>}}__;
801     }
802 wakaba 1.1
803 wakaba 1.4 @Method:
804 wakaba 1.5 @@Name: setSub
805     @@enDesc:
806     Sets a subrotine.
807     @@Param:
808     @@@Name: subName
809     @@@Type:
810     DISLang:String::ManakaiDOM:all
811     @@@enDesc:
812     The name of the subroutine.
813     \
814     {NOTE:: The <P::subName> value must be equal to the
815     <A::ManakaiPerlSub.localName> of the <P::subArg>.
816     @@Param:
817     @@@Name: subArg
818     @@@Type: ManakaiPerlSub
819     @@@enDesc:
820     The subroutine object.
821     @@Return:
822     @@@RaiseException:
823     @@@@@:IN_USE_NODE_ERR
824     @@@@enDesc:
825     An attempt is made to set a subroutine that is
826     already used elsewhere.
827     @@@PerlDef:
828     my $ops = $self->{<Q::TreeCore:node>}->{<Q::pc:sub>};
829     if (ref $ops->{$subName}) {
830     CORE::delete $ops->{<Q::pc:parent>};
831     $ops->{$subName}
832     -><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>;
833     }
834     if ($subArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}) {
835     __EXCEPTION{IN_USE_NODE_ERR::
836     pc:parentNode => {$subArg->{<Q::TreeCore:node>}
837     ->{<Q::pc:parent>}},
838     pc:childNode => {$subArg},
839     }__;
840     }
841     $self->{<Q::TreeCore:node>}-><M::MNodeObject.importTree>
842     ($subArg->{<Q::TreeCore:node>});
843     $ops->{$subName} = $subArg->{<Q::TreeCore:node>};
844     $subArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}
845     = $self->{<Q::TreeCore:node>};
846    
847     @Method:
848 wakaba 1.4 @@Name: getSubAliasName
849     @@enDesc:
850     Gets the real name of a subroutine.
851     @@Param:
852     @@@Name: subName
853     @@@Type:
854     DISLang:String::ManakaiDOM:all
855     @@@enDesc:
856     The name of the alias subroutine.
857     @@Return:
858     @@@Type:
859     DISLang:String::ManakaiDOM:all
860     @@@enDesc:
861     The real name.
862     @@@nullCase:
863     @@@@enDesc:
864     The specified name is used.
865     @@@InCase:
866     @@@@Value:\#CODE
867     @@@@enDesc:
868     The specified name is not an alias.
869     @@@PerlDef:
870     if ($self->{<Q::TreeCore:node>}->{<Q::sub>}->{$subName}) {
871     $r = ref $self->{<Q::TreeCore:node>}
872     ->{<Q::sub>}->{$subName}
873     ? q<#CODE> : $self->{<Q::TreeCore:node>}
874     ->{<Q::sub>}->{$subName};
875     }
876    
877     @Method:
878     @@Name: setSubAliasName
879     @@enDesc:
880     Sets a subroutine name as an alias of another subroutine.
881     @@Param:
882     @@@Name: aliasName
883     @@@Type:
884     DISLang:String::ManakaiDOM:all
885     @@@enDesc:
886     The alias name.
887     @@Param:
888     @@@Name: realName
889     @@@Type:
890     DISLang:String::ManakaiDOM:all
891     @@@enDesc:
892     The real name.
893     @@Return:
894     @@@UnknownOperatorException:
895     @@@PerlDef:
896     my $ops = $self->{<Q::TreeCore:node>}->{<Q::sub>};
897     if (ref $ops->{$aliasName}) {
898     CORE::delete $ops->{<Q::pc:parent>};
899     $ops->{$aliasName}
900     -><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>;
901     }
902     $ops->{$aliasName} = $realName;
903    
904     @Method:
905     @@Name: getOverloadSub
906     @@enDesc:
907     Gets an overloading subroutine.
908     @@Param:
909     @@@Name: opName
910     @@@Type:
911     DISLang:String::ManakaiDOM:all
912     @@@enDesc:
913     The name of the overloaded operator.
914     @@NamedParam:
915     @@@Name: makeNewNode
916     @@@Type:
917     DOMMain:boolean
918     @@@enDesc:
919     Whether a new subroutine object should be created,
920     if it is not exist, or not.
921     @@Return:
922     @@@Type: ManakaiPerlSub
923     @@@enDesc:
924     The subroutine object.
925     @@@nullCase:
926     @@@@enDesc:
927     Either the specified subroutine is not found and
928     the <P::makeNewNode> parameter is set to <DOM::false> or
929     the specified operator is overloaded by specifying method name.
930     @@@UnknownOperatorException:
931     @@@PerlDef:
932     unless (<Code::operatorNameList>->{$opName}) {
933     __EXCEPTION{UNSUPPORTED_OPERATOR_ERR::
934     pc:operator => {$opName},
935     }__;
936     }
937     if ($self->{<Q::TreeCore:node>}->{<Q::dis2pm:operator>}->{$opName}) {
938     $r = ref $self->{<Q::TreeCore:node>}
939     ->{<Q::dis2pm:operator>}->{$opName}
940     ? $self->{<Q::TreeCore:node>}
941     ->{<Q::dis2pm:operator>}->{$opName} : null;
942     } elsif ($makeNewNode) {
943     $r = $self->{<Q::TreeCore:node>}->{<Q::dis2pm:operator>}->{$opName}
944     = <ClassM::ManakaiPerlSub.newObject>;
945     $self->{<Q::TreeCore:node>}
946     -><M::ManakaiDOM:ManakaiDOMNodeObject
947     ::ManakaiDOM:Perl.importTree> ($r);
948     $r->{<Q::pc:parent>} = $self->{<Q::TreeCore:node>};
949     }
950 wakaba 1.6 if ($r) {
951     __CODE{ManakaiNode:getNewReference::
952     $object => $r, $ref => $r,
953     $class => {<ClassName::ManakaiPerlSub>}}__;
954     }
955 wakaba 1.4
956     @Method:
957 wakaba 1.5 @@Name: setOverloadSub
958     @@enDesc:
959     Sets an overloading subrotine.
960     @@Param:
961     @@@Name: opName
962     @@@Type:
963     DISLang:String::ManakaiDOM:all
964     @@@enDesc:
965     The name of the opeartor to overload.
966     @@Param:
967     @@@Name: subArg
968     @@@Type: ManakaiPerlSub
969     @@@enDesc:
970     The subroutine object.
971     @@Return:
972     @@@UnknownOperatorException:
973     @@@RaiseException:
974     @@@@@:IN_USE_NODE_ERR
975     @@@@enDesc:
976     An attempt is made to set a subroutine that is
977     already used elsewhere.
978     @@@PerlDef:
979     unless (<Code::operatorNameList>->{$opName}) {
980     __EXCEPTION{UNSUPPORTED_OPERATOR_ERR::
981     pc:operator => {$opName},
982     }__;
983     }
984     my $ops = $self->{<Q::TreeCore:node>}->{<Q::dis2pm:operator>};
985     if (ref $ops->{$opName}) {
986     CORE::delete $ops->{<Q::pc:parent>};
987     $ops->{$opName}
988     -><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>;
989     }
990     if ($subArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}) {
991     __EXCEPTION{IN_USE_NODE_ERR::
992     pc:parentNode => {$self},
993     pc:childNode => {$subArg},
994     }__;
995     }
996     $self->{<Q::TreeCore:node>}-><M::MNodeObject.importTree>
997     ($subArg->{<Q::TreeCore:node>});
998     $ops->{$opName} = $subArg->{<Q::TreeCore:node>};
999     $subArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}
1000     = $self->{<Q::TreeCore:node>};
1001    
1002    
1003     @Method:
1004 wakaba 1.4 @@Name: getOverloadMethodName
1005     @@enDesc:
1006     Gets an overloading method name.
1007     @@Param:
1008     @@@Name: opName
1009     @@@Type:
1010     DISLang:String::ManakaiDOM:all
1011     @@@enDesc:
1012     The name of the overloaded operator.
1013     @@Return:
1014     @@@Type:
1015     DISLang:String::ManakaiDOM:all
1016     @@@enDesc:
1017     The method name.
1018     @@@nullCase:
1019     @@@@enDesc:
1020     The specified operator is not overloaded.
1021     @@@InCase:
1022     @@@@Value:\#CODE
1023     @@@@enDesc:
1024     The operator is overloaded by an anonymous subroutine.
1025     @@@PerlDef:
1026     if ($self->{<Q::TreeCore:node>}->{<Q::dis2pm:operator>}->{$opName}) {
1027     $r = ref $self->{<Q::TreeCore:node>}
1028     ->{<Q::dis2pm:operator>}->{$opName}
1029     ? q<#CODE> : $self->{<Q::TreeCore:node>}
1030     ->{<Q::dis2pm:operator>}->{$opName};
1031     }
1032    
1033     @Method:
1034     @@Name: setOverloadMethodName
1035     @@enDesc:
1036     Sets an overloading method name.
1037     @@Param:
1038     @@@Name: opName
1039     @@@Type:
1040     DISLang:String::ManakaiDOM:all
1041     @@@enDesc:
1042     The name of the overloaded operator.
1043     @@Param:
1044     @@@Name: methodName
1045     @@@Type:
1046     DISLang:String::ManakaiDOM:all
1047     @@@enDesc:
1048     The name of the method by which overloads an operator.
1049     \
1050     {NOTE:: The method may or may not belong to this package.
1051     \
1052     }
1053     @@Return:
1054     @@@UnknownOperatorException:
1055     @@@PerlDef:
1056     unless (<Code::operatorNameList>->{$opName}) {
1057     __EXCEPTION{UNSUPPORTED_OPERATOR_ERR::
1058     pc:operator => {$opName},
1059     }__;
1060     }
1061     my $ops = $self->{<Q::TreeCore:node>}->{<Q::dis2pm:operator>};
1062     if (ref $ops->{$opName}) {
1063     CORE::delete $ops->{<Q::pc:parent>};
1064     $ops->{$opName}
1065     -><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl.orphanate>;
1066     }
1067     $ops->{$opName} = $methodName;
1068    
1069 wakaba 1.1 @Attr:
1070     @@Name: length
1071     @@enDesc:
1072     The number of child code fragments.
1073     @@Type:
1074     DOMMain:unsigned-long
1075     @@Get:
1076     @@@PerlDef:
1077 wakaba 1.4 $r = keys (%{$self->{<Q::TreeCore:node>}->{<Q::pc:sub>}})
1078     + keys (%{$self->{<Q::TreeCore:node>}->{<Q::dis2pm:operator>}});
1079 wakaba 1.1
1080     @Method:
1081     @@Name: addIsaPackage
1082     @@enDesc:
1083     Adds a class package that this class inherits.
1084     @@Param:
1085     @@@Name: packageName
1086     @@@Type:
1087     Perl:package-name::ManakaiDOM:all
1088     @@@enDesc:
1089     The name of package to add.
1090     @@Return:
1091     @@@PerlDef:
1092     push @{$self->{<Q::TreeCore:node>}->{<Q::dis:ISA>}}, $packageName;
1093    
1094     @Method:
1095     @@Name: addImplementPackage
1096     @@enDesc:
1097     Adds a interface package that this class implements.
1098     @@Param:
1099     @@@Name: packageName
1100     @@@Type:
1101     Perl:package-name::ManakaiDOM:all
1102     @@@enDesc:
1103     The name of package to add.
1104     @@Return:
1105     @@@PerlDef:
1106     $self->{<Q::TreeCore:node>}->{<Q::dis:Implement>}->{$packageName} = true;
1107    
1108     @ToStringMethod:
1109     @@Return:
1110     @@@Type:
1111     DISLang:String
1112     @@@enDesc:
1113     Perl code.
1114     @@@PerlDef:
1115     my $file = $self-><AG::ManakaiPerlCodeFragment.parentNode>;
1116     my $node = $self->{<Q::TreeCore:node>};
1117     my $pn = $node->{<Q::pc:packageName>};
1118     $r .= q<package > . $pn . ";\n";
1119     __DEEP{
1120     $file-><AS::ManakaiPerlFile.currentPackage> ($pn);
1121     $r .= 'our $VERSION = '.
1122     <ClassM::ManakaiPerlCodeImplementation.versionDateTime> (time).
1123     ";\n";
1124     }__;
1125     my @isa = (@{$node->{<Q::dis:ISA>}},
1126     sort keys %{$node->{<Q::dis:Implement>}});
1127     if (@isa) {
1128     $r .= 'push our @ISA, ' .
1129     <ClassM::ManakaiPerlCodeImplementation.perlList> (\@isa) .
1130     ";\n";
1131     }
1132 wakaba 1.4 for my $cnk (keys %{$node->{<Q::pc:sub>}}) {
1133     my $cno = $node->{<Q::pc:sub>}->{$cnk};
1134     if (ref $cno) {
1135 wakaba 1.6 my $cn;
1136     __CODE{ManakaiNode:getWeakReference::
1137     $object => $cno, $ref => $cn,
1138     $class => {<ClassName::ManakaiPerlSub>}}__;
1139 wakaba 1.4 $r .= $cn->stringify;
1140     } else {
1141     $r .= qq<*$cnk = \&$cno;\n>;
1142     }
1143     }
1144     my $op = '';
1145     for my $cnk (keys %{$node->{<Q::dis2pm:operator>}}) {
1146     my $cno = $node->{<Q::dis2pm:operator>}->{$cnk};
1147     if (ref $cno) {
1148 wakaba 1.6 my $cn;
1149     __CODE{ManakaiNode:getWeakReference::
1150     $object => $cno, $ref => $cn,
1151     $class => {<ClassName::ManakaiPerlSub>}}__;
1152 wakaba 1.4 $op .= <ClassM::ManakaiPerlCodeImplementation.perlLiteral> ($cnk)
1153     . ' => ' . $cn->stringify . ', ';
1154     } elsif (defined $cno) {
1155     $op .= <ClassM::ManakaiPerlCodeImplementation.perlList>
1156     ([$cnk => $cno]) . ', ';
1157     }
1158     }
1159     $r .= 'use overload ' . $op . qq[fallback => 1;\n] if $op;
1160 wakaba 1.1 ##PerlPackageScope
1161    
1162 wakaba 1.4 PropDef:
1163     @QName:
1164     dis2pm:operator
1165     @enDesc:
1166     Overloaded operators.
1167    
1168     ElementTypeBinding:
1169     @Name: UnknownOperatorException
1170     @ElementType:
1171     ManakaiDOM:raises
1172     @ShadowContent:
1173     @@@:UNSUPPORTED_OPERATOR_ERR
1174     @@enDesc:
1175     An attempt is made to overload an unknown operator.
1176    
1177     XParamDef:
1178     @QName:
1179     pc:operator
1180     @enDesc:
1181     An operator to overload.
1182    
1183     ResourceDef:
1184     @QName: operatorNameList
1185     @enDesc:
1186     The list of valid operators for <PerlModule::operator> pragma.
1187     @rdf:type:
1188     dis2pm:InlineCode
1189     @PerlDef:
1190     {qw[
1191     + 1 - 1 * 1 / 1 % 1 ** 1 << 1 >> 1 x 1 . 1
1192     += 1 -= 1 *= 1 /= 1 %= 1 **= 1 <<= 1 >>= 1 x= 1 .= 1
1193     < 1 <= 1 > 1 >= 1 == 1 != 1 <=> 1
1194     lt 1 le 1 gt 1 ge 1 eq 1 ne 1 cmp 1
1195     & 1 | 1 ^ 1 neg 1 ! 1 ~ 1
1196     ++ 1 -- 1 = 1
1197     atan2 1 cos 1 sin 1 exp 1 abs 1 log 1 sqrt 1
1198     bool 1 "" 1 0+ 1 ${} 1 @{} 1 %{} 1 &{} 1 *{} 1 <> 1
1199     nomethod 1
1200     ]}
1201    
1202 wakaba 1.1 ClsDef:
1203 wakaba 1.6 @ClsQName: ManakaiPerlStatementContainer
1204     @ClsISA: ManakaiPerlAnyContainer
1205 wakaba 1.1 @enDesc:
1206 wakaba 1.6 A base class for node types that contains zero or more
1207     statements and/or blocks.
1208 wakaba 1.1
1209     @Attr:
1210     @@Name: currentSourceFile
1211     @@enDesc:
1212     The current source file name that is referred when
1213     a code fragment is added.
1214     @@Type:
1215     DISLang:String
1216     @@Get:
1217     @@@nullCase:
1218     @@@@enDesc: No source file name is set.
1219     @@@disDef:
1220     @@@@GetProp: sourceFile
1221     @@Set:
1222     @@@nullCase:
1223     @@@@enDesc: No (or unknown) source file.
1224     @@@disDef:
1225     @@@@SetProp: sourceFile
1226    
1227     @Attr:
1228     @@Name: currentSourceLine
1229     @@enDesc:
1230     The current line number in source file that is referred when
1231     a code fragment is added.
1232     @@Type:
1233 wakaba 1.6 DOMMain:unsigned-long::ManakaiDOM:all
1234 wakaba 1.1 @@Get:
1235     @@@disDef:
1236     @@@@GetProp: sourceLine
1237     @@Set:
1238     @@@disDef:
1239     @@@@SetProp: sourceLine
1240    
1241     @Method:
1242 wakaba 1.5 @@Name: appendCodeFragment
1243     @@enDesc:
1244     Appends a <Class::ManakaiPerlCodeFragment> object.
1245     @@Param:
1246     @@@Name: codeArg
1247     @@@Type: ManakaiPerlCodeFragment
1248     @@@enDesc:
1249     A code fragment object.
1250     @@Return:
1251     @@@RaiseException:
1252     @@@@@:BAD_CHILD_ERR
1253     @@@@enDesc:
1254     An attempt is made to append a child
1255     that is not a <Class::ManakaiPerlUnparsedCode>.
1256     @@@RaiseException:
1257     @@@@@:IN_USE_NODE_ERR
1258     @@@@enDesc:
1259     An attempt is made to append a node that is
1260     already used elsewhere.
1261     @@@PerlDef:
1262 wakaba 1.6 if ({
1263     unparsed => 1, if => 1, statement => 1, block => 1,
1264     inunparsed => 1, variable => 1, bare => 1, atom => 1,
1265     incontainer => 1, string => 1, assign => 1,
1266     }->{$codeArg->{<Q::TreeCore:node>}->{<Q::pc:nodeType>}}) {
1267 wakaba 1.5 if ($codeArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}) {
1268     __EXCEPTION{IN_USE_NODE_ERR::
1269     pc:parentNode => {$codeArg->{<Q::TreeCore:node>}
1270     ->{<Q::pc:parent>}},
1271     pc:childNode => {$codeArg},
1272     }__;
1273     }
1274     $self->{<Q::TreeCore:node>}-><M::MNodeObject.importTree>
1275     ($codeArg->{<Q::TreeCore:node>});
1276     push @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}},
1277     $codeArg->{<Q::TreeCore:node>};
1278     $codeArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}
1279     = $self->{<Q::TreeCore:node>};
1280     } else {
1281     __EXCEPTION{BAD_CHILD_ERR::
1282     pc:parentNode => {$self},
1283     pc:childNode => {$codeArg},
1284     }__;
1285     }
1286    
1287     @Method:
1288 wakaba 1.1 @@Name: appendCode
1289     @@enDesc:
1290     Appends an unparsed Perl code fragment.
1291     @@Param:
1292     @@@Name: codeArg
1293     @@@Type:
1294     lang:Perl::ManakaiDOM:all
1295     @@@enDesc:
1296     An unparsed Perl code fragment.
1297     @@Return:
1298     @@@Type: ManakaiPerlUnparsedCode
1299     @@@enDesc:
1300     The newly created Perl code object.
1301     @@@PerlDef:
1302     $r = <ClassM::ManakaiPerlUnparsedCode.newObject>;
1303     my $node = $self->{<Q::TreeCore:node>};
1304     $r->{<Q::sourceFile>} = $node->{<Q::sourceFile>};
1305     $r->{<Q::sourceLine>} = $node->{<Q::sourceLine>};
1306     $r->{<Q::code>} = $codeArg;
1307     $node->{<Q::sourceLine>} += ($codeArg =~ tr/\x0A/\x0A/);
1308 wakaba 1.6 $node-><M::ManakaiDOM:ManakaiDOMNodeObject
1309     ::ManakaiDOM:Perl.importTree> ($r);
1310     push @{$node->{<Q::pc:childNodes>}}, $r;
1311     $r->{<Q::pc:parent>} = $node;
1312     __CODE{ManakaiNode:getNewReference::
1313     $object => $r, $ref => $r,
1314     $class =>{<ClassName::ManakaiPerlUnparsedCode>},
1315     }__;
1316 wakaba 1.1
1317     @Method:
1318     @@Name: skipLines
1319     @@enDesc:
1320     Skips lines in a code.
1321     @@Param:
1322     @@@Name: codeArg
1323     @@@Type:
1324     lang:Perl::ManakaiDOM:all
1325     @@@enDesc:
1326     A code fragment, which is counted lines.
1327     @@Return:
1328     @@@PerlDef:
1329     $self->{<Q::TreeCore:node>}->{<Q::sourceLine>}
1330     += ($codeArg =~ tr/\x0A/\x0A/);
1331 wakaba 1.4
1332 wakaba 1.6 @ImplNote:
1333     @@lang:en
1334     @@@:
1335     A <Class::ManakaiPerlStatementContainer> object must have
1336     a property:
1337     <Q::pc:childNodes>.
1338     ##PerlStatementContainer
1339    
1340     ClsDef:
1341     @ClsQName: ManakaiPerlSub
1342     @ClsISA: ManakaiPerlStatementContainer
1343     @enDesc:
1344     Perl subroutines.
1345    
1346     @IntMethod:
1347     @@Name:newObject
1348     @@ManakaiDOM:isStatic:1
1349     @@Description:
1350     @@@lang:en
1351     @@@@:
1352     Creates a new instance object for <Class::ManakaiPerlSub>.
1353     @@Return:
1354     @@@Type:
1355     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1356     @@@Description:
1357     @@@@lang:en
1358     @@@@@:
1359     The newly created node object.
1360     @@@PerlDef:
1361     @@@@@:
1362     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1363     ::ManakaiDOM:Perl.new>;
1364     push @{$node->{<Q::TreeCore:subnode>}}, <Q::pc:childNodes>;
1365     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1366     $node->{<Q::pc:childNodes>} = [];
1367     $node->{<Q::pc:sourceLine>} = 0;
1368     $node->{<Q::pc:nodeType>} = 'sub';
1369     @@@@ImplNote:
1370     @@@@@lang:en
1371     @@@@@@:
1372     Optional properties: <Q::pc:localName>,
1373     <Q::pc:sourceFile>, <Q::pc:sourceLine>,
1374     <Q::pc:nodeType>.
1375    
1376     @Attr:
1377     @@Name: localName
1378     @@enDesc:
1379     The name of this subroutine.
1380     @@Type:
1381     DISPerl:SubName
1382     @@Get:
1383     @@@nullCase:
1384     @@@@enDesc:
1385     This subroutine has no name.
1386     @@@disDef:
1387     @@@@GetProp: localName
1388     @@Set:
1389     @@@enDesc:
1390     Sets the name of this subroutine.
1391     \
1392     {NOTE:: Setting this attribute does not change the
1393     name by which the subroutine is registerred to
1394     the parent object.
1395     \
1396     }
1397     @@@nullCase:
1398     @@@@enDesc:
1399     This subroutine has no name.
1400     @@@disDef:
1401     @@@@SetProp: localName
1402    
1403     @Attr:
1404     @@Name: prototype
1405     @@enDesc:
1406     The prototype of this subroutine.
1407     @@Type:
1408     DISPerl:SubPrototype
1409     @@Get:
1410     @@@disDef:
1411     @@@@GetProp: prototype
1412     @@@nullCase:
1413     @@@@enDesc:
1414     No prototype is set.
1415     @@Set:
1416     @@@disDef:
1417     @@@@SetProp: prototype
1418     @@@nullCase:
1419     @@@@enDesc:
1420     No prototype declaration.
1421    
1422 wakaba 1.4 @ToStringMethod:
1423     @@Return:
1424     @@@Type:
1425     DISLang:String
1426     @@@enDesc:
1427     Perl code.
1428     @@@PerlDef:
1429     my $node = $self->{<Q::TreeCore:node>};
1430     $r = q<sub>;
1431     $r .= ' ' . $node->{<Q::pc:localName>}
1432     if defined $node->{<Q::pc:localName>};
1433     $r .= ' (' . $node->{<Q::pc:prototype>} . ')'
1434     if defined $node->{<Q::pc:prototype>};
1435     $r .= " {\n";
1436 wakaba 1.6 for my $cno (@{$node->{<Q::pc:childNodes>}}) {
1437     my $cn;
1438     __CODE{ManakaiNode:getNewReference::
1439     $object => $cno, $ref => $cn,
1440     $class => {<ClassName::ManakaiPerlUnparsedCode>},
1441     }__;
1442     $r .= $cn->stringify;
1443     }
1444 wakaba 1.4 $r .= "}\n";
1445 wakaba 1.1 ##PerlSub
1446    
1447 wakaba 1.5 XParamDef:
1448     @QName: parentNode
1449     @enDesc:
1450     Parent node.
1451    
1452     XParamDef:
1453     @QName: childNode
1454     @enDesc:
1455     Child node.
1456    
1457 wakaba 1.1 ClsDef:
1458     @ClsQName: ManakaiPerlUnparsedCode
1459     @ClsISA: ManakaiPerlCodeFragment
1460     @enDesc:
1461     Unparsed Perl code fragments.
1462    
1463     @IntMethod:
1464     @@Name:newObject
1465     @@ManakaiDOM:isStatic:1
1466     @@Description:
1467     @@@lang:en
1468     @@@@:
1469     Creates a new instance object for <Class::ManakaiPerlUnparsedCode>.
1470     @@Return:
1471     @@@Type:
1472     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1473     @@@Description:
1474     @@@@lang:en
1475     @@@@@:
1476     The newly created node object.
1477     @@@PerlDef:
1478     @@@@@:
1479     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1480     ::ManakaiDOM:Perl.new>;
1481     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1482     $node->{<Q::pc:code>} = '';
1483 wakaba 1.6 $node->{<Q::pc:nodeType>} = 'unparsed';
1484 wakaba 1.1 @@@@ImplNote:
1485     @@@@@lang:en
1486     @@@@@@:
1487 wakaba 1.6 Properties: <Q::pc:nodeType>, <Q::pc:code>.
1488 wakaba 1.5
1489     @Attr:
1490     @@Name: code
1491     @@enDesc:
1492     Perl code.
1493     @@Type:
1494     lang:Perl::ManakaiDOM:all
1495     @@Get:
1496     @@@disDef:
1497     @@@@GetProp: code
1498     @@Set:
1499     @@@disDef:
1500     @@@@SetProp: code
1501    
1502     @Attr:
1503     @@Name: sourceFile
1504     @@enDesc:
1505     The source file name of this fragment.
1506     @@Type:
1507     DISLang:String
1508     @@Get:
1509     @@@enDesc:
1510     Any string identifying the source.
1511     @@@nullCase:
1512     @@@@enDesc: No source file name is set.
1513     @@@disDef:
1514     @@@@GetProp: sourceFile
1515     @@Set:
1516     @@@nullCase:
1517     @@@@enDesc: No (or unknown) source file.
1518     @@@disDef:
1519     @@@@SetProp: sourceFile
1520    
1521     @Attr:
1522     @@Name: sourceLine
1523     @@enDesc:
1524     Source file line number of the first line of this fragment.
1525     @@Type:
1526     DOMMain:unsigned-long
1527     @@Get:
1528     @@@disDef:
1529     @@@@GetProp: sourceLine
1530     @@Set:
1531     @@@disDef:
1532     @@@@SetProp: sourceLine
1533 wakaba 1.6
1534     @ToStringMethod:
1535     @@Return:
1536     @@@Type:
1537     DISLang:String
1538     @@@enDesc:
1539     Perl code.
1540     @@@PerlDef:
1541     my $node = $self->{<Q::TreeCore:node>};
1542     __DEEP{
1543     my $file = $self-><AG::ManakaiPerlCodeFragment.fileNode>;
1544     $r = sprintf (qq<\n#line %d "%s (Chunk %d)"\n>,
1545     $node->{<Q::pc:sourceLine>},
1546     $node->{<Q::pc:sourceFile>},
1547     $file-><M::ManakaiPerlFile.getNextChunkNumber>)
1548     . $node->{<Q::pc:code>}
1549     . sprintf (qq<\n#line 1 "%s (Chunk %d)"\n>,
1550     $file-><AG::ManakaiPerlFile.sourceFile>,
1551     $file-><M::ManakaiPerlFile.getNextChunkNumber>);
1552     }__;
1553 wakaba 1.1 ##PerlUnparsedCode
1554    
1555     ClsDef:
1556 wakaba 1.6 @ClsQName: ManakaiPerlInlineUnparsedCode
1557     @ClsISA: ManakaiPerlCodeFragment
1558     @enDesc:
1559     Unparsed Perl inline code fragments.
1560    
1561     @IntMethod:
1562     @@Name:newObject
1563     @@ManakaiDOM:isStatic:1
1564     @@Description:
1565     @@@lang:en
1566     @@@@:
1567     Creates a new instance object for
1568     <Class::ManakaiPerlInlineUnparsedCode>.
1569     @@Return:
1570     @@@Type:
1571     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1572     @@@Description:
1573     @@@@lang:en
1574     @@@@@:
1575     The newly created node object.
1576     @@@PerlDef:
1577     @@@@@:
1578     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1579     ::ManakaiDOM:Perl.new>;
1580     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1581     $node->{<Q::pc:code>} = '';
1582     $node->{<Q::pc:nodeType>} = 'inunparsed';
1583     @@@@ImplNote:
1584     @@@@@lang:en
1585     @@@@@@:
1586     Properties: <Q::pc:nodeType>, <Q::pc:code>.
1587    
1588     @Attr:
1589     @@Name: code
1590     @@enDesc:
1591     Perl code.
1592     @@Type:
1593     lang:Perl::ManakaiDOM:all
1594     @@Get:
1595     @@@disDef:
1596     @@@@GetProp: code
1597     @@Set:
1598     @@@disDef:
1599     @@@@SetProp: code
1600    
1601     @ToStringMethod:
1602     @@Return:
1603     @@@Type:
1604     DISLang:String
1605     @@@enDesc:
1606     Perl code.
1607     @@@PerlDef:
1608     my $node = $self->{<Q::TreeCore:node>};
1609     $r = $node->{<Q::pc:code>};
1610     ##PerlInlineUnparsedCode
1611    
1612     ClsDef:
1613     @ClsQName: ManakaiPerlStringLiteral
1614     @ClsISA: ManakaiPerlCodeFragment
1615     @enDesc:
1616     Perl string literal.
1617    
1618     @IntMethod:
1619     @@Name:newObject
1620     @@ManakaiDOM:isStatic:1
1621     @@Description:
1622     @@@lang:en
1623     @@@@:
1624     Creates a new instance object for
1625     <Class::ManakaiPerlStringLiteral>.
1626     @@Return:
1627     @@@Type:
1628     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1629     @@@Description:
1630     @@@@lang:en
1631     @@@@@:
1632     The newly created node object.
1633     @@@PerlDef:
1634     @@@@@:
1635     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1636     ::ManakaiDOM:Perl.new>;
1637     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1638     $node->{<Q::infoset:data>} = '';
1639     $node->{<Q::pc:nodeType>} = 'string';
1640     @@@@ImplNote:
1641     @@@@@lang:en
1642     @@@@@@:
1643     Properties: <Q::pc:nodeType>, <Q::infoset:data>.
1644    
1645     @Attr:
1646     @@Name: data
1647     @@enDesc:
1648     String data.
1649     @@Type:
1650     DISLang:String::ManakaiDOM:all
1651     @@Get:
1652     @@@disDef:
1653     @@@@GetProp:
1654     infoset:data
1655     @@Set:
1656     @@@disDef:
1657     @@@@SetProp:
1658     infoset:data
1659    
1660     @ToStringMethod:
1661     @@Return:
1662     @@@Type:
1663     DISLang:String
1664     @@@enDesc:
1665     Perl code.
1666     @@@PerlDef:
1667     my $node = $self->{<Q::TreeCore:node>};
1668     $r = $node->{<Q::infoset:data>};
1669     $r =~ s/(['\\])/\\$1/g;
1670     $r = q<'> . $r . q<'>;
1671     ##PerlStringLiteral
1672    
1673     ClsDef:
1674     @ClsQName: ManakaiPerlBare
1675     @ClsISA: ManakaiPerlCodeFragment
1676     @enDesc:
1677     Unparsed Perl inline code fragments.
1678    
1679     @IntMethod:
1680     @@Name:newObject
1681     @@ManakaiDOM:isStatic:1
1682     @@Description:
1683     @@@lang:en
1684     @@@@:
1685     Creates a new instance object for
1686     <Class::ManakaiPerlInlineBare>.
1687     @@Return:
1688     @@@Type:
1689     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1690     @@@Description:
1691     @@@@lang:en
1692     @@@@@:
1693     The newly created node object.
1694     @@@PerlDef:
1695     @@@@@:
1696     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1697     ::ManakaiDOM:Perl.new>;
1698     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1699     $node->{<Q::pc:code>} = '';
1700     $node->{<Q::pc:nodeType>} = 'bare';
1701     @@@@ImplNote:
1702     @@@@@lang:en
1703     @@@@@@:
1704     Properties: <Q::pc:nodeType>, <Q::pc:code>.
1705    
1706     @Attr:
1707     @@Name: code
1708     @@enDesc:
1709     Perl code.
1710     @@Type:
1711     lang:Perl::ManakaiDOM:all
1712     @@Get:
1713     @@@disDef:
1714     @@@@GetProp: code
1715     @@Set:
1716     @@@disDef:
1717     @@@@SetProp: code
1718    
1719     @ToStringMethod:
1720     @@Return:
1721     @@@Type:
1722     DISLang:String
1723     @@@enDesc:
1724     Perl code.
1725     @@@PerlDef:
1726     my $node = $self->{<Q::TreeCore:node>};
1727     $r = $node->{<Q::pc:code>};
1728     ##PerlBare
1729    
1730     ClsDef:
1731     @ClsQName: ManakaiPerlAtom
1732     @ClsISA: ManakaiPerlBare
1733     @enDesc:
1734     Unparsed Perl atomic code fragments (such as numeric literal).
1735    
1736     @IntMethod:
1737     @@Name:newObject
1738     @@ManakaiDOM:isStatic:1
1739     @@Description:
1740     @@@lang:en
1741     @@@@:
1742     Creates a new instance object for
1743     <Class::ManakaiPerlAtom>.
1744     @@Return:
1745     @@@Type:
1746     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1747     @@@Description:
1748     @@@@lang:en
1749     @@@@@:
1750     The newly created node object.
1751     @@@PerlDef:
1752     @@@@@:
1753     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1754     ::ManakaiDOM:Perl.new>;
1755     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1756     $node->{<Q::pc:code>} = '';
1757     $node->{<Q::pc:nodeType>} = 'atom';
1758     @@@@ImplNote:
1759     @@@@@lang:en
1760     @@@@@@:
1761     Properties: <Q::pc:nodeType>, <Q::pc:code>.
1762    
1763     @ToStringMethod:
1764     @@Return:
1765     @@@Type:
1766     DISLang:String
1767     @@@enDesc:
1768     Perl code.
1769     @@@PerlDef:
1770     my $node = $self->{<Q::TreeCore:node>};
1771     $r = $node->{<Q::pc:code>};
1772     ##PerlAtom
1773    
1774     ClsDef:
1775     @ClsQName: ManakaiPerlVariable
1776     @ClsISA: ManakaiPerlCodeFragment
1777     @enDesc:
1778     Unparsed Perl variable.
1779     \
1780     {NOTE:: Future version of the implementation may
1781     support to specify array index or hash key.
1782     \
1783     }
1784    
1785     @IntMethod:
1786     @@Name:newObject
1787     @@ManakaiDOM:isStatic:1
1788     @@Description:
1789     @@@lang:en
1790     @@@@:
1791     Creates a new instance object for
1792     <Class::ManakaiPerlVariable>.
1793     @@Return:
1794     @@@Type:
1795     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1796     @@@Description:
1797     @@@@lang:en
1798     @@@@@:
1799     The newly created node object.
1800     @@@PerlDef:
1801     @@@@@:
1802     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1803     ::ManakaiDOM:Perl.new>;
1804     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1805     $node->{<Q::pc:variableType>} = '';
1806     $node->{<Q::pc:nodeType>} = 'variable';
1807     @@@@ImplNote:
1808     @@@@@lang:en
1809     @@@@@@:
1810     Properties: <Q::pc:nodeType>, <Q::pc:variableType>,
1811     <Q::packageName>, <Q::localName> (required),
1812     <Q::variableScope>.
1813    
1814     @Attr:
1815     @@Name: variableType
1816     @@enDesc:
1817     Perl variable type (<CODE::$>, <CODE::@>, <CODE::%>,
1818     <CODE::&> or empty string).
1819     @@Type:
1820     lang:Perl::ManakaiDOM:all
1821     @@Get:
1822     @@@disDef:
1823     @@@@GetProp: variableType
1824     @@Set:
1825     @@@disDef:
1826     @@@@SetProp: variableType
1827    
1828     @Attr:
1829     @@Name: packageName
1830     @@enDesc:
1831     The name of the package to which this variable belongs.
1832     @@Type:
1833     Perl:package-name::ManakaiDOM:all
1834     @@Get:
1835     @@@nullCase:
1836     @@@@enDesc:
1837     This package belongs to the current package or
1838     does not belong to any package.
1839     @@@disDef:
1840     @@@@GetProp: packageName
1841     @@Set:
1842     @@@nullCase:
1843     @@@@enDesc:
1844     This package belongs to the current package or
1845     does not belong to any package.
1846     @@@disDef:
1847     @@@@SetProp: variableType
1848    
1849     @Attr:
1850     @@Name: localName
1851     @@enDesc:
1852     The local variable name.
1853     @@Type:
1854     lang:Perl::ManakaiDOM:all
1855     @@Get:
1856     @@@disDef:
1857     @@@@GetProp: localName
1858     @@Set:
1859     @@@disDef:
1860     @@@@SetProp: localName
1861    
1862     @Attr:
1863     @@Name: variableScope
1864     @@enDesc:
1865     Scope modifier (<CODE::my> or <CODE::our> or <CODE::local>).
1866     @@Type:
1867     lang:Perl::ManakaiDOM:all
1868     @@Get:
1869     @@@nullCase:
1870     @@@@enDesc:
1871     This variable does not have scope modifier.
1872     @@@disDef:
1873     @@@@GetProp: variableScope
1874     @@Set:
1875     @@@nullCase:
1876     @@@@enDesc:
1877     This variable does not have scope modifier.
1878     @@@disDef:
1879     @@@@SetProp: variableScope
1880    
1881     @ToStringMethod:
1882     @@Return:
1883     @@@Type:
1884     DISLang:String
1885     @@@enDesc:
1886     Perl code.
1887     @@@PerlDef:
1888     my $node = $self->{<Q::TreeCore:node>};
1889     $r = $node->{<Q::pc:variableType>};
1890     $r .= $node->{<Q::pc:packageName>} . '::'
1891     if defined $node->{<Q::pc:packageName>};
1892     $r .= $node->{<Q::pc:localName>};
1893     if ($node->{<Q::pc:variableType>} eq '$' and
1894     defined $node->{<Q::pc:hashKey>}) {
1895     my $hashKey = $node->{<Q::pc:hashKey>};
1896     $hashKey =~ s/(['\\])/\\$1/g;
1897     $r .= q<{'> . $hashKey . q<'}>;
1898     }
1899    
1900     @Attr:
1901     @@Name: hashKey
1902     @@enDesc:
1903     The key for hash.
1904     \
1905     {NOTE:: Using Perl code for key is not supported in the current
1906     version of the implementation.
1907     \
1908     }
1909     @@Type:
1910     DISLang:String::ManakaiDOM:all
1911     @@Get:
1912     @@@nullCase:
1913     @@@@enDesc:
1914     This variable is not for hash value access.
1915     @@@disDef:
1916     @@@@GetProp: hashKey
1917     @@Set:
1918     @@@nullCase:
1919     @@@@enDesc:
1920     This variable is not for hash value access.
1921     @@@disDef:
1922     @@@@SetProp: hashKey
1923     ##PerlInlineUnparsedCode
1924    
1925     PropDef:
1926     @QName: variableScope
1927     @enDesc:
1928     Variable scope (<CODE::local>, <CODE::my> or <CODE::our>).
1929    
1930     PropDef:
1931     @QName: variableType
1932     @enDesc:
1933     Variable type prefix.
1934    
1935     PropDef:
1936     @QName: hashKey
1937     @enDesc:
1938     Hash key string.
1939    
1940     ClsDef:
1941     @ClsQName: ManakaiPerlAnyContainer
1942     @ClsISA: ManakaiPerlCodeFragment
1943     @enDesc:
1944     A base class implemented by both inline container and
1945     block-level container.
1946    
1947     @Attr:
1948     @@Name: length
1949     @@enDesc:
1950     The number of child code fragments.
1951     @@Type:
1952     DOMMain:unsigned-long
1953     @@Get:
1954     @@@PerlDef:
1955     $r = @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}};
1956    
1957     @Method:
1958     @@Name: appendStringLiteral
1959     @@enDesc:
1960     Appends a Perl string literal (<CODE::q>).
1961     @@Param:
1962     @@@Name: stringArg
1963     @@@Type:
1964     DISLang:String::ManakaiDOM:all
1965     @@@enDesc:
1966     A string.
1967     @@Return:
1968     @@@Type: ManakaiPerlStringLiteral
1969     @@@enDesc:
1970     The newly created Perl string literal object.
1971     @@@PerlDef:
1972     $r = <ClassM::ManakaiPerlStringLiteral.newObject>;
1973     my $node = $self->{<Q::TreeCore:node>};
1974     $r->{<Q::infoset:data>} = $stringArg;
1975     $node-><M::ManakaiDOM:ManakaiDOMNodeObject
1976     ::ManakaiDOM:Perl.importTree> ($r);
1977     push @{$node->{<Q::pc:childNodes>}}, $r;
1978     $r->{<Q::pc:parent>} = $node;
1979     if (defined wantarray) {
1980     __CODE{ManakaiNode:getNewReference::
1981     $object => $r, $ref => $r,
1982     $class =>{<ClassName::ManakaiPerlStringLiteral>},
1983     }__;
1984     }
1985    
1986    
1987     @Method:
1988     @@Name: appendAtom
1989     @@enDesc:
1990     Appends a Perl atomic code fragment.
1991     @@Param:
1992     @@@Name: codeArg
1993     @@@Type:
1994     lang:Perl::ManakaiDOM:all
1995     @@@enDesc:
1996     An atom.
1997     @@Return:
1998     @@@Type: ManakaiPerlAtom
1999     @@@enDesc:
2000     The newly created Perl code object.
2001     @@@PerlDef:
2002     $r = <ClassM::ManakaiPerlAtom.newObject>;
2003     my $node = $self->{<Q::TreeCore:node>};
2004     $r->{<Q::infoset:code>} = $codeArg;
2005     $node-><M::ManakaiDOM:ManakaiDOMNodeObject
2006     ::ManakaiDOM:Perl.importTree> ($r);
2007     push @{$node->{<Q::pc:childNodes>}}, $r;
2008     $r->{<Q::pc:parent>} = $node;
2009     if (defined wantarray) {
2010     __CODE{ManakaiNode:getNewReference::
2011     $object => $r, $ref => $r,
2012     $class =>{<ClassName::ManakaiPerlAtom>},
2013     }__;
2014     }
2015    
2016    
2017     @Method:
2018     @@Name: appendBare
2019     @@enDesc:
2020     Appends a Perl bare code fragment.
2021     @@Param:
2022     @@@Name: codeArg
2023     @@@Type:
2024     lang:Perl::ManakaiDOM:all
2025     @@@enDesc:
2026     An atom.
2027     @@Return:
2028     @@@Type: ManakaiPerlBare
2029     @@@enDesc:
2030     The newly created Perl code object.
2031     @@@PerlDef:
2032     $r = <ClassM::ManakaiPerlBare.newObject>;
2033     my $node = $self->{<Q::TreeCore:node>};
2034     $r->{<Q::infoset:code>} = $codeArg;
2035     $node-><M::ManakaiDOM:ManakaiDOMNodeObject
2036     ::ManakaiDOM:Perl.importTree> ($r);
2037     push @{$node->{<Q::pc:childNodes>}}, $r;
2038     $r->{<Q::pc:parent>} = $node;
2039     if (defined wantarray) {
2040     __CODE{ManakaiNode:getNewReference::
2041     $object => $r, $ref => $r,
2042     $class =>{<ClassName::ManakaiPerlBare>},
2043     }__;
2044     }
2045    
2046     ##PerlAnyContainer
2047    
2048     ClsDef:
2049     @ClsQName: ManakaiPerlInlineContainer
2050     @ClsISA: ManakaiPerlAnyContainer
2051     @enDesc:
2052     Unparsed Perl inline code block.
2053    
2054     @IntMethod:
2055     @@Name:newObject
2056     @@ManakaiDOM:isStatic:1
2057     @@Description:
2058     @@@lang:en
2059     @@@@:
2060     Creates a new instance object for
2061     <Class::ManakaiPerlInlineContainer>.
2062     @@Return:
2063     @@@Type:
2064     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
2065     @@@Description:
2066     @@@@lang:en
2067     @@@@@:
2068     The newly created node object.
2069     @@@PerlDef:
2070     @@@@@:
2071     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
2072     ::ManakaiDOM:Perl.new>;
2073     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
2074     $node->{<Q::pc:childNodes>} = [];
2075     $node->{<Q::pc:nodeType>} = 'incontainer';
2076     @@@@ImplNote:
2077     @@@@@lang:en
2078     @@@@@@:
2079     Properties: <Q::pc:nodeType>, <Q::pc:childNodes>.
2080    
2081     @Method:
2082     @@Name: appendCodeFragment
2083     @@enDesc:
2084     Appends a <Class::ManakaiPerlCodeFragment> object.
2085     @@Param:
2086     @@@Name: codeArg
2087     @@@Type: ManakaiPerlCodeFragment
2088     @@@enDesc:
2089     A code fragment object.
2090     @@Return:
2091     @@@RaiseException:
2092     @@@@@:BAD_CHILD_ERR
2093     @@@@enDesc:
2094     An attempt is made to append a child
2095     that is not a <Class::ManakaiPerlUnparsedCode>.
2096     @@@RaiseException:
2097     @@@@@:IN_USE_NODE_ERR
2098     @@@@enDesc:
2099     An attempt is made to append a node that is
2100     already used elsewhere.
2101     @@@PerlDef:
2102     if ({
2103     atom => 1, bare => 1, incontainer => 1,
2104     inunparsed => 1, variable => 1,
2105     }->{$codeArg->{<Q::TreeCore:node>}->{<Q::pc:nodeType>}}) {
2106     if ($codeArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}) {
2107     __EXCEPTION{IN_USE_NODE_ERR::
2108     pc:parentNode => {$codeArg->{<Q::TreeCore:node>}
2109     ->{<Q::pc:parent>}},
2110     pc:childNode => {$codeArg},
2111     }__;
2112     }
2113     $self->{<Q::TreeCore:node>}-><M::MNodeObject.importTree>
2114     ($codeArg->{<Q::TreeCore:node>});
2115     push @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}},
2116     $codeArg->{<Q::TreeCore:node>};
2117     $codeArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}
2118     = $self->{<Q::TreeCore:node>};
2119     } else {
2120     __EXCEPTION{BAD_CHILD_ERR::
2121     pc:parentNode => {$self},
2122     pc:childNode => {$codeArg},
2123     }__;
2124     }
2125    
2126     @Method:
2127     @@Name: appendCode
2128     @@enDesc:
2129     Appends an unparsed Perl code fragment.
2130     @@Param:
2131     @@@Name: codeArg
2132     @@@Type:
2133     lang:Perl::ManakaiDOM:all
2134     @@@enDesc:
2135     An unparsed Perl code fragment.
2136     @@Return:
2137     @@@Type: ManakaiPerlInlineUnparsedCode
2138     @@@enDesc:
2139     The newly created Perl code object.
2140     @@@PerlDef:
2141     $r = <ClassM::ManakaiPerlInlineUnparsedCode.newObject>;
2142     my $node = $self->{<Q::TreeCore:node>};
2143     $r->{<Q::code>} = $codeArg;
2144     $node-><M::ManakaiDOM:ManakaiDOMNodeObject
2145     ::ManakaiDOM:Perl.importTree> ($r);
2146     push @{$node->{<Q::pc:childNodes>}}, $r;
2147     $r->{<Q::pc:parent>} = $node;
2148     if (defined wantarray) {
2149     __CODE{ManakaiNode:getNewReference::
2150     $object => $r, $ref => $r,
2151     $class =>{<ClassName::ManakaiPerlInlineUnparsedCode>},
2152     }__;
2153     }
2154    
2155     @ToStringMethod:
2156     @@Return:
2157     @@@Type:
2158     DISLang:String
2159     @@@enDesc:
2160     Perl code.
2161     @@@PerlDef:
2162     for my $cno (@{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}}) {
2163     my $cn = $cno-><M::ManakaiPerlCodeFragment.getNodeReference> ($cno);
2164     if ($cno->{<Q::pc:nodeType>} eq 'incontainer' and
2165     \ @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}} == 1) {
2166     $r .= '(' . $cn->stringify . ')';
2167     } else {
2168     $r .= $cn->stringify;
2169     }
2170     }
2171     ##PerlInlineContainer
2172    
2173     ElementTypeBinding:
2174     @Name: RaiseException
2175     @ElementType:
2176     ManakaiDOM:raises
2177    
2178     ClsDef:
2179     @ClsQName: ManakaiPerlCodeImplementation
2180 wakaba 1.1 @enDesc:
2181     The class that provides factory methods.
2182    
2183     @Role:
2184     @@@:
2185     DOMCore:DOMImplementation::ManakaiDOM:ManakaiDOM
2186     @@compat:
2187     DOMCore:ManakaiDOMImplementation::ManakaiDOM:ManakaiDOMLatest
2188    
2189     @Method:
2190     @@Name: createPerlFile
2191     @@enDesc:
2192     Creates a Perl code file.
2193     @@Return:
2194     @@@Type: ManakaiPerlFile
2195     @@@enDesc: A newly created Perl source file object.
2196     @@@PerlDef:
2197     $r = <ClassM::ManakaiPerlFile.newObject>;
2198 wakaba 1.6 __CODE{ManakaiNode:getNewReference::
2199     $object => $r, $ref => $r,
2200     $class => {<ClassName::ManakaiPerlFile>}}__;
2201 wakaba 1.1
2202     @IntMethod:
2203     @@Name: perlComment
2204     @@ManakaiDOM:isStatic:1
2205     @@enDesc:
2206     Generates a Perl comment string.
2207     @@Param:
2208     @@@Name: str
2209     @@@Type:
2210     DISLang:String
2211     @@@enDesc:
2212     A comment text.
2213     @@Return:
2214     @@@Type:
2215     DISLang:String
2216     @@@enDesc:
2217     A Perl comment string.
2218     @@@PerlDef:
2219     $r = $str;
2220     $r =~ s/\n/\n## /g;
2221     $r =~ s/\n## $/\n/s;
2222     $r .= "\n" unless $r =~ /\n$/;
2223     $r = q<## > . $r;
2224    
2225     @IntMethod:
2226     @@Name: rfc3339DateTime
2227     @@ManakaiDOM:isStatic:1
2228     @@enDesc:
2229     Returns RFC 3339 <CODE::date-time> representation of a date.
2230     @@Param:
2231     @@@Name: perlDate
2232     @@@Type:
2233     DOMMain:unsigned-long
2234     @@@enDesc:
2235     A Perl representation of date.
2236     @@Return:
2237     @@@Type:
2238     DISLang:String
2239     @@@enDesc:
2240     RFC 3339 date string.
2241     @@@PerlDef:
2242     my @time = gmtime $perlDate;
2243     $r = sprintf q<%04d-%02d-%02dT%02d:%02d:%02d+00:00>,
2244     $time[5] + 1900, $time[4] + 1, @time[3,2,1,0];
2245    
2246     @IntMethod:
2247     @@Name: versionDateTime
2248     @@ManakaiDOM:isStatic:1
2249     @@enDesc:
2250     Returns date for version.
2251     @@Param:
2252     @@@Name: perlDate
2253     @@@Type:
2254     DOMMain:unsigned-long
2255     @@@enDesc:
2256     A Perl representation of date.
2257     @@Return:
2258     @@@Type:
2259     DISLang:String
2260     @@@enDesc:
2261     A Perl number literal.
2262     @@@PerlDef:
2263     my @time = gmtime $perlDate;
2264     $r = sprintf q<%04d%02d%02d.%02d%02d>,
2265     $time[5] + 1900, $time[4] + 1, @time[3,2,1];
2266    
2267     @Method:
2268     @@Name: perlLiteral
2269     @@enDesc:
2270     Perl code representation.
2271     @@Param:
2272     @@@Name: val
2273     @@@Type:
2274     DOMMain:any
2275     @@@enDesc:
2276     A Perl value.
2277     @@Return:
2278     @@@Type:
2279     DISLang:String
2280     @@@enDesc:
2281     A Perl lexical representation of <P::val>.
2282     @@@PerlDef:
2283     unless (defined $val) {
2284     $r = q<undef>;
2285     } elsif (ref $val eq 'ARRAY') {
2286     __DEEP{
2287     $r = q<[> . <ClassM::ManakaiPerlCodeImplementation
2288     .perlLiteral> ($val) . q<]>;
2289     }__;
2290     } elsif (ref $val eq 'HASH') {
2291     __DEEP{
2292     $r = q<{> . <ClassM::ManakaiPerlCodeImplementation
2293     .perlLiteral> ([%$val]) . q<}>;
2294     }__;
2295     } else {
2296     $val =~ s/(['\\])/\\$1/g;
2297     $r = q<'> . $val . q<'>;
2298     }
2299    
2300     @Method:
2301     @@Name: perlList
2302     @@enDesc:
2303     Perl code representation of a list.
2304     @@Param:
2305     @@@Name: val
2306     @@@Type:
2307     Perl:ARRAY
2308     @@@enDesc:
2309     A Perl array reference.
2310     @@Return:
2311     @@@Type:
2312     DISLang:String
2313     @@@enDesc:
2314     A Perl lexical representation of <CODE::@$val>.
2315     @@@PerlDef:
2316     __DEEP{
2317     $r = join (q<, >, map {<ClassM::ManakaiPerlCodeImplementation
2318     .perlLiteral> ($_)} @{$val});
2319     }__;
2320 wakaba 1.5
2321     @Method:
2322     @@Name: createPerlSub
2323     @@enDesc:
2324     Creates a new <Class::ManakaiPerlSub> object.
2325     @@Param:
2326     @@@Name: subName
2327     @@@Type:
2328     DISLang:String
2329     @@@enDesc:
2330     The name of the subroutine to create.
2331     @@@nullCase:
2332     @@@@enDesc:
2333     The subroutine created has no name.
2334     @@Return:
2335     @@@Type:ManakaiPerlSub
2336     @@@enDesc:
2337     Newly created Perl subroutine object.
2338     @@@PerlDef:
2339     __DEEP{
2340 wakaba 1.6 $r = <ClassM::ManakaiPerlSub.newObject>;
2341     __CODE{ManakaiNode:getNewReference::
2342     $object => $r, $ref => $r,
2343     $class => {<ClassName::ManakaiPerlSub>}}__;
2344     $r-><AS::ManakaiPerlSub.localName> ($subName) if defined $subName;
2345 wakaba 1.5 }__;
2346    
2347     @Method:
2348     @@Name: createPerlUnparsedCode
2349     @@enDesc:
2350     Creates a new <Class::ManakaiPerlUnparsedCode> object.
2351     @@Param:
2352     @@@Name: codeArg
2353     @@@Type:
2354     lang:Perl::ManakaiDOM:all
2355     @@@enDesc:
2356     The code fragment.
2357     @@@nullCase:
2358     @@@@enDesc:
2359     The fragment initially has no code.
2360     @@Return:
2361     @@@Type:ManakaiPerlUnparsedCode
2362     @@@enDesc:
2363     Newly created Perl code object.
2364     @@@PerlDef:
2365     __DEEP{
2366 wakaba 1.6 $r = <ClassM::ManakaiPerlUnparsedCode.newObject>;
2367     __CODE{ManakaiNode:getNewReference::
2368     $object => $r, $ref => $r,
2369     $class => {<ClassName::ManakaiPerlUnparsedCode>}}__;
2370 wakaba 1.5 $r-><M::ManakaiPerlUnparsedCode.code> ($codeArg) if defined $codeArg;
2371 wakaba 1.6 }__;
2372    
2373     @Method:
2374     @@Name: createPerlInlineContainer
2375     @@enDesc:
2376     Creates a new <Class::ManakaiPerlInlineContainer> object.
2377     @@Return:
2378     @@@Type:ManakaiPerlInlineContainer
2379     @@@enDesc:
2380     Newly created Perl code object.
2381     @@@PerlDef:
2382     __DEEP{
2383     $r = <ClassM::ManakaiPerlInlineContainer.newObject>;
2384     __CODE{ManakaiNode:getNewReference::
2385     $object => $r, $ref => $r,
2386     $class => {<ClassName::ManakaiPerlInlineContainer>}}__;
2387     }__;
2388    
2389     @Method:
2390     @@Name: createPerlInlineUnparsedCode
2391     @@enDesc:
2392     Creates a new <Class::ManakaiPerlInlineUnparsedCode> object.
2393     @@Param:
2394     @@@Name: codeArg
2395     @@@Type:
2396     lang:Perl::ManakaiDOM:all
2397     @@@enDesc:
2398     The code fragment.
2399     @@@nullCase:
2400     @@@@enDesc:
2401     The fragment initially has no code.
2402     @@Return:
2403     @@@Type:ManakaiPerlInlineUnparsedCode
2404     @@@enDesc:
2405     Newly created Perl code object.
2406     @@@PerlDef:
2407     __DEEP{
2408     $r = <ClassM::ManakaiPerlInlineUnparsedCode.newObject>;
2409     __CODE{ManakaiNode:getNewReference::
2410     $object => $r, $ref => $r,
2411     $class => {<ClassName::ManakaiPerlInlineUnparsedCode>}}__;
2412     $r-><M::ManakaiPerlInlineUnparsedCode.code> ($codeArg)
2413     if defined $codeArg;
2414     }__;
2415    
2416     @Method:
2417     @@Name: createPerlBare
2418     @@enDesc:
2419     Creates a new <Class::ManakaiPerlBare> object.
2420     @@Param:
2421     @@@Name: codeArg
2422     @@@Type:
2423     lang:Perl::ManakaiDOM:all
2424     @@@enDesc:
2425     The code fragment.
2426     @@Return:
2427     @@@Type:ManakaiPerlBare
2428     @@@enDesc:
2429     Newly created Perl code object.
2430     @@@PerlDef:
2431     __DEEP{
2432     $r = <ClassM::ManakaiPerlBare.newObject>;
2433     __CODE{ManakaiNode:getNewReference::
2434     $object => $r, $ref => $r,
2435     $class => {<ClassName::ManakaiPerlBare>}}__;
2436     $r-><M::ManakaiPerlBare.code> ($codeArg);
2437     }__;
2438    
2439     @Method:
2440     @@Name: createPerlAtom
2441     @@enDesc:
2442     Creates a new <Class::ManakaiPerlAtom> object.
2443     @@Param:
2444     @@@Name: codeArg
2445     @@@Type:
2446     lang:Perl::ManakaiDOM:all
2447     @@@enDesc:
2448     The code fragment.
2449     @@Return:
2450     @@@Type:ManakaiPerlAtom
2451     @@@enDesc:
2452     Newly created Perl code object.
2453     @@@PerlDef:
2454     __DEEP{
2455     $r = <ClassM::ManakaiPerlAtom.newObject>;
2456     __CODE{ManakaiNode:getNewReference::
2457     $object => $r, $ref => $r,
2458     $class => {<ClassName::ManakaiPerlAtom>}}__;
2459     $r-><M::ManakaiPerlBare.code> ($codeArg);
2460     }__;
2461    
2462     @Method:
2463     @@Name: createPerlStringLiteral
2464     @@enDesc:
2465     Creates a new <Class::ManakaiPerlStringLiteral> object.
2466     @@Param:
2467     @@@Name: stringArg
2468     @@@Type:
2469     DISLang:String::ManakaiDOM:all
2470     @@@enDesc: A string.
2471     @@Return:
2472     @@@Type:ManakaiPerlStringLiteral
2473     @@@enDesc:
2474     Newly created Perl code object.
2475     @@@PerlDef:
2476     __DEEP{
2477     $r = <ClassM::ManakaiPerlStringLiteral.newObject>;
2478     __CODE{ManakaiNode:getNewReference::
2479     $object => $r, $ref => $r,
2480     $class => {<ClassName::ManakaiPerlStringLiteral>}}__;
2481     $r-><M::ManakaiPerlStringLiteral.data> ($stringArg);
2482     }__;
2483    
2484     @Method:
2485     @@Name: createPerlVariable
2486     @@enDesc:
2487     Creates a new <Class::ManakaiPerlVariable> object.
2488     @@Param:
2489     @@@Name: variableType
2490     @@@Type:
2491     DISLang:String::ManakaiDOM:all
2492     @@@enDesc:
2493     Variable prefix.
2494     @@Param:
2495     @@@Name: packageName
2496     @@@Type:
2497     Perl:package-name::ManakaiDOM:all
2498     @@@enDesc:
2499     Package name.
2500     @@@nullCase:
2501     @@@@enDesc:
2502     The variable belongs to the current package or a
2503     lexical-scoped variable.
2504     @@Param:
2505     @@@Name: localName
2506     @@@Type:
2507     DISLang:String::ManakaiDOM:all
2508     @@@enDesc:
2509     Variable name.
2510     @@Return:
2511     @@@Type:ManakaiPerlVariable
2512     @@@enDesc:
2513     Newly created Perl variable object.
2514     @@@PerlDef:
2515     __DEEP{
2516     $r = <ClassM::ManakaiPerlVariable.newObject>;
2517     __CODE{ManakaiNode:getNewReference::
2518     $object => $r, $ref => $r,
2519     $class => {<ClassName::ManakaiPerlVariable>}}__;
2520     $r-><M::ManakaiPerlVariable.variableType> ($variableType);
2521     $r-><M::ManakaiPerlVariable.packageName> ($packageName);
2522     $r-><M::ManakaiPerlVariable.localName> ($localName);
2523 wakaba 1.5 }__;
2524 wakaba 1.1 ##PerlCodeImplementation
2525    
2526 wakaba 1.5 ResourceDef:
2527     @QName: MNodeObject
2528     @rdf:type:
2529     ManakaiDOM:Class
2530     @AliasFor:
2531     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
2532    
2533 wakaba 1.1 PropDef:
2534     @QName: code
2535     @enDesc: Perl code.
2536    
2537     PropDef:
2538     @QName: sourceFile
2539     @enDesc:
2540     Source file.
2541    
2542     PropDef:
2543     @QName: sourceLine
2544     @enDesc:
2545     Source line number.
2546    
2547     PropDef:
2548     @QName: prototype
2549     @enDesc:
2550     Prototype of subroutine.
2551    
2552     PropDef:
2553     @QName: parent
2554     @enDesc:
2555     Higher-level object.
2556    
2557     PropDef:
2558     @QName: sub
2559     @enDesc:
2560     Perl subroutines.
2561    
2562     PropDef:
2563     @QName: packageName
2564     @Type:
2565     Perl:package-name
2566     @enDesc:
2567     The fully qualified names of packages.
2568    
2569     PropDef:
2570     @QName: childNodes
2571     @enDesc:
2572     Child code fragments.
2573    
2574     PropDef:
2575     @QName: localName
2576     @enDesc:
2577     Scoped names.
2578 wakaba 1.4
2579     ## -- Exceptions
2580    
2581     ExceptionDef:
2582     @ClsQName: ManakaiPerlCodeException
2583     @enDesc:
2584     Exceptions for the <Module::PerlCode> module.
2585     @ClsISA:
2586     ManakaiDOM:ManakaiDOMException::ManakaiDOM:Perl
2587     @XConstGroupDef:
2588     @@ClsQName: ManakaiPerlCodeExceptionCode
2589     @@enDesc:
2590     Exception codes for <Class::ManakaiPerlCodeException>.
2591 wakaba 1.5 @@XConstDef:
2592     @@@Name: HIERARCHY_REQUEST_ERR
2593     @@@Value:3
2594     @@@enDesc:
2595     An attempt is made to break the hierarchy.
2596     @@@XSubTypeDef:
2597     @@@@QName: BAD_CHILD_ERR
2598     @@@@enDesc:
2599     An attempt is made to append a node as a child whose type
2600     is not allowed.
2601     @@@@XParam:
2602     @@@@@QName: childNode
2603     @@@@@enDesc:
2604     The node attempted to append.
2605     @@@@XParam:
2606     @@@@@QName: parentNode
2607     @@@@@enDesc:
2608     The node to whose child list an attempt to append is made.
2609     @@@XSubTypeDef:
2610     @@@@QName: IN_USE_NODE_ERR
2611     @@@@enDesc:
2612     An attempt is made to append a node that has already been used
2613     elsewhere.
2614     @@@@XParam:
2615     @@@@@QName: childNode
2616     @@@@@enDesc:
2617     The node attempted to append.
2618     @@@@XParam:
2619     @@@@@QName: parentNode
2620     @@@@@enDesc:
2621     The parent node of the <XP::childNode>.
2622 wakaba 1.4 @@XConstDef:
2623     @@@Name: NOT_SUPPORTED_ERR
2624     @@@Value:9
2625     @@@enDesc:
2626     An attempt is made to do something the implementation does not support.
2627     @@@XSubTypeDef:
2628     @@@@QName: UNSUPPORTED_OPERATOR_ERR
2629     @@@@enDesc:
2630     The implementation does not support the specified operator.
2631     @@@@XParam:
2632     @@@@@QName: operator
2633     @@@@@enDesc:
2634     The operator that is not supported.
2635     @@@@enMufDef:
2636     Operator "%p (name => {<Q::pc:operator>});" is not supported
2637    
2638     ElementTypeBinding:
2639     @Name: ExceptionDef
2640     @ElementType:
2641     dis:ResourceDef
2642     @ShadowContent:
2643     @@rdf:type:
2644     ManakaiDOM:ExceptionClass
2645     @@AliasFor:
2646     @@@@:
2647     ::ManakaiDOM:Perl
2648     @@@For:
2649     !=ManakaiDOM:Perl
2650     @@ForCheck:
2651     ManakaiDOM:Perl
2652     @@DOMMain:implementFeature: CoreFeature10
2653    
2654     ElementTypeBinding:
2655     @Name: XConstGroupDef
2656     @ElementType:
2657     dis:ResourceDef
2658     @ShadowContent:
2659     @@rdf:type:
2660     ManakaiDOM:ConstGroup
2661     @@Type:
2662     DOMMain:unsigned-short::ManakaiDOM:all
2663     @@rdfs:subClassOf:
2664     DOMMain:unsigned-short::ManakaiDOM:all
2665    
2666     ElementTypeBinding:
2667     @Name: XConstDef
2668     @ElementType:
2669     dis:ResourceDef
2670     @ShadowContent:
2671     @@rdf:type:
2672     ManakaiDOM:Const
2673    
2674     ElementTypeBinding:
2675     @Name: XSubTypeDef
2676     @ElementType:
2677     dis:ResourceDef
2678     @ShadowContent:
2679     @@rdf:type:
2680     ManakaiDOM:ExceptionOrWarningSubType
2681    
2682     ElementTypeBinding:
2683     @Name: XParam
2684     @ElementType:
2685     ManakaiDOM:exceptionOrWarningParameter
2686    
2687     ElementTypeBinding:
2688     @Name: XParamDef
2689     @ElementType:
2690     dis:ResourceDef
2691     @ShadowContent:
2692     @@rdf:type:
2693     DOMMain:XWParameter
2694     @@AliasFor:
2695     @@@For:
2696     !=ManakaiDOM:all
2697     @@@@:
2698     ::ManakaiDOM:all
2699    
2700     ElementTypeBinding:
2701     @Name: enMufDef
2702     @ElementType:
2703     dis:Def
2704     @ShadowContent:
2705     @@ContentType:
2706     lang:muf
2707     @@lang:en
2708    
2709 wakaba 1.1
2710     ElementTypeBinding:
2711     @Name: ClsDef
2712     @ElementType:
2713     dis:ResourceDef
2714     @ShadowContent:
2715     @@rdf:type:
2716     ManakaiDOM:Class
2717     @@AliasFor:
2718     @@@@:
2719     ::ManakaiDOM:Perl
2720     @@@For:
2721     !=ManakaiDOM:Perl
2722     @@ForCheck:
2723     ManakaiDOM:Perl
2724     @@DOMMain:implementFeature: CoreFeature10
2725    
2726     ElementTypeBinding:
2727     @Name: ClsQName
2728     @ElementType:
2729     dis:QName
2730    
2731     ElementTypeBinding:
2732     @Name: ClsISA
2733     @ElementType:
2734     dis:ISA
2735    
2736     ElementTypeBinding:
2737     @Name: Method
2738     @ElementType:
2739     dis:ResourceDef
2740     @ShadowContent:
2741     @@rdf:type:
2742     DISLang:Method
2743    
2744     ElementTypeBinding:
2745     @Name: ToStringMethod
2746     @ElementType:
2747     dis:ResourceDef
2748     @ShadowContent:
2749     @@rdf:type:
2750     DISLang:Method
2751     @@Operator:
2752     @@@@:
2753     DISPerl:AsStringMethod
2754     @@@ContentType:
2755     dis:TypeQName
2756     @@Description:
2757     @@@lang:en
2758     @@@@:
2759     Returns the textual Perl source code representation of this object.
2760    
2761     ElementTypeBinding:
2762     @Name: IntMethod
2763     @ElementType:
2764     dis:ResourceDef
2765     @ShadowContent:
2766     @@rdf:type:
2767     DISLang:Method
2768     @@ManakaiDOM:isForInternal:1
2769    
2770     ElementTypeBinding:
2771     @Name: Attr
2772     @ElementType:
2773     dis:ResourceDef
2774     @ShadowContent:
2775     @@rdf:type:
2776     DISLang:Attribute
2777    
2778     ElementTypeBinding:
2779     @Name: Return
2780     @ElementType:
2781     dis:ResourceDef
2782     @ShadowContent:
2783     @@rdf:type:
2784     DISLang:MethodReturn
2785    
2786     ElementTypeBinding:
2787     @Name: Get
2788     @ElementType:
2789     dis:ResourceDef
2790     @ShadowContent:
2791     @@rdf:type:
2792     DISLang:AttributeGet
2793    
2794     ElementTypeBinding:
2795     @Name: Set
2796     @ElementType:
2797     dis:ResourceDef
2798     @ShadowContent:
2799     @@rdf:type:
2800     DISLang:AttributeSet
2801    
2802     ElementTypeBinding:
2803     @Name: Param
2804     @ElementType:
2805     dis:ResourceDef
2806     @ShadowContent:
2807     @@rdf:type:
2808     DISLang:MethodParameter
2809    
2810     ElementTypeBinding:
2811     @Name: PerlDef
2812     @ElementType:
2813     dis:Def
2814     @ShadowContent:
2815     @@ContentType:
2816     lang:Perl
2817    
2818     ElementTypeBinding:
2819     @Name: disDef
2820     @ElementType:
2821     dis:Def
2822     @ShadowContent:
2823     @@ContentType:
2824     lang:dis
2825    
2826     ElementTypeBinding:
2827     @Name: InCase
2828     @ElementType:
2829     dis:ResourceDef
2830     @ShadowContent:
2831     @@rdf:type:
2832     ManakaiDOM:InCase
2833    
2834     ElementTypeBinding:
2835     @Name: nullCase
2836     @ElementType:
2837     dis:ResourceDef
2838     @ShadowContent:
2839     @@rdf:type:
2840     ManakaiDOM:InCase
2841     @@Value:
2842     @@@is-null:1
2843    
2844     ElementTypeBinding:
2845     @Name: TrueCase
2846     @ElementType:
2847     dis:ResourceDef
2848     @ShadowContent:
2849     @@rdf:type:
2850     ManakaiDOM:InCase
2851     @@Value:true
2852     @@Type:
2853     DOMMain:boolean
2854    
2855    
2856     ElementTypeBinding:
2857     @Name: FalseCase
2858     @ElementType:
2859     dis:ResourceDef
2860     @ShadowContent:
2861     @@rdf:type:
2862     ManakaiDOM:InCase
2863     @@Value:false
2864     @@Type:
2865     DOMMain:boolean
2866    
2867     ElementTypeBinding:
2868     @Name: enDesc
2869     @ElementType:
2870     dis:Description
2871     @ShadowContent:
2872     @@lang:en
2873    
2874     ElementTypeBinding:
2875     @Name: PropDef
2876     @ElementType:
2877     dis:ResourceDef
2878     @ShadowContent:
2879     @@rdf:type:
2880     rdf:Property
2881     @@AliasFor:
2882     @@@@:
2883     ::ManakaiDOM:all
2884     @@@For:
2885     !=ManakaiDOM:all
2886    
2887     ElementTypeBinding:
2888     @Name: NamedParam
2889     @ElementType:
2890     dis:ResourceDef
2891     @ShadowContent:
2892     @@rdf:type:
2893     DISLang:MethodParameter
2894     @@DISPerl:isNamedParameter:1
2895    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24