/[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.7 - (hide annotations) (download)
Wed Mar 30 03:16:43 2005 UTC (20 years, 3 months ago) by wakaba
Branch: MAIN
Changes since 1.6: +14 -18 lines
plPreprocessStatement now works

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.7 $Date: 2005/03/16 09:08:14 $
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 wakaba 1.7 my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno);
1438 wakaba 1.6 $r .= $cn->stringify;
1439     }
1440 wakaba 1.4 $r .= "}\n";
1441 wakaba 1.1 ##PerlSub
1442    
1443 wakaba 1.5 XParamDef:
1444     @QName: parentNode
1445     @enDesc:
1446     Parent node.
1447    
1448     XParamDef:
1449     @QName: childNode
1450     @enDesc:
1451     Child node.
1452    
1453 wakaba 1.1 ClsDef:
1454     @ClsQName: ManakaiPerlUnparsedCode
1455     @ClsISA: ManakaiPerlCodeFragment
1456     @enDesc:
1457     Unparsed Perl code fragments.
1458    
1459     @IntMethod:
1460     @@Name:newObject
1461     @@ManakaiDOM:isStatic:1
1462     @@Description:
1463     @@@lang:en
1464     @@@@:
1465     Creates a new instance object for <Class::ManakaiPerlUnparsedCode>.
1466     @@Return:
1467     @@@Type:
1468     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1469     @@@Description:
1470     @@@@lang:en
1471     @@@@@:
1472     The newly created node object.
1473     @@@PerlDef:
1474     @@@@@:
1475     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1476     ::ManakaiDOM:Perl.new>;
1477     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1478     $node->{<Q::pc:code>} = '';
1479 wakaba 1.6 $node->{<Q::pc:nodeType>} = 'unparsed';
1480 wakaba 1.1 @@@@ImplNote:
1481     @@@@@lang:en
1482     @@@@@@:
1483 wakaba 1.6 Properties: <Q::pc:nodeType>, <Q::pc:code>.
1484 wakaba 1.5
1485     @Attr:
1486     @@Name: code
1487     @@enDesc:
1488     Perl code.
1489     @@Type:
1490     lang:Perl::ManakaiDOM:all
1491     @@Get:
1492     @@@disDef:
1493     @@@@GetProp: code
1494     @@Set:
1495     @@@disDef:
1496     @@@@SetProp: code
1497    
1498     @Attr:
1499     @@Name: sourceFile
1500     @@enDesc:
1501     The source file name of this fragment.
1502     @@Type:
1503     DISLang:String
1504     @@Get:
1505     @@@enDesc:
1506     Any string identifying the source.
1507     @@@nullCase:
1508     @@@@enDesc: No source file name is set.
1509     @@@disDef:
1510     @@@@GetProp: sourceFile
1511     @@Set:
1512     @@@nullCase:
1513     @@@@enDesc: No (or unknown) source file.
1514     @@@disDef:
1515     @@@@SetProp: sourceFile
1516    
1517     @Attr:
1518     @@Name: sourceLine
1519     @@enDesc:
1520     Source file line number of the first line of this fragment.
1521     @@Type:
1522     DOMMain:unsigned-long
1523     @@Get:
1524     @@@disDef:
1525     @@@@GetProp: sourceLine
1526     @@Set:
1527     @@@disDef:
1528     @@@@SetProp: sourceLine
1529 wakaba 1.6
1530     @ToStringMethod:
1531     @@Return:
1532     @@@Type:
1533     DISLang:String
1534     @@@enDesc:
1535     Perl code.
1536     @@@PerlDef:
1537     my $node = $self->{<Q::TreeCore:node>};
1538     __DEEP{
1539     my $file = $self-><AG::ManakaiPerlCodeFragment.fileNode>;
1540     $r = sprintf (qq<\n#line %d "%s (Chunk %d)"\n>,
1541     $node->{<Q::pc:sourceLine>},
1542     $node->{<Q::pc:sourceFile>},
1543     $file-><M::ManakaiPerlFile.getNextChunkNumber>)
1544     . $node->{<Q::pc:code>}
1545     . sprintf (qq<\n#line 1 "%s (Chunk %d)"\n>,
1546     $file-><AG::ManakaiPerlFile.sourceFile>,
1547     $file-><M::ManakaiPerlFile.getNextChunkNumber>);
1548     }__;
1549 wakaba 1.1 ##PerlUnparsedCode
1550    
1551     ClsDef:
1552 wakaba 1.6 @ClsQName: ManakaiPerlInlineUnparsedCode
1553     @ClsISA: ManakaiPerlCodeFragment
1554     @enDesc:
1555     Unparsed Perl inline code fragments.
1556    
1557     @IntMethod:
1558     @@Name:newObject
1559     @@ManakaiDOM:isStatic:1
1560     @@Description:
1561     @@@lang:en
1562     @@@@:
1563     Creates a new instance object for
1564     <Class::ManakaiPerlInlineUnparsedCode>.
1565     @@Return:
1566     @@@Type:
1567     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1568     @@@Description:
1569     @@@@lang:en
1570     @@@@@:
1571     The newly created node object.
1572     @@@PerlDef:
1573     @@@@@:
1574     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1575     ::ManakaiDOM:Perl.new>;
1576     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1577     $node->{<Q::pc:code>} = '';
1578     $node->{<Q::pc:nodeType>} = 'inunparsed';
1579     @@@@ImplNote:
1580     @@@@@lang:en
1581     @@@@@@:
1582     Properties: <Q::pc:nodeType>, <Q::pc:code>.
1583    
1584     @Attr:
1585     @@Name: code
1586     @@enDesc:
1587     Perl code.
1588     @@Type:
1589     lang:Perl::ManakaiDOM:all
1590     @@Get:
1591     @@@disDef:
1592     @@@@GetProp: code
1593     @@Set:
1594     @@@disDef:
1595     @@@@SetProp: code
1596    
1597     @ToStringMethod:
1598     @@Return:
1599     @@@Type:
1600     DISLang:String
1601     @@@enDesc:
1602     Perl code.
1603     @@@PerlDef:
1604     my $node = $self->{<Q::TreeCore:node>};
1605     $r = $node->{<Q::pc:code>};
1606     ##PerlInlineUnparsedCode
1607    
1608     ClsDef:
1609     @ClsQName: ManakaiPerlStringLiteral
1610     @ClsISA: ManakaiPerlCodeFragment
1611     @enDesc:
1612     Perl string literal.
1613    
1614     @IntMethod:
1615     @@Name:newObject
1616     @@ManakaiDOM:isStatic:1
1617     @@Description:
1618     @@@lang:en
1619     @@@@:
1620     Creates a new instance object for
1621     <Class::ManakaiPerlStringLiteral>.
1622     @@Return:
1623     @@@Type:
1624     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1625     @@@Description:
1626     @@@@lang:en
1627     @@@@@:
1628     The newly created node object.
1629     @@@PerlDef:
1630     @@@@@:
1631     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1632     ::ManakaiDOM:Perl.new>;
1633     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1634     $node->{<Q::infoset:data>} = '';
1635     $node->{<Q::pc:nodeType>} = 'string';
1636     @@@@ImplNote:
1637     @@@@@lang:en
1638     @@@@@@:
1639     Properties: <Q::pc:nodeType>, <Q::infoset:data>.
1640    
1641     @Attr:
1642     @@Name: data
1643     @@enDesc:
1644     String data.
1645     @@Type:
1646     DISLang:String::ManakaiDOM:all
1647     @@Get:
1648     @@@disDef:
1649     @@@@GetProp:
1650     infoset:data
1651     @@Set:
1652     @@@disDef:
1653     @@@@SetProp:
1654     infoset:data
1655    
1656     @ToStringMethod:
1657     @@Return:
1658     @@@Type:
1659     DISLang:String
1660     @@@enDesc:
1661     Perl code.
1662     @@@PerlDef:
1663     my $node = $self->{<Q::TreeCore:node>};
1664     $r = $node->{<Q::infoset:data>};
1665     $r =~ s/(['\\])/\\$1/g;
1666     $r = q<'> . $r . q<'>;
1667     ##PerlStringLiteral
1668    
1669     ClsDef:
1670     @ClsQName: ManakaiPerlBare
1671     @ClsISA: ManakaiPerlCodeFragment
1672     @enDesc:
1673     Unparsed Perl inline code fragments.
1674    
1675     @IntMethod:
1676     @@Name:newObject
1677     @@ManakaiDOM:isStatic:1
1678     @@Description:
1679     @@@lang:en
1680     @@@@:
1681     Creates a new instance object for
1682     <Class::ManakaiPerlInlineBare>.
1683     @@Return:
1684     @@@Type:
1685     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1686     @@@Description:
1687     @@@@lang:en
1688     @@@@@:
1689     The newly created node object.
1690     @@@PerlDef:
1691     @@@@@:
1692     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1693     ::ManakaiDOM:Perl.new>;
1694     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1695     $node->{<Q::pc:code>} = '';
1696     $node->{<Q::pc:nodeType>} = 'bare';
1697     @@@@ImplNote:
1698     @@@@@lang:en
1699     @@@@@@:
1700     Properties: <Q::pc:nodeType>, <Q::pc:code>.
1701    
1702     @Attr:
1703     @@Name: code
1704     @@enDesc:
1705     Perl code.
1706     @@Type:
1707     lang:Perl::ManakaiDOM:all
1708     @@Get:
1709     @@@disDef:
1710     @@@@GetProp: code
1711     @@Set:
1712     @@@disDef:
1713     @@@@SetProp: code
1714    
1715     @ToStringMethod:
1716     @@Return:
1717     @@@Type:
1718     DISLang:String
1719     @@@enDesc:
1720     Perl code.
1721     @@@PerlDef:
1722     my $node = $self->{<Q::TreeCore:node>};
1723     $r = $node->{<Q::pc:code>};
1724     ##PerlBare
1725    
1726     ClsDef:
1727     @ClsQName: ManakaiPerlAtom
1728     @ClsISA: ManakaiPerlBare
1729     @enDesc:
1730     Unparsed Perl atomic code fragments (such as numeric literal).
1731    
1732     @IntMethod:
1733     @@Name:newObject
1734     @@ManakaiDOM:isStatic:1
1735     @@Description:
1736     @@@lang:en
1737     @@@@:
1738     Creates a new instance object for
1739     <Class::ManakaiPerlAtom>.
1740     @@Return:
1741     @@@Type:
1742     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1743     @@@Description:
1744     @@@@lang:en
1745     @@@@@:
1746     The newly created node object.
1747     @@@PerlDef:
1748     @@@@@:
1749     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1750     ::ManakaiDOM:Perl.new>;
1751     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1752     $node->{<Q::pc:code>} = '';
1753     $node->{<Q::pc:nodeType>} = 'atom';
1754     @@@@ImplNote:
1755     @@@@@lang:en
1756     @@@@@@:
1757     Properties: <Q::pc:nodeType>, <Q::pc:code>.
1758    
1759     @ToStringMethod:
1760     @@Return:
1761     @@@Type:
1762     DISLang:String
1763     @@@enDesc:
1764     Perl code.
1765     @@@PerlDef:
1766     my $node = $self->{<Q::TreeCore:node>};
1767     $r = $node->{<Q::pc:code>};
1768     ##PerlAtom
1769    
1770     ClsDef:
1771     @ClsQName: ManakaiPerlVariable
1772     @ClsISA: ManakaiPerlCodeFragment
1773     @enDesc:
1774     Unparsed Perl variable.
1775     \
1776     {NOTE:: Future version of the implementation may
1777     support to specify array index or hash key.
1778     \
1779     }
1780    
1781     @IntMethod:
1782     @@Name:newObject
1783     @@ManakaiDOM:isStatic:1
1784     @@Description:
1785     @@@lang:en
1786     @@@@:
1787     Creates a new instance object for
1788     <Class::ManakaiPerlVariable>.
1789     @@Return:
1790     @@@Type:
1791     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
1792     @@@Description:
1793     @@@@lang:en
1794     @@@@@:
1795     The newly created node object.
1796     @@@PerlDef:
1797     @@@@@:
1798     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
1799     ::ManakaiDOM:Perl.new>;
1800     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
1801     $node->{<Q::pc:variableType>} = '';
1802     $node->{<Q::pc:nodeType>} = 'variable';
1803     @@@@ImplNote:
1804     @@@@@lang:en
1805     @@@@@@:
1806     Properties: <Q::pc:nodeType>, <Q::pc:variableType>,
1807     <Q::packageName>, <Q::localName> (required),
1808     <Q::variableScope>.
1809    
1810     @Attr:
1811     @@Name: variableType
1812     @@enDesc:
1813     Perl variable type (<CODE::$>, <CODE::@>, <CODE::%>,
1814     <CODE::&> or empty string).
1815     @@Type:
1816     lang:Perl::ManakaiDOM:all
1817     @@Get:
1818     @@@disDef:
1819     @@@@GetProp: variableType
1820     @@Set:
1821     @@@disDef:
1822     @@@@SetProp: variableType
1823    
1824     @Attr:
1825     @@Name: packageName
1826     @@enDesc:
1827     The name of the package to which this variable belongs.
1828     @@Type:
1829     Perl:package-name::ManakaiDOM:all
1830     @@Get:
1831     @@@nullCase:
1832     @@@@enDesc:
1833     This package belongs to the current package or
1834     does not belong to any package.
1835     @@@disDef:
1836     @@@@GetProp: packageName
1837     @@Set:
1838     @@@nullCase:
1839     @@@@enDesc:
1840     This package belongs to the current package or
1841     does not belong to any package.
1842     @@@disDef:
1843     @@@@SetProp: variableType
1844    
1845     @Attr:
1846     @@Name: localName
1847     @@enDesc:
1848     The local variable name.
1849     @@Type:
1850     lang:Perl::ManakaiDOM:all
1851     @@Get:
1852     @@@disDef:
1853     @@@@GetProp: localName
1854     @@Set:
1855     @@@disDef:
1856     @@@@SetProp: localName
1857    
1858     @Attr:
1859     @@Name: variableScope
1860     @@enDesc:
1861     Scope modifier (<CODE::my> or <CODE::our> or <CODE::local>).
1862     @@Type:
1863     lang:Perl::ManakaiDOM:all
1864     @@Get:
1865     @@@nullCase:
1866     @@@@enDesc:
1867     This variable does not have scope modifier.
1868     @@@disDef:
1869     @@@@GetProp: variableScope
1870     @@Set:
1871     @@@nullCase:
1872     @@@@enDesc:
1873     This variable does not have scope modifier.
1874     @@@disDef:
1875     @@@@SetProp: variableScope
1876    
1877     @ToStringMethod:
1878     @@Return:
1879     @@@Type:
1880     DISLang:String
1881     @@@enDesc:
1882     Perl code.
1883     @@@PerlDef:
1884     my $node = $self->{<Q::TreeCore:node>};
1885     $r = $node->{<Q::pc:variableType>};
1886     $r .= $node->{<Q::pc:packageName>} . '::'
1887     if defined $node->{<Q::pc:packageName>};
1888     $r .= $node->{<Q::pc:localName>};
1889     if ($node->{<Q::pc:variableType>} eq '$' and
1890     defined $node->{<Q::pc:hashKey>}) {
1891     my $hashKey = $node->{<Q::pc:hashKey>};
1892     $hashKey =~ s/(['\\])/\\$1/g;
1893     $r .= q<{'> . $hashKey . q<'}>;
1894     }
1895    
1896     @Attr:
1897     @@Name: hashKey
1898     @@enDesc:
1899     The key for hash.
1900     \
1901     {NOTE:: Using Perl code for key is not supported in the current
1902     version of the implementation.
1903     \
1904     }
1905     @@Type:
1906     DISLang:String::ManakaiDOM:all
1907     @@Get:
1908     @@@nullCase:
1909     @@@@enDesc:
1910     This variable is not for hash value access.
1911     @@@disDef:
1912     @@@@GetProp: hashKey
1913     @@Set:
1914     @@@nullCase:
1915     @@@@enDesc:
1916     This variable is not for hash value access.
1917     @@@disDef:
1918     @@@@SetProp: hashKey
1919     ##PerlInlineUnparsedCode
1920    
1921     PropDef:
1922     @QName: variableScope
1923     @enDesc:
1924     Variable scope (<CODE::local>, <CODE::my> or <CODE::our>).
1925    
1926     PropDef:
1927     @QName: variableType
1928     @enDesc:
1929     Variable type prefix.
1930    
1931     PropDef:
1932     @QName: hashKey
1933     @enDesc:
1934     Hash key string.
1935    
1936     ClsDef:
1937     @ClsQName: ManakaiPerlAnyContainer
1938     @ClsISA: ManakaiPerlCodeFragment
1939     @enDesc:
1940     A base class implemented by both inline container and
1941     block-level container.
1942    
1943     @Attr:
1944     @@Name: length
1945     @@enDesc:
1946     The number of child code fragments.
1947     @@Type:
1948     DOMMain:unsigned-long
1949     @@Get:
1950     @@@PerlDef:
1951     $r = @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}};
1952    
1953     @Method:
1954     @@Name: appendStringLiteral
1955     @@enDesc:
1956     Appends a Perl string literal (<CODE::q>).
1957     @@Param:
1958     @@@Name: stringArg
1959     @@@Type:
1960     DISLang:String::ManakaiDOM:all
1961     @@@enDesc:
1962     A string.
1963     @@Return:
1964     @@@Type: ManakaiPerlStringLiteral
1965     @@@enDesc:
1966     The newly created Perl string literal object.
1967     @@@PerlDef:
1968     $r = <ClassM::ManakaiPerlStringLiteral.newObject>;
1969     my $node = $self->{<Q::TreeCore:node>};
1970     $r->{<Q::infoset:data>} = $stringArg;
1971     $node-><M::ManakaiDOM:ManakaiDOMNodeObject
1972     ::ManakaiDOM:Perl.importTree> ($r);
1973     push @{$node->{<Q::pc:childNodes>}}, $r;
1974     $r->{<Q::pc:parent>} = $node;
1975     if (defined wantarray) {
1976     __CODE{ManakaiNode:getNewReference::
1977     $object => $r, $ref => $r,
1978     $class =>{<ClassName::ManakaiPerlStringLiteral>},
1979     }__;
1980     }
1981    
1982    
1983     @Method:
1984     @@Name: appendAtom
1985     @@enDesc:
1986     Appends a Perl atomic code fragment.
1987     @@Param:
1988     @@@Name: codeArg
1989     @@@Type:
1990     lang:Perl::ManakaiDOM:all
1991     @@@enDesc:
1992     An atom.
1993     @@Return:
1994     @@@Type: ManakaiPerlAtom
1995     @@@enDesc:
1996     The newly created Perl code object.
1997     @@@PerlDef:
1998     $r = <ClassM::ManakaiPerlAtom.newObject>;
1999     my $node = $self->{<Q::TreeCore:node>};
2000 wakaba 1.7 $r->{<Q::pc:code>} = $codeArg;
2001 wakaba 1.6 $node-><M::ManakaiDOM:ManakaiDOMNodeObject
2002     ::ManakaiDOM:Perl.importTree> ($r);
2003     push @{$node->{<Q::pc:childNodes>}}, $r;
2004     $r->{<Q::pc:parent>} = $node;
2005     if (defined wantarray) {
2006     __CODE{ManakaiNode:getNewReference::
2007     $object => $r, $ref => $r,
2008     $class =>{<ClassName::ManakaiPerlAtom>},
2009     }__;
2010     }
2011    
2012    
2013     @Method:
2014     @@Name: appendBare
2015     @@enDesc:
2016     Appends a Perl bare code fragment.
2017     @@Param:
2018     @@@Name: codeArg
2019     @@@Type:
2020     lang:Perl::ManakaiDOM:all
2021     @@@enDesc:
2022 wakaba 1.7 An bare code.
2023 wakaba 1.6 @@Return:
2024     @@@Type: ManakaiPerlBare
2025     @@@enDesc:
2026     The newly created Perl code object.
2027     @@@PerlDef:
2028     $r = <ClassM::ManakaiPerlBare.newObject>;
2029     my $node = $self->{<Q::TreeCore:node>};
2030 wakaba 1.7 $r->{<Q::pc:code>} = $codeArg;
2031 wakaba 1.6 $node-><M::ManakaiDOM:ManakaiDOMNodeObject
2032     ::ManakaiDOM:Perl.importTree> ($r);
2033     push @{$node->{<Q::pc:childNodes>}}, $r;
2034     $r->{<Q::pc:parent>} = $node;
2035     if (defined wantarray) {
2036     __CODE{ManakaiNode:getNewReference::
2037     $object => $r, $ref => $r,
2038     $class =>{<ClassName::ManakaiPerlBare>},
2039     }__;
2040     }
2041    
2042     ##PerlAnyContainer
2043    
2044     ClsDef:
2045     @ClsQName: ManakaiPerlInlineContainer
2046     @ClsISA: ManakaiPerlAnyContainer
2047     @enDesc:
2048     Unparsed Perl inline code block.
2049    
2050     @IntMethod:
2051     @@Name:newObject
2052     @@ManakaiDOM:isStatic:1
2053     @@Description:
2054     @@@lang:en
2055     @@@@:
2056     Creates a new instance object for
2057     <Class::ManakaiPerlInlineContainer>.
2058     @@Return:
2059     @@@Type:
2060     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
2061     @@@Description:
2062     @@@@lang:en
2063     @@@@@:
2064     The newly created node object.
2065     @@@PerlDef:
2066     @@@@@:
2067     my $node = $r = <ClassM::ManakaiDOM:ManakaiDOMNodeObject
2068     ::ManakaiDOM:Perl.new>;
2069     push @{$node->{<Q::TreeCore:origin>}}, <Q::pc:parent>;
2070     $node->{<Q::pc:childNodes>} = [];
2071     $node->{<Q::pc:nodeType>} = 'incontainer';
2072     @@@@ImplNote:
2073     @@@@@lang:en
2074     @@@@@@:
2075     Properties: <Q::pc:nodeType>, <Q::pc:childNodes>.
2076    
2077     @Method:
2078     @@Name: appendCodeFragment
2079     @@enDesc:
2080     Appends a <Class::ManakaiPerlCodeFragment> object.
2081     @@Param:
2082     @@@Name: codeArg
2083     @@@Type: ManakaiPerlCodeFragment
2084     @@@enDesc:
2085     A code fragment object.
2086     @@Return:
2087     @@@RaiseException:
2088     @@@@@:BAD_CHILD_ERR
2089     @@@@enDesc:
2090     An attempt is made to append a child
2091     that is not a <Class::ManakaiPerlUnparsedCode>.
2092     @@@RaiseException:
2093     @@@@@:IN_USE_NODE_ERR
2094     @@@@enDesc:
2095     An attempt is made to append a node that is
2096     already used elsewhere.
2097     @@@PerlDef:
2098     if ({
2099     atom => 1, bare => 1, incontainer => 1,
2100     inunparsed => 1, variable => 1,
2101     }->{$codeArg->{<Q::TreeCore:node>}->{<Q::pc:nodeType>}}) {
2102     if ($codeArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}) {
2103     __EXCEPTION{IN_USE_NODE_ERR::
2104     pc:parentNode => {$codeArg->{<Q::TreeCore:node>}
2105     ->{<Q::pc:parent>}},
2106     pc:childNode => {$codeArg},
2107     }__;
2108     }
2109     $self->{<Q::TreeCore:node>}-><M::MNodeObject.importTree>
2110     ($codeArg->{<Q::TreeCore:node>});
2111     push @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}},
2112     $codeArg->{<Q::TreeCore:node>};
2113     $codeArg->{<Q::TreeCore:node>}->{<Q::pc:parent>}
2114     = $self->{<Q::TreeCore:node>};
2115     } else {
2116     __EXCEPTION{BAD_CHILD_ERR::
2117     pc:parentNode => {$self},
2118     pc:childNode => {$codeArg},
2119     }__;
2120     }
2121    
2122     @Method:
2123     @@Name: appendCode
2124     @@enDesc:
2125     Appends an unparsed Perl code fragment.
2126     @@Param:
2127     @@@Name: codeArg
2128     @@@Type:
2129     lang:Perl::ManakaiDOM:all
2130     @@@enDesc:
2131     An unparsed Perl code fragment.
2132     @@Return:
2133     @@@Type: ManakaiPerlInlineUnparsedCode
2134     @@@enDesc:
2135     The newly created Perl code object.
2136     @@@PerlDef:
2137     $r = <ClassM::ManakaiPerlInlineUnparsedCode.newObject>;
2138     my $node = $self->{<Q::TreeCore:node>};
2139     $r->{<Q::code>} = $codeArg;
2140     $node-><M::ManakaiDOM:ManakaiDOMNodeObject
2141     ::ManakaiDOM:Perl.importTree> ($r);
2142     push @{$node->{<Q::pc:childNodes>}}, $r;
2143     $r->{<Q::pc:parent>} = $node;
2144     if (defined wantarray) {
2145     __CODE{ManakaiNode:getNewReference::
2146     $object => $r, $ref => $r,
2147     $class =>{<ClassName::ManakaiPerlInlineUnparsedCode>},
2148     }__;
2149     }
2150    
2151     @ToStringMethod:
2152     @@Return:
2153     @@@Type:
2154     DISLang:String
2155     @@@enDesc:
2156     Perl code.
2157     @@@PerlDef:
2158     for my $cno (@{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}}) {
2159 wakaba 1.7 my $cn = <ClassM::ManakaiPerlCodeFragment.getNodeReference> ($cno);
2160 wakaba 1.6 if ($cno->{<Q::pc:nodeType>} eq 'incontainer' and
2161     \ @{$self->{<Q::TreeCore:node>}->{<Q::pc:childNodes>}} == 1) {
2162     $r .= '(' . $cn->stringify . ')';
2163     } else {
2164     $r .= $cn->stringify;
2165     }
2166     }
2167     ##PerlInlineContainer
2168    
2169     ElementTypeBinding:
2170     @Name: RaiseException
2171     @ElementType:
2172     ManakaiDOM:raises
2173    
2174     ClsDef:
2175     @ClsQName: ManakaiPerlCodeImplementation
2176 wakaba 1.1 @enDesc:
2177     The class that provides factory methods.
2178    
2179     @Role:
2180     @@@:
2181     DOMCore:DOMImplementation::ManakaiDOM:ManakaiDOM
2182     @@compat:
2183     DOMCore:ManakaiDOMImplementation::ManakaiDOM:ManakaiDOMLatest
2184    
2185     @Method:
2186     @@Name: createPerlFile
2187     @@enDesc:
2188     Creates a Perl code file.
2189     @@Return:
2190     @@@Type: ManakaiPerlFile
2191     @@@enDesc: A newly created Perl source file object.
2192     @@@PerlDef:
2193     $r = <ClassM::ManakaiPerlFile.newObject>;
2194 wakaba 1.6 __CODE{ManakaiNode:getNewReference::
2195     $object => $r, $ref => $r,
2196     $class => {<ClassName::ManakaiPerlFile>}}__;
2197 wakaba 1.1
2198     @IntMethod:
2199     @@Name: perlComment
2200     @@ManakaiDOM:isStatic:1
2201     @@enDesc:
2202     Generates a Perl comment string.
2203     @@Param:
2204     @@@Name: str
2205     @@@Type:
2206     DISLang:String
2207     @@@enDesc:
2208     A comment text.
2209     @@Return:
2210     @@@Type:
2211     DISLang:String
2212     @@@enDesc:
2213     A Perl comment string.
2214     @@@PerlDef:
2215     $r = $str;
2216     $r =~ s/\n/\n## /g;
2217     $r =~ s/\n## $/\n/s;
2218     $r .= "\n" unless $r =~ /\n$/;
2219     $r = q<## > . $r;
2220    
2221     @IntMethod:
2222     @@Name: rfc3339DateTime
2223     @@ManakaiDOM:isStatic:1
2224     @@enDesc:
2225     Returns RFC 3339 <CODE::date-time> representation of a date.
2226     @@Param:
2227     @@@Name: perlDate
2228     @@@Type:
2229     DOMMain:unsigned-long
2230     @@@enDesc:
2231     A Perl representation of date.
2232     @@Return:
2233     @@@Type:
2234     DISLang:String
2235     @@@enDesc:
2236     RFC 3339 date string.
2237     @@@PerlDef:
2238     my @time = gmtime $perlDate;
2239     $r = sprintf q<%04d-%02d-%02dT%02d:%02d:%02d+00:00>,
2240     $time[5] + 1900, $time[4] + 1, @time[3,2,1,0];
2241    
2242     @IntMethod:
2243     @@Name: versionDateTime
2244     @@ManakaiDOM:isStatic:1
2245     @@enDesc:
2246     Returns date for version.
2247     @@Param:
2248     @@@Name: perlDate
2249     @@@Type:
2250     DOMMain:unsigned-long
2251     @@@enDesc:
2252     A Perl representation of date.
2253     @@Return:
2254     @@@Type:
2255     DISLang:String
2256     @@@enDesc:
2257     A Perl number literal.
2258     @@@PerlDef:
2259     my @time = gmtime $perlDate;
2260     $r = sprintf q<%04d%02d%02d.%02d%02d>,
2261     $time[5] + 1900, $time[4] + 1, @time[3,2,1];
2262    
2263     @Method:
2264     @@Name: perlLiteral
2265     @@enDesc:
2266     Perl code representation.
2267     @@Param:
2268     @@@Name: val
2269     @@@Type:
2270     DOMMain:any
2271     @@@enDesc:
2272     A Perl value.
2273     @@Return:
2274     @@@Type:
2275     DISLang:String
2276     @@@enDesc:
2277     A Perl lexical representation of <P::val>.
2278     @@@PerlDef:
2279     unless (defined $val) {
2280     $r = q<undef>;
2281     } elsif (ref $val eq 'ARRAY') {
2282     __DEEP{
2283     $r = q<[> . <ClassM::ManakaiPerlCodeImplementation
2284     .perlLiteral> ($val) . q<]>;
2285     }__;
2286     } elsif (ref $val eq 'HASH') {
2287     __DEEP{
2288     $r = q<{> . <ClassM::ManakaiPerlCodeImplementation
2289     .perlLiteral> ([%$val]) . q<}>;
2290     }__;
2291     } else {
2292     $val =~ s/(['\\])/\\$1/g;
2293     $r = q<'> . $val . q<'>;
2294     }
2295    
2296     @Method:
2297     @@Name: perlList
2298     @@enDesc:
2299     Perl code representation of a list.
2300     @@Param:
2301     @@@Name: val
2302     @@@Type:
2303     Perl:ARRAY
2304     @@@enDesc:
2305     A Perl array reference.
2306     @@Return:
2307     @@@Type:
2308     DISLang:String
2309     @@@enDesc:
2310     A Perl lexical representation of <CODE::@$val>.
2311     @@@PerlDef:
2312     __DEEP{
2313     $r = join (q<, >, map {<ClassM::ManakaiPerlCodeImplementation
2314     .perlLiteral> ($_)} @{$val});
2315     }__;
2316 wakaba 1.5
2317     @Method:
2318     @@Name: createPerlSub
2319     @@enDesc:
2320     Creates a new <Class::ManakaiPerlSub> object.
2321     @@Param:
2322     @@@Name: subName
2323     @@@Type:
2324     DISLang:String
2325     @@@enDesc:
2326     The name of the subroutine to create.
2327     @@@nullCase:
2328     @@@@enDesc:
2329     The subroutine created has no name.
2330     @@Return:
2331     @@@Type:ManakaiPerlSub
2332     @@@enDesc:
2333     Newly created Perl subroutine object.
2334     @@@PerlDef:
2335     __DEEP{
2336 wakaba 1.6 $r = <ClassM::ManakaiPerlSub.newObject>;
2337     __CODE{ManakaiNode:getNewReference::
2338     $object => $r, $ref => $r,
2339     $class => {<ClassName::ManakaiPerlSub>}}__;
2340     $r-><AS::ManakaiPerlSub.localName> ($subName) if defined $subName;
2341 wakaba 1.5 }__;
2342    
2343     @Method:
2344     @@Name: createPerlUnparsedCode
2345     @@enDesc:
2346     Creates a new <Class::ManakaiPerlUnparsedCode> object.
2347     @@Param:
2348     @@@Name: codeArg
2349     @@@Type:
2350     lang:Perl::ManakaiDOM:all
2351     @@@enDesc:
2352     The code fragment.
2353     @@@nullCase:
2354     @@@@enDesc:
2355     The fragment initially has no code.
2356     @@Return:
2357     @@@Type:ManakaiPerlUnparsedCode
2358     @@@enDesc:
2359     Newly created Perl code object.
2360     @@@PerlDef:
2361     __DEEP{
2362 wakaba 1.6 $r = <ClassM::ManakaiPerlUnparsedCode.newObject>;
2363     __CODE{ManakaiNode:getNewReference::
2364     $object => $r, $ref => $r,
2365     $class => {<ClassName::ManakaiPerlUnparsedCode>}}__;
2366 wakaba 1.7 $r-><AS::ManakaiPerlUnparsedCode.code> ($codeArg) if defined $codeArg;
2367 wakaba 1.6 }__;
2368    
2369     @Method:
2370     @@Name: createPerlInlineContainer
2371     @@enDesc:
2372     Creates a new <Class::ManakaiPerlInlineContainer> object.
2373     @@Return:
2374     @@@Type:ManakaiPerlInlineContainer
2375     @@@enDesc:
2376     Newly created Perl code object.
2377     @@@PerlDef:
2378     __DEEP{
2379     $r = <ClassM::ManakaiPerlInlineContainer.newObject>;
2380     __CODE{ManakaiNode:getNewReference::
2381     $object => $r, $ref => $r,
2382     $class => {<ClassName::ManakaiPerlInlineContainer>}}__;
2383     }__;
2384    
2385     @Method:
2386     @@Name: createPerlInlineUnparsedCode
2387     @@enDesc:
2388     Creates a new <Class::ManakaiPerlInlineUnparsedCode> object.
2389     @@Param:
2390     @@@Name: codeArg
2391     @@@Type:
2392     lang:Perl::ManakaiDOM:all
2393     @@@enDesc:
2394     The code fragment.
2395     @@@nullCase:
2396     @@@@enDesc:
2397     The fragment initially has no code.
2398     @@Return:
2399     @@@Type:ManakaiPerlInlineUnparsedCode
2400     @@@enDesc:
2401     Newly created Perl code object.
2402     @@@PerlDef:
2403     __DEEP{
2404     $r = <ClassM::ManakaiPerlInlineUnparsedCode.newObject>;
2405     __CODE{ManakaiNode:getNewReference::
2406     $object => $r, $ref => $r,
2407     $class => {<ClassName::ManakaiPerlInlineUnparsedCode>}}__;
2408 wakaba 1.7 $r-><AS::ManakaiPerlInlineUnparsedCode.code> ($codeArg)
2409 wakaba 1.6 if defined $codeArg;
2410     }__;
2411    
2412     @Method:
2413     @@Name: createPerlBare
2414     @@enDesc:
2415     Creates a new <Class::ManakaiPerlBare> object.
2416     @@Param:
2417     @@@Name: codeArg
2418     @@@Type:
2419     lang:Perl::ManakaiDOM:all
2420     @@@enDesc:
2421     The code fragment.
2422     @@Return:
2423     @@@Type:ManakaiPerlBare
2424     @@@enDesc:
2425     Newly created Perl code object.
2426     @@@PerlDef:
2427     __DEEP{
2428     $r = <ClassM::ManakaiPerlBare.newObject>;
2429     __CODE{ManakaiNode:getNewReference::
2430     $object => $r, $ref => $r,
2431     $class => {<ClassName::ManakaiPerlBare>}}__;
2432 wakaba 1.7 $r-><AS::ManakaiPerlBare.code> ($codeArg);
2433 wakaba 1.6 }__;
2434    
2435     @Method:
2436     @@Name: createPerlAtom
2437     @@enDesc:
2438     Creates a new <Class::ManakaiPerlAtom> object.
2439     @@Param:
2440     @@@Name: codeArg
2441     @@@Type:
2442     lang:Perl::ManakaiDOM:all
2443     @@@enDesc:
2444     The code fragment.
2445     @@Return:
2446     @@@Type:ManakaiPerlAtom
2447     @@@enDesc:
2448     Newly created Perl code object.
2449     @@@PerlDef:
2450     __DEEP{
2451     $r = <ClassM::ManakaiPerlAtom.newObject>;
2452     __CODE{ManakaiNode:getNewReference::
2453     $object => $r, $ref => $r,
2454     $class => {<ClassName::ManakaiPerlAtom>}}__;
2455 wakaba 1.7 $r-><AS::ManakaiPerlBare.code> ($codeArg);
2456 wakaba 1.6 }__;
2457    
2458     @Method:
2459     @@Name: createPerlStringLiteral
2460     @@enDesc:
2461     Creates a new <Class::ManakaiPerlStringLiteral> object.
2462     @@Param:
2463     @@@Name: stringArg
2464     @@@Type:
2465     DISLang:String::ManakaiDOM:all
2466     @@@enDesc: A string.
2467     @@Return:
2468     @@@Type:ManakaiPerlStringLiteral
2469     @@@enDesc:
2470     Newly created Perl code object.
2471     @@@PerlDef:
2472     __DEEP{
2473     $r = <ClassM::ManakaiPerlStringLiteral.newObject>;
2474     __CODE{ManakaiNode:getNewReference::
2475     $object => $r, $ref => $r,
2476     $class => {<ClassName::ManakaiPerlStringLiteral>}}__;
2477 wakaba 1.7 $r-><AS::ManakaiPerlStringLiteral.data> ($stringArg);
2478 wakaba 1.6 }__;
2479    
2480     @Method:
2481     @@Name: createPerlVariable
2482     @@enDesc:
2483     Creates a new <Class::ManakaiPerlVariable> object.
2484     @@Param:
2485     @@@Name: variableType
2486     @@@Type:
2487     DISLang:String::ManakaiDOM:all
2488     @@@enDesc:
2489     Variable prefix.
2490     @@Param:
2491     @@@Name: packageName
2492     @@@Type:
2493     Perl:package-name::ManakaiDOM:all
2494     @@@enDesc:
2495     Package name.
2496     @@@nullCase:
2497     @@@@enDesc:
2498     The variable belongs to the current package or a
2499     lexical-scoped variable.
2500     @@Param:
2501     @@@Name: localName
2502     @@@Type:
2503     DISLang:String::ManakaiDOM:all
2504     @@@enDesc:
2505     Variable name.
2506     @@Return:
2507     @@@Type:ManakaiPerlVariable
2508     @@@enDesc:
2509     Newly created Perl variable object.
2510     @@@PerlDef:
2511     __DEEP{
2512     $r = <ClassM::ManakaiPerlVariable.newObject>;
2513     __CODE{ManakaiNode:getNewReference::
2514     $object => $r, $ref => $r,
2515     $class => {<ClassName::ManakaiPerlVariable>}}__;
2516 wakaba 1.7 $r-><AS::ManakaiPerlVariable.variableType> ($variableType);
2517     $r-><AS::ManakaiPerlVariable.packageName> ($packageName);
2518     $r-><AS::ManakaiPerlVariable.localName> ($localName);
2519 wakaba 1.5 }__;
2520 wakaba 1.1 ##PerlCodeImplementation
2521    
2522 wakaba 1.5 ResourceDef:
2523     @QName: MNodeObject
2524     @rdf:type:
2525     ManakaiDOM:Class
2526     @AliasFor:
2527     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
2528    
2529 wakaba 1.1 PropDef:
2530     @QName: code
2531     @enDesc: Perl code.
2532    
2533     PropDef:
2534     @QName: sourceFile
2535     @enDesc:
2536     Source file.
2537    
2538     PropDef:
2539     @QName: sourceLine
2540     @enDesc:
2541     Source line number.
2542    
2543     PropDef:
2544     @QName: prototype
2545     @enDesc:
2546     Prototype of subroutine.
2547    
2548     PropDef:
2549     @QName: parent
2550     @enDesc:
2551     Higher-level object.
2552    
2553     PropDef:
2554     @QName: sub
2555     @enDesc:
2556     Perl subroutines.
2557    
2558     PropDef:
2559     @QName: packageName
2560     @Type:
2561     Perl:package-name
2562     @enDesc:
2563     The fully qualified names of packages.
2564    
2565     PropDef:
2566     @QName: childNodes
2567     @enDesc:
2568     Child code fragments.
2569    
2570     PropDef:
2571     @QName: localName
2572     @enDesc:
2573     Scoped names.
2574 wakaba 1.4
2575     ## -- Exceptions
2576    
2577     ExceptionDef:
2578     @ClsQName: ManakaiPerlCodeException
2579     @enDesc:
2580     Exceptions for the <Module::PerlCode> module.
2581     @ClsISA:
2582     ManakaiDOM:ManakaiDOMException::ManakaiDOM:Perl
2583     @XConstGroupDef:
2584     @@ClsQName: ManakaiPerlCodeExceptionCode
2585     @@enDesc:
2586     Exception codes for <Class::ManakaiPerlCodeException>.
2587 wakaba 1.5 @@XConstDef:
2588     @@@Name: HIERARCHY_REQUEST_ERR
2589     @@@Value:3
2590     @@@enDesc:
2591     An attempt is made to break the hierarchy.
2592     @@@XSubTypeDef:
2593     @@@@QName: BAD_CHILD_ERR
2594     @@@@enDesc:
2595     An attempt is made to append a node as a child whose type
2596     is not allowed.
2597     @@@@XParam:
2598     @@@@@QName: childNode
2599     @@@@@enDesc:
2600     The node attempted to append.
2601     @@@@XParam:
2602     @@@@@QName: parentNode
2603     @@@@@enDesc:
2604     The node to whose child list an attempt to append is made.
2605     @@@XSubTypeDef:
2606     @@@@QName: IN_USE_NODE_ERR
2607     @@@@enDesc:
2608     An attempt is made to append a node that has already been used
2609     elsewhere.
2610     @@@@XParam:
2611     @@@@@QName: childNode
2612     @@@@@enDesc:
2613     The node attempted to append.
2614     @@@@XParam:
2615     @@@@@QName: parentNode
2616     @@@@@enDesc:
2617     The parent node of the <XP::childNode>.
2618 wakaba 1.4 @@XConstDef:
2619     @@@Name: NOT_SUPPORTED_ERR
2620     @@@Value:9
2621     @@@enDesc:
2622     An attempt is made to do something the implementation does not support.
2623     @@@XSubTypeDef:
2624     @@@@QName: UNSUPPORTED_OPERATOR_ERR
2625     @@@@enDesc:
2626     The implementation does not support the specified operator.
2627     @@@@XParam:
2628     @@@@@QName: operator
2629     @@@@@enDesc:
2630     The operator that is not supported.
2631     @@@@enMufDef:
2632     Operator "%p (name => {<Q::pc:operator>});" is not supported
2633    
2634     ElementTypeBinding:
2635     @Name: ExceptionDef
2636     @ElementType:
2637     dis:ResourceDef
2638     @ShadowContent:
2639     @@rdf:type:
2640     ManakaiDOM:ExceptionClass
2641     @@AliasFor:
2642     @@@@:
2643     ::ManakaiDOM:Perl
2644     @@@For:
2645     !=ManakaiDOM:Perl
2646     @@ForCheck:
2647     ManakaiDOM:Perl
2648     @@DOMMain:implementFeature: CoreFeature10
2649    
2650     ElementTypeBinding:
2651     @Name: XConstGroupDef
2652     @ElementType:
2653     dis:ResourceDef
2654     @ShadowContent:
2655     @@rdf:type:
2656     ManakaiDOM:ConstGroup
2657     @@Type:
2658     DOMMain:unsigned-short::ManakaiDOM:all
2659     @@rdfs:subClassOf:
2660     DOMMain:unsigned-short::ManakaiDOM:all
2661    
2662     ElementTypeBinding:
2663     @Name: XConstDef
2664     @ElementType:
2665     dis:ResourceDef
2666     @ShadowContent:
2667     @@rdf:type:
2668     ManakaiDOM:Const
2669    
2670     ElementTypeBinding:
2671     @Name: XSubTypeDef
2672     @ElementType:
2673     dis:ResourceDef
2674     @ShadowContent:
2675     @@rdf:type:
2676     ManakaiDOM:ExceptionOrWarningSubType
2677    
2678     ElementTypeBinding:
2679     @Name: XParam
2680     @ElementType:
2681     ManakaiDOM:exceptionOrWarningParameter
2682    
2683     ElementTypeBinding:
2684     @Name: XParamDef
2685     @ElementType:
2686     dis:ResourceDef
2687     @ShadowContent:
2688     @@rdf:type:
2689     DOMMain:XWParameter
2690     @@AliasFor:
2691     @@@For:
2692     !=ManakaiDOM:all
2693     @@@@:
2694     ::ManakaiDOM:all
2695    
2696     ElementTypeBinding:
2697     @Name: enMufDef
2698     @ElementType:
2699     dis:Def
2700     @ShadowContent:
2701     @@ContentType:
2702     lang:muf
2703     @@lang:en
2704    
2705 wakaba 1.1
2706     ElementTypeBinding:
2707     @Name: ClsDef
2708     @ElementType:
2709     dis:ResourceDef
2710     @ShadowContent:
2711     @@rdf:type:
2712     ManakaiDOM:Class
2713     @@AliasFor:
2714     @@@@:
2715     ::ManakaiDOM:Perl
2716     @@@For:
2717     !=ManakaiDOM:Perl
2718     @@ForCheck:
2719     ManakaiDOM:Perl
2720     @@DOMMain:implementFeature: CoreFeature10
2721    
2722     ElementTypeBinding:
2723     @Name: ClsQName
2724     @ElementType:
2725     dis:QName
2726    
2727     ElementTypeBinding:
2728     @Name: ClsISA
2729     @ElementType:
2730     dis:ISA
2731    
2732     ElementTypeBinding:
2733     @Name: Method
2734     @ElementType:
2735     dis:ResourceDef
2736     @ShadowContent:
2737     @@rdf:type:
2738     DISLang:Method
2739    
2740     ElementTypeBinding:
2741     @Name: ToStringMethod
2742     @ElementType:
2743     dis:ResourceDef
2744     @ShadowContent:
2745     @@rdf:type:
2746     DISLang:Method
2747     @@Operator:
2748     @@@@:
2749     DISPerl:AsStringMethod
2750     @@@ContentType:
2751     dis:TypeQName
2752     @@Description:
2753     @@@lang:en
2754     @@@@:
2755     Returns the textual Perl source code representation of this object.
2756    
2757     ElementTypeBinding:
2758     @Name: IntMethod
2759     @ElementType:
2760     dis:ResourceDef
2761     @ShadowContent:
2762     @@rdf:type:
2763     DISLang:Method
2764     @@ManakaiDOM:isForInternal:1
2765    
2766     ElementTypeBinding:
2767     @Name: Attr
2768     @ElementType:
2769     dis:ResourceDef
2770     @ShadowContent:
2771     @@rdf:type:
2772     DISLang:Attribute
2773    
2774     ElementTypeBinding:
2775     @Name: Return
2776     @ElementType:
2777     dis:ResourceDef
2778     @ShadowContent:
2779     @@rdf:type:
2780     DISLang:MethodReturn
2781    
2782     ElementTypeBinding:
2783     @Name: Get
2784     @ElementType:
2785     dis:ResourceDef
2786     @ShadowContent:
2787     @@rdf:type:
2788     DISLang:AttributeGet
2789    
2790     ElementTypeBinding:
2791     @Name: Set
2792     @ElementType:
2793     dis:ResourceDef
2794     @ShadowContent:
2795     @@rdf:type:
2796     DISLang:AttributeSet
2797    
2798     ElementTypeBinding:
2799     @Name: Param
2800     @ElementType:
2801     dis:ResourceDef
2802     @ShadowContent:
2803     @@rdf:type:
2804     DISLang:MethodParameter
2805    
2806     ElementTypeBinding:
2807     @Name: PerlDef
2808     @ElementType:
2809     dis:Def
2810     @ShadowContent:
2811     @@ContentType:
2812     lang:Perl
2813    
2814     ElementTypeBinding:
2815     @Name: disDef
2816     @ElementType:
2817     dis:Def
2818     @ShadowContent:
2819     @@ContentType:
2820     lang:dis
2821    
2822     ElementTypeBinding:
2823     @Name: InCase
2824     @ElementType:
2825     dis:ResourceDef
2826     @ShadowContent:
2827     @@rdf:type:
2828     ManakaiDOM:InCase
2829    
2830     ElementTypeBinding:
2831     @Name: nullCase
2832     @ElementType:
2833     dis:ResourceDef
2834     @ShadowContent:
2835     @@rdf:type:
2836     ManakaiDOM:InCase
2837     @@Value:
2838     @@@is-null:1
2839    
2840     ElementTypeBinding:
2841     @Name: TrueCase
2842     @ElementType:
2843     dis:ResourceDef
2844     @ShadowContent:
2845     @@rdf:type:
2846     ManakaiDOM:InCase
2847     @@Value:true
2848     @@Type:
2849     DOMMain:boolean
2850    
2851    
2852     ElementTypeBinding:
2853     @Name: FalseCase
2854     @ElementType:
2855     dis:ResourceDef
2856     @ShadowContent:
2857     @@rdf:type:
2858     ManakaiDOM:InCase
2859     @@Value:false
2860     @@Type:
2861     DOMMain:boolean
2862    
2863     ElementTypeBinding:
2864     @Name: enDesc
2865     @ElementType:
2866     dis:Description
2867     @ShadowContent:
2868     @@lang:en
2869    
2870     ElementTypeBinding:
2871     @Name: PropDef
2872     @ElementType:
2873     dis:ResourceDef
2874     @ShadowContent:
2875     @@rdf:type:
2876     rdf:Property
2877     @@AliasFor:
2878     @@@@:
2879     ::ManakaiDOM:all
2880     @@@For:
2881     !=ManakaiDOM:all
2882    
2883     ElementTypeBinding:
2884     @Name: NamedParam
2885     @ElementType:
2886     dis:ResourceDef
2887     @ShadowContent:
2888     @@rdf:type:
2889     DISLang:MethodParameter
2890     @@DISPerl:isNamedParameter:1
2891    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24