| Language-Tea documentation | view source | Contained in the Language-Tea distribution. |
Language::Tea::Traverse - Iterates into the Tea Op Tree
use Language::Tree::Traverse;
my $node = traverse_postfix($root, sub { }, []);
my $node = traverse_prefix($root, sub { }, []);
This module iterates through the tree in two different ways
Bottom-up traversal. The visitor will receive both the current node and the result of the processing for each sub-node. As any other arguments passed to traverse_postfix.
Top-Down traversal. The visitor will receive both the current node and the result of the processing for each upper level in the three (from the closest to the farest). It will also receive any other argument passed to traverse_prefix.
| Language-Tea documentation | view source | Contained in the Language-Tea distribution. |