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:dowhilet [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
 +
 +=== doWhileT(#​id,​ #parent, #​enclMethod,​ #condition, #​body) ​ ===
 +
 +Represents the do statement.
 +
 +===Attributes===
 +== ==
 +**#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 element.
 +
 +**#​condition:​** [[plastexpression|expression]]\\ ​
 +ID of the expression of the loop condition of this //do// statement.
 +
 +**#body** [[plaststatement|statement]]\\ ​
 +ID of the body of this //do// statement.
 +
 +
 +=== Sample Java Source ===
 +==  ==
 +<Code lang-java>​
 +void main() {
 +  int i = 0;
 +  do{
 +   i++;
 +  }while(i<​10);​
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​Method,​ _, '​main',​ [], type(basic, void, 0), [], #Block),
 +...
 +doWhileT(#​DoWhile,​ #Block, #Method, #Operation, #BlockDo),
 +blockT(#​BlockDo,​ #DoWhile, #Method, [...]),
 +...
 +operationT(#​Operation,​ #DoWhile, #Method, [...], '<',​ 0),
 +...
 +</​Code>​
 +
 + 
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​doWhileT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [doWhileT]),​ % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT]),​
 +     ​ast_arg(cond, ​   mult(1,1,no ), id,  [expressionType]),​
 +     ​ast_arg(body, ​   mult(1,1,no ), id,  [statementType]) ​    
 +]).
 +</​Code>​
  
research/jtransformer/api/java/pefs/2.9/dowhilet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019