Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Represents the array creation expression.
Optionally marked with an omitArrayDeclarationT.
#id: id
the unique ID assigned to this fact.
#parent: id
ID of the parent node.
#encl: methodT, constructorT, classInitializerT, fieldT, classT, annotationMemberT, annotationT
ID of the fact that represents the enclosing element.
[#dim_1,…]: expression
list of dimension expressions.
[#elem_1,…]: expression, annotationExpressionType
list of initial elements of this array.
TYPE: typeterm
type of this array.
void myArrayAcces(){ int[] array = {1, 3, 8};//corresponding code line to newArrayt array[0]= 9; }
methodDefT(#encl, ..., 'myArrayAcces', [], type(basic, void, 0), [], ...). localDefT(#parent, ..., #encl, type(basic, int, 1), 'array', #id). newArrayT(#id, #parent, #encl, [], [#elem_1, #elem_2, #elem_3], type(basic, int, 1)). omitArrayDeclarationT(#id). literalT(#elem_1, #id, #encl, type(basic, int, 0), '1'). literalT(#elem_2, #id, #encl, type(basic, int, 0), '3'). literalT(#elem_3, #id, #encl, type(basic, int, 0), '8').
ast_node_def('Java',newArrayT,[ ast_arg(id, mult(1,1,no ), id, [newArrayT]), % <-- convention!!! ast_arg(parent, mult(1,1,no ), id, [id]), % <-- convention!!! ast_arg(encl, mult(1,1,no ), id, [methodT, constructorT, classInitializerT, fieldT, classT, annotationMemberT, annotationT]), ast_arg(dims, mult(1,*,ord), id, [expressionType]), ast_arg(elems, mult(0,*,ord), id, [expressionType,annotationExpressionType]), ast_arg(type, mult(1,1,no ), attr, [typeTermType]) ]).