Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Represents the catcher in the try-catch statement. (See also: tryT)
#id: id
the unique ID assigned to this fact.
#parent: id
ID of the containing try statement.
#enclMethod: methodT, constructorT, classInitializerT
ID of the enclosing method declaration.
#param: paramT
ID of the declaration of an exception object.
#body: blockT
ID of the block containing the statements of this catch block part.
void myTryCatch(){ String filename = "/Users/myfilename"; try { new File(filename).createNewFile(); } catch (IOException e) {//corresponding code line to catchT System.out.println("Unable to create "+filename+": "+e.getMessage()); } }
methodT(#Method, #Class, 'main', ...), ... tryT(#Try, _, #Method, _, [#Catch], 'null'), %Try ... catchT(#Catch, #Try, #Method, #Param, #Block), %Catch paramT(#Param, #Catch, ...), blockT(#Block, #Catch, #Method, ...), ...
ast_node_def('Java',catchT,[ ast_arg(id, mult(1,1,no ), id, [catchT]), % <-- convention!!! ast_arg(parent, mult(1,1,no ), id, [id]), % <-- convention!!! ast_arg(encl, mult(1,1,no ), id, [methodT, constructorT, classInitializerT]), ast_arg(param, mult(1,1,no ), id, [paramT]), ast_arg(body, mult(1,1,no ), id, [blockT]) ]).