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:3.0:breakt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== breakT(#id, #parent, #encl, '​label',​ #​target) ​ ===
 +
 +Represents the break 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]]\\ ​
 +The ID of the fact that represents the enclosing element.
 +
 +**'​label':​** atom\\ ​
 +If label is '​null'​ break leaves the enclosing block. Otherwise the block marked with this label. ​
 +
 +**#target** [[plaststatement|statement]]\\ ​
 +ID of the statement where to jump.
 +In case of an switch block the target is the switch statement.
 +
 +=== Sample Java Source ===
 +
 +==  ==
 +<Code lang-java>​
 +void f(){
 +   ​while(true){
 +       ​if(true){
 +          break;
 +       }
 +   }
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​Method,#​Class,'​f',​type(basic,​void,​0),​[],#​BlockM),​
 +...
 +whileT(#​While,​ #Enclosing, #Method, #LiteralW, #BlockW),
 +...
 +ifT(#If, #BlockW, #Method, #Literal, #Block, '​null'​),​
 +literalT(#​Literal,​ #If, #Method, type(basic, boolean, 0), '​true'​),​
 +blockT(#​Block,​ #If, #Method, [#Break]),
 +breakT(#​Break,​ #Block, #Method, '​null',​ #While).
 +
 +</​Code>​
 + 
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​breakT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [breakT]), % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT]),​
 +     ​ast_arg(label, ​  ​mult(1,​1,​no ), attr,​[atom]),​
 +     ​ast_arg(target, ​ mult(0,​1,​no), ​ id,  [statementType])
 +]).
 +</​Code>​
 +
  
research/jtransformer/api/java/pefs/3.0/breakt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019