SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

research:jtransformer:api:java:pefs:4.2:catcht [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== catchT (#id, #parent, #​enclMethod,​ #param, #​body) ​ ===
 +
 +
 +Represents the catcher in the try-catch statement. (See also: [[tryt|tryT]])
 +
 +=== Attributes ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the containing try statement.
 +
 +**#​enclMethod:​** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[classinitializert|classInitializerT]]\\ ​
 +ID of the enclosing method declaration.
 +
 +**#param:** [[paramt|paramT]]\\ ​
 +ID of the declaration of an exception object.
 +
 +**#body:** [[blockt|blockT]]\\  ​
 +ID of the block containing the statements of this catch block part.
 +
 +
 +=== Sample Java Source===
 +==  ==
 +<Code lang-java>​
 +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());​
 + }
 +}
 +
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​Method,​ #Class, '​main',​ ...),
 +                 ...
 +tryT(#Try, _, #Method, _, [#Catch], '​null'​), ​  %Try
 + ...
 +catchT(#​Catch,​ #Try, #Method, #Param, #​Block), ​    ​%Catch
 +paramT(#​Param,​ #Catch, ...),
 +blockT(#​Block,​ #Catch, #Method, ...),
 + ...
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(catchT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [catchT]),
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]),
 +     ​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])
 +]).
 +</​Code>​
  
research/jtransformer/api/java/pefs/4.2/catcht.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019