Commit 1da9b7b9 authored by Leonard Faecke's avatar Leonard Faecke
Browse files

* Expanded analysis of with attributes to include parent

parent d27837e0
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -980,6 +980,7 @@ System.out.println("Analyzing function");
			if(group.getList() == null) addToOutput(output, "GroupSize_0");
			else addToOutput(output, "GroupSize_" + (group.getList().getDefinitions().size()));
			
			//combinations
			String[] definitionTypes = {"AltstepDef", "ConstDef", "ExtConstDef", "ExtFunctionDef", 
					"GroupDef", "FunctionDef", "ImportDef", "ModuleParDef", "SignatureDef", "TemplateDef", 
					"TestcaseDef", "TypeDef"};
@@ -1039,6 +1040,22 @@ System.out.println("Analyzing function");
			addToOutput(output, "with_" + attrib.getKeyword());
			if(attrib.getOverride() != null) addToOutput(output, "override_" + attrib.getOverride());
		}
		
		for(WithStatement statement : EcoreUtil2.getAllContentsOfType(module, WithStatement.class)) {
			EObject parent = EcoreUtil2.getAllContainers(statement).iterator().next();
			String name = parent.getClass().getSimpleName();
			name = name.substring(0, name.length()-4);
			if(name.equals("ModuleDefinition")) {
				EObject o = ((ModuleDefinition) parent).getDef();
				name = o.getClass().getSimpleName();
				name = name.substring(0, name.length()-4);
				
			}
			for(SingleWithAttrib attrib : statement.getAttrib().getMulti().getSingle()) {
				addToOutput(output, name + "_with_" + attrib.getKeyword());
			}
			
		}
	}
	
	@Override