Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
represents the array access expression.
#id: id
the unique id assigned to this fact.
#parent: id
ID of the parent node.
#encl: methodT, constructorT, classInitializerT, fieldt
ID of the fact that represents the enclosing element.
#index: expression
ID of the index expression of this array access expression.
#indexed: expression
ID of the array expression of this array access expression.
void myArrayAcces(){ int[] array = {1, 3, 8}; array[0]= 9; //corresponding code line to indexedT }
methodT(#encl, ..., 'myArrayAcces', [], type(basic, void, 0), [], ...). assignT(#parent, ..., #encl, #id, ...). indexedT(#id, #parent, #encl, #index, #indexed). literalT(#index, #id, #encl, type(basic, int, 0), '0'). identT(#indexed, #id, #encl, 'array', ...).
ast_node_def('Java',indexedT,[ ast_arg(id, mult(1,1,no ), id, [indexedT]), % <-- convention!!! ast_arg(parent, mult(1,1,no ), id, [id]), % <-- convention!!! ast_arg(encl, mult(1,1,no ), id, [methodT, constructorT, classInitializerT, fieldT]), ast_arg(index, mult(1,1,no ), id, [expressionType]), ast_arg(indexed, mult(1,1,no ), id, [expressionType]) ]).