SDA SE Wiki

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

User Tools

Site Tools



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

SEWiki, © 2025