ast_attr(node, name) returns a field or derived attribute of a codegen
node, as the Python attribute node.name: for example
ast_attr(v, "symbol"), ast_attr(block, "left_hand_sides") or
ast_attr(float64, "eps"). ast_kwargs(node) returns the fields as a
named list (Token.kwargs()), and ast_func(node) the constructor, so
do.call(ast_func(node), sym_args(node)) rebuilds the node.
ast_getitem(p, i) indexes a Pointer(), giving an Element().
Usage
ast_attr(node, name)
ast_kwargs(node, exclude = character(), apply = NULL)
ast_func(node)
ast_getitem(p, key)
attr_params(node, looking_for)Arguments
- node
A codegen node.
- name
The attribute name.
- exclude
Field names to leave out.
- apply
Optional function applied to every value.
- p
A
Pointer().- key
An index or a list of indices.
- looking_for
The attribute name.