Packages, Compilation Units and Imports | Annotations | Declarations | Expressions | Statements | Body Level Attributes |
|---|
callT(#id, #parent, #encl, #expr, 'name', [#arg_1,...], #method)
Represents a method invocation. Formerly called applyT
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, constructorT, classInitializerT, fieldT
the ID of the fact that represents the enclosing element.
#expr: expression
the ID of the fact representing the receiver 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.
'name': atom
the simple (i.e. not fully qualified) name of the called method set into simple quotes.
[#arg_1,…]: expression
list of IDs of other facts representing the arguments of this method invocation.
#method: methodT, constructorT
ID of the methodT or 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
m() { // Enclosing method ... this.f(1,2+3); // Sample call }
Its PEF Representation
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
AST Specification
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])
]).


