Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Represents the assert statement (Java 1.4).
#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.
assertionDemo(){ assert m() == 0 : "Error: ...";//corresponding code line to assertT }
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_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]) ]).