SDA SE Wiki

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

User Tools

Site Tools



assertT(#id, #parent, #enclMethod, #condition, #msg)

Represents the assert statement (Java 1.4).

Attributes

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

#parent: id
ID of the father node in the AST, typically a block.

#enclMethod: methodT, constructorT, classInitializerT
ID of the enclosing method declaration.

#condition: expression
boolean expression's ID.

#msg: expression, null
ID of the expression that is to be given to assertionerror.

Sample Java Source

assertionDemo(){
   assert m() == 0 : "Error: ...";//corresponding code line to assertT
}

Its PEF Representation

assertT(#id, #parent, #enclMethod, #condition, #msg).                                 
blockT(#parent, #enclMethod, #enclMethod, [#id]).                        //Parent Node
methodT(#enclMethod, ..., 'assertionDemo', [], type(basic, void, 0), [], #parent).//Enclosing Method
operationT(#condition, #id, #enclMethod, [..., ...], '==', 0).           //Condition
literalT(#msg, #id, #enclMethod, type(class, Type1, 0), 'Error: ...').   //Message 

AST Specification

ast_node_def('Java',assertT,[
     ast_arg(id,      mult(1,1,no ), id,  [assertT]), % <-- convention!!!
     ast_arg(parent,  mult(1,1,no ), id,  [id]), 
     ast_arg(encl,    mult(1,1,no ), id,  [methodT, constructorT, classInitializerT]),
     ast_arg(expr,    mult(0,1,no),  id,  [expressionType]),
     ast_arg(msg,     mult(0,1,no),  id,  [expressionType,nullType])
]).
research/jtransformer/api/java/pefs/4.0/assertt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019