Utilities for syntax trees.
Parameters: outlist ref, full list ref, key, value Find all nodes in full list that have property "key=value". All resulting nodes are stored in outlist.
Parameters: node list ref returns: list Returns a sorted list of all distinct "NodeType"s in the nodes in the list.
Parameters: root, ident, report-on-fail Returns: node, or undef Given a root node and a fully qualified identifier (:: separated), this function will try to find a child of the root node that matches the identifier.
node, name: search for a child
Parameters: root, node Recursively links references in the documentation for each node to real nodes if they can be found. This should be called once the entire parse tree is filled.
Parameters: root, node, docnode Link references in the docs if they can be found. This should be called once the entire parse tree is filled.
Parameter: $rootnode, $parentnode Make an inheritance graph from the parse tree that begins at rootnode. parentnode is the node that is the parent of all base class nodes.
p: $node, $name, $lnode? Add a new ancestor to $node with raw name = $name and node = lnode.
pr: $inheritance node. Returns the name of the inherited node. This checks for existence of a linked node and will use the "raw" name if it is not found.
Parameters: out listref, node Recursively searches for nodes that inherit from this one, returning a list of inheriting nodes in the list ref.
Parameter: node Returns: 0 on fail Checks if the node has an inheritor that is defined within the current library. This is useful for drawing the class hierarchy, since you don't want to display classes that have no relationship with classes within this library. NOTE: perhaps we should cache the value to reduce recursion on subsequent calls.
Parameters: hashref outlist, node, $type Fills the outlist hashref with all the methods of outlist, recursively traversing the inheritance tree. If type is not specified, it is assumed to be "method"
Parameters: root, node, name Looks for nodes of the same name as the parameter, in its parent and the parent's ancestors. It returns a node if it finds one.
Parameters: parent, child Attaches child to the parent, setting Access, Kids and KidHash of respective nodes.
Parameters: node, outlist ref fills outlist with a sorted list of all direct, non-external compound children of node.
Parameters: node, deep Returns: none Does a recursive dump of the node and its children. If deep is set, it is used as the recursion property, otherwise "Kids" is used.
Parameters: rootnode Interactive testing of referencing system. Calling this will use the readline library to allow interactive entering of identifiers. If a matching node is found, its node name will be printed.
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.