SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools



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, constructorT, 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 statement
ID of the statement where to jump. In case of an switch block the target is the switch statement.

Sample Java Source

void f(){
   while(true){
       if(true){
          break;
       }
   }
}

Its PEF Representation

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).

AST Specification

ast_node_type_spec(breakT,[
     ast_arg(id,      mult(1,1,no ), id,  [breakT]),
     ast_arg(parent,  mult(1,1,no ), id,  [id]),
     ast_arg(encl,    mult(1,1,no ), id,  [methodT, constructorT, classInitializerT]),
     ast_arg(label,   mult(1,1,no ), attr,[atomic]),
     ast_arg(target,  mult(0,1,no),  id,  [statementType])
]).
research/jtransformer/api/java/pefs/4.2/breakt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024