SDA SE Wiki

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

User Tools

Site Tools


@deprecated with JT 2.8.0 see classT for current representation


classDefT(#id, #parent, 'name', [#def_1,...]) - *deprecated*

represents the class or interface declaration. Every interface declaration is accompanied by the additional fact: interfaceT(#id).
Every annotation declaration is accompanied by an interfaceT(#id) and an annotationT(#id) fact.

Arguments

#id:
the unique ID assigned to this fact.

#parent: compilationUnitT, classDefT, newClassT, blockT, execT

'name':
the class name, without a package. In the case of anonymous classes, a globally unique name: ANONYMOUS$<UN>, where <UN> is a unique number.

[#def_1,…]: methodDefT, fieldDeftT, classDefT, annotationMemberT
list of IDs for other facts representing the methods or fields, and inner classes. These fields and methods are the members (not necessarily public!) of the class.



Note: There is no difference between normal and abstract classes.

Sample Java Source

class HelloWorld  { //corresponding code line to classDefT

   ...
}

Its PEF Representation

classDefT(#id, 'null', 'HelloWorld', [fqn('HelloWorld', '<init>', []), #def_2, #def_3]).

AST Specification

% tree_constraints(classDefT ,[[execT,packageT,classDefT,newClassT,blockT,nullType],[atom],[methodDefT,fieldDefT,classDefT]]).
ast_node_def('Java',classDefT,[
     ast_arg(id,      mult(1,1,no ), id,  [classDefT]), % <-- convention!!!
     ast_arg(parent,  mult(1,1,no ), id,  [execT,compilationUnitT,packageT ,classDefT, newClassT, blockT]), 
     ast_arg(name,    mult(1,1,no ), attr,[atom]),
     ast_arg(defs,    mult(0,*,ord), id,  [methodDefT,fieldDefT,classDefT,annotationMemberT])
]).
research/jtransformer/api/java/pefs/old/classdeft.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024