The commands as described in the script library are a procedural
interface to abstract syntax trees and their nodes. Access is done
via tree handles (and node indices).
Through the use of command aliases an object oriented interface is
available as well. So, under the assumption
that
- tree is a variable containing a tree handle.
- n is a variable containing a node index.
- node is a variable containing the node handle
for the node described by tree and n.
the mapping is defined as
- $node == $tree.n$n
-
$tree method args... ==
::parsetools::ast::TreeCmd $tree method args... ==
::parsetools::ast::Tmethod $tree args...
-
$node method args... ==
::parsetools::ast::NodeCmd $tree $n method args... ==
::parsetools::ast::Nmethod $tree $n args...
Example
|
$node parent
==>
::parsetools::ast::NodeCmd $tree $n parent
==>
::parsetools::ast::Nparent $tree $n
|
|
|