SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools



omit_lambdaParameterTypesT(#id)

This fact is only used for preserving the original appearance of the source code after transformations. It declares that the types of the parameters of a lambda expression are omitted in the code. This behaviour is applied to ALL parameters of a specific lambda expression.

(e) -> System.out.println("button pressed")); 

instead of

(ActionEvent e) -> System.out.println("button pressed")); 

Arguments

#id: lambdaT
ID of the lambdaT element.

Sample Java Source

JButton button = new JButton();
button.addActionListener((e) -> System.out.println("button pressed"));

Its PEF Representation

localT(#Button, ..., 'button', ...).
...
callT(#Parent, ..., [#Lambda], #RefToAddActionListener, [], ...).
lambdaT(#Lambda, #Parent, #Enclosing, [#Parameter], #Body).
omit_lambdaParameterTypesT(#Lamba).
paramT(#Parameter, #Lambda, #RefToActionEvent 'e').             // Paramter of the lambda expression
callT(#Body, #Lambda, #Lambda, ...).                            // Sysout call (Body of the lambda expression)

AST Specification

ast_relation_type_spec(omit_lambdaParameterTypesT,[
	ast_arg(id,	mult(1,1,no ), id, [lambdaT])
]).
research/jtransformer/api/java/pefs/4.2/omit_lambdaparametertypest.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019