Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
The JTransformer release 2.6.0 incorporates the following changes of the PEF representation:
JT 2.6 separates the language independent PEFs for projects, folders and files from the PEFs representing language specific file contents. Now there are two containment hierarchies:
They are linked by the reference from compilationUnitT to fileS. As a mnemonic aid, the suffix S of projectS, sourcefolderS and fileS stands for “Source”. It indicates that these elements representat language independent Source information, not abstract syntax tree elements (which have the suffix T – for Tree).
As a followup change the second argument of classDefT now refers to a compilationUnitT instead as a packageT!
projectT('projectName', 'localPath', 'outputProjectName', 'outputProjectLocalPath')
⇒
projectS(#Id, 'projectName', 'localPath', 'outputProjectName', 'outputProjectLocalPath')
Note that that not only the PEF name changed, but also the structure. Each project now has its own identity.
projectLocationT(#file, 'ProjectName', 'SourceFolder')(#file, 'ProjectName', 'SourceFolder')
⇒
sourceFolderS(#id, #ProjectID, 'SourceFolder')(#id, #ProjectID, 'SourceFolder')
Note that that not only the name changed, but also the structure. Each folder has its own identity and refers to its containing project via an identity. It does not refer to contained files anymore. The files refer to the containing folder via its identity (see below).
fileT(#id, #package
, 'filename', [#def_1,…])
⇒
fileS(#id, #sourceFolder, 'path') and
compilationUnitT(#id, #package
, #fileS, [#import1, …], [#typeDecl1, …] )
Previously, fileT mixed language independent information (e.g. the file name) with language specific information (e.g. packages). It has therefore been split into an element that only represents language specific information (fileS) and an element that represents Java-specific information and links it to the file (compilationUnitT). See the documentation of compilationUnitT for hints how to migrate old code.
In JTransformer versions < 2.6.0
Since JTransformer 2.6.0
newClassT (#id, #parent, #encl, #constructor, [#arg_1,…], #typeExpr, #def, #enclosing)
⇒
newClassT(#id, #parent, #encl, #constructor, [#arg_1,…], #instantiatedClass, #def, #enclosing)
The sixth argument (#instantiatedClass) now refers to a classDefT element representing the class instantiated by this constructor call. Before JT 2.6.0, it referred to identT or selectT elements.
identT(#id, #parent, #encl, 'name', #symbol)
only represents identifiers. In JTransformer versions < 2.6.0 it also represented class literals and qualified type names.
Now
selectT(#id, #parent, #encl, 'name', ENCLOSING_TYPE, #selectedType)
now only represents class literals (TypeName.class) or the access to super and this “instances” in inner and anonymous classes. Previously, it was also used for representating the nesting of qualified type names in constructor calls.
typeRefT(#id, #parent, #encl, #type)
A new AST element. Represents a (qualified) class name in static method calls or static field access.
The new PEF for comments represents arbitrary comments. For Java source files javadoc, block and end-of-line comments are represented. This PEF supports loss-free reverse engineering after transformations.