ANTAREX API

Clava API

LARA API

LARA Common Language API

(.js)
laraImport("clava.code.Outliner");

(.lara)
import clava.code.Outliner;

Outliner

Constructor

Outliner

new Outliner()

Instance Members

checkOutline

checkOutline(begin, end)

Verifies if a code region can undergo function outlining.
This check is performed automatically by the outliner itself, but it can be invoked manually if desired.

Parameters

begin: statement - the first statement of the outlining region
end: statement - the last statement of the outlining region

Returns

any - true if the outlining region is valid, false otherwise

constructor

constructor()

outline

outline(begin, end)

Applies function outlining to a code region delimited by two statements.
Function outlining is the process of removing a section of code from a function and placing it in a new function.
The beginning and end of the code region must be at the same scope level.

Parameters

begin: statement - the first statement of the outlining region
end: statement - the last statement of the outlining region

Returns

any - an array with the joinpoints of the outlined function and the call to it. These values are merely references, and all changes have already been committed to the AST at this point

outlineWithName

outlineWithName(begin, end, functionName)

Applies function outlining to a code region delimited by two statements.
Function outlining is the process of removing a section of code from a function and placing it in a new function.
The beginning and end of the code region must be at the same scope level.

Parameters

begin: statement - the first statement of the outlining region
end: statement - the last statement of the outlining region
functionName: string - the name to give to the outlined function

Returns

any - an array with the joinpoints of the outlined function and the call to it. These values are merely references, and all changes have already been committed to the AST at this point

setDefaultPrefix

setDefaultPrefix(prefix)

Sets the prefix used for the autogenerated names of the outlined functions

Parameters

prefix: string - the prefix to be used

setVerbosity

setVerbosity(verbose)

Sets the verbosity of the outliner, with false being the equivalent of a silent mode (true is the default)

Parameters

verbose: boolean - the verbosity of the outliner