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:3.0:typecastt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== typeCastT (#id, #parent, #encl, #type, #​expr) ​ ===
 +
 +Represents the cast expression.
 + 
 +=== Arguements ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#encl:** [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]],​ [[fieldt|fieldT]],​ [[annotationMemberT|annotationMemberT]],​ [[annotationt|annotationT]] \\ 
 +ID of the fact that represents the enclosing element.
 +
 +**#type:** [[typeInst]]\\
 +the id of the reference to the target type
 +
 +**#expr:** [[plastexpression|expression]]\\ ​
 +ID of the expression of this cast expression.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +void myFunction(){
 + double i = 0;
 + int j = 0;
 + i = (double)j ;// corresponding code line to typeCastT
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +typeCastT(#​id,​ #parent, #encl, #typeref, #expr).
 +typeRefT(#​typeref,​ #id, #encl, ...).
 +assignT(#​parent,​ ..., #encl, ..., #id).
 +methodT(#​encl,​ ..., '​myFunction',​ [], ..., [], ...).
 +identT(#​expr,​ #id, #encl, '​j',​ ...).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​typeCastT,​[
 +     ​ast_arg(id, ​    ​mult(1,​1,​no ), id, [typeCastT]),​ % <-- convention!!!
 +     ​ast_arg(parent,​ mult(1,1,no ), id, [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​  ​mult(1,​1,​no ), id, [methodT, constructorT,​ classInitializerT,​ fieldT, annotationMemberT]),​
 +     ​ast_arg(type, ​  ​mult(1,​1,​no ), id, [typeInst]),​
 +     ​ast_arg(expr, ​  ​mult(1,​1,​no ), id, [expressionType])
 +]).
 +</​Code> ​
 +
  
research/jtransformer/api/java/pefs/3.0/typecastt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019