Commit 7bb83565 authored by Leonard Faecke's avatar Leonard Faecke
Browse files

+ Added type definition analysis

parent fa2bd156
Loading
Loading
Loading
Loading
+30 −11
Original line number Diff line number Diff line
@@ -358,11 +358,12 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the import statements.
	 * Analyzes an import statement.
	 * @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("Analyzing import");
		String impType = "Import";
		if(imp.getAll() == null && imp.getImportSpec() == null && imp.getSpec() == null) {
			impType += "null"; //Import statement that does not import something, should not happen
@@ -379,7 +380,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the group definitions. Currently just a skeleton
	 * Analyzes a group definition. Currently just a skeleton
	 * @param group The group definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -388,7 +389,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the template definitions. Currently just a skeleton
	 * Analyzes a template definition. Currently just a skeleton
	 * @param tem The template definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -397,7 +398,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the testcase definitions. Currently just a skeleton
	 * Analyzes a testcase definition. Currently just a skeleton
	 * @param test The import definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -406,7 +407,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the signature definitions. Currently just a skeleton
	 * Analyzes a signature definition. Currently just a skeleton
	 * @param sig The signature definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -415,16 +416,34 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the type definitions. Currently just a skeleton
	 * Analyzes a type definition. 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");
		System.out.println("Analyzing type definition");
		String id = "Type:";
		if(type.getBody().getSub() != null) {
			if(type.getBody().getSub().getType().getPre() == null) {
				id += "Non-Primitive";
			} else {
				id += type.getBody().getSub().getType().getPre();
			}
			if(type.getBody().getSub().getSpec() != null) {
				id += "Specified";
			}
			addToOutput(output, id);
		} else if(type.getBody().getStructured() != null) {
			id += "Structured";
			//TODO expand analysis
			addToOutput(output, id);
		} else {
			System.out.println("Type is neither structured nor a subtype");
		}
	}
	
	/**
	 * Analyzes the altstep definitions. Currently just a skeleton
	 * Analyzes a altstep definition. Currently just a skeleton
	 * @param alt The altstep definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -433,7 +452,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the ext constant definitions. Currently just a skeleton
	 * Analyzes a ext constant definition. Currently just a skeleton
	 * @param con The ext constant definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -442,7 +461,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the ext function definitions. Currently just a skeleton
	 * Analyzes a ext function definition. Currently just a skeleton
	 * @param fun The ext function definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */
@@ -451,7 +470,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> {
	}
	
	/**
	 * Analyzes the module par definitions. Currently just a skeleton
	 * Analyzes a module par definition. Currently just a skeleton
	 * @param mod The module par definition to be analyzed
	 * @param output The TTCN3Usage to write the output to
	 */