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

Last revision Both sides next revision
research:jtransformer:api:java:pefs:4.2:classinitializert [2018/05/09 01:59]
127.0.0.1 external edit
research:jtransformer:api:java:pefs:4.2:classinitializert [2018/12/23 02:11]
Günter Kniesel
Line 4: Line 4:
 === classInitializerT(#​id,​ #​class,#​body) ​ === === classInitializerT(#​id,​ #​class,#​body) ​ ===
  
-Represents ​the initializer declaration.+Represents ​either a static or instance ​initializer declaration. If it is a static initializer there is also an associated PEF modifierT(#​modiferId,​ #id, '​static'​),​ where #id is the same as the one in the first argument of the classInitializer PEF
  
 Added in JT 2.8: Up to 2.8.0 it was part of [[..:​old:​methoddeft|methodDefT]]. Added in JT 2.8: Up to 2.8.0 it was part of [[..:​old:​methoddeft|methodDefT]].
Line 22: Line 22:
 == == == ==
 <Code lang-java>​ <Code lang-java>​
-class MyClass  ​  ​ +public ​class InitializerTest ​
-       ​static { ... +  
-...                                              ​+ int i; 
 +
 + i=0; 
 + } // Instance initializer 
 +  
 +  
 +        static int j; 
 + static { 
 + j=0; 
 + // Static initializer 
 } }
 </​Code>​ </​Code>​
  
 +/*
 +class(#​class,​ #​compilationUnit,​ '​MyClass',​ [..., #init]).
 +classInitializerT(#​init,​ #class, #body).
 +modifierT(#​init,​ static).
 +*/
  
 === Its PEF Representation === === Its PEF Representation ===
 ==  == ==  ==
 <Code lang-prolog>​ <Code lang-prolog>​
-class(#class#​compilationUnit, 'MyClass', [..., #init]). + ​classT(51036,51075,'InitializerTest',[],​[51053,​51082,​51054,​51083]). 
-classInitializerT(#init#class#body). + 
-modifierT(#init, static).+  fieldT(51053,​51036,​10080,​i,​null). 
 +  classInitializerT(51082,​51036,​51088). 
 +   ​blockT(51088,51082,​51082,​[51090]). 
 +    ​execT(51090,​51088,​51082,​51092). 
 +     ​assignT(51092,​51090,​51082,​51093,​51094). 
 +      fieldAccessT(51093,​51092,​51082,​null,​51053,​10080). 
 +      literalT(51094,​51092,​51082,​10080,'​0'​). 
 +       
 +  fieldT(51054,​51036,​10080,​j,​null). 
 +  modifierT(51054,​ static). 
 +  ​classInitializerT(51083,51036,51098). 
 +  modifierT(51083, static). 
 +   ​blockT(51098,​51083,​51083,​[51101]). 
 +    execT(51101,​51098,​51083,​51103). 
 +     ​assignT(51103,​51101,​51083,​51104,​51105). 
 +      fieldAccessT(51104,​51103,​51083,​null,​51054,​10080). 
 +      literalT(51105,​51103,​51083,​10080,'​0'​).
 </​Code>​ </​Code>​
  
research/jtransformer/api/java/pefs/4.2/classinitializert.txt · Last modified: 2019/01/29 14:24 by Günter Kniesel

SEWiki, © 2019