SDA SE Wiki

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

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
research:jtransformer:api:java:migration:upgradeinstructions [2010/12/12 23:57]
127.0.0.1 external edit
research:jtransformer:api:java:migration:upgradeinstructions [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Changes JTranformer 2.5 -> 2.6 ======
 +
 +The JTransformer release 2.6.0 incorporates the following changes of the PEF representation:​
 +  * [[#Redesign of PEFs for projects, folders, files and classes]]
 +  * [[#Redesign of PEFs for identifiers,​ class literals, and qualified type names]]
 +  * [[#New PEF for comments]]
 +
 +===== Redesign of PEFs for projects, folders, files and classes =====
 +
 +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:​
 +  * a language-independent one ([[..:​..:​meta:​pefs:​projectS|projectS]] <- [[..:​..:​meta:​pefs:​sourceFolderS|sourceFolderS]] <- [[..:​..:​meta:​pefs:​fileS|fileS]]) and 
 +  * a Java-specific one ([[..:​pefs:​2.9:​packageT|packageT]] <- [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]] <- [[..:​pefs:​old:​classDefT|classDefT]] <- ...). 
 +They are linked by the reference from [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]] to [[..:​..:​meta:​pefs:​fileS|fileS]]. As a mnemonic aid, the suffix S of [[..:​..:​meta:​pefs:​projects|projectS]],​ [[..:​..:​meta:​pefs:​sourcefolderS|sourcefolderS]] and [[..:​..:​meta:​pefs:​fileS|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 [[..:​pefs:​old:​classDefT|classDefT]] now refers to a [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]] instead as a [[..:​pefs:​2.9:​packageT|packageT]]!
 +
 +==== projectT became projectS ====
 +[[..:​pefs:​old:​projectT|projectT]]('​projectName',​ '​localPath',​ '​outputProjectName',​ '​outputProjectLocalPath'​)\\
 +=> \\
 +[[..:​..:​meta:​pefs:​projectS|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 became sourceFolderS ====
 +[[..:​pefs:​old:​projectLocationT]](__#​file__,​ __'​ProjectName'​__,​ '​SourceFolder'​)\\
 +=> \\
 +[[..:​..:​meta:​pefs:​sourceFolderS]](__#​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 was split into two PEFs ====
 +[[..:​pefs:​old:​fileT|fileT]](#​id,​ ''#​package'',​ __'​filename'​__,​ **[#​def_1,​...]**)\\
 +=> \\
 +[[..:​..:​meta:​pefs:​fileS|fileS]](#​id,​ __#​sourceFolder__,​ __'​path'​__) and 
 +[[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]](#​id,​ ''#​package'',​ __#fileS__, **[#​import1,​ ...], [#​typeDecl1,​ ...]** )
 +
 +Previously, [[..:​pefs:​old:​fileT|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 ([[..:​..:​meta:​pefs:​fileS|fileS]]) and an element that represents Java-specific information and links it to the file ([[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]]). See the documentation of [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]] for hints how to migrate old code.
 +
 +
 +===== Redesign of PEFs for identifiers,​ class literals, and qualified type names =====
 +
 +In JTransformer versions < 2.6.0 
 +  * [[..:​pefs:​2.9:​identT|identT]] represented identifiers,​ class literals, and qualified type names. ​
 +  * [[..:​pefs:​2.9:​identT|identT]] and [[..:​pefs:​2.9:​selectT|selectT]] jointly represented qualified type names in constructor calls (e.g. new Outer.Inner(..)).
 +  * [[..:​pefs:​2.9:​newClassT|newClassT]] referred in its sixth argument to [[..:​pefs:​2.9:​identT|identT]] or [[..:​pefs:​2.9:​selectT|selectT]] elements ​
 +
 +Since JTransformer 2.6.0
 +  * [[..:​pefs:​2.9:​identT|identT]] only represents identifiers. ​
 +  * [[..:​pefs:​2.9:​selectT|selectT]] represents class literals (TypeName.class) or the access to "​super"​ or "​this"​ in inner and anonymous classes.
 +  * [[..:​pefs:​2.9:​typeRefT|typeRefT]] represents ​ qualified type names in static method calls and static field accesses
 +  * [[..:​pefs:​2.9:​newClassT|newClassT]] refers in its sixth argument to a [[..:​pefs:​old:​classDefT|classDefT]] element representing the class instantiated by this constructor call. This is an inlined representation of qualified type names in constructor calls (e.g. new Outer.Inner(..)).
 +
 +
 +==== newClassT ====
 +newClassT (#id, #parent, #encl, #​constructor,​ [#​arg_1,​...],​ __#​typeExpr__,​ #def, #​enclosing)\\
 +=>\\
 +[[..:​pefs:​2.9:​newClassT|newClassT]](#​id,​ #parent, #encl, #​constructor,​ [#​arg_1,​...],​ __#​instantiatedClass__,​ #def, #enclosing)
 +
 +The sixth argument (#​instantiatedClass) now refers to a [[..:​pefs:​old:​classDefT|classDefT]] element representing the class instantiated by this constructor call. Before JT 2.6.0, it referred to [[..:​pefs:​2.9:​identT|identT]] or [[..:​pefs:​2.9:​selectT|selectT]] elements.
 +
 +==== identT ====
 +[[..:​pefs:​2.9:​identT]]\\
 +only represents identifiers. In JTransformer versions < 2.6.0 it also represented class literals and qualified type names.
 +Now
 +  * class literals are represented via [[..:​pefs:​2.9:​selectT|selectT]],​
 +  * qualified type names in static method calls and static field accesses are represented via [[..:​pefs:​2.9:​typeRefT|typeRefT]],​
 +  * qualified type names in constructor calls (e.g. new Outer.Inner(..)) are inlined into the sixth argument of [[..:​pefs:​2.9:​newClassT|newClassT]].
 +
 +==== selectT ====
 +[[..:​pefs:​2.9:​selectT]]\\
 +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 ====
 +[[..:​pefs:​2.9:​typeRefT]]\\
 +A new AST element. Represents a (qualified) class name in static method calls or static field access. ​
 +
 +===== New PEF for comments =====
 +
 +The new [[..:​pefs:​2.9:​commentT| 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. ​
 +
  
research/jtransformer/api/java/migration/upgradeinstructions.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019