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:4.2:fieldaccesst [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== fieldAccessT(#​id,​ #parent, #encl, #receiver, #field, #​type) ​ ===
 +
 +Represents a field access expression (read access **and** write access).
 +
 +== History ==
 +  * JTransformer 4.0: Renamed from getFieldT to fieldAccessT,​ removed argument name, added argument type
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID of this field access. ​
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +     
 +**#encl:** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[classinitializert|classInitializerT]],​ [[classt|classT]],​ [[fieldt|fieldT]],​ [[annotationmembert|annotationMemberT]],​ [[packaget|packageT]]\\ ​
 +ID of the fact that represents the enclosing element. ​
 +
 +**#​receiver:​** [[plastexpression|expression]],​ [[statictypereft|staticTypeRefT]],​ '​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 [[statictypereft|staticTypeRefT]].
 +
 +**#field:** [[fieldt|fieldT]]\\ ​
 +ID of the accessed field.
 +
 +**#type:** [[type_inst]],​ [[wildcardt|wildcardT]],​ '​null'​\\ ​
 +Type of the field access (for paramtereized types this may differ from the type of the field)
 + 
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +int field = 1;
 +
 +public void fieldAccess() {
 +     int j = field;
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +fieldT(Field,​ ..., _, '​field',​ ...),
 +
 +methodT(Method,​ ..., '​fieldAccess',​ ...),
 +localT(Local,​ ..., '​j',​ FieldAccess),​
 +fieldAccessT(FieldAccess,​ Local, Method, '​null',​ Field, RefToInt).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(fieldAccessT,​[
 +     ​ast_arg(id, ​      ​mult(1,​1,​no ), id,  [fieldAccessT]),​
 +     ​ast_arg(parent, ​  ​mult(1,​1,​no ), id,  [id]),
 +     ​ast_arg(encl, ​    ​mult(1,​1,​no ), id,  [methodT, constructorT,​ classInitializerT,​ classT, fieldT, annotationMemberT,​ packageT]),
 +     ​ast_arg(receiver,​ mult(0,​1,​no),​ id,   ​[nullType,​ expressionType,​ staticTypeRefT]),​
 +     ​ast_arg(ref, ​     mult(1,1,no ), id,  [fieldT]),
 +     ​ast_arg(type, ​    ​mult(1,​1,​no ), id,  [type_inst, wildcardT, nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/fieldaccesst.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019