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_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])
]).
Last modified: 2014/04/10 04:53
 
*