SDA SE Wiki

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

User Tools

Site Tools



outerTypeParamsT(#id, #rawType, [#param1, ...])

Java 5 Syntax Element

This fact represents the outer type parameters of a parameterized type if it is a reference to an inner class. There can be multiple outerTypeParamsT facts for one parameterized type.

Arguments

#id: parameterizedTypeT
the ID of the surrounding parameterizedTypeT.1)

#rawType: classT
the raw type of the outer type

[#param1, …]: classT, parameterizedTypeT, wildcardT, arrayTypeT, typeParamT
type params to the outer type

Sample Java Source

public class Outer<T> {

   class C { }

   class Inner {
      // This field's type is defined in the outer class:
      Outer<String>.C field;
   }
}

Its PEF Representation

In the following, # is the prefix for an id and … represents a value that is irrelevant in this example:

classT(#classOuter, ..., 'Outer', [...], [..., #classC, #classInner]).

classT(#classC,     #classOuter, 'C', [], [...]).

classT(#classInner, #classOuter, 'Inner', [], [..., #field]).
fieldT(#field, #classInner, #type, 'field', 'null').
parameterizedTypeT(#type, #classC, [#outerTypeParam]).
outerTypeParamsT(#outerTypeParam, #classOuter, [#IdOfClassString]).

AST Specification

ast_node_type_spec(outerTypeParamsT,[
     ast_arg(id,          mult(1,1,no ), id,   [outerTypeParamsT]),
     ast_arg(rawType,     mult(1,1,no ), id,   [classT]), % out raw types
     ast_arg(outerParams, mult(1,*,ord ),id,   [classT, parameterizedTypeT, wildcardT, arrayTypeT, typeParamT])
]).
1)
here it's possible that the list of type parameters is empty, see the example
research/jtransformer/api/java/pefs/4.1/outertypeparamst.txt · Last modified: 2019/05/22 12:57 by Günter Kniesel

SEWiki, © 2019