A set of iterator functions for traversing the various trees and indexes. Each iterator expects closures that operate on the elements in the iterated data structure.
Params: $node, &$loopsub, &$skipsub, &$applysub, &$recursesub
Iterate over $node\'s children. For each iteration:
If loopsub( $node, $kid ) returns false, the loop is terminated. If skipsub( $node, $kid ) returns true, the element is skipped.
Applysub( $node, $kid ) is called If recursesub( $node, $kid ) returns true, the function recurses into the current node.
Params: $root, $recurse?, $commonsub, $compoundsub, $membersub, $skipsub
Traverse the ast tree starting at $root, skipping if skipsub returns true.
Applying $commonsub( $node, $kid), then $compoundsub( $node, $kid ) or $membersub( $node, $kid ) depending on the Compound flag of the node.
Apply $compoundsub( $node ) to all locally defined compound nodes (ie nodes that are not external to the library being processed).
Params: $node, $levelDownSub, $printSub, $levelUpSub
This allows easy hierarchy traversal and printing.
Traverses the inheritance hierarchy starting at $node, calling printsub for each node. When recursing downward into the tree, $levelDownSub($node) is called, the recursion takes place, and $levelUpSub is called when the recursion call is completed.
Call $printsub for each *direct* ancestor of $node. Only multiple inheritance can lead to $printsub being called more than once.
To install Ast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ast
CPAN shell
perl -MCPAN -e shell install Ast
For more information on module installation, please visit the detailed CPAN module installation guide.