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:2.9:callt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +=== callT(#id, #parent, #encl, #expr, '​name',​ [#​arg_1,​...],​ #​method) ​ ===
 +
 +Represents a method invocation. ++Formerly called applyT| Renamed since JTransformer 2.3.1_200804151649++ ​
 +
 +
 +=== 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.
 +
 +**#​expr:​** ​ [[plastexpression|expression]]\\ ​
 +the ID of the fact representing the receiver [[plastexpression|expression]] on which the method is invoked. If the receiver is ''​this''​ the value of #expr is ''​null''​. In case of static method call #expr is a [[typeRefT|typeRefT]].
 +
 +**'​name':​** atom \\ 
 +the simple (i.e. not fully qualified) name of the called method set into simple quotes.
 +
 +**[#​arg_1,​...]:​** [[plastexpression|expression]]\\ ​
 +list of IDs of other facts representing the arguments of this method invocation.
 +
 +**#​method:​** [[methodT|methodT]],​ [[constructorT|constructorT]] \\
 +ID of the [[methodt|methodT]] or [[constructorT|constructorT]] 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.
 +
 +
 +=== Sample Java Source ===
 +
 +==  ==
 +<Code lang-java>​
 +m() {                                                             // Enclosing method
 +  ...
 +    this.f(1,​2+3); ​                                               // Sample call
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +
 +==  ==
 +<​Code>​
 +methodT(#​meth,​ ..., '​m',​ [], type(basic, void, 0), [], ...).   // Enclosing method
 +...
 +execT(#​parent,​ V5, #meth, V7).                                   // Parent node
 +callT(#​call,​ #parent, #meth, #recv, '​f',​ [#first, #second], #f).  // Call
 +identT(#​recv,​ #call, #meth, this). ​                               // Call target
 +literalT(#​first,​ #call, #meth, type(basic, int, 0), '​1'​). ​        // First argument
 +operationT(#​second,​ #call, #meth, [..., ...], '​+',​ 0).            // Second argument
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​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(expr, ​   mult(0,​1,​no), ​  ​id, ​  ​[expressionType,​ nullType, typeRefT]),
 +     ​ast_arg(name, ​   mult(1,1,no ),  attr, [atom]),
 +     ​ast_arg(args, ​   mult(0,​*,​ord ), id,   ​[expressionType]),​
 +     ​ast_arg(ref, ​    ​mult(1,​1,​no ),  id,   ​[methodT,​ constructorT])
 + ​]). ​
 +</​Code>​
research/jtransformer/api/java/pefs/2.9/callt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019