whileT(#id, #parent, #encl, #condition, #body)

Represents the while statement.

Formerly called whileLoopT: Renamed since JTransformer 2.3.1_200804151649.

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: expressionType
ID of the expression of this while statement.

#body statementType
ID of the body of this while statement.

Sample Java Source

void expression(){
	while (true){        // corresponding code line to whileT
		...
	}
}

Its PEF Representation

methodT(#enclMethod, ..., 'expression', [], type(basic, void, 0), [], #parent).
blockT(#parent, #enclMethod, #enclMethod, [#id]).
whileT(#id, #parent, #enclMethod, #condition, #body).
literalT(#condition, #id, #enclMethod, type(basic, boolean, 0), 'true').
blockT(#body, #id, #enclMethod, [...]).

AST Specification

ast_node_def('Java',whileT,[
     ast_arg(id,     mult(1,1,no ), id,   [whileT]), % <-- 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(body,   mult(1,1,no ), id,   [statementType])
]).
Last modified: 2014/04/13 08:04
 
*