Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Java 5 Syntax Element - supported since JTransformer 2.3.
Represents the for each statement.
#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.
#param, paramT
ID of the local parameter of this for statement.
#expression expression
ID of the expression (of type list or array) in this for statement.
#body: statement
ID of the body of this for statement.
int[] array = {1, 2, 3}; for (int i : array) { ... }
localT(#Array, #Block, #Method, type(basic, int, 1), array, #NewArray) foreachT(#ForEach, #Block, #Method, #Param, #Ident, #BlockFor), paramT(#Param, #ForEach, type(basic, int, 0), 'd'), identT(#Ident, #ForEach, #Method, 'array', #Array), blockT(#BlockFor, #ForEach, #Method, [...]), ...
ast_node_def('Java',foreachT,[ ast_arg(id, mult(1,1,no ), id, [foreachT]), ast_arg(parent, mult(1,1,no ), id, [id]), ast_arg(encl, mult(1,1,no ), id, [methodT, constructorT, classInitializerT]), ast_arg(inits, mult(1,1,no ), id, [paramT]), ast_arg(expr, mult(1,1,no ), id, [expressionType]), ast_arg(body, mult(1,1,no ), id, [blockT,statementType]) ]).