SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools



indexedT(#id, #parent, #encl, #index, #arrayRef)

represents the array access expression.

Arguments

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).

Sample Java Code

void myArrayAcces(){
	int[] a = {1, 3, 8};
	a[0]= 9;     // <-- represented by indexedT fact below
}

Its PEF Representation

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 Specification

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])
]).
1)
Either class or field initializer
research/jtransformer/api/java/pefs/4.0/indexedt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025