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

Both sides previous revision Previous revision
Next revision
Previous revision
research:jtransformer:api:java:migration:2.6 [2011/02/16 12:37]
127.0.0.1 external edit
research:jtransformer:api:java:migration:2.6 [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Migration to AST Version 2.6.0 ======
 +
 +JTransformer Release 2.6.0 incorporates some new and redesigned PEFs. In order to migrate from a pre-2.6.0 Version the changes described on this page must be taken into consideration.
 +
 +   ​*[[#​Changes Overview]]
 +   ​*[[#​Detailed description of the changes]]
 +     ​*[[#​projectT has been replaced by projectS]]
 +     ​*[[#​projectLocationT has been replaced by sourceFolderS]]
 +     ​*[[#​fileT has been replaced by fileS and compilationUnitT]]
 +     ​*[[#​classDefT now refers to a compilation unit]]
 +     ​*[[#​importT now refers to a compilation unit]]
 +
 +==== Changes Overview ====
 +== ==
 +The language specific PEFs [[..:​pefs:​old:​projectt|projectT]],​[[..:​pefs:​old:​projectlocationt|projectLocationT]] and [[..:​pefs:​old:​filet|fileT]] have been modified/​replaced to represent language independent information.
 +
 +The suffix S of [[..:​..:​meta:​pefs:​projects|projectS]],​ [[..:​..:​meta:​pefs:​sourcefolderS|sourceFolderS]] and [[..:​..:​meta:​pefs:​fileS|fileS]] indicates that these elements belong to the language independent representation of source information (S = Source), not to an Abstract Syntax Tree (which has the suffix T – for Tree). ​ [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]] is the link from the Java AST to the source representation.
 +
 +Now there are two containment hierarchies,​ a [[..:​..:​meta:​pefs:​pefs|language-independent one]] ([[..:​..:​meta:​pefs:​projectS|projectS]] <- [[..:​..:​meta:​pefs:​sourceFolderS|sourceFolderS]] <- [[..:​..:​meta:​pefs:​fileS|fileS]]) and a [[..:​pefs:​2.9:​java_pef_overview|Java-sepcific 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]]. ​  
 +
 +{{:​research:​jtransformer:​basic-structur.png|}}
 +
 +[Just for historical completeness (superseded by the following "​Detailed description of changes":​ [[upgradeinstructions|Upgrade from 2.5.0 to 2.6.0]].]
 +
 +==== Detailed description of the changes ====
 +
 +=== projectT has been replaced by projectS===
 +== ==
 +An Eclipse project is now represented by a [[..:​..:​meta:​pefs:​projectS|projectS]] PEF with a unique ID. 
 +
 +
 +[[..:​pefs:​old:​projectT]] => \\
 +[[..:​..:​meta:​pefs:​projectS]]
 +
 +
 +=== projectLocationT has been replaced by sourceFolderS ===
 +== ==
 +The [[..:​pefs:​old:​projectLocationT|projectLocationT]] element has been removed from the AST specification. It has been replaced by a [[..:​..:​meta:​pefs:​sourceFolderS|sourceFolderS]] element representing a source folder in an Eclipse project represented by a [[..:​..:​meta:​pefs:​projectS|projectS]] element.
 +
 +[[..:​pefs:​old:​projectLocationT]] => \\
 +[[..:​..:​meta:​pefs:​sourceFolderS]]
 +
 +=== fileT has been replaced by fileS and compilationUnitT ===
 +== ==
 +Up until version 2.6.0 [[..:​pefs:​old:​fileT|fileT]] facts had been used to represent java source files. fileT has been replaced by
 +
 +  * by [[..:​..:​meta:​pefs:​fileS|fileS]] facts representing any kind of source file in some Eclipse source folder. ​
 +  * by [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]] facts representing a Java compilation unit.
 +
 +Migrating to the new representation requires replacing any 
 +<code Prolog>
 +  fileT(Id, Package, Filename, Definitions) ​
 +</​Code>​
 +by 
 +<code Prolog>
 +  separate_imports_from_types(Definitions,​ Imports, Types),
 +  compilationUnitT(Id,​ Package, FileId, Imports, Types),
 +  fileS(FileId,​ SourceFolder,​ Filename).
 +</​Code>​
 +
 +=== classDefT now refers to a compilation unit ===
 +== ==
 +In addition, classDefT now does not reference a package as a parent but refers instead to a compilation unit. So any 
 +<code Prolog>
 +  classDefT(Id,​ Package, Classname, Definitions) ​
 +</​Code>​
 +must be checked manually. In cases where
 +the existing code does not use the package reference (that is, the package reference is an anonymous or singleton variable)
 +one does not need to change anything, except singleton variable names: ​
 +<code Prolog>
 +  classDefT(Id,​ __CompilationUnit,​ Classname, Definitions)
 +</​Code>​
 +If the package reference is relevant, one must write
 +<code Prolog>
 +  classDefT(Id,​ CompilationUnit,​ Classname, Definitions)
 +  compilationUnitT(CompilationUnit,​ Package, _, _, _)
 +</​Code>​
 +
 +Byte-code classes refer to a dummy compilation unit that refers to a dummy file with the ID '​dummyFile',​ the correct package, an empty list of imports and a type definition list that only contains the respective byte-code class. For each class #C for which "​externT(#​C)"​ is true, we have the following representation:​
 +
 +<code Prolog>
 +  externT(#​C).
 +  classDefT(#​C,​ #​CompilationUnit,​ Classname, Definitions).
 +  compilationUnitT(#​CompilationUnit,​ #Package, '​dummyFile',​ [], [#C]).
 +</​Code>​
 +
 +
 + 
 +=== importT now refers to a compilation unit ===
 +== ==
 +[[..:​pefs:​2.9:​importT|importT]] facts no longer reference a file as a parent but a [[..:​pefs:​2.9:​compilationUnitT|compilationUnitT]]:​
 +<Code lang-prolog>​
 +  compilationUnitT(#​CompID,#​Package,#​File,​[#​Import],​[#​Types]).
 +  importT(#​Import,#​CompID,#​X).
 +</​Code>​
 +
  
research/jtransformer/api/java/migration/2.6.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019