SE & SDA Wiki

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

User Tools

Site Tools



ifT (#id, #parent, #encl, #condition, #thenPart, #elsePart)

Represents the if 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 element.

#condition: expression
ID of the expression in this if statement.

#thenPart: statement
ID of the “then” part of this if statement.

#elsePart: statement, null
ID of the “else” part of this if statement, or 'null' if this if statement has no “else” part.

Sample Java Code

void myIf(){
	int i =0;
	if (i > 0)//corresponding code line to ifT
		i++;
}

Its PEF Representation

methodT(#enclMethod, ..., 'myIf', [], type(basic, void, 0), [], #parent).
blockT(#parent, #enclMethod, #enclMethod, [..., #id]).
ifT(#id, #parent, #enclMethod, #condition, #thenPart, 'null').

operationT(#condition, #id, #enclMethod, [..., ...], '>', 0).
execT(#thenPart, #id, #enclMethod, ...).

AST Specification

ast_node_def('Java',ifT,[
     ast_arg(id,      mult(1,1,no ), id,  [ifT]), % <-- convention!!!
     ast_arg(parent,  mult(1,1,no ), id,  [id]), % <-- convention!!!
     ast_arg(encl,    mult(1,1,no ), id,  [methodT, constructorT, classInitializerT]),
     ast_arg(cond,    mult(1,1,no ), id,  [expressionType]),
     ast_arg(then,    mult(1,1,no ), id,  [blockT,statementType]),
     ast_arg(else,    mult(0,1,no), id,   [nullType,blockT,statementType])
]).
research/jtransformer/api/java/pefs/3.0/ift.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2018