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.0:callt [2015/11/12 10:19]
Günter Kniesel
research:jtransformer:api:java:pefs:4.0:callt [2018/05/09 01:59] (current)
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 (in case of type parameters this might be different from the method'​s type). The constant '​null'​ is the return of a constructor (constructorT).
 +
 +=== 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, V7).                                    // Parent of the call
 +callT(#​call,​ #parent, #meth, #recv, [#first, #second], #f, FIXME, FIXME). ​      // 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.0/callt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019