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

Next revision
Previous revision
research:jtransformer:api:java:pefs:3.0:localt [2013/07/03 06:52]
127.0.0.1 external edit
research:jtransformer:api:java:pefs:3.0:localt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== localT(#id, #parent, #encl, #type, '​name',​ #​init) ​ ===
 +== ==
 +
 +Represents local variable declaration.
 +
 +Changed in JT 2.8: Up to 2.8.0 it was part of [[..:​old:​localdeft|localDefT]].
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#encl:** [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]]\\ ​
 +ID of the enclosing element.
 +
 +**#type:** [[typeinst]]\\ ​
 +the id of the type of the variable
 +
 +**'​name':​** atom\\ ​
 +variable name.
 + 
 +**#init:** [[plastexpression|expression]],​ null\\ ​
 +ID of the initializer of this variable declaration.
 + 
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +void myFunction(){
 + int i = 0;//​corresponding code line to localT
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​enclMethod,​ ..., '​myFunction',​ [], #​returntype,​ [], #parent).
 +blockT(#​parent,​ #​enclMethod,​ #​enclMethod,​ [#id]).
 +localT(#id, #parent, #​enclMethod,​ #localtype, '​i',​ #init).
 +literalT(#​init,​ #id, #​enclMethod,​ #​literaltype,​ '​0'​).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​localT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [localT]), % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]),
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT]),​
 +     ​ast_arg(type, ​   mult(1,1,no ), id,  [typeInst]),​
 +     ​ast_arg(name, ​   mult(1,1,no ), attr,​[atom]),​
 +     ​ast_arg(expr, ​   mult(0,​1,​no), ​ id,  [expressionType,​nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/3.0/localt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019