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:callt [2017/07/11 06:17]
Daniel Speicher
research:jtransformer:api:java:pefs:4.2:callt [2019/06/19 14:57]
Günter Kniesel
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== callT(#id, #parent, #encl, #expr, [#​arg_1,​...],​ #method, [#​type_param_1,​...],​ #​type) ​ ===
 +
 +Represents a method invocation.
 +
 +== History ==
 +  * Removed "​name"​ argument in JTransformer 4.0
 +  * Renamed from applyT to call T in JTransformer 2.3.1
 +
 +=== 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:** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[classinitializert|classInitializerT]],​ [[fieldt|fieldT]]\\ ​
 +the ID of the fact that represents the enclosing element.
 +
 +**#​receiver:​** ​ [[plastexpression|expression]],​ [[statictypereft|staticTypeRefT]],​ null\\ ​
 +the ID of the fact representing the receiver [[plastexpression|expression]] on which the method is invoked. If the receiver is an implicit ''​this''​ the value of #receiver is ''​null''​. In case of static method call #expr is a [[statictypereft|staticTypeRefT]].
 +
 +**[#​arg_1,​...]:​** [[plastexpression|expression]]\\ ​
 +list of IDs of other facts representing the arguments of this method invocation.
 +
 +**#​method:​** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[annotationmembert|annotationMemberT]] \\
 +ID of the [[methodt|methodT]],​ [[constructort|constructorT]] or [[annotationmembert|annotationMemberT]] fact that represents the declaration of the invoked method in the static type of the receiver expression. Because of dynamic binding the method actually invoked at run-time might be another one.
 +
 +**[#​type_param_1,​...]:​** [[type_inst|Type reference]],​ [[wildcardt|wildcardT]]\\ ​
 +list of IDs of the type parameters of this call.
 +
 +**#type:** [[type_inst|Type reference]],​ [[wildcardt|wildcardT]],​ null\\ ​
 +type that is returned by the called method or "​null"​. If "​null",​ then the return type is the return type of the method declaration (see #method). Otherwise (in the case of type parameters),​ it might be different from the method'​s type.
 +
 +=== Sample Java Source ===
 +
 +==  ==
 +<Code lang-java>​
 +m() {                                                             // Enclosing method
 +  ...
 +    this.f(1,​2+3); ​                                               // Sample call
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +
 +==  ==
 +<​Code>​
 +methodT(#​meth,​ ..., '​m',​ [], #​returntype,​ [], ...).                      // Enclosing method
 +...
 +execT(#​parent,​ V5, #meth, #​call). ​                                       // Parent of the call
 +callT(#​call,​ #parent, #meth, #recv, [#first, #second], #f, [], #​ftype). ​ // Call
 +identT(#​recv,​ #call, #meth, this). ​                                      // Call target
 +literalT(#​first,​ #call, #meth, #​literaltype,​ '​1'​). ​                      // First argument
 +operationT(#​second,​ #call, #meth, [..., ...], '​+',​ 0).                   // Second argument
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec('​Java',​callT,​[
 +     ​ast_arg(id, ​        ​mult(1,​1,​no ),  id,   ​[callT]),​ % <-- convention!!!
 +     ​ast_arg(parent, ​    ​mult(1,​1,​no ),  id,   ​[id]),​
 +     ​ast_arg(encl, ​      ​mult(1,​1,​no ),  id,   ​[methodT,​ constructorT,​ classInitializerT,​fieldT]),​
 +     ​ast_arg(receiver, ​  ​mult(0,​1,​no ),  id,   ​[expressionType,​ nullType, staticTypeRefT]),​
 +     ​ast_arg(args, ​      ​mult(0,​*,​ord), ​ id,   ​[expressionType]),​
 +     ​ast_arg(ref, ​       mult(1,1,no ),  id,   ​[methodT,​ constructorT,​ annotationMemberT]),​
 +     ​ast_arg(typeParams,​ mult(0,​*,​ord), ​ id,   ​[type_inst,​ wildcardT]),​
 +     ​ast_arg(type, ​      ​mult(1,​1,​no ),  id,   ​[type_inst,​ wildcardT, nullType])
 + ​]). ​
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/callt.txt · Last modified: 2019/06/19 14:57 by Günter Kniesel

SEWiki, © 2019