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

research:jtransformer:api:java:pefs:3.0:getfieldt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== getFieldT(#​id,​ #parent, #encl, #receiver, '​name',​ #​field) ​ ===
 +
 +Represents a field access expression (read access **and** write access).
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID of this field access. ​
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#encl:** [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]],​ [[fieldt|fieldT]],​ [[annotationMemberT|annotationMemberT]],​ [[annotationt|annotationT]]\\ ​
 +ID of the fact that represents the enclosing element. ​
 +
 +**#​receiver:​** [[plastexpression|expression]],​ [[typereft|typeRefT]],​ '​null'​ \\ 
 +ID of the expression on which the field is accessed
 +or '​null'​ for the implicit field access.\\  ​
 +In case of an access to a static field #expr is a [[typeRefT|typeRefT]].
 +
 +**'​name':​** atom\\ ​
 +name of the accessed field.
 +
 +**#field:** [[fieldt|fieldT]],​ null\\ ​
 +ID of the accessed field. \\
 +''​null''​ is only valid in case of the "​length"​ field of array types.
 + 
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +int field = 1;
 +
 +public void getField() {
 +     int j = field;
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +fieldT(#​field,​ ..., #fieldtype, '​field',​ ...).
 +
 +methodT(#​encl,​ ..., '​getField',​ [], #​returntype,​ [], ...).
 +localT(#​parent,​ ..., #encl, #localtype, '​j',​ #id).
 +getFieldT(#​id,​ #parent, #encl, '​null',​ '​i',​ #field).
 +
 +
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​getFieldT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,   ​[getFieldT]),​
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,   ​[id]),​
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,   ​[methodT,​ constructorT,​ classInitializerT,​ fieldT, annotationMemberT,​ annotationT]),​
 +     ​ast_arg(expr, ​   mult(0,1,no ), id,   ​[nullType,​expressionType,​typeRefT]),​
 +     ​ast_arg(name, ​   mult(0,1,no ), attr, [atom]),
 +     ​ast_arg(ref, ​    ​mult(1,​1,​no ), id,   ​[fieldT,​nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/3.0/getfieldt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019