Kaynağa Gözat

Changes for name calculation in CDomain

René Beckmann 7 yıl önce
ebeveyn
işleme
dfa1888dae

+ 18 - 6
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CCodeGeneratorModule.java

@@ -22,6 +22,7 @@ import org.yakindu.base.types.Annotation;
 import org.yakindu.sct.generator.c.eventdriven.EventDrivenExpressionCode;
 import org.yakindu.sct.generator.c.eventdriven.EventDrivenStatemachineHeader;
 import org.yakindu.sct.generator.c.eventdriven.EventDrivenStatemachineSource;
+import org.yakindu.sct.generator.c.extensions.GenmodelEntries;
 import org.yakindu.sct.generator.c.types.CTypeSystemAccess;
 import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
 import org.yakindu.sct.generator.core.IGeneratorModule;
@@ -32,12 +33,11 @@ import org.yakindu.sct.model.sgen.GeneratorEntry;
 import org.yakindu.sct.model.sgraph.Statechart;
 
 import com.google.inject.Binder;
-import com.google.inject.Singleton;
 import com.google.inject.name.Names;
 /**
- * 
+ *
  * @author andreas muelder - Initial contribution and API
- * 
+ *
  */
 public class CCodeGeneratorModule implements IGeneratorModule {
 
@@ -47,9 +47,11 @@ public class CCodeGeneratorModule implements IGeneratorModule {
 		binder.bind(IExecutionFlowGenerator.class).to(CGenerator.class);
 		binder.bind(ICodegenTypeSystemAccess.class).to(CTypeSystemAccess.class);
 		binder.bind(IncludeProvider.class).to(StandardIncludeProvider.class);
+		binder.bind(INamingService.class).to(CNamingService.class);
 		bindIGenArtifactConfigurations(entry, binder);
 		bindTracingProperty(entry, binder);
 		configureEventDriven(entry, binder);
+		binder.bind(String.class).annotatedWith(Names.named("Separator")).toInstance(getSeparator(entry));
 	}
 
 	protected void bindTracingProperty(GeneratorEntry entry, Binder binder) {
@@ -72,16 +74,26 @@ public class CCodeGeneratorModule implements IGeneratorModule {
 			binder.bind(IGenArtifactConfigurations.class).to(SimpleGenArtifactConfigurations.class);
 		}
 	}
-	
+
 	protected void configureEventDriven(GeneratorEntry entry, Binder binder) {
 		Statechart statechart = (Statechart) entry.getElementRef();
 		Annotation eventDrivenAnnotation = statechart.getAnnotationOfType(EVENT_DRIVEN_ANNOTATION);
-		
-		if(eventDrivenAnnotation != null) {
+
+		if (eventDrivenAnnotation != null) {
 			binder.bind(StatemachineHeader.class).to(EventDrivenStatemachineHeader.class);
 			binder.bind(StatemachineSource.class).to(EventDrivenStatemachineSource.class);
 			binder.bind(CExpressionsGenerator.class).to(EventDrivenExpressionCode.class);
 		}
 	}
 
+	protected String getSeparator(GeneratorEntry entry) {
+		GenmodelEntries entries = new GenmodelEntries();
+		String separator = entries.getSeparator(entry);
+		if (separator == null) {
+			return "_";
+		} else {
+			return separator;
+		}
+	}
+
 }

+ 4 - 4
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/FlowCode.xtend

@@ -59,13 +59,13 @@ class FlowCode {
 	
 	def dispatch CharSequence code(TraceStateEntered it) '''
 		«IF entry.tracingEnterState»
-		«flow.type.toFirstLower»_stateEntered(«scHandle», «it.state.shortName»);
+		«flow.type.toFirstLower»_stateEntered(«scHandle», «it.state.stateName»);
 		«ENDIF»
 	'''
 	
 	def dispatch CharSequence code(TraceStateExited it) '''
 		«IF entry.tracingExitState»
-		«flow.type.toFirstLower»_stateExited(«scHandle», «it.state.shortName»);
+		«flow.type.toFirstLower»_stateExited(«scHandle», «it.state.stateName»);
 		«ENDIF»
 	'''
 
@@ -95,7 +95,7 @@ class FlowCode {
 			{
 		«ENDIF»
 			«FOR caseid : cases»
-				case «caseid.state.shortName» :
+				case «caseid.state.stateName» :
 				{
 					«caseid.step.code»
 					break;
@@ -147,7 +147,7 @@ class FlowCode {
 	'''
 	
 	def dispatch CharSequence code(EnterState it) '''
-		«scHandle»->stateConfVector[«state.stateVector.offset»] = «state.shortName»;
+		«scHandle»->stateConfVector[«state.stateVector.offset»] = «state.stateName»;
 		«scHandle»->stateConfVectorPosition = «state.stateVector.offset»;
 	'''
 

+ 0 - 15
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineHeader.xtend

@@ -162,21 +162,6 @@ class StatemachineHeader implements IContentTemplate {
 		} «statesEnumType»;
 	'''
 
-	def dispatch scopeTypeDeclMember(EventDefinition it) '''
-		«bool» «eventRaisedFlag»;
-		«IF type != null && type.name != 'void'»«typeSpecifier.targetLanguageName» «eventValueVariable»;«ENDIF»
-	'''
-
-	def dispatch scopeTypeDeclMember(TimeEvent it) '''
-		«bool» «timeEventRaisedFlag»;
-	'''
-
-	def dispatch scopeTypeDeclMember(VariableDefinition it) '''
-		«IF type.name != 'void' && !isConst»«typeSpecifier.targetLanguageName» «variable»;«ENDIF»
-	'''
-	
-	def dispatch scopeTypeDeclMember(Declaration it) ''''''
-
 	def scopeTypeDecl(Scope scope) '''
 		«val typeRelevantDeclarations = scope.typeRelevantDeclarations.toList»
 		«IF !typeRelevantDeclarations.empty»

+ 6 - 6
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineSource.xtend

@@ -194,7 +194,7 @@ class StatemachineSource implements IContentTemplate {
 			{
 			«FOR state : states»
 				«IF state.reactSequence !== null»
-				case «state.shortName»:
+				case «state.stateName»:
 				{
 					«state.reactSequence.shortName»(«scHandle»);
 					break;
@@ -229,10 +229,10 @@ class StatemachineSource implements IContentTemplate {
 			switch (state)
 			{
 				«FOR s : states»
-				case «s.shortName» :
-					result = (sc_boolean) («IF s.leaf»«scHandle»->stateConfVector[«s.stateVectorDefine»] == «s.shortName»
-					«ELSE»«scHandle»->stateConfVector[«s.stateVectorDefine»] >= «s.shortName»
-						&& «scHandle»->stateConfVector[«s.stateVectorDefine»] <= «s.subStates.last.shortName»«ENDIF»);
+				case «s.stateName» :
+					result = (sc_boolean) («IF s.leaf»«scHandle»->stateConfVector[«s.stateVectorDefine»] == «s.stateName»
+					«ELSE»«scHandle»->stateConfVector[«s.stateVectorDefine»] >= «s.stateName»
+						&& «scHandle»->stateConfVector[«s.stateVectorDefine»] <= «s.subStates.last.stateName»«ENDIF»);
 					break;
 				«ENDFOR»
 				default:
@@ -272,7 +272,7 @@ class StatemachineSource implements IContentTemplate {
 		''' +
 		// only if the impact vector is completely covered by final states the state machine
 		// can become final
-		{if (finalStateImpactVector.isCompletelyCovered) {'''	return «FOR i : 0 ..<finalStateImpactVector.size SEPARATOR ' && '»(«FOR fs : finalStateImpactVector.get(i) SEPARATOR ' || '»«scHandle»->stateConfVector[«i»] == «IF fs.stateVector.offset == i»«fs.shortName»«ELSE»«null_state»«ENDIF»«ENDFOR»)«ENDFOR»;
+		{if (finalStateImpactVector.isCompletelyCovered) {'''	return «FOR i : 0 ..<finalStateImpactVector.size SEPARATOR ' && '»(«FOR fs : finalStateImpactVector.get(i) SEPARATOR ' || '»«scHandle»->stateConfVector[«i»] == «IF fs.stateVector.offset == i»«fs.stateName»«ELSE»«null_state»«ENDIF»«ENDFOR»)«ENDFOR»;
 		'''} else {'''   return bool_false;'''} }		
 		+ Strings.newLine + '''}'''
 	}

+ 47 - 31
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/extensions/Naming.xtend

@@ -11,6 +11,7 @@
 package org.yakindu.sct.generator.c.extensions
 
 import com.google.inject.Inject
+import com.google.inject.name.Named
 import java.util.List
 import org.eclipse.emf.ecore.EObject
 import org.yakindu.base.types.Declaration
@@ -24,10 +25,10 @@ import org.yakindu.sct.model.sexec.ExecutionState
 import org.yakindu.sct.model.sexec.Step
 import org.yakindu.sct.model.sexec.TimeEvent
 import org.yakindu.sct.model.sexec.naming.INamingService
-import org.yakindu.sct.model.sgen.GeneratorEntry
 import org.yakindu.sct.model.sgraph.Scope
 import org.yakindu.sct.model.sgraph.ScopedElement
 import org.yakindu.sct.model.sgraph.State
+import org.yakindu.sct.model.sgraph.Statechart
 import org.yakindu.sct.model.stext.naming.StextNameProvider
 import org.yakindu.sct.model.stext.stext.EventDefinition
 import org.yakindu.sct.model.stext.stext.InterfaceScope
@@ -36,18 +37,15 @@ import org.yakindu.sct.model.stext.stext.OperationDefinition
 import org.yakindu.sct.model.stext.stext.VariableDefinition
 
 class Naming {
+	@Inject @Named("Separator") protected String sep;
 
-	@Inject extension Navigation
+	@Inject protected extension Navigation
 
-	@Inject extension ICodegenTypeSystemAccess
+	@Inject protected extension ICodegenTypeSystemAccess
 
-	@Inject private StextNameProvider provider
+	@Inject protected StextNameProvider provider
 
-	@Inject extension INamingService
-
-	@Inject GeneratorEntry entry
-
-	@Inject extension GenmodelEntries
+	@Inject protected extension INamingService
 
 	public static final String NULL_STRING = "null";
 
@@ -56,10 +54,7 @@ class Naming {
 	}
 
 	def module(ExecutionFlow it) {
-		if (entry.moduleName.nullOrEmpty) {
-			return name.asIdentifier.toFirstUpper
-		}
-		return entry.moduleName.toFirstUpper
+		type
 	}
 
 	def filterNullOrEmptyAndJoin(Iterable<CharSequence> it) {
@@ -103,10 +98,7 @@ class Naming {
 	}
 
 	def dispatch String type(ExecutionFlow it) {
-		if (entry.statemachinePrefix.nullOrEmpty) {
-			return name.asIdentifier.toFirstUpper
-		}
-		return entry.statemachinePrefix.toFirstUpper
+		name.asIdentifier.toFirstUpper
 	}
 
 	def dispatch instance(InterfaceScope it) {
@@ -122,11 +114,6 @@ class Naming {
 	}
 
 	def functionPrefix(Scope it, Declaration decl) {
-		// only non-unique declarations in different scopes will be prefixed with the name of the scope
-		if (!isUniqueName(it, decl) && !entry.statemachinePrefix.nullOrEmpty)
-			return entry.statemachinePrefix + separator + it.instance.toFirstUpper
-		if (!entry.statemachinePrefix.nullOrEmpty)
-			return entry.statemachinePrefix
 		return type.toFirstLower
 	}
 
@@ -135,14 +122,11 @@ class Naming {
 	}
 
 	def functionPrefix(ExecutionFlow it) {
-		if (!entry.statemachinePrefix.nullOrEmpty) {
-			return entry.statemachinePrefix + separator
-		}
 		type.toFirstLower + separator
 	}
 
 	def separator() {
-		var sep = entry.separator
+		var sep = this.sep
 		if (sep.nullOrEmpty) {
 			sep = "_"
 		}
@@ -186,9 +170,37 @@ class Naming {
 		return null;
 	}
 	
+	def Statechart statechart(EObject element) {
+		var ret = element;
+
+		while (ret !== null) {
+			if (ret instanceof Statechart) {
+				return ret as Statechart
+			} else {
+				ret = ret.eContainer;
+			}
+		}
+		return null;
+	}
+	
 	def bool() {
 		"sc_boolean"
 	}
+	
+	def dispatch scopeTypeDeclMember(EventDefinition it) '''
+		«bool» «eventRaisedFlag»;
+		«IF type !== null && type.name != 'void'»«typeSpecifier.targetLanguageName» «eventValueVariable»;«ENDIF»
+	'''
+
+	def dispatch scopeTypeDeclMember(TimeEvent it) '''
+		«bool» «timeEventRaisedFlag»;
+	'''
+
+	def dispatch scopeTypeDeclMember(VariableDefinition it) '''
+		«IF type.name != 'void' && !isConst»«typeSpecifier.targetLanguageName» «variable»;«ENDIF»
+	'''
+	
+	def dispatch scopeTypeDeclMember(Declaration it) ''''''
 
 	def constantName(VariableDefinition it) {
 		(flow.type + separator + scope.type + separator + name.asEscapedIdentifier).toUpperCase
@@ -255,29 +267,33 @@ class Naming {
 	}
  
 	def asRaiser(EventDefinition it) {
-		scope.functionPrefix(it) + separator + 'raise' + separator + name.asIdentifier.toFirstLower
+		accessFunction("raise")
 	}
 
 	def asRaised(EventDefinition it) {
-		scope.functionPrefix(it) + separator + 'israised' + separator + name.asIdentifier.toFirstLower
+		accessFunction("israised")
 	}
 
 	def asGetter(EventDefinition it) {
-		scope.functionPrefix(it) + separator + 'get' + separator + name.asIdentifier.toFirstLower + separator + 'value'
+		accessFunction("get").value
 	}
 
 	def asGetter(VariableDefinition it) {
-		scope.functionPrefix(it) + separator + 'get' + separator + name.asIdentifier.toFirstLower
+		accessFunction("get")
 	}
 
 	def asSetter(VariableDefinition it) {
-		scope.functionPrefix(it) + separator + 'set' + separator + name.asIdentifier.toFirstLower
+		accessFunction("set")
 	}
 
 	def asFunction(OperationDefinition it) {
 		scope.functionPrefix(it) + separator + name.asIdentifier.toFirstLower
 	}
 	
+	def accessFunction(Declaration it, String funcName) {
+		scope.functionPrefix(it) + separator + funcName + separator + name.asIdentifier.toFirstLower
+	}
+	
 	def variable(VariableDefinition it) {
 		name.asEscapedIdentifier
 	}

+ 4 - 0
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppNaming.xtend

@@ -82,6 +82,10 @@ class CppNaming extends Naming {
 	def timeEventsInstance() {
 		'timeEvents'
 	}
+	
+	override dispatch scopeTypeDeclMember(VariableDefinition it) '''
+		«IF type.name != 'void'»«IF const»static const «ENDIF»«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
+	'''
 
 	def protected signature(OperationDefinition it) '''
 	«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«IF parameter.isVarArgs»...«ELSE»«parameter.typeSpecifier.

+ 0 - 4
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineHeader.xtend

@@ -225,10 +225,6 @@ class StatemachineHeader extends org.yakindu.sct.generator.c.StatemachineHeader
 		''''''	
 	}
 	
-	override dispatch scopeTypeDeclMember(VariableDefinition it) '''
-		«IF type.name != 'void'»«IF const»static const «ENDIF»«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
-	'''
-
 	def createOCBInterface(StatechartScope scope) {
 		'''
 			«IF scope.hasOperations»

+ 2 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/naming/tree/TreeNamingService.xtend

@@ -11,6 +11,7 @@
 
 package org.yakindu.sct.model.sexec.naming.tree
 
+import com.google.inject.name.Named
 import java.util.ArrayList
 import java.util.List
 import java.util.Map
@@ -40,7 +41,7 @@ import org.yakindu.sct.model.stext.stext.TimeEventSpec
  */
 class TreeNamingService implements INamingService {
 	@Accessors protected int maxLength = 0;
-	@Accessors protected char separator = '_';
+	@Inject @Named("Separator") @Accessors protected char separator = '_';
 
 	@Inject extension SExecExtensions
 	@Inject extension StatechartExtensions

+ 8 - 3
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/STextRuntimeModule.java

@@ -38,7 +38,7 @@ import com.google.inject.name.Names;
 /**
  * Use this class to register components to be used at runtime / without the
  * Equinox extension registry.
- * 
+ *
  * @author andreas muelder
  * @author axel terfloth
  */
@@ -50,9 +50,13 @@ public class STextRuntimeModule extends org.yakindu.sct.model.stext.AbstractSTex
 		binder.bind(IDefaultResourceDescriptionStrategy.class).to(SCTResourceDescriptionStrategy.class);
 		// https://github.com/Yakindu/statecharts/issues/1199
 		binder.bind(IReferableElementsUnloader.class).to(IReferableElementsUnloader.NullUnloader.class);
-		binder.bind(INamesAreUniqueValidationHelper.class).to(STextNamesAreUniqueValidationHelper.class);
 	}
 
+	public Class<? extends INamesAreUniqueValidationHelper> bindNamesAreUniqueValidationHelper() {
+		return STextNamesAreUniqueValidationHelper.class;
+	}
+
+	@Override
 	public Class<? extends org.eclipse.xtext.scoping.IGlobalScopeProvider> bindIGlobalScopeProvider() {
 		return STextGlobalScopeProvider.class;
 	}
@@ -76,6 +80,7 @@ public class STextRuntimeModule extends org.yakindu.sct.model.stext.AbstractSTex
 		return STextValueConverterService.class;
 	}
 
+	@Override
 	public void configureFileExtensions(Binder binder) {
 		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("stext,sct");
 	}
@@ -98,7 +103,7 @@ public class STextRuntimeModule extends org.yakindu.sct.model.stext.AbstractSTex
 	public Class<? extends ITypeSystemInferrer> bindITypeSystemInferrer() {
 		return STextTypeInferrer.class;
 	}
-	
+
 	@Override
 	public Class<? extends ITransientValueService> bindITransientValueService() {
 		return STextTransientValueService.class;

+ 52 - 34
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/validation/STextNamesAreUniqueValidationHelper.java

@@ -6,7 +6,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  * Contributors:
  * 	rbeckmann - initial API and implementation
- * 
+ *
  */
 package org.yakindu.sct.model.stext.validation;
 
@@ -31,12 +31,15 @@ import org.eclipse.xtext.validation.ValidationMessageAcceptor;
  * @author rbeckmann
  *
  */
-public class STextNamesAreUniqueValidationHelper extends NamesAreUniqueValidationHelper implements INamesAreUniqueValidationHelper {
+public class STextNamesAreUniqueValidationHelper extends NamesAreUniqueValidationHelper
+		implements
+			INamesAreUniqueValidationHelper {
 	protected OperationCanceledManager operationCanceledManager = new OperationCanceledManager();
 
 	protected Map<QualifiedName, IEObjectDescription> nameMap;
 	protected Map<QualifiedName, IEObjectDescription> caseInsensitiveMap;
-	
+	protected Map<String, IEObjectDescription> lastElementMap;
+
 	@Override
 	public void checkUniqueNames(Iterable<IEObjectDescription> descriptions, ValidationMessageAcceptor acceptor) {
 		checkUniqueNames(descriptions, null, acceptor);
@@ -55,6 +58,7 @@ public class STextNamesAreUniqueValidationHelper extends NamesAreUniqueValidatio
 		Iterator<IEObjectDescription> iter = descriptions.iterator();
 		this.nameMap = new HashMap<>();
 		this.caseInsensitiveMap = new HashMap<>();
+		this.lastElementMap = new HashMap<>();
 		if (!iter.hasNext())
 			return;
 		while (iter.hasNext()) {
@@ -69,74 +73,88 @@ public class STextNamesAreUniqueValidationHelper extends NamesAreUniqueValidatio
 		QualifiedName qName = description.getName();
 		IEObjectDescription put = nameMap.put(qName, description);
 		IEObjectDescription lowerCasePut = caseInsensitiveMap.put(qName.toLowerCase(), description);
-		if(put != null) {
+		IEObjectDescription lastElementPut = lastElementMap.put(qName.getLastSegment(), description);
+		if (put != null) {
 			EClass common = checkForCommonSuperClass(put, description);
-			if(common != null) {
-				createDuplicateNameError(description, common, acceptor);
-				createDuplicateNameError(put, common, acceptor);
+			if (common != null) {
+				duplicateFQN(description, put, common, acceptor);
 			}
-		} else if(lowerCasePut != null) {
-			if(lowerCasePut.getEClass().equals(description.getEClass())) {
-				createDuplicateNameWarning(description, description.getEClass(), acceptor);
-				createDuplicateNameWarning(lowerCasePut, description.getEClass(), acceptor);
+		} else if (lowerCasePut != null) {
+			if (lowerCasePut.getEClass().equals(description.getEClass())) {
+				duplicateCaseInsensitiveFQN(description, lowerCasePut, acceptor);
 			}
 		}
+		if (lastElementPut != null) {
+			duplicateLastElement(description, lastElementPut, acceptor);
+		}
+	}
+
+	protected void duplicateLastElement(IEObjectDescription description, IEObjectDescription lastElementPut,
+			ValidationMessageAcceptor acceptor) {
+	}
+
+	protected void duplicateCaseInsensitiveFQN(IEObjectDescription description, IEObjectDescription lowerCasePut,
+			ValidationMessageAcceptor acceptor) {
+		createDuplicateNameWarning(description, description.getEClass(), acceptor);
+		createDuplicateNameWarning(lowerCasePut, description.getEClass(), acceptor);
+	}
+
+	protected void duplicateFQN(IEObjectDescription description, IEObjectDescription old, EClass common,
+			ValidationMessageAcceptor acceptor) {
+		createDuplicateNameError(description, common, acceptor);
+		createDuplicateNameError(old, common, acceptor);
 	}
 
 	protected void createDuplicateNameWarning(IEObjectDescription description, EClass eClass,
 			ValidationMessageAcceptor acceptor) {
 		EObject object = description.getEObjectOrProxy();
 		EStructuralFeature feature = getNameFeature(object);
-		acceptor.acceptWarning(
-				getDuplicateNameWarningMessage(description, eClass, feature), 
-				object, 
-				feature,
-				ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
-				getErrorCode());
+		acceptor.acceptWarning(getDuplicateNameWarningMessage(description, eClass, feature), object, feature,
+				ValidationMessageAcceptor.INSIGNIFICANT_INDEX, getErrorCode());
 	}
 
 	protected String getDuplicateNameWarningMessage(IEObjectDescription description, EClass eClass,
 			EStructuralFeature feature) {
-		return getDuplicateNameErrorMessage(description, eClass, feature) + ". Names differ only in case, which can lead to compilation problems.";
+		return getDuplicateNameErrorMessage(description, eClass, feature)
+				+ ". Names differ only in case, which can lead to compilation problems.";
 	}
 
 	protected EClass checkForCommonSuperClass(IEObjectDescription one, IEObjectDescription two) {
-		
-		
+
 		List<EClass> flatOne = buildSuperClassList(one.getEClass());
 		List<EClass> flatTwo = buildSuperClassList(two.getEClass());
-		
-		for(EClass eC : flatOne) {
-			if(flatTwo.contains(eC))
+
+		for (EClass eC : flatOne) {
+			if (flatTwo.contains(eC))
 				return eC;
 		}
-		
+
 		return null;
 	}
-	
+
 	protected List<EClass> buildSuperClassList(EClass eClass) {
 		List<List<EClass>> superClasses = new ArrayList<>();
-		
+
 		buildSuperClassList(superClasses, eClass, 0);
-		
+
 		List<EClass> result = new ArrayList<>();
-		for(List<EClass> list : superClasses) {
+		for (List<EClass> list : superClasses) {
 			result.addAll(list);
 		}
-		
+
 		return result;
 	}
-	
+
 	protected void buildSuperClassList(List<List<EClass>> superClasses, EClass eClass, int depth) {
-		if(superClasses.size() <= depth) {
+		if (superClasses.size() <= depth) {
 			superClasses.add(depth, new ArrayList<>());
 		}
-		
+
 		List<EClass> superTypes = eClass.getESuperTypes();
 
 		superClasses.get(depth).add(eClass);
-		
-		for(EClass superType : superTypes) {
+
+		for (EClass superType : superTypes) {
 			buildSuperClassList(superClasses, superType, depth + 1);
 		}
 	}