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:uniontypet [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== unionTypeT(#​id,​ #rawType, [#​type_1,​...]) ​ ===
 +
 +Represents the union type in a multi-catch.
 +
 +== History ==
 +  * JTransformer 4.0: Added
 +
 +=== Arguments ===
 +== ==
 +**#id:** id \\ 
 +the unique ID assigned to this fact.
 +
 +**#​rawType:​** [[type_inst]]\\ ​
 +the id of the implicit type of the union. This type is not visible in the source-code (it's the common supertype of all the types in the union).
 +
 +**[#​type_1,​…]:​** [[type_inst]]\\ ​
 +the ids of all the types in the union.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +try {
 +  ...
 +} catch (ClassCastException | NullPointerException e) {
 +  ...
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<​Code>​
 +tryT(Try, _, _, [], _, [Catch], null),
 +catchT(Catch,​ Try, _, Param, _),
 +paramT(Param,​ Catch, UnionType, e),
 +unionTypeT(UnionType,​ RefToRuntimeException,​ [RefToClassCastException,​ RefToNullPointerException]).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(unionTypeT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [unionTypeT]),​
 +     ​ast_arg(rawType,​ mult(1,1,no ), id,  [type_inst]),​
 +     ​ast_arg(types, ​  ​mult(0,​*,​no ), id,  [type_inst])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/uniontypet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019