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:4.2:omit_lambdaparameterparenthesest [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
  
 +=== omit_lambdaParameterParenthesesT(#​id) ===
 +
 +This fact is only used for preserving the original appearance of the source code after transformations. It declares that the parameter of a lambda expression doesn'​t have the enclosing parantheses. The only case where this is allowed is, if there is exactly one parameter. If the parantheses are omitted it always means, that the parameter type is omitted also (see [[omit_lambdaparametertypest|omit_lambdaParameterTypesT]]).
 +
 +<Code lang-java>​e -> System.out.println("​button pressed"​));​ </​Code>​
 +instead of
 +<Code lang-java>​(e) -> System.out.println("​button pressed"​));​ </​Code>​
 +
 +=== Arguments ===
 +== ==
 +**#id:** [[lambdat|lambdaT]]\\ ​
 +ID of the lambdaT element.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +JButton button = new JButton();
 +button.addActionListener(e -> System.out.println("​button pressed"​));​
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +<​Code>​
 +localT(#​Button,​ ..., '​button',​ ...).
 +...
 +callT(#​Parent,​ ..., [#Lambda], #​RefToAddActionListener,​ [], ...).
 +lambdaT(#​Lambda,​ #Parent, #Enclosing, [#​Parameter],​ #Body).
 +omit_lambdaParameterParenthesesT(#​Lamba).
 +omit_lambdaParameterTypesT(#​Lamba).
 +paramT(#​Parameter,​ #Lambda, #​RefToActionEvent '​e'​). ​            // Paramter of the lambda expression
 +callT(#​Body,​ #Lambda, #Lambda, ...).                            // Sysout call (Body of the lambda expression)
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_relation_type_spec(omit_lambdaParameterParenthesesT,​[
 + ast_arg(id,​ mult(1,​1,​no ), id, [lambdaT])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/omit_lambdaparameterparenthesest.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019