SDA SE Wiki

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

User Tools

Site Tools



typeTestT (#id, #parent, #encl, #condition, #expression)

represents the instanceof expression.

Arguments

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

#parent: id
ID of the parent node.

#encl: methodT, constructorT, classInitializerT
ID of the fact that represents the enclosing method.

#condition: typeTerm
right operand of this instanceof expression

#expression: expression
left operand of this instanceof expression

Sample Java Source

if (test instanceof TestChild) return;

Its PEF Representation

ifT(#ifT_ID, #Parent, _, #Condition, #ThenPart, 'null').
typeTestT(#Condition, #ifT_ID, _, type(class, Type0, 0), #expression).
identT(#expression, Condition, _, 'test', _).
returnT(#ThenPart, ID, _, 'null').

AST Specification

ast_node_def('Java',typeTestT,[    
     ast_arg(id,     mult(1,1,no ), id,   [typeTestT]), % <-- convention!!!
     ast_arg(parent, mult(1,1,no ), id,   [id]), % <-- convention!!!
     ast_arg(encl,   mult(1,1,no ), id,   [methodT, constructorT, classInitializerT]),
     ast_arg(type,   mult(1,1,no ), attr, [typeTermType]),   % expr instanceof type
     ast_arg(expr,   mult(1,1,no ), id,   [expressionType])
]).
research/jtransformer/api/java/pefs/2.9/typetestt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2023