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:operationt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== operationT (#id, #parent, #encl, [#​arg1,​...],​ '​operatorName',​ pos)  ===
 +
 +Represents the infix expression, postfix expression and prefix expression.
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#​encl:​** ​ [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]],​ [[fieldt|fieldT]],​ [[classt|classT]]\\ ​
 +ID of the fact that represents the enclosing element. (classT if used in a [[memberValueT|memberValueT]])
 +
 +**[#​arg1,​...]:​** [[plastexpression|expression]]\\ ​
 +list of the operands of this expression.
 +
 +**operatorName:​** atom\\ ​
 +the operator of this expression (!,​+,​-,/,​*,<<,​...).
 +
 +**pos:** number\\ ​
 +postfix expression: 1\\ 
 +infix expression: 0\\  ​
 +prefix expression: -1\\ \\ 
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +void expression(){
 + int i = 0;
 + i++;                           //​corresponding code line to operationT
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​encl,​ ..., '​expression',​ [], type(basic, void, 0), [], ...).
 +execT(#​parent,​ ..., #encl, #id).
 +operationT(#​id,​ #parent, #encl, [#arg1], '​++',​ 1).
 +identT(#​arg1,​ #id, #encl, '​i',​ ...).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​operationT,​[
 +     ​ast_arg(id, ​    ​mult(1,​1,​no ), id,  [operationT]),​ % <-- convention!!!
 +     ​ast_arg(parent,​ mult(1,1,no ), id,  [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​  ​mult(1,​1,​no ), id,  [methodT, constructorT,​ classInitializerT,​fieldT,​classT]),​
 +     ​ast_arg(args, ​  ​mult(1,​1,​ord),​ id,  [expressionType]),​
 +     ​ast_arg(op, ​    ​mult(1,​1,​no ), attr,  [atom]),
 +     ​ast_arg(pos, ​   mult(1,1,no ), attr,  [number])
 +]).
 +</​Code>​
  
research/jtransformer/api/java/pefs/2.9/operationt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019