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.0:newarrayt [2014/07/09 12:31]
fabian.noth created
research:jtransformer:api:java:pefs:4.0:newarrayt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
  
 +=== newArrayT (#id, #parent, #encl, [#​dim_1,​...],​ [#​elem_1,​...],​ #​type) ​ ===
 +== ==
 +
 +Represents the array creation expression.\\ ​
 +Optionally marked with an [[preserve_omitArrayDeclarationT|preserve_omitArrayDeclarationT]].
 +
 +=== 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]],​ [[classt|classT]],​ [[annotationMemberT|annotationMemberT]],​ [[annotationT|annotationT]]\\ ​
 +ID of the fact that represents the enclosing element.
 +
 +**[#​dim_1,​...]:​** [[plastexpression|expression]]\\ ​
 +list of dimension expressions.
 +
 +**[#​elem_1,​...]:​** [[plastexpression|expression]],​ [[annotationExpressionType|annotationExpressionType]]\\ ​
 +list of initial elements of this array.
 +
 +**#type:** [[type_inst]]\\
 +the id of the type of this array.
 + 
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +void myArrayAcces(){
 + int[] array = {1, 3, 8};//​corresponding code line to newArrayt
 + array[0]= 9;
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodDefT(#​encl,​ ..., '​myArrayAcces',​ [], #​returntype,​ [], ...).
 +localDefT(#​parent,​ ..., #encl, type(basic, int, 1), '​array',​ #id).
 +newArrayT(#​id,​ #parent, #encl, [], [#elem_1, #elem_2, #elem_3], #​newarraytype).
 +omitArrayDeclarationT(#​id).
 +literalT(#​elem_1,​ #id, #encl, #​literal1type,​ '​1'​).
 +literalT(#​elem_2,​ #id, #encl, #​literal2type,​ '​3'​).
 +literalT(#​elem_3,​ #id, #encl, #​literal3type,​ '​8'​).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(newArrayT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [newArrayT]),​
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]),
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT,​ fieldT, classT, annotationMemberT,​ packageT]),
 +     ​ast_arg(dims, ​   mult(1,​*,​ord),​ id,  [expressionType]),​
 +     ​ast_arg(elems, ​  ​mult(0,​*,​ord),​ id,  [expressionType,​annotationExpressionType]),​
 +     ​ast_arg(type, ​   mult(1,1,no ), id,  [type_inst])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.0/newarrayt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019