SDA SE Wiki

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

User Tools

Site Tools



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, constructorT, classInitializerT
ID of the enclosing element.

#condition: expression
ID of the expression of the loop condition of this do statement.

#body statement
ID of the body of this do statement.

Sample Java Source

void main() {	
  int i = 0;
  do{
	  i++;
  }while(i<10);
}

Its PEF Representation

methodT(#Method, _, 'main', [], type(basic, void, 0), [], #Block),
...
doWhileT(#DoWhile, #Block, #Method, #Operation, #BlockDo),
blockT(#BlockDo, #DoWhile, #Method, [...]),
...
operationT(#Operation, #DoWhile, #Method, [...], '<', 0),
...

AST Specification

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])     
]).
research/jtransformer/api/java/pefs/2.9/dowhilet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024