Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
tree_conv - Convert between imploded and exploded tree arrays
Synopsis
Description
Error Handling
Examples
See Also
Author
itree/xconv ![tree]
xtree/iconv ![tree]
xtree/iconv ![tree], ![root]
The itree/xconv instruction converts an exploded tree array into an imploded tree array by moving pointers. Conversely, the xtree/iconv instruction converts from imploded to exploded.
The tree array to convert is identified by the tree argument.
The itree/xconv instruction implodes a branch of the nexus into a separate tree structure that has a new root node contained within the psTreeImp attribute. The new root node will be named after the leaf name of the existing psTreeExp attribute. The psTreeExp attribute and associated class are subsequently removed from the tree object. The new tree array will behave exactly as if it were created using itree/def or related instruction, see tree_def(5).
The xtree/iconv instruction will explode the tree into the nexus underneath the tree array object. Alternatively if the root argument is provided, the tree will be exploded underneath this location in the nexus instead. The root node of the imploded tree will not survive the conversion. Children of the root node will be merged into the target namespace. If a child node clashes with a node that already exists in the target, then the existing target object will be preserved and the node being converted (and any of its children) will be silently discarded. The psTreeExp attribute will point to the location where the tree was exploded. The psTreeImp attribute and associated class are subsequently removed form the tree object. The new tree array will behave exactly as if it were created using xtree/def or related instruction, see tree_def(5).
If the psTreeRoot attribute is set on the tree array object, it will retain its original value.
A runtime error is generated if an argument is of the wrong type, or if a referenced object does not exist in the nexus or does not point to a tree array of the correct type.
For more complete examples see ps_tree(5).
itree/xconv P11 Converts the exploded tree array pointed to in register P11 to an imploded tree array. xtree/iconv PEEK, P9 Converts the imploded tree array pointed to in the topmost item of the program stack to an exploded tree array. The array contents will be exploded underneath the node pointed to in register P9.
pal_commands(5), pal_registers(5), pal_indices(5), ps_attributes(5), ps_tree(5), tree_def(5), tree_set(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2016 Mark R. Bannister <cambridge@users.sourceforge.net>.
This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
PAL 1.0 | tree_conv (5) | 26 February 2016 |