KADABRA API

LARA API

LARA Common Language API

(.js)
laraImport("weaver.Ast");

(.lara)
import weaver.Ast;

Ast

Ast

Ast

Contains utility methods related to the AST provided by the LARA compiler.


Static Members

getChild

getChild(astNode, index)

Parameters

astNode: any
index: any

Returns

Object - the child of the node at the given index.

getChildren

getChildren(astNode)

Parameters

astNode: any

Returns

Object[] - an array with the children AST nodes of the given AST node.

getDescendants

getDescendants(astNode, accum)

Parameters

astNode: any
accum: any

Returns

Object[] - an array with the descendants AST nodes of the given AST node.

getNumChildren

getNumChildren(astNode)

Parameters

astNode: any

Returns

integer - the number of children of the AST node.

getParent

getParent(astNode)

Parameters

astNode: any

Returns

Object - the parent AST node of the given AST node.

root

root()

Returns

Object - the current root node of the AST.

toWeaverJoinPoint

toWeaverJoinPoint(astNode)

Converts the given AST node to the native join point supported by the current LARA compiler.

Parameters

astNode: any

Returns

$jp - a native join point, as opposed to the join point of the current language specification.