diff --git a/build.gradle b/build.gradle index 2e6b66c6aad8a5fdc056079bb5f9a7be6e17488e..555420f50e18f629f023a005cc81e05fac268b8a 100644 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,6 @@ apply plugin: 'findbugs' project.version = '1.0.5-SNAPSHOT' project.group = 'de.prob' -sourceCompatibility = 1.5 - repositories { mavenCentral() maven { @@ -20,7 +18,7 @@ configurations { // configuration that holds jars to copy into lib releaseJars } -def parser_version = '2.4.28-SNAPSHOT' +def parser_version = '2.5.0-SNAPSHOT' dependencies { //compile (group: 'com.microsoft', name: 'tla2tools', version: '1.4.6') @@ -43,32 +41,34 @@ dependencies { } jacoco { - toolVersion = "0.6.2.201302030002" + toolVersion = "0.7.1.201405082137" reportsDir = file("$buildDir/customJacocoReportDir") } -jacocoTestReport { - reports { - xml.enabled false - csv.enabled false - html.destination "${buildDir}/jacocoHtml" - } -} +// type 'gradle tla2b jacocoIntegrationTestReport' in order to run the jacoco code coverage analysis +task jacocoIntegrationTestReport(type: JacocoReport) { + sourceSets sourceSets.main + //executionData files('build/jacoco/integrationTests.exec') + executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec") + } tasks.withType(FindBugs) { + // disable findbugs by default + // in order to run findbugs type 'gradle tlc4b findbugsMain findbugsTest' + task -> enabled = gradle.startParameter.taskNames.contains(task.name) + reports { xml.enabled = false html.enabled = true } -} - -findbugs { - ignoreFailures = true + + ignoreFailures = true } test { exclude('testing') + allJvmArgs = [ "-Xss515m" ] } jar { from sourceSets.main.allJava } @@ -79,7 +79,6 @@ jar { jar { manifest { attributes "Main-Class" : 'de.tla2b.TLA2B' - attributes "Class-Path": './tla/ tlatools.jar' } } diff --git a/src/main/java/de/tla2b/analysis/RecursiveFunktion.java b/src/main/java/de/tla2b/analysis/RecursiveFunktion.java index 0f8f0c259191e6338f075c296c5b1d7b7748ff8d..54ccc5434db2eb625063a34b02de5b8fc0159ca5 100644 --- a/src/main/java/de/tla2b/analysis/RecursiveFunktion.java +++ b/src/main/java/de/tla2b/analysis/RecursiveFunktion.java @@ -5,7 +5,6 @@ package de.tla2b.analysis; import de.tla2b.exceptions.NotImplementedException; -import tla2sany.semantic.ExprOrOpArgNode; import tla2sany.semantic.OpApplNode; import tla2sany.semantic.OpDefNode; import tlc2.tool.BuiltInOPs; @@ -24,28 +23,28 @@ public class RecursiveFunktion extends BuiltInOPs { } - /** - * @throws NotImplementedException - * - */ - private void evalDef() throws NotImplementedException { - ExprOrOpArgNode e = rfs.getArgs()[0]; - //System.out.println(rfs.toString(5)); - if (e instanceof OpApplNode) { - OpApplNode o = (OpApplNode) e; - switch (getOpCode(o.getOperator().getName())) { - case OPCODE_ite: { // IF THEN ELSE - ifThenElse = o; - return; - } - } - throw new NotImplementedException( - "Only IF/THEN/ELSE or CASE constructs are supported at the body of a recursive function."); - } else { - throw new NotImplementedException( - "Only IF/THEN/ELSE or CASE constructs are supported at the body of a recursive function."); - } - } +// /** +// * @throws NotImplementedException +// * +// */ +// private void evalDef() throws NotImplementedException { +// ExprOrOpArgNode e = rfs.getArgs()[0]; +// //System.out.println(rfs.toString(5)); +// if (e instanceof OpApplNode) { +// OpApplNode o = (OpApplNode) e; +// switch (getOpCode(o.getOperator().getName())) { +// case OPCODE_ite: { // IF THEN ELSE +// ifThenElse = o; +// return; +// } +// } +// throw new NotImplementedException( +// "Only IF/THEN/ELSE or CASE constructs are supported at the body of a recursive function."); +// } else { +// throw new NotImplementedException( +// "Only IF/THEN/ELSE or CASE constructs are supported at the body of a recursive function."); +// } +// } public OpDefNode getOpDefNode() { return def; diff --git a/src/main/java/de/tla2b/output/PrologPrinter.java b/src/main/java/de/tla2b/output/PrologPrinter.java index 46ba2b8bfde6657c2d2e3e88483d81f9fb23b129..22007dcb10f2539a5f9befa9d68fdf180637afae 100644 --- a/src/main/java/de/tla2b/output/PrologPrinter.java +++ b/src/main/java/de/tla2b/output/PrologPrinter.java @@ -10,9 +10,7 @@ import java.util.List; import java.util.Map; import de.be4.classicalb.core.parser.BParser; -import de.be4.classicalb.core.parser.analysis.pragma.Pragma; import de.be4.classicalb.core.parser.analysis.prolog.ASTProlog; -import de.be4.classicalb.core.parser.analysis.prolog.NodeIdAssignment; import de.be4.classicalb.core.parser.analysis.prolog.RecursiveMachineLoader; import de.be4.classicalb.core.parser.node.Node; import de.be4.classicalb.core.parser.node.Start; @@ -84,14 +82,6 @@ public class PrologPrinter { pout.fullstop(); } - if (bParser.getPragmas().size() > 0) { - NodeIdAssignment ids = pprinter.nodeIds; - List<Pragma> pragmas = bParser.getPragmas(); - for (Pragma pragma : pragmas) { - pragma.printProlog(pout, ids); - pout.fullstop(); - } - } pout.flush(); } } diff --git a/src/main/java/de/tla2bAst/SimpleResolver.java b/src/main/java/de/tla2bAst/SimpleResolver.java index 8ffd983b673aa3ee133b1a7a48875bc8ee9a65e6..c91f186a7f006e97ce3cd75bd4e54be92f09f0c6 100644 --- a/src/main/java/de/tla2bAst/SimpleResolver.java +++ b/src/main/java/de/tla2bAst/SimpleResolver.java @@ -5,6 +5,8 @@ import java.io.File; import util.FilenameToStream; public class SimpleResolver implements FilenameToStream { + + private File file; public boolean isStandardModule(String arg0) { return false; @@ -12,8 +14,12 @@ public class SimpleResolver implements FilenameToStream { public File resolve(String arg0, boolean arg1) { - File file = new File(arg0); + file = new File(arg0); return file; } + public String getFullPath() { + return file.getAbsolutePath(); + } + } \ No newline at end of file diff --git a/src/main/java/de/tla2bAst/Translator.java b/src/main/java/de/tla2bAst/Translator.java index 76f539e8fe35bdc55b0e414554cb7d7c6cb48092..44334139649a0fdc532ded3b74324019ca9c6789 100644 --- a/src/main/java/de/tla2bAst/Translator.java +++ b/src/main/java/de/tla2bAst/Translator.java @@ -93,7 +93,14 @@ public class Translator implements TranslationGlobals { } } - // used to for external use + /** + * External interface + * @param moduleName + * @param moduleString + * @param configString + * @return + * @throws TLA2BException + */ public static String translateModuleString(String moduleName, String moduleString, String configString) throws TLA2BException { Translator translator = new Translator(moduleName, moduleString, @@ -371,8 +378,7 @@ public class Translator implements TranslationGlobals { final File f, final BParser bparser) throws BException { final RecursiveMachineLoader rml = new RecursiveMachineLoader( f.getParent(), bparser.getContentProvider()); - rml.loadAllMachines(f, ast, null, bparser.getDefinitions(), - bparser.getPragmas()); + rml.loadAllMachines(f, ast, null, bparser.getDefinitions()); return rml; } diff --git a/src/test/java/de/tla2b/util/TestUtil.java b/src/test/java/de/tla2b/util/TestUtil.java index 7e2af8f3e9d1011273ed4f4d12eeca960951a5c4..2dfadfad4892e6c6051467ba9f198bb50a603090 100644 --- a/src/test/java/de/tla2b/util/TestUtil.java +++ b/src/test/java/de/tla2b/util/TestUtil.java @@ -6,10 +6,6 @@ package de.tla2b.util; import static org.junit.Assert.assertEquals; -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; - import util.FileUtil; import de.be4.classicalb.core.parser.BParser; import de.be4.classicalb.core.parser.exceptions.BException; @@ -20,7 +16,6 @@ import de.tla2b.exceptions.TLA2BException; import de.tla2b.output.ASTPrettyPrinter; import de.tla2b.output.Renamer; import de.tla2bAst.Translator; -import tla2sany.semantic.AbortException; import util.ToolIO; public class TestUtil {