SDA SE Wiki

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

User Tools

Site Tools



packageT(#id, 'fullname')

Represents the package declaration.

Arguments

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

'fullname': atom
package name of this package declaration, as an atom.

E. g.:
packageT(42, 'org.cs3.pl.astvisitor').
packageT(defaultPackage, ' '). (for the default Java package) ← Changed in JT 2.6.3

Note: packageT does not have the ID of the children in his declaration. packageT has so called unreferenced_children, that means the children referencing the parent, but not the other way around.
The unreferenced_children from packageT are compilationUnitT, see also Program Element Facts for Java AST

Sample Java Source

 package packaged.de.tests;
 public class tests {
   ...
}

Its PEF Representation

packageT(#Package, 'packaged.de.tests'), 
compilationUnitT(#CompilationUnit, #Package, ..., [], #Class),                               
classT(#Class, #CompilationUnit, 'tests', [#Children]),

AST Specification

ast_node_def('Java',packageT,[
     ast_arg(id,   mult(1,1,no ), id,   [id]), % <-- convention!!!
     ast_arg(name, mult(1,1,no ), attr, [atom])
]).
research/jtransformer/api/java/pefs/3.0/packaget.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2018