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

Both sides previous revision Previous revision
Next revision
Previous revision
research:jtransformer:api:java:pefs:4.2:typecastt [2018/01/20 14:42]
Günter Kniesel
research:jtransformer:api:java:pefs:4.2:typecastt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== typeCastT (#id, #parent, #exec, #type, #​expr) ​ ===
 +
 +Represents the cast expression.
 + 
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#exec:** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[classinitializert|classInitializerT]],​ [[fieldt|fieldT]],​ [[annotationmembert|annotationMemberT]],​ [[annotationt|annotationT]] \\ 
 +ID of the fact that represents the executable that contains this type cast. An executable is a method, constructor,​ class or field initialiser,​ annotation or annotation member.
 +
 +**#type:** [[typeinst]],​ [[intersectiontypet|intersectionTypeT]]\\
 +the id of the target type (the type to which the expression is cast)
 +
 +**#expr:** [[plastexpression|expression]]\\ ​
 +ID of the expression that is cast to the target type.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +void myFunction(){
 + double i = 0;
 + int j = 0;
 + i = (double)j ; // <-- RHS of this assignment is represented by a typeCastT fact
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +methodT(#​method,​ ..., '​myFunction',​ [], ..., [], ...).
 +  ...
 +  assignT(#​assign,​ ..., #method, ..., #cast).
 +    typeCastT(#​cast,​ #assign, #method, #type, #j).
 +      identT(#j, #cast, #method, '​j',​ ...).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(typeCastT,​[
 +     ​ast_arg(id, ​    ​mult(1,​1,​no ), id,   ​[typeCastT]),​
 +     ​ast_arg(parent,​ mult(1,1,no ), id,   ​[id]),​
 +     ​ast_arg(exec, ​  ​mult(1,​1,​no ), id,   ​[methodT,​ constructorT,​ classInitializerT,​ classT, fieldT, annotationMemberT,​ packageT]),
 +     ​ast_arg(type, ​  ​mult(1,​1,​no ), id,   ​[type_inst,​ intersectionTypeT]),​
 +     ​ast_arg(expr, ​  ​mult(1,​1,​no ), id,   ​[expressionType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/typecastt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019