/[suikacvs]/messaging/manakai/lib/Message/Util/ManakaiNode.dis
Suika

Contents of /messaging/manakai/lib/Message/Util/ManakaiNode.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (hide annotations) (download)
Fri Sep 30 13:06:18 2005 UTC (19 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.25: +3 -1 lines
++ manakai/bin/ChangeLog	30 Sep 2005 12:38:36 -0000
2005-09-30  Wakaba  <wakaba@suika.fam.cx>

	* mkdisdump.pl (append_module_group_documentation,
	append_document_documentation): New functions.
	(append_class_documentation, append_interface_documentation):
	Generates method/attribute/constgroup information (in partial mode)
	even if "is_partial" option is true to compute inheriting
	class member information correctly.
	(--resource-uri): New option.

	* Makefile (error.xml, minimpl.xml): New rules.

++ manakai/lib/Message/Util/ChangeLog	30 Sep 2005 12:50:16 -0000
2005-09-30  Wakaba  <wakaba@suika.fam.cx>

	* DIS.dis (readProperties): Saves property name to values.
	(getPropertyModuleList): New method.


	* ManakaiNode.dis: Use "disPerl:H" instead
	of "disPerl:Q" for hash keys.
	(NodeStem): Property value "mn:treeID"
	has changed to scalar reference.
++ manakai/lib/Message/Util/Error/ChangeLog	30 Sep 2005 12:49:59 -0000
2005-09-30  Wakaba  <wakaba@suika.fam.cx>
	* DOMException.dis (dx:ManakaiErrorModules): New documentation.
++ manakai/lib/Message/Util/DIS/ChangeLog	30 Sep 2005 12:48:08 -0000
2005-09-30  Wakaba  <wakaba@suika.fam.cx>

	* Value.dis (name): New attribute.

	* Perl.dis (plFullyQualifiedName): Use module's package
	name properties if available.

++ manakai/lib/Message/DOM/ChangeLog	30 Sep 2005 12:40:49 -0000
2005-09-30  Wakaba  <wakaba@suika.fam.cx>

	* DOMCore.dis, SimpleLS.dis: Shares namespace URIs and local
	names where possible.

	* DOMFeature.dis: Documentation for DOM Minimum Implementation
	added (still work in progress).

	* Makefile (feature.dae, feature-spec.dae): New rules.

++ manakai/lib/manakai/ChangeLog	30 Sep 2005 12:53:24 -0000
2005-09-30  Wakaba  <wakaba@suika.fam.cx>

	* DISCore.dis: Documentation-related and meta-informational
	resoruces are moved to new "Document.dis" module.  The
	module now references "Document.dis".
	(DISCore:module, DISCore:resource): New properties.

	* DISRDF.dis: Some resources added from FOAF vocabulary.

	* Document.dis: New module.

	* DISIDL.dis: Some IDL comcepts added.  New name
	given to IDL datatypes.

	* DISLang.dis (dis:prefix): Removed.  (Moved to "DISIDL.dis"
	and it is now obsolete.)

2005-09-29  Wakaba  <wakaba@suika.fam.cx>

	* DISPerl.dis (DISPerl:HashStringRef, DISPerl:StringRef): New.

1 wakaba 1.1 Module:
2     @QName:
3     Util:ManakaiNode
4     @FullName:
5     @@lang: en
6     @@@:
7     Manakai Generic Node Implementation
8     @Namespace:
9     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
10    
11     @Description:
12     @@lang:en
13     @@@:
14     The <Module::Util:ManakaiNode> module provides a basic
15     implementation for glaph (perhaps tree) structures.
16    
17 wakaba 1.18 @DISCore:author: DISCore|Wakaba
18 wakaba 1.1 @License:
19     license:Perl+MPL
20     @Date:
21     @@@:
22 wakaba 1.26 $Date: 2005/09/29 09:14:58 $
23 wakaba 1.1 @@ContentType:
24     dis:Date.RCS
25    
26     @Require:
27     @@Module:
28 wakaba 1.4 @@@QName:
29     DISlib:DISPerl
30 wakaba 1.1 @@@WithFor:
31     ManakaiDOM:all
32 wakaba 1.2 @@Module:
33 wakaba 1.16 @@@QName: Util|ManakaiNode
34 wakaba 1.2 @@@WithFor:
35     ManakaiDOM:Perl
36    
37     @DefaultFor:
38     ManakaiDOM:Perl
39 wakaba 1.1
40     Namespace:
41 wakaba 1.13 @DIS:
42     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
43 wakaba 1.1 @dis:
44     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
45     @dis2pm:
46     http://suika.fam.cx/~wakaba/archive/2004/11/8/dis2pm#
47 wakaba 1.4 @DISlib:
48     http://suika.fam.cx/~wakaba/archive/2004/dis/
49 wakaba 1.13 @doc:
50     http://suika.fam.cx/~wakaba/archive/2005/7/tutorial#
51 wakaba 1.26 @kwd:
52     http://suika.fam.cx/~wakaba/archive/2005/rfc2119/
53 wakaba 1.1 @lang:
54     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
55     @license:
56     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
57     @ManakaiDOM:
58     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
59 wakaba 1.10 @mn:
60     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
61 wakaba 1.1 @Perl:
62     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl--
63     @rdf:
64     http://www.w3.org/1999/02/22-rdf-syntax-ns#
65     @rdfs:
66     http://www.w3.org/2000/01/rdf-schema#
67     @TreeCore:\
68     @Util:
69     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
70    
71     ResourceDef:
72     @QName:
73     Util:
74     @rdf:type:
75     dis:ModuleGroup
76     @FullName:
77     @@lang:en
78     @@@:
79     The manakai support modules
80 wakaba 1.17 @DISPerl:packageName:
81 wakaba 1.14 Message::Util::
82 wakaba 1.17 @DISPerl:interfacePackageName:
83     Message::Util::IF::
84 wakaba 1.13
85 wakaba 1.1 ## -- Internal node object
86    
87     ClassDef:
88 wakaba 1.10 @resourceFor: ForFull
89     @resourceFor: ForCompact
90     @resourceFor:
91     ManakaiDOM:ForIF
92    
93     @QName:
94     @@@: NodeStem
95     @@ForCheck:
96     ManakaiDOM:ForIF
97    
98 wakaba 1.1 @QName:
99 wakaba 1.10 @@@:
100     ManakaiDOM:ManakaiDOMNodeObject
101     @@ForCheck: ForFull
102    
103     @QName:
104     @@@: ManakaiNodeStem
105     @@ForCheck: ForCompact
106    
107     @Implement:
108     @@@: NodeStem
109     @@ForCheck: ForFull
110    
111     @Implement:
112     @@@: NodeStem
113     @@ForCheck: ForCompact
114    
115 wakaba 1.1 @Description:
116     @@lang:en
117     @@@:
118     Internal (actual) node objects that is accessed via
119     <Class::ManakaiDOM:ManakaiDOMNodeReference> objects referring it.
120     @ImplNote:
121     @@lang:en
122     @@@:
123     No public interface should be defined for any class inheriting
124     this class - applications should access to nodes only via
125     <Class::ManakaiDOM:ManakaiDOMNodeReference> objects.
126     @ImplNote:
127 wakaba 1.13 @@ForCheck: ManakaiDOM|ForClass
128 wakaba 1.1 @@lang:en
129     @@@:
130 wakaba 1.13 A <Class::> object is a blessed hash
131 wakaba 1.1 reference. Each hash key and value pair is called as a
132     <DFN::property>. Currently, several core properties
133 wakaba 1.13 are defined as listed below. Applications of this class,
134     such as <Class::DOMCore:ManakaiDOMNode::ManakaiDOM:all>,
135     defines additional properties for their own purpose and scope.
136 wakaba 1.1 \
137 wakaba 1.13 {doc:fig:: <doc:caption::Core node properties>
138    
139     {doc:figBody::
140 wakaba 1.1 \
141     - <CODE::TreeCore:origin>::: An array reference, containing
142     hash key names of <DFN::origin>
143     properties for this node.
144     \
145 wakaba 1.3 - <CODE::TreeCore:subnode0>::: An array reference, containing
146     hash key names of <DFN::subnode>
147     properties for this node.
148     \
149 wakaba 1.1 - <CODE::TreeCore:subnode>::: An array reference, containing
150 wakaba 1.3 hash key names of <DFN::subnode> list
151 wakaba 1.1 properties for this node.
152     \
153     - <CODE::TreeCore:subnode2>::: An array reference, containing
154 wakaba 1.3 hash key names of <DFN::subnode> (two steps) list
155 wakaba 1.1 properties for this node.
156     \
157     - <CODE::TreeCore:irefnode>::: An array reference, containing
158     hash key names of <DFN::irefnode>
159     properties for this node.
160     \
161     - <CODE::TreeCore:anydata>::: An array reference, containing
162 wakaba 1.3 hash key names of <DFN::anydata> list
163     properties for this node.
164 wakaba 1.1 \
165     - <CODE::TreeCore:anydata2>::: An array reference, containing
166 wakaba 1.3 hash key names of <DFN::anydata> (two steps) list properties
167 wakaba 1.1 for this node.
168 wakaba 1.13 }
169 wakaba 1.1 }
170    
171     @IntMethod:
172     @@Name: new
173     @@Description:
174     @@@lang:en
175     @@@@:
176     Constructs a new instance of
177     <Class::ManakaiDOM:ManakaiDOMNodeObject> and returns it.
178 wakaba 1.22 @@Param:
179     @@@ForCheck: ForCompact
180     @@@Name: className
181     @@@Type: DISLang|String||ManakaiDOM|all
182     @@@enDesc:
183     The name of a class which is typically used as reference
184     to the node. The class <kwd:SHOULD> implement the
185     <IF::NodeRef> interface. The <QUOTE::dis> definition
186     for the class <kwd:SHOULD> play the role of <Q::mn|NodeRefRole
187     ||ManakaiDOM|all>.
188 wakaba 1.1 @@Return:
189 wakaba 1.10 @@@Type: NodeStem
190 wakaba 1.1 @@@Description:
191     @@@@lang:en
192     @@@@@:
193     The newly created <Class::ManakaiDOM:ManakaiDOMNodeObject> instance.
194 wakaba 1.7 @@@PerlDef:
195 wakaba 1.20 @@@@ForCheck: ForFull
196     @@@@@:
197 wakaba 1.1 $r = bless {
198     <Q::TreeCore:origin> => [],
199 wakaba 1.3 <Q::TreeCore:subnode0> => [],
200 wakaba 1.1 <Q::TreeCore:subnode> => [],
201     <Q::TreeCore:subnode2> => [],
202     <Q::TreeCore:irefnode> => [],
203     <Q::TreeCore:anydata> => [],
204     <Q::TreeCore:anydata2> => [],
205 wakaba 1.19 <H::mn:rc> => 0,
206     <H::mn:treeID> => <Code::ManakaiDOM:generateUniqueID>,
207     <H::mn:nodeID> => <Code::ManakaiDOM:generateUniqueID>,
208 wakaba 1.1 }, ref $self || $self;
209 wakaba 1.20 @@@PerlDef:
210     @@@@ForCheck: ForCompact
211     @@@@@:
212 wakaba 1.25 my $grc = 0;
213 wakaba 1.20 $r = bless {
214 wakaba 1.25 <H::mn:type> => $className,
215     <H::mn:groveReferenceCounter> => \$grc,
216     <H::mn:rc> => 0,
217 wakaba 1.20 <H::mn:treeID> => \ (<Code::ManakaiDOM:generateUniqueID>),
218     <H::mn:nodeID> => <Code::ManakaiDOM:generateUniqueID>,
219     }, ref $self || $self;
220 wakaba 1.10
221 wakaba 1.1 @IntMethod:
222     @@Name: newReference
223     @@Description:
224     @@@lang:en
225     @@@@:
226     Creates a new reference to this node and returns it.
227 wakaba 1.10 @@ForCheck: ForFull
228 wakaba 1.1 @@Param:
229     @@@Name: class
230     @@@Type:
231 wakaba 1.7 Perl:package-name::ManakaiDOM:all
232 wakaba 1.1 @@@Description:
233     @@@@lang:en
234     @@@@@:
235     A Perl class package name with which the newly created
236     reference is blessed. The <P::class> class must be a
237     subclass of <Class::ManakaiDOM:ManakaiDOM:ManakaiDOMNodeReference>.
238     @@Return:
239     @@@Type:
240     ManakaiDOM:ManakaiDOMNodeReference
241     @@@Description:
242     @@@@lang:en
243     @@@@@:
244     The newly created node reference.
245     @@@PerlDef:
246     $r = bless {
247 wakaba 1.19 <H::mn:node> => $self,
248 wakaba 1.7 }, ref $class ? ref $class : defined $class ? $class :
249 wakaba 1.1 <ClassName::ManakaiDOM:ManakaiDOMNodeReference>;
250 wakaba 1.19 $self->{<H::mn:rc>}++;
251 wakaba 1.6
252     @ResourceDef:
253     @@QName: getNewReference
254     @@rdf:type:
255     dis2pm:BlockCode
256 wakaba 1.20 @@ForCheck: ForCompact
257 wakaba 1.6 @@Description:
258     @@@lang:en
259     @@@@:
260     Creates a new node reference object.
261     @@ResourceDef:
262     @@@rdf:type:
263     DISPerl:CodeParameter
264     @@@Name: $object
265 wakaba 1.10 @@@Type: NodeStem
266 wakaba 1.6 @@@In:1
267     @@@enDesc:
268     A node object for which a reference is created.
269     @@@DISPerl:paramStyle: var
270     @@ResourceDef:
271     @@@rdf:type:
272     DISPerl:CodeParameter
273     @@@Name: $ref
274 wakaba 1.10 @@@Type: NodeRef
275 wakaba 1.6 @@@Out:1
276     @@@enDesc:
277     A node reference for <P::$object>. It may or may not
278     be same as <P::$object>.
279     @@@DISPerl:paramStyle: var
280     @@ResourceDef:
281     @@@rdf:type:
282     DISPerl:CodeParameter
283     @@@Name: $class
284     @@@Type:
285     Perl:package-name::ManakaiDOM:all
286     @@@enDesc:
287     A package name with which <P::$ref> is blessed.
288     @@@In:1
289     @@@DISPerl:paramStyle: any
290     @@PerlDef:
291 wakaba 1.19 $object->{<H::mn:rc>}++;
292 wakaba 1.25 ${$object->{<H::mn:groveReferenceCounter>}}++;
293 wakaba 1.6 $ref = bless {
294 wakaba 1.19 <H::mn:node> => $object,
295 wakaba 1.6 }, $class;
296    
297     @ResourceDef:
298     @@QName: getWeakReference
299     @@rdf:type:
300     dis2pm:BlockCode
301 wakaba 1.20 @@ForCheck: ForCompact
302 wakaba 1.6 @@Description:
303     @@@lang:en
304     @@@@:
305     Creates a new weak node reference object.
306     \
307     The weak node reference is actually a node reference
308     except that this code fragment does not increment
309     the reference count of the object. When all non-weak
310     references to the object are destructed, then
311     the object is destructed and any operation via
312     weak references will lead unexpected result.
313     \
314     {NOTE:: It is intended that internal code creates a weak reference
315     so that it gets access to public interface.
316     \
317     }
318     @@ResourceDef:
319     @@@rdf:type:
320     DISPerl:CodeParameter
321     @@@Name: $object
322 wakaba 1.10 @@@Type: NodeStem
323 wakaba 1.6 @@@In:1
324     @@@enDesc:
325     A node object for which a reference is created.
326     @@@DISPerl:paramStyle: var
327     @@ResourceDef:
328     @@@rdf:type:
329     DISPerl:CodeParameter
330     @@@Name: $ref
331 wakaba 1.10 @@@Type: NodeRef
332 wakaba 1.6 @@@Out:1
333     @@@enDesc:
334     A node reference for <P::$object>. It may or may not
335     be same as <P::$object>.
336     @@@DISPerl:paramStyle: var
337     @@ResourceDef:
338     @@@rdf:type:
339     DISPerl:CodeParameter
340     @@@Name: $class
341     @@@Type:
342     Perl:package-name::ManakaiDOM:all
343     @@@enDesc:
344     A package name with which <P::$ref> is blessed.
345     @@@In:1
346     @@@DISPerl:paramStyle: any
347     @@PerlDef:
348     $ref = bless {
349 wakaba 1.19 <H::mn:node> => $object,
350     <H::mn:isWeak> => true,
351 wakaba 1.8 }, $class;
352    
353     @ResourceDef:
354     @@QName: getWeakRef
355     @@rdf:type:
356     dis2pm:InlineCode
357 wakaba 1.10 @@ForCheck: ForFull
358 wakaba 1.8 @@Description:
359     @@@lang:en
360     @@@@:
361     Creates a new weak node reference object.
362     \
363     The weak node reference is actually a node reference
364     except that this code fragment does not increment
365     the reference count of the object. When all non-weak
366     references to the object are destructed, then
367     the object is destructed and any operation via
368     weak references will lead unexpected result.
369     \
370     {NOTE:: It is intended that internal code creates a weak reference
371     so that it gets access to public interface.
372     \
373     }
374     @@ResourceDef:
375     @@@rdf:type:
376     DISPerl:CodeParameter
377     @@@Name: $object
378 wakaba 1.10 @@@Type: NodeStem
379 wakaba 1.8 @@@In:1
380     @@@enDesc:
381     A node object for which a reference is created.
382     @@@DISPerl:paramStyle: var
383     @@ResourceDef:
384     @@@rdf:type:
385     DISPerl:CodeParameter
386     @@@Name: $class
387     @@@Type:
388     Perl:package-name::ManakaiDOM:all
389     @@@enDesc:
390     A package name with which <P::$ref> is blessed.
391     @@@In:1
392     @@@DISPerl:paramStyle: any
393     @@PerlDef:
394 wakaba 1.9 (bless {
395 wakaba 1.19 <H::mn:node> => $object,
396     <H::mn:isWeak> => true,
397 wakaba 1.9 }, $class)
398 wakaba 1.6
399 wakaba 1.1 @IntMethod:
400     @@Name: isExternallyReferred
401     @@Description:
402     @@@lang:en
403     @@@@:
404     Checks whether the tree containing this node has been referred
405     from the outside of the tree or not.
406     @@Return:
407     @@@Type:
408 wakaba 1.7 DISPerl:Boolean::ManakaiDOM:all
409 wakaba 1.1 @@@InCase:
410 wakaba 1.15 @@@@Value:
411     @@@@@@:1
412     @@@@@ContentType: DISCore|Boolean
413 wakaba 1.1 @@@@Description:
414     @@@@@lang:en
415     @@@@@@:
416     There is one or more nodes in the tree that has been
417     referred via <Class::ManakaiDOM:ManakaiDOMNodeReference> objects.
418     @@@InCase:
419 wakaba 1.15 @@@@Value:
420     @@@@@@:0
421     @@@@@ContentType: DISCore|Boolean
422 wakaba 1.1 @@@@Description:
423     @@@@@lang:en
424     @@@@@@: No external reference found.
425     @@@PerlDef:
426 wakaba 1.10 @@@@ForCheck: ForFull
427     @@@@@:
428 wakaba 1.19 if ($self->{<H::mn:rc>}) {
429 wakaba 1.1 $r = true;
430     } else {
431     my @node = ($self);
432     my %checked;
433 wakaba 1.25 NODES: while (@node) {
434     my $node = shift @node;
435     next NODES unless UNIVERSAL::isa ($node,
436     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>);
437 wakaba 1.19 if ($node->{<H::mn:rc>}) {
438 wakaba 1.1 $r = true;
439     last NODES;
440 wakaba 1.19 } elsif ($checked{$node->{<H::mn:nodeID>}}) {
441 wakaba 1.1 next NODES;
442     }
443     my @n;
444 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:subnode2>}}) {
445     if (ref $node->{$p} eq 'ARRAY') {
446     push @n, @{$node->{$p}};
447     } elsif (ref $node->{$p} eq 'HASH') {
448     push @n, values %{$node->{$p}};
449 wakaba 1.1 }
450     }
451 wakaba 1.3 for my $p (@n,
452     map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}) {
453     if (ref $p eq 'ARRAY') {
454     push @node, @$p;
455     } elsif (ref $p eq 'HASH') {
456     push @node, values %$p;
457 wakaba 1.1 }
458     }
459 wakaba 1.6 for my $p (@{$node->{<Q::TreeCore:origin>}}) {
460     unshift @node, $node->{$p} if $node->{$p};
461     ## NOTE: Puts the top of the list,
462     ## since upper-level nodes are expected to be referred
463     ## more than lower-levels.
464     }
465     for my $p (@{$node->{<Q::TreeCore:subnode0>}}) {
466 wakaba 1.3 push @node, $node->{$p} if $node->{$p};
467 wakaba 1.1 }
468 wakaba 1.19 $checked{$node->{<H::mn:nodeID>}} = true;
469 wakaba 1.1 }
470     }
471 wakaba 1.10 @@@PerlDef:
472     @@@@ForCheck: ForCompact
473     @@@@@:
474 wakaba 1.19 if ($self->{<H::mn:rc>}) {
475 wakaba 1.10 $r = true;
476     } else {
477     my @node = ($self);
478     my %checked;
479 wakaba 1.25 NODES: while (@node) {
480     my $node = shift @node;
481     next NODES unless ref $node;
482 wakaba 1.19 if ($node->{<H::mn:rc>}) {
483 wakaba 1.10 $r = true;
484     last NODES;
485 wakaba 1.19 } elsif ($checked{$node->{<H::mn:nodeID>}}) {
486 wakaba 1.10 next NODES;
487     }
488     my @n;
489 wakaba 1.23 my $nt = $Message::Util::ManakaiNode::ManakaiNodeRef::Prop{
490     $node->{<H::mn:type>}
491     };
492 wakaba 1.25 for my $p (@{$nt->{<H::mn:subnode2>}}) {
493 wakaba 1.10 if (ref $node->{$p} eq 'ARRAY') {
494     push @n, @{$node->{$p}};
495     } elsif (ref $node->{$p} eq 'HASH') {
496     push @n, values %{$node->{$p}};
497     }
498     }
499     for my $p (@n,
500 wakaba 1.25 map {$node->{$_}} @{$nt->{<H::mn:subnode1>}}) {
501 wakaba 1.10 if (ref $p eq 'ARRAY') {
502     push @node, @$p;
503     } elsif (ref $p eq 'HASH') {
504     push @node, values %$p;
505     }
506     }
507 wakaba 1.25 for my $p (@{$nt->{<H::mn:origin0>}}) {
508 wakaba 1.10 unshift @node, $node->{$p} if $node->{$p};
509     ## NOTE: Puts the top of the list,
510     ## since upper-level nodes are expected to be referred
511     ## more than lower-levels.
512     }
513 wakaba 1.23 for my $p (@{$nt->{<H::mn:subnode0>}}) {
514 wakaba 1.10 push @node, $node->{$p} if $node->{$p};
515     }
516 wakaba 1.25 $checked{$node->{<H::mn:nodeID>}} = true;
517 wakaba 1.10 }
518     }
519 wakaba 1.1
520 wakaba 1.25 @ResourceDef:
521     @@QName: mn|isGroveReferenced
522     @@rdf:type: DISPerl|InlineCode
523     @@PerlDef:
524     (${$node->{<H::mn:groveReferenceCounter>}} > 0)
525     @@ForCheck: ForCompact
526    
527 wakaba 1.1 @IntMethod:
528     @@Name: destroy
529     @@Description:
530     @@@lang:en
531     @@@@:
532     Destructs the tree containing this node.
533     @@Return:
534     @@@PerlDef:
535 wakaba 1.10 @@@@ForCheck: ForFull
536     @@@@@:
537 wakaba 1.1 my @node = ($self);
538 wakaba 1.25 NODES: while (@node) {
539     my $node = shift @node;
540 wakaba 1.1 my @n;
541 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:subnode2>}}) {
542     if (ref $node->{$p} eq 'ARRAY') {
543     push @n, @{$node->{$p}};
544     } elsif (ref $node->{$p} eq 'HASH') {
545     push @n, values %{$node->{$p}};
546 wakaba 1.1 }
547     }
548 wakaba 1.3 for my $p (@n,
549     map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}) {
550     if (ref $p eq 'ARRAY') {
551 wakaba 1.10 push @node, grep {UNIVERSAL::isa ($_,
552     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>)
553 wakaba 1.19 and defined $_->{<H::mn:nodeID>}} @$p;
554 wakaba 1.3 } elsif (ref $p eq 'HASH') {
555 wakaba 1.10 push @node, grep {UNIVERSAL::isa ($_,
556     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>)
557 wakaba 1.19 and defined $_->{<H::mn:nodeID>}}
558 wakaba 1.3 values %$p;
559 wakaba 1.1 }
560     }
561 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:origin>}},
562     \ @{$node->{<Q::TreeCore:subnode0>}}) {
563     push @node, $node->{$p}
564     if defined $node->{$p} and
565 wakaba 1.19 defined $node->{$p}->{<H::mn:nodeID>};
566 wakaba 1.1 }
567     %$node = ();
568     }
569 wakaba 1.10 @@@PerlDef:
570     @@@@ForCheck: ForCompact
571     @@@@@:
572     my @node = ($self);
573 wakaba 1.25 NODES: while (@node) {
574     my $node = shift @node;
575     next NODES unless ref $node and defined $node->{<H::mn:nodeID>};
576 wakaba 1.10 my @n;
577 wakaba 1.23 my $nt = $Message::Util::ManakaiNode::ManakaiNodeRef::Prop{
578     $node->{<H::mn:type>}
579     };
580 wakaba 1.25 for my $p (@{$nt->{<H::mn:subnode2>}||[]}) {
581 wakaba 1.10 if (ref $node->{$p} eq 'ARRAY') {
582     push @n, @{$node->{$p}};
583     } elsif (ref $node->{$p} eq 'HASH') {
584     push @n, values %{$node->{$p}};
585     }
586     }
587     for my $p (@n,
588 wakaba 1.25 map {$node->{$_}} @{$nt->{<H::mn:subnode1>}||[]}) {
589 wakaba 1.10 if (ref $p eq 'ARRAY') {
590     push @node, @$p;
591     } elsif (ref $p eq 'HASH') {
592     push @node, values %$p;
593     }
594     }
595 wakaba 1.25 for my $p (@{$nt->{<H::mn:origin0>}||[]},
596     \ @{$nt->{<H::mn:subnode0>}||[]}) {
597 wakaba 1.10 push @node, $node->{$p};
598     }
599     %$node = ();
600     }
601 wakaba 1.1 @@ImplNote:
602     @@@lang:en
603     @@@@:
604     This method is different from Perl <Perl::DESTROY> special
605     purpose method.
606     \
607     An <QUOTE::uninitialized> warning in this method might mean
608     some method puts an <Perl::undef> into a list of nodes.
609    
610     @IntMethod:
611     @@Name: importTree
612     @@Description:
613     @@@lang:en
614     @@@@:
615     Changes the tree identifier of the nodes belong to another tree
616     to be same as this node's tree identifier.
617     @@Param:
618     @@@Name: node
619     @@@Type:
620     ManakaiDOM:ManakaiDOMNodeObject
621     @@@Description:
622     @@@@lang:en
623     @@@@@:
624     Any node from the tree to change its identifier.
625     @@Return:
626     @@@PerlDef:
627 wakaba 1.10 @@@@ForCheck: ForFull
628     @@@@@:
629 wakaba 1.19 unless ($node->{<H::mn:treeID>} eq
630     $self->{<H::mn:treeID>}) {
631 wakaba 1.1 my @node = ($node);
632 wakaba 1.25 NODES: while (@node) {
633     my $node = shift @node;
634     next NODES unless UNIVERSAL::isa ($node,
635     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>);
636 wakaba 1.1 my @n;
637 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:subnode2>}}) {
638     if (ref $node->{$p} eq 'ARRAY') {
639     push @n, @{$node->{$p}};
640     } elsif (ref $node->{$p} eq 'HASH') {
641     push @n, values %{$node->{$p}};
642 wakaba 1.1 }
643     }
644 wakaba 1.3 for my $p (@n,
645     map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}) {
646     if (ref $p eq 'ARRAY') {
647 wakaba 1.9 push @node, grep {UNIVERSAL::isa ($_,
648     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>)
649 wakaba 1.19 and $_->{<H::mn:treeID>} ne
650     $self->{<H::mn:treeID>}} @$p;
651 wakaba 1.3 } elsif (ref $p eq 'HASH') {
652 wakaba 1.9 push @node, grep {UNIVERSAL::isa ($_,
653     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>)
654 wakaba 1.19 and $_->{<H::mn:treeID>} ne
655     $self->{<H::mn:treeID>}}
656 wakaba 1.3 values %$p;
657 wakaba 1.1 }
658     }
659 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:origin>}},
660     \ @{$node->{<Q::TreeCore:subnode0>}}) {
661     push @node, $node->{$p}
662     if defined $node->{$p} and
663 wakaba 1.19 $node->{$p}->{<H::mn:treeID>} ne
664     $self->{<H::mn:treeID>};
665 wakaba 1.1 }
666 wakaba 1.19 $node->{<H::mn:treeID>} = $self->{<H::mn:treeID>};
667 wakaba 1.1 }
668     }
669 wakaba 1.10 @@@PerlDef:
670     @@@@ForCheck: ForCompact
671     @@@@@:
672     my @node = ($node);
673 wakaba 1.25 my $newgrc = $self->{<H::mn:groveReferenceCounter>};
674     my $newtid = $self->{<H::mn:treeID>};
675     NODES: while (@node) {
676     my $node = shift @node;
677     next NODES unless ref $node;
678     next NODES if ${$node->{<H::mn:treeID>}} eq $$newtid;
679 wakaba 1.10 my @n;
680 wakaba 1.23 my $nt = $Message::Util::ManakaiNode::ManakaiNodeRef::Prop{
681     $node->{<H::mn:type>}
682     };
683 wakaba 1.25 for my $p (@{$nt->{<H::mn:subnode2>}||[]}) {
684 wakaba 1.10 if (ref $node->{$p} eq 'ARRAY') {
685     push @n, @{$node->{$p}};
686     } elsif (ref $node->{$p} eq 'HASH') {
687     push @n, values %{$node->{$p}};
688     }
689     }
690     for my $p (@n,
691 wakaba 1.25 map {$node->{$_}} @{$nt->{<H::mn:subnode1>}||[]}) {
692 wakaba 1.10 if (ref $p eq 'ARRAY') {
693     push @node, @$p;
694     } elsif (ref $p eq 'HASH') {
695     push @node, values %$p;
696     }
697     }
698 wakaba 1.25 for my $p (@{$nt->{<H::mn:origin0>}||[]},
699     \ @{$nt->{<H::mn:subnode0>}||[]}) {
700 wakaba 1.10 push @node, $node->{$p};
701     }
702 wakaba 1.25
703     ${$node->{<H::mn:groveReferenceCounter>}} -= $node->{<H::mn:rc>};
704     $node->{<H::mn:treeID>} = $newtid;
705     $node->{<H::mn:groveReferenceCounter>} = $newgrc;
706     ${$node->{<H::mn:groveReferenceCounter>}} += $node->{<H::mn:rc>};
707 wakaba 1.10 }
708 wakaba 1.1
709     @IntMethod:
710     @@Name: changeTreeID
711     @@Description:
712     @@@lang:en
713     @@@@:
714     Changes tree identifier of all nodes traversable from this node.
715     @@Param:
716     @@@Name: treeID
717     @@@Type:
718 wakaba 1.7 DISPerl:String::ManakaiDOM:all
719 wakaba 1.1 @@@Description:
720     @@@@lang:en
721     @@@@@:
722     The new tree identifier.
723 wakaba 1.20 @@@InCase:
724 wakaba 1.21 @@@@Type: DISPerl|SCALAR||ManakaiDOM|all
725 wakaba 1.20 @@@@enDesc:
726     A reference to the new tree identifier.
727     The tree will reference the identifier as it.
728 wakaba 1.25 @@Param:
729     @@@ForCheck: ForCompact
730     @@@Name: groveRC
731     @@@Type: DISPerl|SCALAR||ManakaiDOM|all
732     @@@enDesc:
733     The new reference counter.
734 wakaba 1.1 @@Return:
735     @@@PerlDef:
736 wakaba 1.10 @@@@ForCheck: ForFull
737     @@@@@:
738 wakaba 1.19 unless ($self->{<H::mn:treeID>} eq $treeID) {
739 wakaba 1.1 my @node = ($self);
740 wakaba 1.25 NODES: while (@node) {
741     my $node = shift @node;
742     next NODES unless UNIVERSAL::isa ($node,
743 wakaba 1.9 <ClassName::ManakaiDOM:ManakaiDOMNodeObject>);
744 wakaba 1.1 my @n;
745 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:subnode2>}}) {
746     if (ref $node->{$p} eq 'ARRAY') {
747     push @n, @{$node->{$p}};
748     } elsif (ref $node->{$p} eq 'HASH') {
749     push @n, values %{$node->{$p}};
750 wakaba 1.1 }
751     }
752 wakaba 1.3 for my $p (@n,
753     map {$node->{$_}} @{$node->{<Q::TreeCore:subnode>}}) {
754     if (ref $p eq 'ARRAY') {
755 wakaba 1.9 push @node, grep {UNIVERSAL::isa ($_,
756     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>)
757 wakaba 1.5 and
758 wakaba 1.19 $_->{<H::mn:treeID>} ne $treeID} @$p;
759 wakaba 1.3 } elsif (ref $p eq 'HASH') {
760 wakaba 1.9 push @node, grep {UNIVERSAL::isa ($_,
761     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>)
762 wakaba 1.19 and $_->{<H::mn:treeID>} ne $treeID}
763 wakaba 1.3 values %$p;
764 wakaba 1.1 }
765     }
766 wakaba 1.3 for my $p (@{$node->{<Q::TreeCore:origin>}},
767     \ @{$node->{<Q::TreeCore:subnode0>}}) {
768     push @node, $node->{$p}
769     if defined $node->{$p} and
770 wakaba 1.19 $node->{$p}->{<H::mn:treeID>} ne $treeID;
771 wakaba 1.1 }
772 wakaba 1.19 $node->{<H::mn:treeID>} = $treeID;
773 wakaba 1.1 }
774     }
775     @@@PerlDef:
776 wakaba 1.10 @@@@ForCheck: ForCompact
777     @@@@@:
778 wakaba 1.20 my $tid = ref $treeID ? $treeID : \$treeID;
779 wakaba 1.10 my @node = ($self);
780 wakaba 1.25 NODES: while (@node) {
781     my $node = shift @node;
782     next NODES unless ref $node;
783     next NODES if ${$node->{<H::mn:treeID>}} eq $$tid;
784 wakaba 1.10 my @n;
785 wakaba 1.23 my $nt = $Message::Util::ManakaiNode::ManakaiNodeRef::Prop{
786     $node->{<H::mn:type>}
787     };
788 wakaba 1.25 for my $p (@{$nt->{<H::mn:subnode2>}||[]}) {
789 wakaba 1.10 if (ref $node->{$p} eq 'ARRAY') {
790     push @n, @{$node->{$p}};
791     } elsif (ref $node->{$p} eq 'HASH') {
792     push @n, values %{$node->{$p}};
793     }
794     }
795     for my $p (@n,
796 wakaba 1.25 map {$node->{$_}} @{$nt->{<H::mn:subnode1>}||[]}) {
797 wakaba 1.10 if (ref $p eq 'ARRAY') {
798     push @node, @$p;
799     } elsif (ref $p eq 'HASH') {
800     push @node, values %$p;
801     }
802     }
803 wakaba 1.25 for my $p (@{$nt->{<H::mn:origin0>}||[]},
804     \ @{$nt->{<H::mn:subnode0>}||[]}) {
805 wakaba 1.10 push @node, $node->{$p};
806     }
807 wakaba 1.25
808     ${$node->{<H::mn:groveReferenceCounter>}} -= $node->{<H::mn:rc>};
809 wakaba 1.20 $node->{<H::mn:treeID>} = $tid;
810 wakaba 1.25 $node->{<H::mn:groveReferenceCounter>} = $groveRC;
811     ${$node->{<H::mn:groveReferenceCounter>}} += $node->{<H::mn:rc>};
812 wakaba 1.1 }
813    
814     @IntMethod:
815     @@Name: isSameNode
816     @@Description:
817     @@@lang:en
818     @@@@:
819     Returns whether a node is the same as this node or not.
820     \
821     {NOTE:: The sameness is different from the equality;
822     two nodes are same iff they are same hash reference.
823     \
824     }
825     @@Operator:
826     @@@ContentType:
827     lang:Perl
828     @@@@: eq
829     @@Param:
830     @@@Name: node
831 wakaba 1.10 @@@Type: NodeStem
832 wakaba 1.1 @@@Description:
833     @@@@lang:en
834     @@@@@:
835     A node to compare with.
836     @@Return:
837     @@@Type:
838 wakaba 1.7 DISPerl:Boolean::ManakaiDOM:all
839 wakaba 1.1 @@@Description:
840     @@@@lang:en
841     @@@@@: Whether the two nodes are same or not.
842     @@@PerlDef:
843 wakaba 1.10 @@@@ForCheck: ForFull
844     @@@@@:
845 wakaba 1.1 if (ref $node and
846     UNIVERSAL::isa ($node,
847     <ClassName::ManakaiDOM:ManakaiDOMNodeObject>) and
848 wakaba 1.19 $node->{<H::mn:nodeID>} eq $self->{<H::mn:nodeID>}) {
849 wakaba 1.1 $r = true;
850     }
851 wakaba 1.10 @@@PerlDef:
852     @@@@ForCheck: ForCompact
853     @@@@@:
854     if (ref $node and
855 wakaba 1.23 UNIVERSAL::isa ($node, <ClassName::ManakaiNodeStem>) and
856 wakaba 1.19 $node->{<H::mn:nodeID>} eq $self->{<H::mn:nodeID>}) {
857 wakaba 1.10 $r = true;
858     }
859 wakaba 1.1 @IntMethod:
860     @@Name: orphanate
861     @@Description:
862     @@@lang:en
863     @@@@:
864     Notifies that this node (and its neibors if any) is no longer
865     part of the main tree. If the new tree containing this node
866     has been referred yet, then the tree is preserved except its
867     tree identifier has changed. Otherwise, i.e. the tree is
868     useless any more, then it is destructed.
869     \
870     {NOTE:: Interaction on deleting a relationship from multiply
871     organized <QUOTE::trees> (such as DOM tree and
872     styled displaying tree) is less studied. This
873     method might be modified or addition of another method(s)
874     might be required when style sheet, XBL, or other
875     technologies has been implemented.
876     \
877     }
878     @@Return:
879     @@@PerlDef:
880 wakaba 1.20 @@@@ForCheck: ForFull
881     @@@@@:
882     if ($self-><M::NodeStem.isExternallyReferred>) {
883     $self-><M::NodeStem.changeTreeID>
884     (<Code::ManakaiDOM:generateUniqueID>);
885     } else {
886     $self-><M::NodeStem.destroy>;
887     }
888     @@@PerlDef:
889     @@@@ForCheck: ForCompact
890     @@@@@:
891     if ($self-><M::NodeStem.isExternallyReferred>) {
892 wakaba 1.25 my $grc = 0;
893 wakaba 1.20 $self-><M::NodeStem.changeTreeID>
894 wakaba 1.25 (\(<Code::ManakaiDOM:generateUniqueID>), \$grc);
895 wakaba 1.20 } else {
896     $self-><M::NodeStem.destroy>;
897     }
898 wakaba 1.10 ##NodeStem
899 wakaba 1.1
900     ## -- Public node object
901    
902     ClassDef:
903 wakaba 1.10 @resourceFor: ForFull
904     @resourceFor: ForCompact
905     @resourceFor:
906     ManakaiDOM:ForIF
907    
908     @QName:
909     @@@: NodeRef
910     @@ForCheck:
911     ManakaiDOM:ForIF
912    
913 wakaba 1.1 @QName:
914 wakaba 1.10 @@@:
915     ManakaiDOM:ManakaiDOMNodeReference
916     @@ForCheck: ForFull
917    
918     @Implement:
919     @@@: NodeRef
920     @@ForCheck: ForFull
921    
922     @QName:
923     @@@: ManakaiNodeRef
924     @@ForCheck: ForCompact
925    
926     @Implement:
927     @@@: NodeRef
928     @@ForCheck: ForCompact
929    
930 wakaba 1.22 @DISLang:role:
931     @@@: mn|NodeRefRole
932     @@ForCheck: ForCompact
933    
934 wakaba 1.1 @Description:
935     @@lang:en
936     @@@:
937     References to the node object corresponding to it. From
938     applications' view, any node object is hidden and
939     <Class::ManakaiDOM:ManakaiDOMNodeReference> seems as if
940     the node itself.
941     @ImplNote:
942     @@lang:en
943     @@@:
944 wakaba 1.13 {P:: A <Class::ManakaiDOM:ManakaiDOMNodeReference> is a blessed hash
945 wakaba 1.1 reference; currently there is a hash key defined:
946     \
947     - <CODE::TreeCore:node>::: A node object
948     (<Class::ManakaiDOM:ManakaiDOMNodeObject>) to which
949     this is referring.
950 wakaba 1.13
951     - <CODE::TreeCore:isWeak>::: Whether the reference is <QUOTE::weak>
952     or not.
953     }
954    
955     @ResourceDef:
956     @@Name: free
957     @@rdf:type: DISLang|Method
958     @@enDesc:
959     Frees the grove referenced by this object. Once
960     this operation is done, results of operations to objects belonging
961     to the grove are unknown.
962     @@ForCheck: ForCompact
963     @@Return:
964     @@@PerlDef:
965 wakaba 1.19 $self->{<H::mn:node>}-><M::NodeStem.destroy>;
966 wakaba 1.1
967     @IntMethod:
968     @@Name: destroy
969     @@Description:
970     @@@lang:en
971     @@@@: Destroy this reference object.
972     @@Operator:
973     @@@ContentType:
974     lang:Perl
975     @@@@: DESTROY
976     @@Return:
977     @@@PerlDef:
978 wakaba 1.25 @@@@ForCheck: ForFull
979 wakaba 1.1 @@@@@:
980 wakaba 1.19 my $node = $self->{<H::mn:node>};
981 wakaba 1.1 if ($node) {
982 wakaba 1.19 CORE::delete $self->{<H::mn:node>};
983     unless ($self->{<H::mn:isWeak>}) {
984     $node->{<H::mn:rc>}--;
985 wakaba 1.10 unless ($node-><M::NodeStem.isExternallyReferred>) {
986     $node-><M::NodeStem.destroy>;
987 wakaba 1.6 }
988 wakaba 1.1 }
989     } else {
990     warn ref ($self) . q{->DESTROY: there is no associated }.
991     q{node object - you have a global variable or }.
992     qq{potential memory-leak detected\n};
993     }
994 wakaba 1.25 @@@PerlDef:
995     @@@@ForCheck: ForCompact
996     @@@@@:
997     my $node = $self->{<H::mn:node>};
998     if ($node) {
999     CORE::delete $self->{<H::mn:node>};
1000     unless ($self->{<H::mn:isWeak>}) {
1001     $node->{<H::mn:rc>}--;
1002     ${$node->{<H::mn:groveReferenceCounter>}}--;
1003     unless (<Code::isGroveReferenced:: $node = $node>) {
1004     $node-><M::NodeStem.destroy>;
1005     }
1006     }
1007     } else {
1008     warn ref ($self) . q{->DESTROY: there is no associated }.
1009     q{node object - you have a global variable or }.
1010     qq{potential memory-leak detected\n};
1011     }
1012 wakaba 1.1 @@@@ImplNote:
1013     @@@@@lang:en
1014     @@@@@@:
1015     {P::Warning during the global destruction might mean:
1016     \
1017     - there be a loop in the manakai internal implementation -
1018     it should be a bug.
1019     \
1020     - there be a loop created by application, e.g.
1021     event handler containing a reference to any node
1022     belonging to the same tree.
1023     \
1024     - there be a global variable that contains a node reference
1025     and it is not altered or <Perl::undef>ed until the global
1026     destruction.
1027     \
1028     - or other unknown bad situation.
1029     \
1030     }
1031     @@ImplNote:
1032     @@@lang:en
1033     @@@@:
1034     Don't override this method unintentionally - for example,
1035     inheritting <PerlModule::Tie::Array> would hide this method
1036     from that class, since that module defines its own
1037     destructor.
1038 wakaba 1.10 ##NodeRef
1039 wakaba 1.22
1040     ResourceDef:
1041     @QName: mn|NodeRefRole
1042     @rdf:type: DISLang|Role
1043     @For: =ManakaiDOM|all
1044     @enDesc:
1045     The <QUOTE::dis> definition for a class which plays the role
1046     of <Q::mn|NodeRefRole> provides a set of <QUOTE::dis> properties such
1047     as <Q::mn|subnode0> which identify the set of object internal
1048     property names (or hash key names) used to construct groves.
1049    
1050     PropDef:
1051     @QName: mn|type
1052     @mn:stemName: t
1053    
1054     PropDef:
1055     @QName: mn|noderef
1056     @dataType: DISCore|QName
1057     @multipleProperties: DISCore|UnorderedList
1058    
1059     PropDef:
1060     @QName: mn|subnode0
1061     @enDesc:
1062     A property of type <Q::mn|subnode0> takes a value of
1063     reference to another node (<Q::mn|NodeStem||ManakaiDOM|Perl>)
1064     in the same grove. The referenced node is considered
1065     to make a part of the node and just one <Q::mn|origin0>
1066     property of the referenced node <kwd:MUST> have a reference
1067     to the node. That is, these properties shows
1068     a origin-subnode-relationship.
1069     @dataType: DISCore|QName
1070     @multipleProperties: DISCore|UnorderedList
1071 wakaba 1.23 @mn:stemName: s0
1072 wakaba 1.22
1073     PropDef:
1074     @QName: mn|subnode1
1075     @enDesc:
1076     A property of type <Q::mn|subnode1> is similar to <Q::mn|subnode0>
1077     properties, but its value is an array or hash reference whose
1078     values are references to subnodes.
1079     @rdfs:subPropertyOf: mn|noderef
1080     @dataType: DISCore|QName
1081     @multipleProperties: DISCore|UnorderedList
1082 wakaba 1.23 @mn:stemName: s
1083 wakaba 1.22
1084     PropDef:
1085     @QName: mn|subnode2
1086     @enDesc:
1087     A property of type <Q::mn|subnode2> is similar to <Q::mn|subnode1>
1088     properties, but its value is an array or hash reference whose
1089     values are array or hash references whose values are
1090     references to subnodes.
1091     @rdfs:subPropertyOf: mn|noderef
1092     @dataType: DISCore|QName
1093     @multipleProperties: DISCore|UnorderedList
1094 wakaba 1.23 @mn:stemName: s2
1095 wakaba 1.22
1096     PropDef:
1097     @QName: mn|origin0
1098     @rdfs:subPropertyOf: mn|noderef
1099     @dataType: DISCore|QName
1100     @multipleProperties: DISCore|UnorderedList
1101 wakaba 1.23 @mn:stemName: o
1102 wakaba 1.22
1103     PropDef:
1104     @QName: mn|irefnode0
1105     @rdfs:subPropertyOf: mn|noderef
1106     @dataType: DISCore|QName
1107     @multipleProperties: DISCore|UnorderedList
1108 wakaba 1.23 @mn:stemName: i
1109 wakaba 1.22
1110     PropDef:
1111     @QName: mn|anydata1
1112     @rdfs:subPropertyOf: mn|noderef
1113     @dataType: DISCore|QName
1114     @multipleProperties: DISCore|UnorderedList
1115 wakaba 1.23 @mn:stemName: a1
1116 wakaba 1.22
1117     PropDef:
1118     @QName: mn|anydata2
1119     @rdfs:subPropertyOf: mn|noderef
1120     @dataType: DISCore|QName
1121     @multipleProperties: DISCore|UnorderedList
1122 wakaba 1.23 @mn:stemName: a2
1123 wakaba 1.6
1124     PropDef:
1125 wakaba 1.19 @QName: mn|nodeID
1126     @enDesc:
1127     The globally unique identifier of the node.
1128     @mn:stemName: nid
1129    
1130     PropDef:
1131     @QName: mn|treeID
1132     @enDesc:
1133     The globally unique identifier of the grove to which the
1134     node belongs.
1135     @mn:stemName: tid
1136    
1137     PropDef:
1138     @QName: mn|rc
1139     @enDesc:
1140     The number of the reference that points the node.
1141     @mn:stemName: rc
1142    
1143     PropDef:
1144 wakaba 1.25 @QName: mn|groveReferenceCounter
1145     @enDesc:
1146     A reference to the number of references that reference
1147     a node in the grove.
1148     @mn:stemName: grc
1149    
1150     PropDef:
1151 wakaba 1.19 @QName: mn|node
1152     @mn:refName: node
1153     @rdfs:domain: mn|NodeRef||ManakaiDOM|Perl
1154     @rdfs:range: mn|NodeStem||ManakaiDOM|Perl
1155    
1156     PropDef:
1157     @QName: mn|isWeak
1158 wakaba 1.6 @enDesc:
1159     Whether a reference is weak or not.
1160 wakaba 1.19 @rdfs:domain: mn|NodeRef||ManakaiDOM|Perl
1161 wakaba 1.16 @Type: DISPerl|Boolean
1162 wakaba 1.19 @mn:refName: w
1163    
1164     PropDef:
1165     @QName: mn|stemName
1166     @enDesc:
1167     The key name of the property when it is used in <Class::ManakaiNodeStem
1168     ::ManakaiDOM:Perl>.
1169     @dataType: DISCore|String
1170     @multipleProperties: DISCore|Single
1171     @rdfs:domain: rdfs|Property
1172     @rdfs:subPropertyOf: DISPerl|propHashKey
1173    
1174     PropDef:
1175     @QName: mn|refName
1176     @enDesc:
1177     The key name of the property when it is used in <Class::ManakaiNodeRef
1178     ::ManakaiDOM:Perl>.
1179     @dataType: DISCore|String
1180     @multipleProperties: DISCore|Single
1181     @rdfs:domain: rdfs|Property
1182     @rdfs:subPropertyOf: DISPerl|propHashKey
1183 wakaba 1.6
1184     ElementTypeBinding:
1185     @Name:PropDef
1186     @ElementType:
1187     dis:ResourceDef
1188     @ShadowContent:
1189     @@rdf:type:
1190     rdf:Property
1191 wakaba 1.16 @@For: =ManakaiDOM|all
1192 wakaba 1.6
1193     ElementTypeBinding:
1194     @Name:enDesc
1195     @ElementType:
1196     dis:Description
1197     @ShadowContent:
1198     @@lang:en
1199 wakaba 1.1
1200     ## -- Frequently used code fragments
1201    
1202     ResourceDef:
1203     @QName:
1204     ManakaiDOM:generateUniqueID
1205     @rdf:type:
1206     dis2pm:InlineCode
1207     @Description:
1208     @@lang:en
1209     @@@:
1210     Generates a global-unique opaque string.
1211     \
1212     {NOTE:: A URI reference is generated by this code.
1213     \
1214     }
1215 wakaba 1.16
1216     @For: =ManakaiDOM|Perl
1217    
1218 wakaba 1.1 @PerlDef:
1219     (
1220 wakaba 1.24 sprintf 'tag:suika.fam.cx,2005-09:%x:%x%s',
1221 wakaba 1.1 time, $$,
1222     ['A'..'Z', 'a'..'z', '0'..'9']->[rand 62] .
1223     ['A'..'Z', 'a'..'z', '0'..'9']->[rand 62] .
1224     ['A'..'Z', 'a'..'z', '0'..'9']->[rand 62] .
1225     ['A'..'Z', 'a'..'z', '0'..'9']->[rand 62] .
1226     ['A'..'Z', 'a'..'z', '0'..'9']->[rand 62]
1227     )
1228     ##ManakaiDOM:generateUniqueID
1229    
1230     ## -- lang:dis vocabulary
1231    
1232     TreeElementType:
1233     @QName:
1234     dis:GetProp
1235     @dataType:
1236     dis:TypeQName
1237     @rdfs:range:
1238     rdf:Property
1239     @Description:
1240     @@lang:en
1241     @@@:
1242     Gets the non-nodal value of a <Class::ManakaiDOM:ManakaiDOMNodeReference>
1243     property (actualy <Class::ManakaiDOM:ManakaiDOMNodeObject> property).
1244    
1245     TreeElementType:
1246     @QName:
1247     dis:SetProp
1248     @dataType:
1249     dis:TypeQName
1250     @rdfs:range:
1251     rdf:Property
1252     @Description:
1253     @@lang:en
1254     @@@:
1255     Sets the non-nodal value of a <Class::ManakaiDOM:ManakaiDOMNodeReference>
1256     property (actualy <Class::ManakaiDOM:ManakaiDOMNodeObject> property).
1257    
1258     ## -- Syntax sugar
1259    
1260     ElementTypeBinding:
1261     @Name: TreeElementType
1262     @ElementType:
1263     dis:ResourceDef
1264     @ShadowContent:
1265     @@rdf:type:
1266     DISLang:TreeElementType
1267 wakaba 1.16 @@For: =ManakaiDOM|all
1268 wakaba 1.1
1269     ElementTypeBinding:
1270     @Name: ClassDef
1271     @ElementType:
1272     dis:ResourceDef
1273     @ShadowContent:
1274     @@rdf:type:
1275     @@@@:
1276 wakaba 1.10 dis:MultipleResource
1277     @@@ForCheck:
1278     !ForFull !ForCompact !ManakaiDOM:ForIF
1279     @@rdf:type:
1280 wakaba 1.25 @@@@: DISLang|Interface
1281     @@@ForCheck: ManakaiDOM|ForIF
1282 wakaba 1.10 @@rdf:type:
1283 wakaba 1.25 @@@@: DISLang|Class
1284 wakaba 1.10 @@@ForCheck: ForFull
1285     @@rdf:type:
1286 wakaba 1.25 @@@@: DISLang|Class
1287 wakaba 1.10 @@@ForCheck: ForCompact
1288 wakaba 1.25 @@ForCheck: ManakaiDOM|Perl
1289 wakaba 1.10
1290     ForDef:
1291     @QName:
1292     mn:ForFull
1293 wakaba 1.25 @ISA: ManakaiDOM|ForClass
1294 wakaba 1.10
1295     ForDef:
1296     @QName:
1297     mn:ForCompact
1298 wakaba 1.25 @ISA: ManakaiDOM|ForClass
1299 wakaba 1.1
1300     ElementTypeBinding:
1301     @Name: IntMethod
1302     @ElementType:
1303     dis:ResourceDef
1304     @ShadowContent:
1305     @@rdf:type:
1306     DISLang:Method
1307     @@ManakaiDOM:isForInternal:1
1308    
1309     ElementTypeBinding:
1310     @Name: Return
1311     @ElementType:
1312     dis:ResourceDef
1313     @ShadowContent:
1314     @@rdf:type:
1315     DISLang:MethodReturn
1316    
1317     ElementTypeBinding:
1318     @Name: Param
1319     @ElementType:
1320     dis:ResourceDef
1321     @ShadowContent:
1322     @@rdf:type:
1323     DISLang:MethodParameter
1324    
1325     ElementTypeBinding:
1326     @Name: PerlDef
1327     @ElementType:
1328     dis:Def
1329     @ShadowContent:
1330     @@ContentType:
1331     lang:Perl
1332    
1333     ElementTypeBinding:
1334     @Name: InCase
1335     @ElementType:
1336     dis:ResourceDef
1337     @ShadowContent:
1338     @@rdf:type:
1339     ManakaiDOM:InCase

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24