Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Represents the throw 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.
#expr: expression
ID of the exception.
void myArrayAccess(int i) throws MyException{ if (i > 2){ throw new MyException("index out of range"); // corresponding code line to throwT } }
throwT(#id, #parent, #enclMethod, #expr). blockT(#parent, ..., #enclMethod, [#id]). methodT(#enclMethod, ..., 'myArrayAccess', [V8], type(basic, void, 0), ..., ...). newClassT(#expr, #id, #enclMethod, ..., ..., ..., 'null', 'null').
ast_node_def('Java',throwT,[ ast_arg(id, mult(1,1,no ), id, [throwT]), % <-- 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]) ]).