Previous Page Contents

output::tree -- display of trees

Introduction

output::tree formats internally represented trees to display graphically.

Call(s)

output::tree(Tree <, indentdepth <, charlist> <, options>>)

Parameters

Tree - the tree, given as a special list
indentdepth - indent depth for each subtree
charlist - the chars that illustrate the tree structure
options - option Small

Options

Small - suppresses the display of a space line between every tree entry

Returns

an string object to display

Related Functions

adt::Tree, prog::exprtree

Details

Option: Small

Example 1

output::tree displayes special nested lists as trees:

>> TREE := ["a1", "a2", ["b1", "b2", ["c1", "c2"], "b3"],
                  ["d1", "d2", "d3"]]:
   print(Unquoted, output::tree(TREE))
                              a1
                              |
                              +-- a2
                              |
                              +-- b1
                              |   |
                              |   +-- b2
                              |   |
                              |   +-- c1
                              |   |   |
                              |   |   `-- c2
                              |   |
                              |   `-- b3
                              |
                              `-- d1
                                  |
                                  +-- d2
                                  |
                                  `-- d3
>> print(Unquoted, output::tree(TREE, 3, Small)):
                                a1
                                +- a2
                                +- b1
                                |  +- b2
                                |  +- c1
                                |  |  `- c2
                                |  `- b3
                                `- d1
                                   +- d2
                                   `- d3

The chars can be defined by the user:

>> print(Unquoted, output::tree(TREE, 6, ["|", "|", ".", "\\", " "])):
                           a1
                           |
                           |.... a2
                           |
                           |.... b1
                           |     |
                           |     |.... b2
                           |     |
                           |     |.... c1
                           |     |     |
                           |     |     \.... c2
                           |     |
                           |     \.... b3
                           |
                           \.... d1
                                 |
                                 |.... d2
                                 |
                                 \.... d3

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000