Commit eccbda23 authored by Leonard Faecke's avatar Leonard Faecke
Browse files

+ Added function skeletons for all known definitions

parent a0d06327
Loading
Loading
Loading
Loading
+113 −0
Original line number Diff line number Diff line
@@ -260,10 +260,31 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
		}
		EList<ModuleDefinition> defs = module.getDefs().getDefinitions();
		for(ModuleDefinition def : defs) {
			//switch would be better, but does not work when comparing to classes
			if(def.getDef().getClass() == ConstDefImpl.class) {
				analyzeConstDef((ConstDef) def.getDef(), output);
			} else if (def.getDef().getClass() == FunctionDefImpl.class) {
				analyzeFunctionDef((FunctionDef) def.getDef(), output);
			} else if(def.getDef().getClass() == ImportDefImpl.class) {
				analyzeImportDef((ImportDef) def, output);
			} else if(def.getDef().getClass() == GroupDefImpl.class) {
				analyzeGroupDef((GroupDef) def, output);
			} else if(def.getDef().getClass() == TemplateDefImpl.class) {
				analyzeTemplateDef((TemplateDef) def, output);
			} else if(def.getDef().getClass() == TestcaseDefImpl.class) {
				analyzeTestcaseDef((TestcaseDef) def, output);
			} else if(def.getDef().getClass() == SignatureDefImpl.class) {
				analyzeSignatureDef((SignatureDef) def, output);
			} else if(def.getDef().getClass() == TypeDefImpl.class) {
				analyzeTypeDef((TypeDef) def, output);
			} else if(def.getDef().getClass() == AltstepDefImpl.class) {
				analyzeAltstepDef((AltstepDef) def, output);
			} else if(def.getDef().getClass() == ExtFunctionDefImpl.class) {
				analyzeExtFunctionDef((ExtFunctionDef) def, output);
			} else if(def.getDef().getClass() == ExtConstDefImpl.class) {
				analyzeExtConstDef((ExtConstDef) def, output);
			} else if(def.getDef().getClass() == ModuleParDefImpl.class) {
				analyzeModuleParDef((ModuleParDef) def, output);
			} else {
				System.out.println("Unanalyzed: " + def.getDef().getClass());
			}
@@ -332,6 +353,98 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
			id = "0ParamsInFunction";
		}
		addToOutput(output, id);
		
		//TODO: Statements within the function
	}
	
	/**
	 * Analyzes the import statements. Currently just a skeleton
	 * @param imp The import definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeImportDef(ImportDef imp, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the group definitions. Currently just a skeleton
	 * @param group The group definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeGroupDef(GroupDef group, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the template definitions. Currently just a skeleton
	 * @param tem The template definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeTemplateDef(TemplateDef tem, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the testcase definitions. Currently just a skeleton
	 * @param test The import definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeTestcaseDef(TestcaseDef test, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the signature definitions. Currently just a skeleton
	 * @param sig The signature definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeSignatureDef(SignatureDef sig, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the type definitions. Currently just a skeleton
	 * @param type The type definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeTypeDef(TypeDef type, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the altstep definitions. Currently just a skeleton
	 * @param alt The altstep definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeAltstepDef(AltstepDef alt, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the ext constant definitions. Currently just a skeleton
	 * @param con The ext constant definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeExtConstDef(ExtConstDef con, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the ext function definitions. Currently just a skeleton
	 * @param fun The ext function definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeExtFunctionDef(ExtFunctionDef fun, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	/**
	 * Analyzes the module par definitions. Currently just a skeleton
	 * @param mod The module par definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
	private void analyzeModuleParDef(ModuleParDef mod, TTCN3Usage output) {
		System.out.println("TODO");
	}
	
	@Override