ANTAREX API

Clava API

LARA API

LARA Common Language API

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

(.lara)
import clava.ClavaType;

ClavaType

ClavaType

ClavaType

Utility methods related with the type join points.


Static Members

asExpression

asExpression($expression, [isOptional = false])

Makes sure the given parameter is an expression join point.

Parameters

$expression: String|$expr - If a string, returns a literal expression with the code of the string. Otherwise, returns $expression
isOptional: boolean - If false and $expression is undefined, throws an exception. Otherwise, returns undefined if $expression is undefined. (optional)

asScope

asScope(code)

Makes sure the given parameter is a scope join point.

Parameters

code: String|$jp - If a string, returns a literal statement with the code of the string. Otherwise, returns $statement

Returns

$scope

asStatement

asStatement(code, [isOptional = false])

Makes sure the given parameter is a statement join point.

Parameters

code: String|$jp - If a string, returns a literal statement with the code of the string. Otherwise, tries to transform the given node to a $statement
isOptional: boolean - If false and code is undefined, throws an exception. Otherwise, returns undefined if code is undefined. (optional)

asType

asType($type)

Makes sure the given parameter is a type join point.

Parameters

$type: String|$type - If a string, returns a literal type with the code of the string. Otherwise, returns $type

getVarrefsInTypeCopy

getVarrefsInTypeCopy(type, varrefs, $type)

Parameters

type: any - a type join point that will be visited looking for $expr join points. Any visited nodes in the type (e.g., desugar) will be copied, so that the returned varrefs can be safely modified.
varrefs: any - an array (possibly empty) where the $varref join points found in the given type will be stored
$type: any

Returns

any - a copy of the given $type, to which the varrefs refer to

visitExprInTypeCopy

visitExprInTypeCopy(type, exprFunction, $type)

Parameters

type: any - the type to visit
exprFunction: any - a function that receives an $expr join point
$type: any

Returns

any - the $type after applying the given exprFunction to its $expr nodes. If any of the fields of the type is visited, a copy of the type is returned.