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:pefs:4.2:identt [2017/11/14 08:57]
Günter Kniesel
research:jtransformer:api:java:pefs:4.2:identt [2018/12/20 12:21]
Günter Kniesel
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== identT(#id, #parent, #encl, #​refToAccessedElement) ​ ===
 +
 +Represents an access to
 +  - a method parameter or
 +  - a local variable or
 +  - '​this'​ (represented by a [[thist|thisT]] ((added in Version 4.1)) fact) or
 +  - '​super'​ (represented by a [[supert|superT]] ((added in Version 4.1)) fact) 
 +
 +<​note>​
 +Note that identT represents **no field accesses**. Field accesses are represented by [[fieldaccesst|fieldAccessT]]. ​
 +</​note>​
 +
 +== Changes in JTransformer 4.0 ==
 +  * Removed "​name"​ argument
 +  * The access to the Java constant '​null'​ is not longer represented as an identT but as a literalT
 +  * In JTransformer versions < 2.6.0 identT also represented class literals, and qualified type names. Class literals are now modeled with [[selectt|selectT]]. Qualified type names in static method calls and static field accesses are now represented with [[statictypereft|staticTypeRefT]].
 +
 +
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#encl:** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[classinitializert|classInitializerT]],​ [[fieldt|fieldT]]\\ ​
 +ID of the fact that represents the method, constructor,​ class initializer or field definition that contains this variable access.
 +
 +**#​refToAccessedElement:​** [[localt|localT]],​ [[paramt|paramT]],​ [[thist|thisT]],​ [[supert|superT]] \\
 +ID of the accessed element.  ​
 +
 +==== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +public Object m(int i) {
 + int j=0;
 +        ...
 +        x = i + j;
 +        ...
 +        Object o = super.abc;
 +        ...
 +        return this;
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +For better readability IDs are represented by symbolic constants prefixed with #.
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​encl,​ ..., '​m',​ [], #​refToObject,​ [], ...).
 +  paramT(#​symbol1,​ ..., #refToInt, '​i'​).
 +  localT(#​symbol2,​ ..., #encl, #refToInt, '​j',​ ...).
 +...
 +operationT(#​parent,​ ..., #encl, [#id1, #id2], '​+',​ 0).
 +  identT(#​id1,​ #parent, #encl, #symbol1).
 +  identT(#​id2,​ #parent, #encl, #symbol2).
 +...
 +localT(#​symbol3,​ ..., #encl, #​refToObject,​ '​o',​ #​fieldAccess).
 +  fieldAccessT(#​fieldAccess,​ #symbol3, #encl, #id3, #abc, #​refToFieldType).
 +    identT(#​id3,​ #​fieldAccess,​ #encl, #​superclass).
 +    superT(#​id3).
 +
 +...
 +returnT(#​retid,​ ..., #encl, #ident).
 +  identT(#​ident,​ #retid, #encl, #​classOfThis).
 +  thisT(#​ident).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(identT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [identT]),
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]), ​
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT,​ fieldT]), ​
 +     ​ast_arg(ref, ​    ​mult(1,​1,​no ), id,  [classT,​localT,​paramT]) ​
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/identt.txt · Last modified: 2018/12/20 12:21 by Günter Kniesel

SEWiki, © 2019