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

Next revision
Previous revision
research:jtransformer:api:java:pefs:3.0:whilet [2013/07/11 00:14]
127.0.0.1 external edit
research:jtransformer:api:java:pefs:3.0:whilet [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== whileT(#id, #parent, #encl, #condition, #​body) ​ ===
 +
 +Represents the while statement.
 +
 +Formerly called whileLoopT: Renamed since JTransformer 2.3.1_200804151649.
 +
 +=== 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 element.
 +
 +**#​condition:​** [[plastexpression|expressionType]]\\ ​
 +ID of the expression of this while statement.
 +
 +**#body** [[plaststatement|statementType]]\\ ​
 +ID of the body of this while statement.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +void expression(){
 + while (true){ ​       // corresponding code line to whileT
 + ...
 + }
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +methodT(#​enclMethod,​ ..., '​expression',​ [], type(basic, void, 0), [], #parent).
 +blockT(#​parent,​ #​enclMethod,​ #​enclMethod,​ [#id]).
 +whileT(#id, #parent, #​enclMethod,​ #condition, #body).
 +literalT(#​condition,​ #id, #​enclMethod,​ type(basic, boolean, 0), '​true'​).
 +blockT(#​body,​ #id, #​enclMethod,​ [...]).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​whileT,​[
 +     ​ast_arg(id, ​    ​mult(1,​1,​no ), id,   ​[whileT]),​ % <-- 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/3.0/whilet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019