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:assignt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== assignT(#​id,​ #parent, #encl, #lhs, #​expr) ​ ===
 +
 +Represents the assignment expression.
 +
 +===Attributes==
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +the ID of the parent node.
 +
 +**#encl:** [[methodt|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT |classInitializerT]],​ [[fieldt|fieldT]]\\ ​
 +the ID of the fact that represents the enclosing element.
 +
 +**#lhs:** [[getfieldt|getFieldT]],​ [[identt|identT]],​ [[indexedt|indexedT]]\\ ​
 +ID of the left hand side of this assignment expression. ​
 +
 +**#exprt:** [[plastexpression|expression]]\\ ​
 +ID of the right hand side expression.
 +
 +=== Sample Java Source ==
 +==  ==
 +
 +<Code lang-java>​
 +void assign(){
 +        int i = 5;
 + int j = 9;
 + i = i + j; //​corresponding code line to assignT
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +
 +==  ==
 +<Code lang-prolog>​
 +assignT(#​id,​ #parent, #encl, #lhs, #expr).
 +execT(#​parent,​ ..., #encl, #id).
 +methodT(#​encl,​ ..., '​assign',​ [], type(basic, void, 0), [], ...).
 +identT(#​lhs,​ #id, #encl, '​i',​ ...).
 +operationT(#​expr,​ #id, #encl, [..., ...], '​+',​ 0).
 +</​Code>​
 + 
 +===AST Specification===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​assignT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [assignT]), % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT,​ fieldT]),
 +     ​ast_arg(lhs, ​    ​mult(1,​1,​no ), id,  [getFieldT, identT, indexedT]),
 +     ​ast_arg(expr, ​   mult(1,1,no ), id,  [expressionType])
 +]).
 +</​Code>​
 +
  
research/jtransformer/api/java/pefs/2.9/assignt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019