Slide 11 : 18
LAML transformation functions
Below we list the most important LAML transformation and AST access functions
AST traversal and transformation functions
(find-asts ast el-name [transform-fn])
Traverses ast to find all ASTs with root el-name, and transform these if transform-fn is provided
(find-first-ast ast el-name [transform-fn])
Locates the first AST in ast with root el-name, and transform it as above
(transform-ast-list content-list . transform-spec)
Transforms each element in content-list, by use of a list of possible transformation specifications
AST access functions
(ast-subtree ast el-name [n])
Returns the n'th subtree of ast with element-type el-name
(ast-attribute ast attr-name [default-value])
Returns the value of attr-name in ast
(ast-text ast)
Aggregates the textual contents of ast
A collection of simple, convenient functions
If you don't like them - just make your own