Loading de.ugoe.cs.swe.T3Q/src/de/ugoe/cs/swe/T3Q/UsageAnalyzer.java +21 −20 Original line number Diff line number Diff line Loading @@ -44,18 +44,6 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { //System.out.println("Module, FunctionDef, AltConstruct, RecordDefNamed, ComponentDef, ConstDef"); for (TTCN3Module module : ((TTCN3File)model).getModules()) { //immediate output (will look weird if single-core is not activated) //TODO: count different constructs (naive approach), e.g. /* System.out.println(module.getName() + ", " +EcoreUtil2.getAllContentsOfType(module, FunctionDef.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, AltConstruct.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, RecordDefNamed.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, ComponentDef.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, ConstDef.class).size() ); */ //TODO: very inefficient, better to traverse tree once, e.g. //process with a stream Loading Loading @@ -385,6 +373,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeGroupDef(GroupDef group, TTCN3Usage output) { System.out.println("Analyzing group"); String id = "Group"; if(group.getList() != null) { id += "Size" + group.getList().getDefinitions().size(); Loading @@ -396,12 +385,18 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { } /** * Analyzes a template definition. Currently just a skeleton * Analyzes a template definition on its base type and whether it is derived * @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"); System.out.println("Analyzing template"); if(tem.getBase().getType().getPre() != null) { addToOutput(output, "Template:" + tem.getBase().getType().getPre()); } else addToOutput(output, "Template:Non-Primitive"); if(tem.getDerived() != null) addToOutput(output, "Template:Derived"); //TODO analyze body //TODO analyze Restriction } /** Loading @@ -410,7 +405,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeTestcaseDef(TestcaseDef test, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "Testcase"); //TODO everything } /** Loading @@ -419,7 +415,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeSignatureDef(SignatureDef sig, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "Signature"); //TODO everything } /** Loading Loading @@ -485,7 +482,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeAltstepDef(AltstepDef alt, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "Altstep"); //TODO everything } /** Loading @@ -494,7 +492,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeExtConstDef(ExtConstDef con, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "ExtConst"); //TODO everything } /** Loading @@ -503,7 +502,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeExtFunctionDef(ExtFunctionDef fun, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "ExtFunction"); //TODO everything } /** Loading @@ -512,7 +512,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeModuleParDef(ModuleParDef mod, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "ModulePar"); //TODO everything } @Override Loading Loading
de.ugoe.cs.swe.T3Q/src/de/ugoe/cs/swe/T3Q/UsageAnalyzer.java +21 −20 Original line number Diff line number Diff line Loading @@ -44,18 +44,6 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { //System.out.println("Module, FunctionDef, AltConstruct, RecordDefNamed, ComponentDef, ConstDef"); for (TTCN3Module module : ((TTCN3File)model).getModules()) { //immediate output (will look weird if single-core is not activated) //TODO: count different constructs (naive approach), e.g. /* System.out.println(module.getName() + ", " +EcoreUtil2.getAllContentsOfType(module, FunctionDef.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, AltConstruct.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, RecordDefNamed.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, ComponentDef.class).size() + ", " +EcoreUtil2.getAllContentsOfType(module, ConstDef.class).size() ); */ //TODO: very inefficient, better to traverse tree once, e.g. //process with a stream Loading Loading @@ -385,6 +373,7 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeGroupDef(GroupDef group, TTCN3Usage output) { System.out.println("Analyzing group"); String id = "Group"; if(group.getList() != null) { id += "Size" + group.getList().getDefinitions().size(); Loading @@ -396,12 +385,18 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { } /** * Analyzes a template definition. Currently just a skeleton * Analyzes a template definition on its base type and whether it is derived * @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"); System.out.println("Analyzing template"); if(tem.getBase().getType().getPre() != null) { addToOutput(output, "Template:" + tem.getBase().getType().getPre()); } else addToOutput(output, "Template:Non-Primitive"); if(tem.getDerived() != null) addToOutput(output, "Template:Derived"); //TODO analyze body //TODO analyze Restriction } /** Loading @@ -410,7 +405,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeTestcaseDef(TestcaseDef test, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "Testcase"); //TODO everything } /** Loading @@ -419,7 +415,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeSignatureDef(SignatureDef sig, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "Signature"); //TODO everything } /** Loading Loading @@ -485,7 +482,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeAltstepDef(AltstepDef alt, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "Altstep"); //TODO everything } /** Loading @@ -494,7 +492,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeExtConstDef(ExtConstDef con, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "ExtConst"); //TODO everything } /** Loading @@ -503,7 +502,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeExtFunctionDef(ExtFunctionDef fun, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "ExtFunction"); //TODO everything } /** Loading @@ -512,7 +512,8 @@ public class UsageAnalyzer implements Callable<TTCN3Usage> { * @param output The TTCN3Usage to write the output to */ private void analyzeModuleParDef(ModuleParDef mod, TTCN3Usage output) { System.out.println("TODO"); addToOutput(output, "ModulePar"); //TODO everything } @Override Loading