ANTAREX API

Clava API

LARA API

LARA Common Language API

(.js)
laraImport("clava.ClavaCode");

(.lara)
import clava.ClavaCode;

ClavaCode

ClavaCode

ClavaCode

Utility methods related with the source code.


Static Members

_renameStaticDeclarations

_renameStaticDeclarations($file, staticVerification)

Parameters

$file: unknown
staticVerification: unknown

getFunctionDefinition

getFunctionDefinition(functionName, isSingleFunction)

Returns the function definitions in the program with the given name.

Parameters

functionName: string - The name of the function to find
isSingleFunction: boolean - If true, ensures there is a single definition with the given name

Returns

$function[]|$function - An array of function definitions, or a single function is 'isSingleFunction' is true

isExecutedOnce

isExecutedOnce($statement)

Tries to statically detect if a statement is executed only once.

Restrictions:
- Does not take into account runtime execution problems, such as exceptions;
- Does not detect if the function is called indirectly through a function pointer;

Parameters

$statement: unknown

Returns

any - true if it could be detected, within the restrictions, that the statement is only executed once.

toSingleFile

toSingleFile(fileOrBaseFolder, optionalFile)

Writes the code corresponding to the current AST as a single file.

Parameters

fileOrBaseFolder: unknown
optionalFile: unknown

toSingleFileCode

toSingleFileCode()

Generates code for a single fime corresponding to the current AST.

Returns

String - the code of the current AST as a single file.