Packages, Compilation Units and Imports | Annotations | Declarations | Expressions | Statements | Body Level Attributes |
|---|
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])
]).


