
Text::UberText::Tree - Tree Representation Of UberText Document

An UberText document can have command blocks that enclose other commands or text within the document. Because of this, the document needs to be structured like a tree to keep track of the relationships of the commands and text. Some parts of the document are siblings in relation, others have children, and all parts have a parent.
Each broken down portion of the document is refered to as a node, and each node can represent either a command, or a piece of text. If the command acts as a container block, it will have an understanding of several child nodes that must also be processed when the command is run by the Text::UberText::Dispatch object.

Creates a new tree object.
Adds a hunk of text to the tree. The $string variable refers to the raw text, and $line refers to the line number in the source document. The $class variable points to which Node class this data should be assigned to (either Text::UberText::Node::Text, or Text::UberText::Node::Command).
Shows the breakdown of the document tree, which may be useful for debugging purposes.
Processes each top level node in the tree. If nodes at this level have children, they are expected to handle processing the child nodes themselves.
Returns a list of children for a particular node id. Zero (0) is used by default, and is considered the topmost node in the document.
Returns the output of the tree for all child nodes of $node_id. Zero (0) is used by default since it is the highest node in the tree.
Returns the document output like the output() method, but prefixes the actual node output with the id number of the node.
Returns a single Node object, based on the ID passed to it.

Chris Josephes <cpj1@visi.com>

Text::UberText::Node, Text::UberText::Dispatch

Copyright 2002, Chris Josephes. All rights reserved. This module is free software. It may be used, redistributed, and/or modified under the same terms as Perl itself. ~