to_blocks: Convert an ASTNode Object to Basic Blocks

Description Usage Arguments Details Value

View source: R/to_blocks.R

Description

This function converts an ASTNode object or a quoted R expression into a list of basic blocks. When the root of the AST is a Function object, the CFG is built for its body.

Usage

1
to_blocks(node, in_place = FALSE, ssa = TRUE, insert_return = TRUE)

Arguments

node

A quoted R expression or an abstract syntax tree.

in_place

(logical) Operate on the node in place? If TRUE, the node will be modified.

ssa

(logical) Also convert to static single assignment form?

insert_return

(logical) Apply insert_return() to the node before generating the CFG?

Details

Each basic block contains a sequence of non-branching program instructions. Each basic block ends with an instruction that branches to one or more other basic blocks.

Value

A Function node with the control flow graph in its $cfg field.


nick-ulle/ast documentation built on July 17, 2018, 4:16 a.m.