Packages, Compilation Units and Imports | Annotations | Declarations | Expressions | Statements | Body Level Attributes |
|---|
catchT (#id, #parent, #enclMethod, #param, #body)
Represents the catcher in the try-catch statement. (See also: tryT)
Attributes
#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.
Sample Java Source
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()); } }
Its PEF Representation
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 Specification
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])
]).


