SDA SE Wiki

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

User Tools

Site Tools



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

represents the array access expression.

Arguments

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

Sample Java Code

void myArrayAcces(){
	int[] array = {1, 3, 8};
	array[0]= 9;                  //corresponding code line to indexedT
}

Its PEF Representation

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 Specification

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])
]).
research/jtransformer/api/java/pefs/2.9/indexedt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025