Tree TREE, n. 1. The general name of the largest of the vegetable
kind, consisting of a firm woody stem springing from woody roots, and
spreading above into branches which terminate in leaves. A tree differs
from a shrub principally in size, many species of trees growing to the
highth of fifty or sixty feet, and some species to seventy or eighty,
and a few, particularly the pine, to a much greater highth. Trees
are of various kinds; as nuciferous, or nut-bearing trees; bacciferous,
or berry-bearing; coniferous, or cone-bearing, etc. Some are forest-trees,
and useful for timber or fuel; others are fruit trees, and cultivated in
gardens and orchards; others are used chiefly for shade and ornament.
2. Something resembling a tree, consisting of a stem or stalk and
branches; as a genealogical tree. 3. In ship-building, pieces of
timber are called chess-trees, cross-trees, roof-trees, tressel-trees,
etc. 4. In Scripture, a cross. --Jesus, whom they slew and hanged
on a tree. Acts 10. 5. Wood. TREE'-FROG, n. [tree and
frog.] A species of frog, the Rana arborea, found on trees and shrubs;
called by the older writers, Ranunculus viridis.
tree
n 1: a tall perennial woody plant having a main trunk and
branches forming a distinct elevated crown; includes both
gymnosperms and angiosperms
2: a figure that branches from a single root; "genealogical
tree" [syn: tree, tree diagram]
3: English actor and theatrical producer noted for his lavish
productions of Shakespeare (1853-1917) [syn: Tree, Sir
Herbert Beerbohm Tree}]
v 1: force a person or an animal into a position from which he
cannot escape [syn: corner, tree]
2: plant with trees; "this lot should be treed so that the house
will be shaded in summer"
3: chase an animal up a tree; "the hunters treed the bear with
dogs and killed it"; "her dog likes to tree squirrels"
4: stretch (a shoe) on a shoetree [syn: tree, shoetree]
tree
O.E. treo, treow "tree" (also "wood"), from P.Gmc. *trewan, from PIE
*deru-/*doru- "oak." Importance of the oak in mythology is reflected
in the recurring use of words for "oak" to mean "tree" (cf. Skt. dru,
Rus. drevo). In O.E. and M.E., also "thing made of wood," especially
the cross of the Crucifixion and a gallows (cf. Tyburn tree, gallows
mentioned 12c. at Tyburn, at junction of Oxford Street and Edgware Road,
place of public execution for Middlesex until 1783). Sense in family
tree first attested 1706; verb meaning "to chase up a tree" is from
1700. Tree-hugger, contemptuous for "environmentalist" is from late 1980s.
tree I. nounEtymology: Middle English, from Old English trēow; akin
to Old Norse trē tree, Greek drys, Sanskrit dāru
wood Date: before 12th century 1.a. a woody perennial plant having a single usually elongate
main stem generally with few or no branches on its lower part b.
a shrub or herb of arborescent form <rose trees>
<a banana tree>
2.a.(1) a piece of wood (as a post or pole) usually adapted to a
particular use or forming part of a structure or implement (2)archaic the cross on which Jesus was crucified
b.archaicgallows3. something in the form of
or resembling a tree: as
a. a diagram or graph that branches usually from a simple stem or
vertex without forming loops or polygons <a genealogical tree>
<phylogenetic trees> b. a much-branched system
of channels especially in an animal body <the vascular tree>
4.saddletree • treelessadjective •
treelikeadjectiveII. transitive verb (treed; treeing)
Date: 1575 1.a. to drive to or up a tree <treed by a bull> <dogs
treeing game> b. to put into a position of extreme
disadvantage ;corner; especially to bring to bay
2. to furnish or fit (as a shoe) with a tree
tree n. & v. 1 a a perennial plant with a woody self-supporting main stem or trunk when mature and usu. unbranched for some distance above the ground (cf. SHRUB(1)). b any similar plant having
a tall erect usu. single stem, e.g. palm tree. 2 a piece or frame of wood etc. for various purposes (shoe-tree). 3 archaic or poet. a a gibbet. b a cross, esp. the one used for Christ's
crucifixion. 4 (in full tree diagram) Math. a diagram with a structure of branching connecting lines. 5 = family tree. --v.tr. 1 force to take refuge in a tree. 2 esp. US put into a
difficult position. 3 stretch on a shoe-tree. Phrases and idioms: grow on trees (usu. with neg.) be plentiful. tree agate agate with treelike markings. tree calf a calf binding for
books stained with a treelike design. tree-fern a large fern, esp. of the family Cyatheaceae, with an upright trunklike stem. tree frog any arboreal tailless amphibian, esp. of the family Hylidae,
climbing by means of adhesive discs on its digits. tree hopper any insect of the family Membracidae, living in trees. tree house a structure in a tree for children to play in. tree line =
TIMBERLINE. tree of heaven an ornamental Asian tree, Ailanthus altissima, with evil-smelling flowers. tree of knowledge the branches of knowledge as a whole. tree of life = ARBOR VITAE. tree ring a
ring in a cross section of a tree, from one year's growth. tree shrew any small insect-eating arboreal mammal of the family Tupaiidae having a pointed nose and bushy tail. tree sparrow 1 Brit. a
sparrow, Passer montanus, inhabiting woodland areas. 2 US a N. American finch, Spizella arborea, inhabiting grassland areas. tree surgeon a person who treats decayed trees in order to preserve
them. tree surgery the art or practice of such treatment. tree toad = tree frog. tree tomato a South American shrub, Cyphomandra betacea, with egg-shaped red fruit. tree-trunk the trunk of a tree.
up a tree esp. US cornered; nonplussed. Derivatives: treeless adj. treelessness n. tree-like adj. Etymology: OE treow f. Gmc
tree
(trees)Frequency: The word is one of the 1500 most common words in English.
1. A tree is a tall plant that has a hard trunk, branches, and leaves.
I planted those apple trees....a variety of shrubs and trees.N-COUNT: oft n Nsee alsoChristmas tree, family tree
2. If you say that someone is barking up the wrong tree, you mean that they are
following the wrong course of action because their beliefs or ideas about something are
incorrect. (INFORMAL)
Scientists in Switzerland realised that most other researchers had been barking up the
wrong tree.PHRASE: V inflects, usu cont
3. If someone can't see the wood for the trees in British English, or can't see
the forest for the trees in American English, they are very involved in the details of
something and so they do not notice what is important about the thing as a whole.
PHRASE: V inflects
4.
the top of the tree: seetop
tree
tri: n. & v. 1 a a perennial plant with a woody self-supporting
main stem or trunk when mature and usu. unbranched for some distance above the
ground (cf. SHRUB(1)). b any similar plant having a tall erect usu. single
stem, e.g. palm tree. 2 a piece or frame of wood etc. for various purposes
(shoe-tree). 3 archaic or poet. a a gibbet. b a cross, esp. the one used
for Christ's crucifixion. 4 (in full tree diagram) Math. a diagram with a
structure of branching connecting lines. 5 = family tree. --v.tr. 1 force to
take refuge in a tree. 2 esp. US put into a difficult position. 3 stretch on
a shoe-tree. øgrow on trees (usu. with neg.) be plentiful. tree agate agate
with treelike markings. tree calf a calf binding for books stained with a
treelike design. tree-fern a large fern, esp. of the family Cyatheaceae, with
an upright trunklike stem. tree frog any arboreal tailless amphibian, esp. of
the family Hylidae, climbing by means of adhesive discs on its digits. tree
hopper any insect of the family Membracidae, living in trees. tree house a
structure in a tree for children to play in. tree line = TIMBERLINE. tree
of heaven an ornamental Asian tree, Ailanthus altissima, with evil-smelling
flowers. tree of knowledge the branches of knowledge as a whole. tree of
life = ARBOR VITAE. tree ring a ring in a cross section of a tree, from one
year's growth. tree shrew any small insect-eating arboreal mammal of the
family Tupaiidae having a pointed nose and bushy tail. tree sparrow 1 Brit. a
sparrow, Passer montanus, inhabiting woodland areas. 2 US a N. American finch,
Spizella arborea, inhabiting grassland areas. tree surgeon a person who treats
decayed trees in order to preserve them. tree surgery the art or practice of
such treatment. tree toad = tree frog. tree tomato a South American shrub,
Cyphomandra betacea, with egg-shaped red fruit. tree-trunk the trunk of a
tree. up a tree esp. US cornered; nonplussed. øøtreeless adj. treelessness
n. tree-like adj. [OE treow f. Gmc]
TREE
Welcome, ye shades! ye bowery thickets hail!
Ye lofty pines! ye venerable oaks!
Ye ashes wild, resounding o'er the steep!
Delicious is your shelter to the soul.
Seasons: Summer. J. THOMSON.
Now all the tree-tops lay asleep,
Like green waves on the sea,
As still as in the silent deep
The ocean woods may be.
The Recollection. P.B. SHELLEY.
Like two cathedral towers these stately pines
Uplift their fretted summits tipped with cones;
The arch beneath them is not built with stones,
Not Art but Nature traced these lovely lines,
And carved this graceful arabesque of vines;
No organ but the wind here sighs and moans,
No sepulchre conceals a martyr's bones,
No marble bishop on his tomb reclines.
Enter! the pavement, carpeted with leaves,
Gives back a softened echo to thy tread!
Listen! the choir is singing; all the birds,
In leafy galleries beneath the eaves,
Are singing! listen, ere the sound be fled,
And learn there may be worship without words.
My Cathedral. H.W. LONGFELLOW.
Those green-robed senators of mighty woods,
Tall oaks, branch-charmed by the earnest stars,
Dream, and so dream all night without a stir.
Hyperion, Bk. I. J. KEATS.
A brotherhood of venerable Trees.
Sonnet composed at ---- Castle. W. WORDSWORTH.
Cedar, and pine, and fir, and branching palm,
A sylvan scene, and as the ranks ascend
Shade above shade, a woody theatre
Of stateliest view.
Paradise Lost, Bk. IV. MILTON.
Of vast circumference and gloom profound,
This solitary Tree! A living thing
Produced too slowly ever to decay;
Of form and aspect too magnificent
To be destroyed.
Yew-Trees. W. WORDSWORTH.
Tree \Tree\ (tr[=e]), n. [OE. tree, tre, treo, AS. tre['o],
tre['o]w, tree, wood; akin to OFries. tr[=e], OS. treo, trio,
Icel. tr[=e], Dan. tr[ae], Sw. tr["a], tr["a]d, Goth. triu,
Russ. drevo, W. derw an oak, Ir. darag, darog, Gr. dry^s a
tree, oak, do`ry a beam, spear shaft, spear, Skr. dru tree,
wood, d[=a]ru wood. [root]63, 241. Cf. Dryad, Germander,
Tar, n., Trough.]
1. (Bot.) Any perennial woody plant of considerable size
(usually over twenty feet high) and growing with a single
trunk.
Note: The kind of tree referred to, in any particular case,
is often indicated by a modifying word; as forest tree,
fruit tree, palm tree, apple tree, pear tree, etc.
2. Something constructed in the form of, or considered as
resembling, a tree, consisting of a stem, or stock, and
branches; as, a genealogical tree.
3. A piece of timber, or something commonly made of timber;
-- used in composition, as in axletree, boottree,
chesstree, crosstree, whiffletree, and the like.
4. A cross or gallows; as Tyburn tree.
[Jesus] whom they slew and hanged on a tree. --Acts
x. 39.
5. Wood; timber. [Obs.] --Chaucer.
In a great house ben not only vessels of gold and of
silver but also of tree and of earth. --Wyclif (2
Tim. ii. 20).
6. (Chem.) A mass of crystals, aggregated in arborescent
forms, obtained by precipitation of a metal from solution.
See Lead tree, under Lead.
Tree bear (Zo["o]l.), the raccoon. [Local, U. S.]
Tree beetle (Zo["o]l.) any one of numerous species of
beetles which feed on the leaves of trees and shrubs, as
the May beetles, the rose beetle, the rose chafer, and the
goldsmith beetle.
Tree bug (Zo["o]l.), any one of numerous species of
hemipterous insects which live upon, and suck the sap of,
trees and shrubs. They belong to Arma, Pentatoma,
Rhaphigaster, and allied genera.
Tree cat (Zool.), the common paradoxure ({Paradoxurus
musang}).
Tree clover (Bot.), a tall kind of melilot ({Melilotus
alba}). See Melilot.
Tree crab (Zo["o]l.), the purse crab. See under Purse.
Tree creeper (Zo["o]l.), any one of numerous species of
arboreal creepers belonging to Certhia, Climacteris,
and allied genera. See Creeper, 3.
Tree cricket (Zo["o]l.), a nearly white arboreal American
cricket ({Ecanthus niv[oe]us}) which is noted for its loud
stridulation; -- called also white cricket.
Tree crow (Zo["o]l.), any one of several species of Old
World crows belonging to Crypsirhina and allied genera,
intermediate between the true crows and the jays. The tail
is long, and the bill is curved and without a tooth.
Tree dove (Zo["o]l.) any one of several species of East
Indian and Asiatic doves belonging to Macropygia and
allied genera. They have long and broad tails, are chiefly
arboreal in their habits, and feed mainly on fruit.
Tree duck (Zo["o]l.), any one of several species of ducks
belonging to Dendrocygna and allied genera. These ducks
have a long and slender neck and a long hind toe. They are
arboreal in their habits, and are found in the tropical
parts of America, Africa, Asia, and Australia.
Tree fern (Bot.), an arborescent fern having a straight
trunk, sometimes twenty or twenty-five feet high, or even
higher, and bearing a cluster of fronds at the top. Most
of the existing species are tropical.
Tree fish (Zo["o]l.), a California market fish
({Sebastichthys serriceps}).
Tree frog. (Zo["o]l.)
(a) Same as Tree toad.
(b) Any one of numerous species of Old World frogs
belonging to Chiromantis, Rhacophorus, and allied
genera of the family Ranid[ae]. Their toes are
furnished with suckers for adhesion. The flying frog
(see under Flying) is an example.
Tree goose (Zo["o]l.), the bernicle goose.
Tree hopper (Zo["o]l.), any one of numerous species of
small leaping hemipterous insects which live chiefly on
the branches and twigs of trees, and injure them by
sucking the sap. Many of them are very odd in shape, the
prothorax being often prolonged upward or forward in the
form of a spine or crest.
Tree jobber (Zo["o]l.), a woodpecker. [Obs.]
Tree kangaroo. (Zo["o]l.) See Kangaroo.
Tree lark (Zo["o]l.), the tree pipit. [Prov. Eng.]
Tree lizard (Zo["o]l.), any one of a group of Old World
arboreal lizards ({Dendrosauria}) comprising the
chameleons.
Tree lobster. (Zo["o]l.) Same as Tree crab, above.
Tree louse (Zo["o]l.), any aphid; a plant louse.
Tree moss. (Bot.)
(a) Any moss or lichen growing on trees.
(b) Any species of moss in the form of a miniature tree.
Tree mouse (Zo["o]l.), any one of several species of
African mice of the subfamily Dendromyin[ae]. They have
long claws and habitually live in trees.
Tree nymph, a wood nymph. See Dryad.
Tree of a saddle, a saddle frame.
Tree of heaven (Bot.), an ornamental tree ({Ailantus
glandulosus}) having long, handsome pinnate leaves, and
greenish flowers of a disagreeable odor.
Tree of life (Bot.), a tree of the genus Thuja; arbor
vit[ae].
Tree onion (Bot.), a species of garlic ({Allium
proliferum}) which produces bulbs in place of flowers, or
among its flowers.
Tree oyster (Zo["o]l.), a small American oyster ({Ostrea
folium}) which adheres to the roots of the mangrove tree;
-- called also raccoon oyster.
Tree pie (Zo["o]l.), any species of Asiatic birds of the
genus Dendrocitta. The tree pies are allied to the
magpie.
Tree pigeon (Zo["o]l.), any one of numerous species of
longwinged arboreal pigeons native of Asia, Africa, and
Australia, and belonging to Megaloprepia, Carpophaga,
and allied genera.
Tree pipit. (Zo["o]l.) See under Pipit.
Tree porcupine (Zo["o]l.), any one of several species of
Central and South American arboreal porcupines belonging
to the genera Ch[ae]tomys and Sphingurus. They have an
elongated and somewhat prehensile tail, only four toes on
the hind feet, and a body covered with short spines mixed
with bristles. One South American species ({S. villosus})
is called also couiy; another ({S. prehensilis}) is
called also c[oe]ndou.
Tree rat (Zo["o]l.), any one of several species of large
ratlike West Indian rodents belonging to the genera
Capromys and Plagiodon. They are allied to the
porcupines.
Tree serpent (Zo["o]l.), a tree snake.
Tree shrike (Zo["o]l.), a bush shrike.
Tree snake (Zo["o]l.), any one of numerous species of
snakes of the genus Dendrophis. They live chiefly among
the branches of trees, and are not venomous.
Tree sorrel (Bot.), a kind of sorrel ({Rumex Lunaria})
which attains the stature of a small tree, and bears
greenish flowers. It is found in the Canary Islands and
Teneriffe.
Tree sparrow (Zo["o]l.) any one of several species of small
arboreal sparrows, especially the American tree sparrow
({Spizella monticola}), and the common European species
({Passer montanus}).
Tree swallow (Zo["o]l.), any one of several species of
swallows of the genus Hylochelidon which lay their eggs
in holes in dead trees. They inhabit Australia and
adjacent regions. Called also martin in Australia.
Tree swift (Zo["o]l.), any one of several species of swifts
of the genus Dendrochelidon which inhabit the East
Indies and Southern Asia.
Tree tiger (Zo["o]l.), a leopard.
Tree toad (Zo["o]l.), any one of numerous species of
amphibians belonging to Hyla and allied genera of the
family Hylid[ae]. They are related to the common frogs
and toads, but have the tips of the toes expanded into
suckers by means of which they cling to the bark and
leaves of trees. Only one species ({Hyla arborea}) is
found in Europe, but numerous species occur in America and
Australia. The common tree toad of the Northern United
States ({H. versicolor}) is noted for the facility with
which it changes its colors. Called also tree frog. See
also Piping frog, under Piping, and Cricket frog,
under Cricket.
Tree warbler (Zo["o]l.), any one of several species of
arboreal warblers belonging to Phylloscopus and allied
genera.
Tree wool (Bot.), a fine fiber obtained from the leaves of
pine trees.
Tree \Tree\, v. t. [imp. & p. p. Treed; p. pr. & vb. n.
Treeing.]
1. To drive to a tree; to cause to ascend a tree; as, a dog
trees a squirrel. --J. Burroughs.
2. To place upon a tree; to fit with a tree; to stretch upon
a tree; as, to tree a boot. See Tree, n., 3.
tree
tree(n) BLT Built-In Commands tree(n)
______________________________________________________________________________
NAME
tree - Create and manage tree data objects.
SYNOPSIS
blt::tree create ?treeName?
blt::tree destroy treeName...
blt::tree names ?pattern?
_________________________________________________________________
DESCRIPTION
The tree command creates tree data objects. A tree object is general
ordered tree of nodes. Each node has both a label and a key-value list
of data. Data can be heterogeneous, since nodes do not have to contain
the same data keys. It is associated with a Tcl command that you can
use to access and modify the its structure and data. Tree objects can
also be managed via a C API.
INTRODUCTION
EXAMPLE
SYNTAX
tree create ?treeName?
Creates a new tree object. The name of the new tree is
returned. If no treeName argument is present, then the name of
the tree is automatically generated in the form "tree0",
"tree1", etc. If the substring "#auto" is found in treeName, it
is automatically substituted by a generated name. For example,
the name .foo.#auto.bar will be translated to .foo.tree0.bar.
A new Tcl command (by the same name as the tree) is also cre-
ated. Another Tcl command or tree object can not already exist
as treeName. If the Tcl command is deleted, the tree will also
be freed. The new tree will contain just the root node. Trees
are by default, created in the current namespace, not the global
namespace, unless treeName contains a namespace qualifier, such
as "fred::myTree".
tree destroy treeName...
Releases one of more trees. The Tcl command associated with
treeName is also removed. Trees are reference counted. The
internal tree data object isn't destroyed until no one else is
using the tree.
tree names ?pattern?
Returns the names of all tree objects. if a pattern argument is
given, then the only those trees whose name matches pattern will
be listed.
NODE IDS AND TAGS
Nodes in a tree object may be referred in either of two ways: by id or
by tag. Each node has a unique serial number or id that is assigned to
that node when it's created. The id of an node never changes and id
numbers are not re-used.
A node may also have any number of tags associated with it. A tag is
just a string of characters, and it may take any form except that of an
integer. For example, "x123" is valid, but "123" isn't. The same tag
may be associated with many different nodes. This is commonly done to
group nodes in various interesting ways.
There are two built-in tags: The tag all is implicitly associated with
every node in the tree. It may be used to invoke operations on all the
nodes in the tree. The tag root is managed automatically by the tree
object. It applies to the node currently set as root.
When specifying nodes in tree object commands, if the specifier is an
integer then it is assumed to refer to the single node with that id.
If the specifier is not an integer, then it is assumed to refer to all
of the nodes in the tree that have a tag matching the specifier. The
symbol node is used below to indicate that an argument specifies either
an id that selects a single node or a tag that selects zero or more
nodes. Many tree commands only operate on a single node at a time; if
node is specified in a way that names multiple items, then an error
"refers to more than one node" is generated.
NODE MODIFIERS
You can also specify node in relation to another node by appending one
or more modifiers to the node id or tag. A modifier refers to a node
in relation to the specified node. For example, "root->firstchild"
selects the first subtree of the root node.
The following modifiers are available:
firstchild
Selects the first child of the node.
lastchild Selects the last child of the node.
next Selects the next node in preorder to the node.
nextsibling
Selects the next sibling of the node.
parent Selects the parent of the node.
previous Selects the previous node in preorder to the node.
prevsibling
Selects the previous sibling of the node.
"label" Selects the node whose label is label. Enclosing
label in quotes indicates to always search for a node
by its label (for example, even if the node is labeled
"parent").
It's an error the node can't be found. For example, lastchild and
firstchild will generate errors if the node has no children. The
exception to this is the index operation. You can use index to test if
a modifier is valid.
TREE OPERATIONS
Once you create a tree object, you can use its Tcl command to query or
modify it. The general form is
treeName operation ?arg?...
Both operation and its arguments determine the exact behavior of the
command. The operations available for trees are listed below.
treeName ancestor node1 node2
Returns the mutual ancestor of the two nodes node1 and node2.
The ancestor can be one of the two nodes. For example, if node1
and node2 are the same nodes, their ancestor is node1.
treeName apply node ?switches?
Runs commands for all nodes matching the criteria given by
switches for the subtree designated by node. By default all
nodes match, but you can set switches to narrow the match. This
operation differs from find in two ways: 1) Tcl commands can be
invoked both pre- and post-traversal of a node and 2) the tree
is always traversed in depth first order.
The -exact, -glob, and -regexp switches indicate both what kind
of pattern matching to perform and the pattern. By default each
pattern will be compared with the node label. You can set more
than one of these switches. If any of the patterns match (logi-
cal or), the node matches. If the -key switch is used, it des-
ignates the data field to be matched.
The valid switches are listed below:
-depth number
Descend at most number (a non-negative integer) levels
If number is 1 this means only apply the tests to the
children of node.
-exact string
Matches each node using string. The node must match
string exactly.
-glob string
Test each node to string using global pattern match-
ing. Matching is done in a fashion similar to that
used by the C-shell.
-invert Select non-matching nodes. Any node that doesn't
match the given criteria will be selected.
-key key If pattern matching is selected (using the -exact,
-glob, or -regexp switches), compare the values of the
data field keyed by key instead of the node's label.
If no pattern matching switches are set, then any node
with this data key will match.
-leafonly Only test nodes with no children.
-nocase Ignore case when matching patterns.
-path Use the node's full path when comparing nodes. The
node's full path is a list of labels, starting from
the root of each ancestor and the node itself.
-precommand command
Invoke command for each matching node. Before command
is invoked, the id of the node is appended. You can
control processing by the return value of command. If
command generates an error, processing stops and the
find operation returns an error. But if command
returns break, then processing stops, no error is gen-
erated. If command returns continue, then processing
stops on that subtree and continues on the next.
-postcommand command
Invoke command for each matching node. Before command
is invoked, the id of the node is appended. You can
control processing by the return value of command. If
command generates an error, processing stops and the
find operation returns an error. But if command
returns break, then processing stops, no error is gen-
erated. If command returns continue, then processing
stops on that subtree and continues on the next.
-regexp string
Test each node using string as a regular expression
pattern.
-tag string
Only test nodes that have the tag string.
treeName attach treeObject
Attaches to an existing tree object treeObject. This is for
cases where the tree object was previously created via the C
API. The current tree associated with treeName is discarded.
In addition, the current set of tags, notifier events, and
traces are removed.
treeName children node
Returns a list of children for node. If node is a leaf, then an
empty string is returned.
treeName copy srcNode ?destTree? parentNode ?switches?
Copies srcNode into parentNode. Both nodes srcNode and parentN-
ode must already exist. The id of the new node is returned. You
can copy from one tree to another. If a destTree argument is
present, it indicates the name of the destination tree. By
default both the source and destination trees are the same. The
valid switches are listed below:
-label string
Label destNode as string. By default, destNode has the
same label as srcNode.
-overwrite
Overwrite nodes that already exist. Normally nodes are
always created, even if there already exists a node by
the same name. This switch indicates to add or overwrite
the node's data fields.
-recurse
Recursively copy all the subtrees of srcNode as well. In
this case, srcNode can't be an ancestor of destNode as it
would result in a cyclic copy.
-tags Copy tag inforation. Normally the following node is
copied: its label and data fields. This indicates to
copy tags as well.
treeName degree node
Returns the number of children of node.
treeName delete node...
Recursively deletes one or more nodes from the tree. The node
and all its descendants are removed. The one exception is the
root node. In this case, only its descendants are removed. The
root node will remain. Any tags or traces on the nodes are
released.
treeName depth node
Returns the depth of the node. The depth is the number of steps
from the node to the root of the tree. The depth of the root
node is 0.
treeName dump node
Returns a list of the paths and respective data for node and its
descendants. The subtree designated by node is traversed
returning the following information for each node: 1) the node's
path relative to node, 2) a sublist key value pairs representing
the node's data fields, and 3) a sublist of tags. This list
returned can be used later to copy or restore the tree with the
restore operation.
treeName dumpfile node fileName
Writes a list of the paths and respective data for node and its
descendants to the given file fileName. The subtree designated
by node is traversed returning the following information for
each node: 1) the node's path relative to node, 2) a sublist key
value pairs representing the node's data fields, and 3) a sub-
list of tags. This list returned can be used later to copy or
restore the tree with the restore operation.
treeName exists node ?key?
Indicates if node exists in the tree. If a key argument is
present then the command also indicates if the named data field
exists.
treeName find node ?switches?
Finds for all nodes matching the criteria given by switches for
the subtree designated by node. A list of the selected nodes is
returned. By default all nodes match, but you can set switches
to narrow the match.
The -exact, -glob, and -regexp switches indicate both what kind
of pattern matching to perform and the pattern. By default each
pattern will be compared with the node label. You can set more
than one of these switches. If any of the patterns match (logi-
cal or), the node matches. If the -key switch is used, it des-
ignates the data field to be matched.
The order in which the nodes are traversed is controlled by the
-order switch. The possible orderings are preorder, postorder,
inorder, and breadthfirst. The default is postorder.
The valid switches are listed below:
-addtag string
Add the tag string to each selected node.
-count number
Stop processing after number (a positive integer)
matches.
-depth number
Descend at most number (a non-negative integer) levels
If number is 1 this means only apply the tests to the
children of node.
-exact string
Matches each node using string. The node must match
string exactly.
-exec command
Invoke command for each matching node. Before command
is invoked, the id of the node is appended. You can
control processing by the return value of command. If
command generates an error, processing stops and the
find operation returns an error. But if command
returns break, then processing stops, no error is gen-
erated. If command returns continue, then processing
stops on that subtree and continues on the next.
-glob string
Test each node to string using global pattern match-
ing. Matching is done in a fashion similar to that
used by the C-shell.
-invert Select non-matching nodes. Any node that doesn't
match the given criteria will be selected.
-key key Compare the values of the data field keyed by key
instead of the node's label. If no pattern is given
(-exact, -glob, or -regexp switches), then any node
with this data key will match.
-leafonly Only test nodes with no children.
-nocase Ignore case when matching patterns.
-order string
Traverse the tree and process nodes according to
string. String can be one of the following:
breadthfirst
Process the node and the subtrees at each
sucessive level. Each node on a level is
processed before going to the next level.
inorder Recursively process the nodes of the first
subtree, the node itself, and any the
remaining subtrees.
postorder Recursively process all subtrees before the
node.
preorder Recursively process the node first, then any
subtrees.
-path Use the node's full path when comparing nodes.
-regexp string
Test each node using string as a regular expression
pattern.
-tag string
Only test nodes that have the tag string.
treeName findchild node label
Searches for a child node Ilabel in node. The id of the child
node is returned if found. Otherwise -1 is returned.
treeName firstchild node
Returns the id of the first child in the node's list of sub-
trees. If node is a leaf (has no children), then -1 is
returned.
treeName get node ?key? ?defaultValue?
Returns a list of key-value pairs of data for the node. If key
is present, then onlyx the value for that particular data field
is returned. It's normally an error if node does not contain
the data field key. But if you provide a defaultValue argument,
this value is returned instead (node will still not contain
key). This feature can be used to access a data field of node
without first testing if it exists. This operation may trigger
read data traces.
treeName index node
Returns the id of node. If node is a tag, it can only specify
one node. If node does not represent a valid node id or tag, or
has modifiers that are invalid, then -1 is returned.
treeName insert parent ?switches?
Inserts a new node into parent node parent. The id of the new
node is returned. The following switches are available:
-after child
Position node after child. The node child must be a
child of parent.
-at number
Inserts the node into parent's list of children at
position number. The default is to append node.
-before child
Position node before child. The node child must be a
child of parent.
-data dataList
Sets the value for each data field in dataList for the
new node. DataList is a list of key-value pairs.
-label string
Designates the labels of the node as string. By
default, nodes are labeled as node0, node1, etc.
-node id Designates the id for the node. Normally new ids are
automatically generated. This allows you to create a
node with a specific id. It is an error if the id is
already used by another node in the tree.
-tags tagList
Adds each tag in tagList to the new node. TagList is a
list of tags, so be careful if a tag has embedded
space.
treeName is property args
Indicates the property of a node. Both property and args deter-
mine the property being tested. Returns 1 if true and 0 other-
wise. The following property and args are valid:
ancestor node1 node2
Indicates if node1 is an ancestor of node2.
before node1 node2
Indicates if node1 is before node2 in depth first
traversal.
leaf node Indicates if node is a leaf (it has no subtrees).
root node Indicates if node is the designated root. This can be
changed by the root operation.
treeName label node ?newLabel?
Returns the label of the node designated by node. If newLabel
is present, the node is relabeled using it as the new label.
treeName lastchild node
Returns the id of the last child in the node's list of subtrees.
If node is a leaf (has no children), then -1 is returned.
treeName move node newParent ?switches?
Moves node into newParent. Node is appended to the list children
of newParent. Node can not be an ancestor of newParent. The
valid flags for switches are described below.
-after child
Position node after child. The node child must be a
child of newParent.
-at number
Inserts node into parent's list of children at posi-
tion number. The default is to append the node.
-before child
Position node before child. The node child must be a
child of newParent.
treeName next node
Returns the next node from node in a preorder traversal. If
node is the last node in the tree, then -1 is returned.
treeName nextsibling node
Returns the node representing the next subtree from node in its
parent's list of children. If node is the last child, then -1
is returned.
treeName notify args
Manages notification events that indicate that the tree struc-
ture has been changed. See the NOTIFY OPERATIONS section below.
treeName parent node
Returns the parent node of node. If node is the root of the
tree, then -1 is returned.
treeName path node
Returns the full path (from root) of node.
treeName position node
Returns the position of the node in its parent's list of chil-
dren. Positions are numbered from 0. The position of the root
node is always 0.
treeName previous node
Returns the previous node from node in a preorder traversal. If
node is the root of the tree, then -1 is returned.
treeName prevsibling node
Returns the node representing the previous subtree from node in
its parent's list of children. If node is the first child, then
-1 is returned.
treeName restore node dataString switches
Performs the inverse function of the dump operation, restoring
nodes to the tree. The format of dataString is exactly what is
returned by the dump operation. It's a list containing informa-
tion for each node to be restored. The information consists of
1) the relative path of the node, 2) a sublist of key value
pairs representing the node's data, and 3) a list of tags for
the node. Nodes are created starting from node. Nodes can be
listed in any order. If a node's path describes ancestor nodes
that do not already exist, they are automatically created. The
valid switches are listed below:
-overwrite
Overwrite nodes that already exist. Normally nodes are
always created, even if there already exists a node by
the same name. This switch indicates to add or overwrite
the node's data fields.
treeName restorefile node fileName switches
Performs the inverse function of the dumpfile operation, restor-
ing nodes to the tree from the file fileName. The format of
fileName is exactly what is returned by the dumpfile operation.
It's a list containing information for each node to be restored.
The information consists of 1) the relative path of the node, 2)
a sublist of key value pairs representing the node's data, and
3) a list of tags for the node. Nodes are created starting from
node. Nodes can be listed in any order. If a node's path
describes ancestor nodes that do not already exist, they are
automatically created. The valid switches are listed below:
-overwrite
Overwrite nodes that already exist. Normally nodes are
always created, even if there already exists a node by
the same name. This switch indicates to add or overwrite
the node's data fields.
treeName root ?node?
Returns the id of the root node. Normally this is node 0. If a
node argument is provided, it will become the new root of the
tree. This lets you temporarily work within a subset of the
tree. Changing root affects operations such as next, path, pre-
vious, etc.
treeName set node key value ?key value...?
Sets one or more data fields in node. Node may be a tag that
represents several nodes. Key is the name of the data field to
be set and value is its respective value. This operation may
trigger write and create data traces.
treeName size node
Returns the number of nodes in the subtree. This includes the
node and all its descendants. The size of a leaf node is 1.
treeName sort node ?switches?
-ascii Compare strings using the ASCII collation order.
-command string
Use command string as a comparison command. To com-
pare two elements, evaluate a Tcl script consisting of
command with the two elements appended as additional
arguments. The script should return an integer less
than, equal to, or greater than zero if the first ele-
ment is to be considered less than, equal to, or
greater than the second, respectively.
-decreasing
Sort in decreasing order (largest items come first).
-dictionary
Compare strings using a dictionary-style comparison.
This is the same as -ascii except (a) case is ignored
except as a tie-breaker and (b) if two strings contain
embedded numbers, the numbers compare as integers, not
characters. For example, in -dictionary mode, bigBoy
sorts between bigbang and bigboy, and x10y sorts
between x9y and x11y.
-integer Compare the nodes as integers.
-key string
Sort based upon the node's data field keyed by string.
Normally nodes are sorted according to their label.
-path Compare the full path of each node. The default is to
compare only its label.
-real Compare the nodes as real numbers.
-recurse Recursively sort the entire subtree rooted at node.
-reorder Recursively sort subtrees for each node. Warning.
Unlike the normal flat sort, where a list of nodes is
returned, this will reorder the tree.
treeName tag args
Manages tags for the tree object. See the TAG OPERATIONS sec-
tion below.
treeName trace args
Manages traces for data fields in the tree object. Traces cause
Tcl commands to be executed whenever a data field of a node is
created, read, written, or unset. Traces can be set for a spe-
cific node or a tag, representing possibly many nodes. See the
TRACE OPERATIONS section below.
treeName unset node key...
Removes one or more data fields from node. Node may be a tag
that represents several nodes. Key is the name of the data
field to be removed. It's not an error is node does not contain
key. This operation may trigger unset data traces.
TAG OPERATIONS
Tags are a general means of selecting and marking nodes in the tree. A
tag is just a string of characters, and it may take any form except
that of an integer. The same tag may be associated with many different
nodes.
There are two built-in tags: The tag all is implicitly associated with
every node in the tree. It may be used to invoke operations on all the
nodes in the tree. The tag root is managed automatically by the tree
object. It specifies the node that is currently set as the root of the
tree.
Most tree operations use tags. And several operations let you operate
on multiple nodes at once. For example, you can use the set operation
with the tag all to set a data field in for all nodes in the tree.
Tags are invoked by the tag operation. The general form is
treeName tag operation ?arg?...
Both operation and its arguments determine the exact behavior of the
command. The operations available for tags are listed below.
treeName tag add string node...
Adds the tag string to one of more nodes.
treeName tag delete string node...
Deletes the tag string from one or more nodes.
treeName tag forget string
Removes the tag string from all nodes. It's not an error if no
nodes are tagged as string.
treeName tag names ?node?
Returns a list of tags used by the tree. If a node argument is
present, only those tags used by node are returned.
treeName tag nodes string
Returns a list of nodes that have the tag string. If no node is
tagged as string, then an empty string is returned.
TRACE OPERATIONS
Data fields can be traced much in the same way that you can trace Tcl
variables. Data traces cause Tcl commands to be executed whenever a
particular data field of a node is created, read, written, or unset. A
trace can apply to one or more nodes. You can trace a specific node by
using its id, or a group of nodes by a their tag.
The tree's get, set, and unset operations can trigger various traces.
The get operation can cause a read trace to fire. The set operation
causes a write trace to fire. And if the data field is written for the
first time, you will also get a create trace. The unset operation
triggers unset traces.
Data traces are invoked by the trace operation. The general form is
treeName trace operation ?arg?...
Both operation and its arguments determine the exact behavior of the
command. The operations available for traces are listed below.
treeName trace create node key ops command
Creates a trace for node on data field key. Node can refer to
more than one node (for example, the tag all). If node is a tag,
any node with that tag can possibly trigger a trace, invoking
command. Command is command prefix, typically a procedure name.
Whenever a trace is triggered, four arguments are appended to
command before it is invoked: treeName, id of the node, key and,
ops. Note that no nodes need have the field key. A trace iden-
tifier in the form "trace0", "trace1", etc. is returned.
Ops indicates which operations are of interest, and consists of
one or more of the following letters:
r Invoke command whenever key is read. Both read and write
traces are temporarily disabled when command is executed.
w Invoke command whenever key is written. Both read and
write traces are temporarily disabled when command is
executed.
c Invoke command whenever key is created.
u Invoke command whenever key is unset. Data fields are
typically unset with the unset command. Data fields are
also unset when the tree is released, but all traces are
disabled prior to that.
treeName trace delete traceId...
Deletes one of more traces. TraceId is the trace identifier
returned by the trace create operation.
treeName trace info traceId
Returns information about the trace traceId. TraceId is a trace
identifier previously returned by the trace create operation.
It's the same information specified for the trace create opera-
tion. It consists of the node id or tag, data field key, a
string of letters indicating the operations that are traced
(it's in the same form as ops) and, the command prefix.
treeName trace names
Returns a list of identifers for all the current traces.
NOTIFY OPERATIONS
Tree objects can be shared among many clients, such as a hiertable wid-
get. Any client can create or delete nodes, sorting the tree, etc.
You can request to be notified whenever these events occur. Notify
events cause Tcl commands to be executed whenever the tree structure is
changed.
Notifications are handled by the notify operation. The general form is
treeName notify operation ?arg?...
Both operation and its arguments determine the exact behavior of the
command. The operations available for events are listed below.
treeName notify create ?switches? command ?args?...
Creates a notifier for the tree. A notify identifier in the
form "notify0", "notify1", etc. is returned.
Command and args are saved and invoked whenever the tree struc-
ture is changed (according to switches). Two arguments are
appended to command and args before it's invoked: the id of the
node and a string representing the type of event that occured.
One of more switches can be set to indicate the events that are
of interest. The valid switches are as follows:
-create Invoke command whenever a new node has been added.
-delete Invoke command whenever a node has been deleted.
-move Invoke command whenever a node has been moved.
-sort Invoke command whenever the tree has been sorted and
reordered.
-relabel Invoke command whenever a node has been relabeled.
-allevents
Invoke command whenever any of the above events occur.
-whenidle When an event occurs don't invoke command immediately,
but queue it to be run the next time the event loop is
entered and there are no events to process. If subse-
quent events occur before the event loop is entered,
command will still be invoked only once.
treeName notify delete notifyId
Deletes one or more notifiers from the tree. NotifyId is the
notifier identifier returned by the notify create operation.
treeName notify info notifyId
Returns information about the notify event notifyId. NotifyId
is a notify identifier previously returned by the notify create
operation. It's the same information specified for the notify
create operation. It consists of the notify id, a sublist of
event flags (it's in the same form as flags) and, the command
prefix.
treeName notify names
Returns a list of identifers for all the current notifiers.
C LANGUAGE API
Blt_TreeApply, Blt_TreeApplyBFS, Blt_TreeApplyDFS, Blt_TreeChangeRoot,
Blt_TreeCreate, Blt_TreeCreateEventHandler, Blt_TreeCreateNode,
Blt_TreeCreateTrace, Blt_TreeDeleteEventHandler, Blt_TreeDeleteNode,
Blt_TreeDeleteTrace, Blt_TreeExists, Blt_TreeFindChild,
Blt_TreeFirstChild, Blt_TreeFirstKey, Blt_TreeGetNode, Blt_TreeGetTo-
ken, Blt_TreeGetValue, Blt_TreeIsAncestor, Blt_TreeIsBefore,
Blt_TreeIsLeaf, Blt_TreeLastChild, Blt_TreeMoveNode, Blt_TreeName,
Blt_TreeNextKey, Blt_TreeNextNode, Blt_TreeNextSibling, Blt_TreeNodeDe-
gree, Blt_TreeNodeDepth, Blt_TreeNodeId, Blt_TreeNodeLabel, Blt_TreeN-
odeParent, Blt_TreePrevNode, Blt_TreePrevSibling, Blt_TreeRelabelNode,
Blt_TreeReleaseToken, Blt_TreeRootNode, Blt_TreeSetValue, Blt_TreeSize,
Blt_TreeSortNode, and Blt_TreeUnsetValue.
KEYWORDS
tree, hiertable, widget
BLT 2.4 tree(n)
tree
TREE(1) TREE(1)
NAME
tree - list contents of directories in a tree-like format.
SYNOPSIS
tree [-adfgilnopqrstuxACDFNS] [-L level [-R]] [-H baseHREF] [-T title]
[-o filename] [--nolinks] [-P pattern] [-I pattern] [--inodes]
[--device] [--noreport] [--dirsfirst] [--version] [--help] [directory
...]
DESCRIPTION
Tree is a recursive directory listing program that produces a depth
indented listing of files, which is colorized ala dircolors if the
LS_COLORS environment variable is set and output is to tty. With no
arguments, tree lists the files in the current directory. When direc-
tory arguments are given, tree lists all the files and/or directories
found in the given directories each in turn. Upon completion of list-
ing all files/directories found, tree returns the total number of files
and/or directories listed.
By default, when a symbolic link is encountered, the path that the sym-
bolic link refers to is printed after the name of the link in the for-
mat:
name -> real-path
If the `-l' option is given and the symbolic link refers to an actual
directory, then tree will follow the path of the symbolic link as if it
were a real directory.
OPTIONS
Tree understands the following command line switches:
--help Outputs a verbose usage listing.
--version
Outputs the version of tree.
-a All files are printed. By default tree does not print hidden
files (those beginning with a dot `.'). In no event does tree
print the file system constructs `.' (current directory) and
`..' (previous directory).
-d List directories only.
-f Prints the full path prefix for each file.
-i Makes tree not print the indentation lines, useful when used in
conjunction with the -f option.
-l Follows symbolic links if they point to directories, as if they
were directories. Symbolic links that will result in recursion
are avoided when detected.
-x Stay on the current file-system only. Ala find -xdev.
-P pattern
List only those files that match the wild-card pattern. Note:
you must use the -a option to also consider those files begin-
ning with a dot `.' for matching. Valid wildcard operators are
`*' (any zero or more characters), `?' (any single character),
`[...]' (any single character listed between brackets (optional
- (dash) for character range may be used: ex: [A-Z]), and
`[^...]' (any single character not listed in brackets) and `|'
separates alternate patterns.
-I pattern
Do not list those files that match the wild-card pattern.
--noreport
Omits printing of the file and directory report at the end of
the tree listing.
-p Print the protections for each file (as per ls -l).
-s Print the size of each file along with the name.
-u Print the username, or UID # if no username is available, of the
file.
-g Print the group name, or GID # if no group name is available, of
the file.
-D Print the date of the last modification time for the file
listed.
--inodes
Prints the inode number of the file or directory
--device
Prints the device number to which the file or directory belongs
-F Append a `/' for directories, a `=' for socket files, a `*' for
executable files and a `|' for FIFO's, as per ls -F
-q Print non-printable characters in filenames as question marks
instead of the default carrot notation.
-N Print non-printable characters as is instead of the default car-
rot notation.
-r Sort the output in reverse alphabetic order.
-t Sort the output by last modification time instead of alphabeti-
cally.
--dirsfirst
List directories before files.
-n Turn colorization off always, over-ridden by the -C option.
-C Turn colorization on always, using built-in color defaults if
the LS_COLORS environment variable is not set. Useful to col-
orize output to a pipe.
-A Turn on ANSI line graphics hack when printing the indentation
lines.
-S Turn on ASCII line graphics (useful when using linux console
mode fonts). This option is now equivalent to `--charset=IBM437'
and will eventually be depreciated.
-L level
Max display depth of the directory tree.
-R Recursively cross down the tree each level directories (see -L
option), and at each of them execute tree again adding `-o
00Tree.html' as a new option.
-H baseHREF
Turn on HTML output, including HTTP references. Useful for ftp
sites. baseHREF gives the base ftp location when using HTML
output. That is, the local directory may be `/local/ftp/pub',
but it must be referenced as `ftp://hostname.organiza-
tion.domain/pub' (baseHREF should be `ftp://hostname.organiza-
tion.domain'). Hint: don't use ANSI lines with this option, and
don't give more than one directory in the directory list. If you
wish to use colors via CCS stylesheet, use the -C option in
addition to this option to force color output.
-T title
Sets the title and H1 header string in HTML output mode.
--charset charset
Set the character set to use when outputting HTML and for line
drawing.
--nolinks
Turns off hyperlinks in HTML output.
-o filename
Send output to filename.
FILES
/etc/DIR_COLORS System color database.
~/.dircolors Users color database.
ENVIRONMENT
LS_COLORS Color information created by dircolors
TREE_CHARSET Character set for tree to use in HTML mode.
LC_CTYPE Locale for filename output.
AUTHOR
Steve Baker (ice@mama.indstate.edu)
HTML output hacked by Francesc Rocher (rocher@econ.udg.es)
Charsets and OS/2 support by Kyosuke Tokoro (NBG01720@nifty.ne.jp)
BUGS
Tree does not prune "empty" directories when the -P and -I options are
used. Tree prints directories as it comes to them, so cannot accumu-
late information on files and directories beneath the directory it is
printing. Probably more.
SEE ALSO
dircolors(1L), ls(1L), find(1L)
Tree 1.5.0 TREE(1)
On most web browsers you can double click any word on this page to see what definitions I have for that word.
This dictionary server is not an authoratative source of information for anything. Like almost everything at sorabji.com, I set this up for my own purposes. In this case the purpose is to
browse words and ideas at random. An automatically generated page that produces 1000 Random Words
is my gateway to this resource. I also attempt a word of the day project,
in which I attempt to write something about myself starting with interesting words that I find through the Wordswarm Random Words Pages. I have made
available the complete 1828 Webster's Dictionary, which many feel is the greatest English dictionary ever published.
Other random links of mine include the Sorabji.com Random Link, which sends you to one of
over 7,000 pages on my web sites; the Face Server produces random images of
human faces; clicking the Random WAYD link shows you a random posting to my "What Are You Doing?" board; the Random USPS
Mailbox link sends you to a page with information about a random mailbox; and the random pictures page page of sorabji.com shows one of over 11,000 random images any time you load the page. On an unrelated note, I have begun making several thousand pages of legal documents searchable.