SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Command disabled: revisions

classInitializerT(#id, #parent,#body)

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 methodDefT.

Arguments

#id: id
the unique ID assigned to this fact.

#class: classT
ID of the parent (the declaring class).

#body: blockT
ID of the block.

Sample Java Source

public class InitializerTest {
		
	int i;
	{
		i=0;
	} // Instance initializer
		
		
        static int j;
	static {
		j=0;
	} // Static initializer

}

Its PEF Representation

 classT(51036,51075,'InitializerTest',[],[51053,51082,51054,51083]).

  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').

AST Specification

ast_node_type_spec(classInitializerT,[
    ast_arg(id,      mult(1,1,no ), id,  [classInitializerT]),
    ast_arg(parent,  mult(1,1,no ), id,  [classT]), 
    ast_arg(body,    mult(0,1,no),  id,  [blockT])
]).
research/jtransformer/api/java/pefs/4.2/classinitializert.txt · Last modified: 2019/01/29 14:24 by Günter Kniesel

SEWiki, © 2019