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:2.9:returnt [2018/05/09 01:59]
research:jtransformer:api:java:pefs:2.9:returnt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
  
 +=== returnT(#​id,​ #parent, #encl, #​expr) ​ ===
 +== ==
 +Represents the return statement.
 +
 +=== Arguments ===
 +== == 
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#encl:** [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]]\\ ​
 +ID of the enclosing method declaration.
 +
 +**#expr:** [[plastexpression|expression]],​ null\\ ​
 +ID of the expression of this return statement, or null if there is none.
 +
 +=== Sample Java Code ===
 +== ==
 +<Code lang-java>​
 +int myFunction(){
 + int i = 0;
 + return i;// corresponding code line to returnT
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +methodT(#​enclMethod,​ ..., '​myFunction',​ [], type(basic, int, 0), [], #parent).
 +blockT(#​parent,​ #​enclMethod,​ #​enclMethod,​ [..., #id]).
 +returnT(#​id,​ #parent, #​enclMethod,​ #expr).
 +identT(#​expr,​ #id, #​enclMethod,​ '​i',​ ...).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​returnT,​[
 +     ​ast_arg(id, ​    ​mult(1,​1,​no ), id,  [execT]), % <-- 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,​nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/2.9/returnt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019