SDA SE Wiki

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

User Tools

Site Tools



constructorReferenceT(#id, #parent, #encl, #type, [#type_param_1,...], #ref)

Represents a constructor reference. See the Java Language Specification.

Arguments

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

#parent: id
the ID of the fact that represents the parent of this fact in the prolog AST.

#encl: Method declaration type, fieldT
the ID of the fact that represents the enclosing element.

#type: Type reference, null
the ID of the type fact representing the receiver.

[#type_param_1,…]: Type reference, wildcardT
list of IDs of the type parameters of this method reference.

#ref: constructorT, null
ID of the constructorT fact that represents the declaration of the referenced constructor. If the receiver is an array type, this argument's value is null.

Sample Java Source

interface MyInterface {    
    int[] someMethod(int i);
}
...
class MyClass {
  void m() {
    MyInterface f = int[]::new;
  }
}

Its PEF Representation

methodT(#Method, ..., 'm', [], #returntype, [], ...).   // Enclosing method
...
localT(#Parent, ..., 'f', #ConstrRef).                            // Parent of the constructor reference
constructorReferenceT(#ConstrRef, #Parent, #Enclosing, #IntArrayType, [], null).
arrayTypeT(#IntArrayType, #RefToInt, 1).

AST Specification

ast_node_type_spec(constructorReferenceT,[
     ast_arg(id,         mult(1,1,no ), id,  [constructorReferenceT]),
     ast_arg(parent,     mult(1,1,no ), id,  [id]),
     ast_arg(encl,       mult(1,1,no ), id,  [method_declaration_type,fieldT]),
     ast_arg(type,       mult(1,1,no ), id,  [type_inst, null_type]),
     ast_arg(typeParams, mult(0,*,ord), id,  [type_inst, wildcardT]),
     ast_arg(ref,        mult(1,1,no ), id,  [constructorT, null_type])
]).
research/jtransformer/api/java/pefs/4.2/constructorreferencet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2023