53 DATA_MEMBERS, 54 CONSTRUCTORS, 55 REDEFINED_FUNCTIONS, 56 OVERRIDEN_FUNCTIONS, 57 MEMBER_FUNCTIONS, 58 MEMBER_FUNCTIONS_DECLARATIONS, 59 PRINT_VARIABLES, 60 } 61 62 protected final String name; 63 protected final TypeKlass thisKlass; 64 private final TypeKlass parentKlass; 65 private final ArrayList<TypeKlass> interfaces; 66 67 public Klass(TypeKlass thisKlass, TypeKlass parent, 68 ArrayList<TypeKlass> interfaces, String name, int level, 69 IRNode variableDeclarations, IRNode constructorDefinitions, 70 IRNode functionDefinitions, IRNode abstractFunctionRedefinitions, 71 IRNode overridenFunctionRedefitions, IRNode functionDeclarations, 72 IRNode printVariablesBlock) { 73 this.thisKlass = thisKlass; 74 klass = thisKlass; 75 this.parentKlass = parent; 76 this.interfaces = interfaces; 77 this.name = name; 78 this.level = level; 79 addChild(variableDeclarations); 80 addChild(constructorDefinitions); 81 addChild(abstractFunctionRedefinitions); 82 addChild(overridenFunctionRedefitions); 83 addChild(functionDefinitions); 84 addChild(functionDeclarations); 85 addChild(printVariablesBlock); 86 } 87 88 @Override 89 public long complexity() { 90 return 0; 91 } 92 93 @Override 94 public<T> T accept(Visitor<T> v) { 95 return v.visit(this); 96 } 97 } | 53 DATA_MEMBERS, 54 CONSTRUCTORS, 55 REDEFINED_FUNCTIONS, 56 OVERRIDEN_FUNCTIONS, 57 MEMBER_FUNCTIONS, 58 MEMBER_FUNCTIONS_DECLARATIONS, 59 PRINT_VARIABLES, 60 } 61 62 protected final String name; 63 protected final TypeKlass thisKlass; 64 private final TypeKlass parentKlass; 65 private final ArrayList<TypeKlass> interfaces; 66 67 public Klass(TypeKlass thisKlass, TypeKlass parent, 68 ArrayList<TypeKlass> interfaces, String name, int level, 69 IRNode variableDeclarations, IRNode constructorDefinitions, 70 IRNode functionDefinitions, IRNode abstractFunctionRedefinitions, 71 IRNode overridenFunctionRedefitions, IRNode functionDeclarations, 72 IRNode printVariablesBlock) { 73 super(thisKlass); 74 this.thisKlass = thisKlass; 75 owner = thisKlass; 76 this.parentKlass = parent; 77 this.interfaces = interfaces; 78 this.name = name; 79 this.level = level; 80 resizeUpChildren(KlassPart.values().length); 81 setChild(KlassPart.DATA_MEMBERS.ordinal(), variableDeclarations); 82 setChild(KlassPart.CONSTRUCTORS.ordinal(), constructorDefinitions); 83 setChild(KlassPart.REDEFINED_FUNCTIONS.ordinal(), abstractFunctionRedefinitions); 84 setChild(KlassPart.OVERRIDEN_FUNCTIONS.ordinal(), overridenFunctionRedefitions); 85 setChild(KlassPart.MEMBER_FUNCTIONS.ordinal(), functionDefinitions); 86 setChild(KlassPart.MEMBER_FUNCTIONS_DECLARATIONS.ordinal(), functionDeclarations); 87 setChild(KlassPart.PRINT_VARIABLES.ordinal(), printVariablesBlock); 88 } 89 90 @Override 91 public long complexity() { 92 return 0; 93 } 94 95 @Override 96 public<T> T accept(Visitor<T> v) { 97 return v.visit(this); 98 } 99 } |