Tcllib里的page
其实不是一个package,而是一个命令行工具,用于各种文本格式之间的转换。
基本上看下面的例子就有点概念了
set tcllib = /some/path/to/tcllib setenv TCLLIBPATH $tcllib/modules setenv PAGE_PLUGINS $tcllib/modules/page/plugins echo 'root {} {} a 0 {} d 3 {} e 3 {} b 0 {} c 0 {}' | \ $tcllib/apps/page -r treeser -w tree
上面的例子会输出下面的内容:
info [Serialized Tree] Reading grammar from stdin info [Tree Dump] Writing to stdout root <> a <> d <> e <> b <> c <>
输入的文本是struct::tree
的表示,输出的是另一种形式的tree.
所表示的struct::tree
如下:
+- d +- a -+ root -+- b +- e +- c