SDA SE Wiki

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

User Tools

Site Tools



returnT(#id, #parent, #encl, #expr)

Represents the return statement.

Arguments

#id: id
the unique ID assigned to this fact.

#parent: id
ID of the parent node.

#encl: methodT, constructorT, classInitializerT
ID of the enclosing method declaration.

#expr: expression, null
ID of the expression of this return statement, or null if there is none.

Sample Java Code

int myFunction(){
	int i = 0;
	return i;// corresponding code line to returnT
}

Its PEF Representation

methodT(#enclMethod, ..., 'myFunction', [], type(basic, int, 0), [], #parent).
blockT(#parent, #enclMethod, #enclMethod, [..., #id]).
returnT(#id, #parent, #enclMethod, #expr).
identT(#expr, #id, #enclMethod, 'i', ...).

AST Specification

ast_node_def('Java',returnT,[
     ast_arg(id,     mult(1,1,no ), id,  [execT]), % <-- convention!!!
     ast_arg(parent, mult(1,1,no ), id,  [id]), % <-- convention!!!
     ast_arg(encl,   mult(1,1,no ), id,  [methodT, constructorT, classInitializerT]),
     ast_arg(expr,   mult(1,1,no ), id,  [expressionType,nullType])
]).
research/jtransformer/api/java/pefs/2.9/returnt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024