blockT(#id, #parent, #enclMethod, [#statement_1,...])

Represents the block statement.

Attributes

#id: id
the unique ID assigned to this fact.

#parent: id
ID of the parent node.

#enclMethod: methodT, constructorT, classInitializerT
the ID of the fact that represents the enclosing element.

[#statement_1,…]: statement
List of the statements in this block.

Sample Java Source

method() {                                                 // Enclosing method
    f(1,2);                                    //corresponding code line to blockT  
}

Its PEF Representation

methodT(#Method, #Class, 'method', [], type(basic, void, 0), [], #Block),
blockT(#Block, #Method, #Method, [#Exec]),
execT(#Exec, #Block, #Method, #Call),
callT(#Call, #Exec, #Method, 'null', 'f', [#Literal1, #Literal2], _),
literalT(#Literal1, #Call, #Method, type(basic, int, 0), '1'),
literalT(#Literal2, #Call, #Method, type(basic, int, 0), '2'),

AST Specificaton

ast_node_def('Java',blockT,[
     ast_arg(id,      mult(1,1,no ), id,  [blockT]), % <-- convention!!!
     ast_arg(parent,  mult(1,1,no ), id,  [id]), % <-- convention!!!
     ast_arg(encl,    mult(1,1,no ), id,  [methodT, constructorT, classInitializerT]),
     ast_arg(stmts,   mult(0,*,ord), id,  [statementType])
]).
Last modified: 2014/11/17 21:49
*