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:2.9:indexedt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
  
 +=== indexedT (#id, #parent, #encl, #index, #​indexed) ​ ===
 +
 +represents the array access expression.
 +
 +=== Arguments ===
 +== ==
 +**#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]]\\ ​
 +ID of the fact that represents the enclosing element.
 +
 +**#index:** [[plastexpression|expression]]\\ ​
 +ID of the index expression of this array access expression.
 +
 +**#​indexed:​** [[plastexpression|expression]]\\ ​
 +ID of the array expression of this array access expression.
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +void myArrayAcces(){
 + int[] array = {1, 3, 8};
 + array[0]= 9;                  //​corresponding code line to indexedT
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​encl,​ ..., '​myArrayAcces',​ [], type(basic, void, 0), [], ...).
 +assignT(#​parent,​ ..., #encl, #id, ...).
 +indexedT(#​id,​ #parent, #encl, #index, #indexed).
 +
 +literalT(#​index,​ #id, #encl, type(basic, int, 0), '​0'​).
 +identT(#​indexed,​ #id, #encl, '​array',​ ...).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​indexedT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [indexedT]),​ % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT,​ fieldT]),
 +     ​ast_arg(index, ​  ​mult(1,​1,​no ), id,  [expressionType]),​
 +     ​ast_arg(indexed,​ mult(1,1,no ), id,  [expressionType])
 +]).
 +</​Code>​
 + 
research/jtransformer/api/java/pefs/2.9/indexedt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019