SDA SE Wiki

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

User Tools

Site Tools



classT(#id, #parent, 'name', #paramRef, [#def_1,...])

Represents a class or interface declaration. Every interface declaration is accompanied by the additional fact: interfaceT(#id).

Every classT fact that represents an annotation is accompanied by an interfaceT(#id) and an annotationT(#id) fact for the same #id.

An abstract class is accompanied by an additional fact modifierT(#id, 'abstract').

Arguments

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

#parent: execT, compilationUnitT, classT, newClassT
ID of the element that contains this class declaration.

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

#paramRef: typeParamT
List of the type parameters of the class.

[#def_1,…]: annotationMemberT, classT, fieldT, methodT, constructorT, classInitializerT
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.

Change history

JT 2.8: Renamed. Before it was called classDefT.

JT 2.6: Now 'owner' referst to a compilationUnitT instead of a packageT. See notes on Changes JTranformer 2.5 -> 2.6.

Sample Java Source

class HelloWorld  { //corresponding code line to classT

   ...
}

Its PEF Representation

classT(#id, #parentElement, 'HelloWorld', [], [#members ...]).

AST Specification

ast_node_def('Java',classT,[
     ast_arg(id,      mult(1,1,no ), id,  [classT]),
     ast_arg(parent,  mult(1,1,no ), id,  [execT, compilationUnitT, classT, newT, blockT]), 
     ast_arg(name,    mult(1,1,no ), attr,[atomic]),
     ast_arg(paramRef,mult(0,*,ord ),id,  [typeParamT]),
     ast_arg(defs,    mult(0,*,ord), id,  [annotationMemberT, classT, fieldT, methodT, constructorT, classInitializerT])
]).
research/jtransformer/api/java/pefs/4.1/classt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2021