• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..11-Apr-2013244

ChangeLogH A D02-Mar-20102.9 KiB

lib/H05-Apr-20133

Makefile.PLH A D02-Mar-2010654

MANIFESTH A D02-Mar-2010189

MANIFEST.SKIPH A D02-Mar-201058

META.ymlH A D02-Mar-2010517

READMEH A D02-Mar-20104.2 KiB

t/H11-Apr-20134

README

1README for Tree::DAG_Node
2
3			    Tree::DAG_Node
4			     version 1.06
5
6[Partially excerpted from the POD.]
7
8Tree::DAG_Node is a (super)class for representing nodes in a tree.
9
10This class encapsulates/makes/manipulates objects that represent nodes
11in a tree structure.  The tree structure is not an object itself, but
12is emergent from the linkages you create between nodes.  This class
13provides the methods for making linkages that can be used to build up
14a tree, while preventing you from ever making any kinds of linkages
15which are not allowed in a tree (such as having a node be its own
16mother or ancestor, or having a node have two mothers).
17
18This is what I mean by a "tree structure", a bit redundantly stated:
19
20    * A tree is a special case of an acyclic directed graph.
21
22    * A tree is a network of nodes where there's exactly one root node
23    (i.e., 'the top'), and the only primary relationship between nodes
24    is the mother-daugher relationship.
25
26    * No node can be its own mother, or its mother's mother, etc.
27
28    * Each node in the tree has exactly one "parent" (node in the "up"
29    direction) -- except the root, which is parentless.
30
31    * Each node can have any number (0 to any finite number) of
32    daughter nodes. A given node's daughter nodes constitute an
33    *ordered* list.  (However, you are free to consider this ordering
34    irrelevant. Some applications do need daughters to be ordered, so
35    I chose to consider this the general case.)
36
37    * A node can appear in only one tree, and only once in that tree.
38    Notably (notable because it doesn't follow from the two above
39    points), a node cannot appear twice in its mother's daughter list.
40
41    * In other words, there's an idea of up (toward the root) versus
42    down (away from the root), and left (i.e., toward the start (index
43    0) of a given node's daughter list) versus right (toward the end
44    of a given node's daughter list).
45
46Trees as described above have various applications, among them:
47representing syntactic constituency, in formal linguistics;
48representing contingencies in a game tree; representing abstract
49syntax in the parsing of any computer language -- whether in
50expression trees for programming languages, or constituency in the
51parse of a markup language document.  (Some of these might not use the
52fact that daughters are ordered.)
53
54Note: B-Trees are a very special case of the above kinds of trees, and
55are best treated with their own class.  Check CPAN for modules
56encapsulating B-Trees; or if you actually want a database, and for
57some reason ended up looking here, go look at the AnyDBM_File
58manpage.)
59
60Many base classes are not usable except as such -- but Tree::DAG_Node
61can be used as a normal class.
62
63
64PREREQUISITES
65
66This suite requires Perl 5; I've only used it under Perl 5.004, so for
67anything lower, you're on your own.
68
69Tree::DAG_Node doesn't use any nonstandard modules.
70
71
72INSTALLATION
73
74You install Tree::DAG_Node, as you would install any perl module
75library, by running these commands:
76
77   perl Makefile.PL
78   make
79   make test
80   make install
81
82If you want to install a private copy of Tree::DAG_Node in your home
83directory, then you should try to produce the initial Makefile with
84something like this command:
85
86  perl Makefile.PL LIB=~/perl
87
88Then you may need something like
89  setenv PERLLIB "$HOME/perl"
90in your shell initialization file (e.g., ~/.cshrc).
91
92See perldoc perlmodinstall for more information on installing modules.
93
94
95DOCUMENTATION
96
97POD-format documentation is included in DAG_Node.pm.  POD is readable
98with the 'perldoc' utility.  See ChangeLog for recent changes.
99
100
101MACPERL INSTALLATION NOTES
102
103Don't bother with the makefiles.  Just make a Tree directory in your
104MacPerl site_lib or lib directory, and move DAG_Node.pm into there.
105
106
107SUPPORT
108
109Questions, bug reports, useful code bits, and suggestions for
110Tree::DAG_Node should just be sent to David Hand, <cogent@cpan.org>.
111
112
113AVAILABILITY
114
115The latest version of Tree::DAG_Node is available from the Comprehensive
116Perl Archive Network (CPAN).  Visit <http://www.perl.com/CPAN/> to find
117a CPAN site near you.
118
119
120COPYRIGHT AND LICENSE
121
122Copyright 1998-2001, 2004, 2007 by Sean M. Burke and David Hand.
123
124This program is free software; you can redistribute it and/or modify it
125under the same terms as Perl itself.
126