Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
represents the array access expression.
Note: 'ID of …' means 'ID of the fact that represents …'.
#id: id
ID of this fact.
#parent: id
ID of the parent node.
#encl: methodT, constructorT, classInitializerT, fieldt
ID of the method, constructor, or initializer1) that contains this array access.
#index: expression
ID of the index expression (Example: In a[i]
i is the index expression).
#arrayRef: expression
ID of the reference to the accessed array (Example: In a[i]
a is the array reference expression).
void myArrayAcces(){ int[] a = {1, 3, 8}; a[0]= 9; // <-- represented by indexedT fact below }
methodT(#encl, ..., 'myArrayAcces', [], type(basic, void, 0), [], ...). assignT(#parent, ..., #encl, #id, ...). indexedT(#id, #parent, #encl, #index, #arrayRef). % <-- a[0] literalT(#index, #id, #encl, type(basic, int, 0), '0'). % <-- 0 identT(#arrayRef, #id, #encl, 'a', ...). % <-- a
ast_node_type_spec(indexedT,[ ast_arg(id, mult(1,1,no ), id, [indexedT]), ast_arg(parent, mult(1,1,no ), id, [id]), 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]) ]).