From cb01e2255cd682e0281226b3a6d9a784a79fe89b Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Fri, 5 Dec 2014 16:58:16 +0100 Subject: [PATCH 01/90] Add reference to GUI builder paper. [Issue: ] --- core/guibuilder/README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/guibuilder/README.md b/core/guibuilder/README.md index d3a378471b..f73d566490 100644 --- a/core/guibuilder/README.md +++ b/core/guibuilder/README.md @@ -2,20 +2,24 @@ - **Primary Contacts:** Luis Diogo Couto - **Status:** - Development + Maintenance ## Description This module integrates an external tool for prototyping GUIs for VDM models. - -This tool integrates entirely using the remote control features of the Overture -interpreter and a special control class called -"org.overture.guibuilder.GuiBuilderRemote". +The tool primarily uses the remote control features of the Overture interpreter +and in combination with a special control class called +`org.overture.guibuilder.GuiBuilderRemote`. In order to use the tool, a jar that provides the GUI Builder is necessary. That jar can be built by invoking `mvn assembly:single` on this module. Be sure to grab the one named `custom-dependencies`. +For more information about the original GUI Builder tool see: +Nunes, C., & Paiva, A. (2011, October). Automatic Generation of Graphical User +Interfaces From VDM++ Specifications. In ICSEA 2011, The Sixth International +Conference on Software Engineering Advances. + ## Known Issues: VDM-SL models are not supported From cc27cc33da262989d67a7b75ccb1d2b0423865f9 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 9 Feb 2015 16:07:27 +0100 Subject: [PATCH 02/90] Added test to exercise 'let be st' when the set is union typed --- .../resources/union_type_specs/LetBeStRecElem | 19 +++++ .../union_type_specs/LetBeStRecElem.result | 82 +++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 core/codegen/src/test/resources/union_type_specs/LetBeStRecElem create mode 100644 core/codegen/src/test/resources/union_type_specs/LetBeStRecElem.result diff --git a/core/codegen/src/test/resources/union_type_specs/LetBeStRecElem b/core/codegen/src/test/resources/union_type_specs/LetBeStRecElem new file mode 100644 index 0000000000..83104f5430 --- /dev/null +++ b/core/codegen/src/test/resources/union_type_specs/LetBeStRecElem @@ -0,0 +1,19 @@ +class Entry + +values + +xs : set of (nat | A) = {mk_A(5)} + +types + +A :: a : int; + +operations + +public static Run : () ==> ? +Run () == +let r in set xs be st r.a = 5 +in + return r.a; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/union_type_specs/LetBeStRecElem.result b/core/codegen/src/test/resources/union_type_specs/LetBeStRecElem.result new file mode 100644 index 0000000000..4d169c68e9 --- /dev/null +++ b/core/codegen/src/test/resources/union_type_specs/LetBeStRecElem.result @@ -0,0 +1,82 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + private static final VDMSet xs = SetUtil.set(new A(5L)); + + public Entry() { + } + + public static Object Run() { + Object r = null; + Boolean success_1 = false; + VDMSet set_1 = Utils.clone(xs); + + for (Iterator iterator_1 = set_1.iterator(); + iterator_1.hasNext() && !(success_1);) { + r = ((Object) iterator_1.next()); + + Number apply_1 = null; + + if (r instanceof A) { + apply_1 = ((A) r).a; + } else { + throw new RuntimeException("Missing member: a"); + } + + success_1 = Utils.equals(apply_1, 5L); + } + + if (!(success_1)) { + throw new RuntimeException("Let Be St found no applicable bindings"); + } + + Number apply_2 = null; + + if (r instanceof A) { + apply_2 = ((A) r).a; + } else { + throw new RuntimeException("Missing member: a"); + } + + return apply_2; + } + + public String toString() { + return "Entry{" + "xs = " + Utils.toString(xs) + "}"; + } + + private static class A implements Record { + public Number a; + + public A(final Number _a) { + a = _a; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof A)) { + return false; + } + + A other = ((A) obj); + + return Utils.equals(a, other.a); + } + + public int hashCode() { + return Utils.hashCode(a); + } + + public A clone() { + return new A(a); + } + + public String toString() { + return "mk_Entry`A" + Utils.formatFields(a); + } + } +} + +########## From e5cf06acaefb62ae113dc930feaf02666b68b23f Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 9 Feb 2015 21:45:38 +0100 Subject: [PATCH 03/90] Added test revealing problem with code generation of 'cases' when the expression being cased on has side effects --- .../resources/pattern_specs/CasesStmOpCallExp | 24 ++++ .../pattern_specs/CasesStmOpCallExp.result | 126 ++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp create mode 100644 core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp.result diff --git a/core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp b/core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp new file mode 100644 index 0000000000..013bce55fc --- /dev/null +++ b/core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp @@ -0,0 +1,24 @@ +class Entry + +types + +public A :: a : int; +public B :: b : int; + +operations + +public static Run : () ==> ? +Run () == +( + cases rec(): + mk_A(9) -> return 11, + mk_B(9) -> return 111, + mk_B(10) -> return 1111 + end; + return -1; +); + +public static rec : () ==> A|B +rec () == return mk_B(10); + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp.result b/core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp.result new file mode 100644 index 0000000000..2c42a7d58e --- /dev/null +++ b/core/codegen/src/test/resources/pattern_specs/CasesStmOpCallExp.result @@ -0,0 +1,126 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + Object casesExp_1 = rec(); + Boolean success_1 = true; + + if (casesExp_1 instanceof A) { + A recordPattern_1 = ((A) casesExp_1); + Number intPattern_1 = recordPattern_1.a; + success_1 = Utils.equals(intPattern_1, 9L); + } else { + success_1 = false; + } + + if (!(success_1)) { + if (casesExp_1 instanceof B) { + B recordPattern_2 = ((B) casesExp_1); + success_1 = true; + + Number intPattern_2 = recordPattern_2.b; + success_1 = Utils.equals(intPattern_2, 9L); + } else { + success_1 = false; + } + + if (!(success_1)) { + if (casesExp_1 instanceof B) { + B recordPattern_3 = ((B) casesExp_1); + success_1 = true; + + Number intPattern_3 = recordPattern_3.b; + success_1 = Utils.equals(intPattern_3, 10L); + } else { + success_1 = false; + } + + if (success_1) { + return 1111L; + } + } else { + return 111L; + } + } else { + return 11L; + } + + return -1L; + } + + public static Object rec() { + return new B(10L); + } + + public String toString() { + return "Entry{}"; + } + + public static class A implements Record { + public Number a; + + public A(final Number _a) { + a = _a; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof A)) { + return false; + } + + A other = ((A) obj); + + return Utils.equals(a, other.a); + } + + public int hashCode() { + return Utils.hashCode(a); + } + + public A clone() { + return new A(a); + } + + public String toString() { + return "mk_Entry`A" + Utils.formatFields(a); + } + } + + public static class B implements Record { + public Number b; + + public B(final Number _b) { + b = _b; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof B)) { + return false; + } + + B other = ((B) obj); + + return Utils.equals(b, other.b); + } + + public int hashCode() { + return Utils.hashCode(b); + } + + public B clone() { + return new B(b); + } + + public String toString() { + return "mk_Entry`B" + Utils.formatFields(b); + } + } +} + +########## From 092a52bacd29da5cba7738322959a20c56ccc21a Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 9 Feb 2015 21:48:04 +0100 Subject: [PATCH 04/90] Added fix for code generation of 'cases' when the expression being cased on has side effects --- .../org/overture/codegen/ir/CodeGenBase.java | 1 + .../trans/patterns/PatternTransformation.java | 23 ++++++++++++++++--- .../codegen/vdm2java/JavaTransSeries.java | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/ir/CodeGenBase.java b/core/codegen/src/main/java/org/overture/codegen/ir/CodeGenBase.java index 381494420f..87f49d202b 100644 --- a/core/codegen/src/main/java/org/overture/codegen/ir/CodeGenBase.java +++ b/core/codegen/src/main/java/org/overture/codegen/ir/CodeGenBase.java @@ -15,6 +15,7 @@ public class CodeGenBase public static final String OBJ_EXP_NAME_PREFIX = "obj_"; public static final String TERNARY_IF_EXP_NAME_PREFIX = "ternaryIfExp_"; public static final String CALL_STM_OBJ_NAME_PREFIX = "callStmObj_"; + public static final String CASES_EXP_NAME_PREFIX = "casesExp_"; public static final String CASES_EXP_RESULT_NAME_PREFIX = "casesExpResult_"; public static final String AND_EXP_NAME_PREFIX = "andResult_"; public static final String OR_EXP_NAME_PREFIX = "orResult_"; diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java b/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java index 42a5dde297..a3e054ac67 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java @@ -54,6 +54,7 @@ import org.overture.codegen.cgast.expressions.ARealLiteralExpCG; import org.overture.codegen.cgast.expressions.ATupleCompatibilityExpCG; import org.overture.codegen.cgast.expressions.AUndefinedExpCG; +import org.overture.codegen.cgast.expressions.SVarExpCG; import org.overture.codegen.cgast.patterns.ABoolPatternCG; import org.overture.codegen.cgast.patterns.ACharPatternCG; import org.overture.codegen.cgast.patterns.AIdentifierPatternCG; @@ -98,10 +99,12 @@ public class PatternTransformation extends DepthFirstAnalysisAdaptor private TempVarPrefixes varPrefixes; + private String casesExpNamePrefix; + public PatternTransformation(List classes, TempVarPrefixes varPrefixes, IRInfo info, TransAssistantCG transformationAssistant, - PatternMatchConfig config) + PatternMatchConfig config, String casesExpNamePrefix) { this.classes = classes; this.info = info; @@ -109,6 +112,8 @@ public PatternTransformation(List classes, this.varPrefixes = varPrefixes; this.config = config; + + this.casesExpNamePrefix = casesExpNamePrefix; } @Override @@ -135,13 +140,25 @@ public void caseACasesStmCG(ACasesStmCG node) throws AnalysisException List nodeCases = node.getCases(); SPatternCG firstOriginal = nodeCases.get(0).getPattern().clone(); - List patternInfo = extractFromCases(nodeCases, node.getExp()); + ABlockStmCG replacementBlock = new ABlockStmCG(); + String expName = info.getTempVarNameGen().nextVarName(casesExpNamePrefix); + SExpCG exp = node.getExp(); + + if (!(node.getExp() instanceof SVarExpCG)) + { + AVarDeclCG expVarDecl = info.getDeclAssistant().consLocalVarDecl(node.getExp().getType().clone(), + transformationAssistant.consIdPattern(expName), node.getExp().clone()); + replacementBlock.getLocalDefs().add(expVarDecl); + exp = transformationAssistant.consIdentifierVar(expName, + node.getExp().getType().clone()); + } + + List patternInfo = extractFromCases(nodeCases, exp); PatternBlockData patternData = new PatternBlockData(MismatchHandling.NONE); List blocks = consPatternHandlingBlockCases(patternInfo, patternData); - ABlockStmCG replacementBlock = new ABlockStmCG(); replacementBlock.getStatements().add(blocks.get(0)); ANotUnaryExpCG notSuccess = info.getExpAssistant().negate(patternData.getSuccessVar()); diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java index 5d9e649f48..b9f198e2a8 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java @@ -56,7 +56,7 @@ public DepthFirstAnalysisAdaptor[] consAnalyses(List classes, FunctionValueTransformation funcValueTransformation = new FunctionValueTransformation(irInfo, transAssistant, functionValueAssistant, INTERFACE_NAME_PREFIX, TEMPLATE_TYPE_PREFIX, EVAL_METHOD_PREFIX, PARAM_NAME_PREFIX); ILanguageIterator langIterator = new JavaLanguageIterator(transAssistant, irInfo.getTempVarNameGen(), codeGen.getTempVarPrefixes()); TransformationVisitor transVisitor = new TransformationVisitor(irInfo, classes, codeGen.getTempVarPrefixes(), transAssistant, consExists1CounterData(), langIterator, TERNARY_IF_EXP_NAME_PREFIX, CASES_EXP_RESULT_NAME_PREFIX, AND_EXP_NAME_PREFIX, OR_EXP_NAME_PREFIX, WHILE_COND_NAME_PREFIX, REC_MODIFIER_NAME_PREFIX); - PatternTransformation patternTransformation = new PatternTransformation(classes, codeGen.getTempVarPrefixes(), irInfo, transAssistant, new PatternMatchConfig()); + PatternTransformation patternTransformation = new PatternTransformation(classes, codeGen.getTempVarPrefixes(), irInfo, transAssistant, new PatternMatchConfig(), CASES_EXP_NAME_PREFIX); PreCheckTransformation preCheckTransformation = new PreCheckTransformation(irInfo, transAssistant, new JavaValueSemanticsTag(false)); PostCheckTransformation postCheckTransformation = new PostCheckTransformation(postCheckCreator, irInfo, transAssistant, FUNC_RESULT_NAME_PREFIX, new JavaValueSemanticsTag(false)); IsExpTransformation isExpTransformation = new IsExpTransformation(irInfo, transAssistant, IS_EXP_SUBJECT_NAME_PREFIX); From 281da95eb85d99938535c51c6dfae49294cec1cf Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 10 Feb 2015 18:34:07 +0100 Subject: [PATCH 05/90] Added a node to the IR to support stack declarations --- core/codegen/src/main/resources/cg.astv2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/codegen/src/main/resources/cg.astv2 b/core/codegen/src/main/resources/cg.astv2 index 753d522f83..a57e798e8f 100644 --- a/core/codegen/src/main/resources/cg.astv2 +++ b/core/codegen/src/main/resources/cg.astv2 @@ -166,7 +166,9 @@ CG {-> package='org.overture.codegen.cgast' | {namedType} [name]:java_String [type]:CG.#type - | {namedTrace} [pathname]:CG.#name.token* [terms]:CG.#term.traceDecl* + | {namedTrace} + [pathname]:CG.#name.token* + [terms]:CG.#term.traceDecl* ; #stateDesignator {-> package='org.overture.codegen.cgast.statements' @@ -223,6 +225,10 @@ CG {-> package='org.overture.codegen.cgast' | {try} [stm]:CG.#stm [catchClauses]:CG.#decl.catchClause* [finally]:CG.#stm | {periodic} [opname]:java_String [args]:CG.#exp* //| Sporadic + | {stackDecl} + [type]:CG.#type + [name]:java_String + [args]:CG.#exp* ; #call {-> package='org.overture.codegen.cgast.statements' From 5fa8063ca72315b7b1da2cb7e871f48b0860cf62 Mon Sep 17 00:00:00 2001 From: Joey Coleman Date: Wed, 11 Feb 2015 11:45:49 +0100 Subject: [PATCH 06/90] [maven-release-plugin] prepare for next development iteration --- core/ast/pom.xml | 2 +- core/codegen-runtime/pom.xml | 2 +- core/codegen/pom.xml | 2 +- core/combinatorialtesting/ctruntime/pom.xml | 2 +- core/combinatorialtesting/ctutils/pom.xml | 2 +- core/combinatorialtesting/pom.xml | 2 +- core/commandline/pom.xml | 2 +- core/guibuilder/pom.xml | 2 +- core/interpreter/pom.xml | 2 +- core/modelcheckers/pom.xml | 2 +- core/modelcheckers/probsolver/pom.xml | 2 +- core/modelcheckers/probsolverintegration/pom.xml | 2 +- core/parser/pom.xml | 2 +- core/pog/pom.xml | 2 +- core/pom.xml | 2 +- core/prettyprinting/npp/pom.xml | 2 +- core/prettyprinting/pom.xml | 2 +- core/prettyprinting/prettyprinter/pom.xml | 2 +- core/testframework/pom.xml | 2 +- core/testing/exsupport/pom.xml | 2 +- core/testing/extests/pom.xml | 2 +- core/testing/framework/pom.xml | 2 +- core/testing/pom.xml | 2 +- core/testing/tests/pom.xml | 2 +- core/typechecker/pom.xml | 2 +- core/vdmjc/pom.xml | 2 +- externals/documentation/pom.xml | 2 +- externals/examples/pom.xml | 2 +- externals/pom.xml | 2 +- pom.xml | 4 ++-- 30 files changed, 31 insertions(+), 31 deletions(-) diff --git a/core/ast/pom.xml b/core/ast/pom.xml index 9f4410c94c..2b55d54b40 100644 --- a/core/ast/pom.xml +++ b/core/ast/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/codegen-runtime/pom.xml b/core/codegen-runtime/pom.xml index ab2724d134..a5117f8bdf 100644 --- a/core/codegen-runtime/pom.xml +++ b/core/codegen-runtime/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/codegen/pom.xml b/core/codegen/pom.xml index 3cdfd28194..20e2849d97 100644 --- a/core/codegen/pom.xml +++ b/core/codegen/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/combinatorialtesting/ctruntime/pom.xml b/core/combinatorialtesting/ctruntime/pom.xml index b463dc16cf..025214ce1f 100644 --- a/core/combinatorialtesting/ctruntime/pom.xml +++ b/core/combinatorialtesting/ctruntime/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core combinatorialtesting - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/combinatorialtesting/ctutils/pom.xml b/core/combinatorialtesting/ctutils/pom.xml index b54152f3d7..bc98f74db6 100644 --- a/core/combinatorialtesting/ctutils/pom.xml +++ b/core/combinatorialtesting/ctutils/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core combinatorialtesting - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/combinatorialtesting/pom.xml b/core/combinatorialtesting/pom.xml index 441b01777a..82da663a60 100644 --- a/core/combinatorialtesting/pom.xml +++ b/core/combinatorialtesting/pom.xml @@ -4,7 +4,7 @@ core org.overturetool - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/commandline/pom.xml b/core/commandline/pom.xml index 431405e287..af1885dc7f 100644 --- a/core/commandline/pom.xml +++ b/core/commandline/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/guibuilder/pom.xml b/core/guibuilder/pom.xml index 940d01b563..c337ca30a3 100644 --- a/core/guibuilder/pom.xml +++ b/core/guibuilder/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/interpreter/pom.xml b/core/interpreter/pom.xml index 1f45f312ee..fe03fafc52 100644 --- a/core/interpreter/pom.xml +++ b/core/interpreter/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/modelcheckers/pom.xml b/core/modelcheckers/pom.xml index aae425b6a0..8a77c9ba69 100644 --- a/core/modelcheckers/pom.xml +++ b/core/modelcheckers/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/modelcheckers/probsolver/pom.xml b/core/modelcheckers/probsolver/pom.xml index b9ccc071df..7374ef1c1e 100644 --- a/core/modelcheckers/probsolver/pom.xml +++ b/core/modelcheckers/probsolver/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core modelcheckers - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/modelcheckers/probsolverintegration/pom.xml b/core/modelcheckers/probsolverintegration/pom.xml index 10b76855cd..05b1c9f424 100644 --- a/core/modelcheckers/probsolverintegration/pom.xml +++ b/core/modelcheckers/probsolverintegration/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core modelcheckers - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/parser/pom.xml b/core/parser/pom.xml index 0554adf8df..9f70009e38 100644 --- a/core/parser/pom.xml +++ b/core/parser/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/pog/pom.xml b/core/pog/pom.xml index 7cedc805e4..3500863d75 100644 --- a/core/pog/pom.xml +++ b/core/pog/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/pom.xml b/core/pom.xml index f9927ea901..db2d041025 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.overturetool root - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/prettyprinting/npp/pom.xml b/core/prettyprinting/npp/pom.xml index cdd813ef26..f2e5543c2a 100644 --- a/core/prettyprinting/npp/pom.xml +++ b/core/prettyprinting/npp/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core prettyprinting - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/prettyprinting/pom.xml b/core/prettyprinting/pom.xml index ffff9fcff5..1729aded99 100644 --- a/core/prettyprinting/pom.xml +++ b/core/prettyprinting/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/prettyprinting/prettyprinter/pom.xml b/core/prettyprinting/prettyprinter/pom.xml index 7752505446..1082eca075 100644 --- a/core/prettyprinting/prettyprinter/pom.xml +++ b/core/prettyprinting/prettyprinter/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core prettyprinting - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/testframework/pom.xml b/core/testframework/pom.xml index 11d602ea4c..9dd657dc3e 100644 --- a/core/testframework/pom.xml +++ b/core/testframework/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/testing/exsupport/pom.xml b/core/testing/exsupport/pom.xml index 53efc5bbd5..1f7ca8a498 100644 --- a/core/testing/exsupport/pom.xml +++ b/core/testing/exsupport/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/testing/extests/pom.xml b/core/testing/extests/pom.xml index e32b39e96f..e2bb97b9d8 100644 --- a/core/testing/extests/pom.xml +++ b/core/testing/extests/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/testing/framework/pom.xml b/core/testing/framework/pom.xml index 60233c5bd1..655dd57039 100644 --- a/core/testing/framework/pom.xml +++ b/core/testing/framework/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/testing/pom.xml b/core/testing/pom.xml index 62564bd026..afd6fdf27b 100644 --- a/core/testing/pom.xml +++ b/core/testing/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/testing/tests/pom.xml b/core/testing/tests/pom.xml index 917cab3348..34e3d6a918 100644 --- a/core/testing/tests/pom.xml +++ b/core/testing/tests/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/typechecker/pom.xml b/core/typechecker/pom.xml index 8590187727..3bce799a38 100644 --- a/core/typechecker/pom.xml +++ b/core/typechecker/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/core/vdmjc/pom.xml b/core/vdmjc/pom.xml index c48235aef3..8e08ce0e44 100644 --- a/core/vdmjc/pom.xml +++ b/core/vdmjc/pom.xml @@ -4,7 +4,7 @@ core org.overturetool - 2.2.0 + 2.2.1-SNAPSHOT org.overturetool.core diff --git a/externals/documentation/pom.xml b/externals/documentation/pom.xml index bbcbfe42ad..e38b6c3c07 100644 --- a/externals/documentation/pom.xml +++ b/externals/documentation/pom.xml @@ -4,7 +4,7 @@ org.overturetool externals - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/externals/examples/pom.xml b/externals/examples/pom.xml index d003be304c..cd951438dc 100644 --- a/externals/examples/pom.xml +++ b/externals/examples/pom.xml @@ -4,7 +4,7 @@ org.overturetool externals - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/externals/pom.xml b/externals/pom.xml index fc226b68c7..4a7f1bfa65 100644 --- a/externals/pom.xml +++ b/externals/pom.xml @@ -4,7 +4,7 @@ org.overturetool root - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 53571ae0cf..36f061f3e4 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.overturetool root - 2.2.0 + 2.2.1-SNAPSHOT The Overture Tool Platform root @@ -302,7 +302,7 @@ git@github.com:overturetool/overture.git scm:git:git://github.com/overturetool/overture.git scm:git:git@github.com:overturetool/overture.git - Release/2.2.0 + HEAD From 124e8140be47063eea66f4854f820f935f91e85e Mon Sep 17 00:00:00 2001 From: Joey Coleman Date: Wed, 11 Feb 2015 12:45:11 +0100 Subject: [PATCH 07/90] Bump ide/ to version 2.2.1-SNAPSHOT --- ide/builders/pom.xml | 2 +- ide/builders/vdmj/META-INF/MANIFEST.MF | 2 +- ide/builders/vdmj/pom.xml | 2 +- ide/core/META-INF/MANIFEST.MF | 2 +- ide/core/pom.xml | 2 +- ide/debug/META-INF/MANIFEST.MF | 2 +- ide/debug/pom.xml | 2 +- ide/features/core/feature.xml | 2 +- ide/features/core/pom.xml | 2 +- ide/features/pom.xml | 2 +- ide/features/rcp/feature.xml | 2 +- ide/features/rcp/pom.xml | 2 +- ide/help/META-INF/MANIFEST.MF | 2 +- ide/help/pom.xml | 2 +- ide/parsers/pom.xml | 2 +- ide/parsers/vdmj/META-INF/MANIFEST.MF | 2 +- ide/parsers/vdmj/pom.xml | 2 +- ide/platform/META-INF/MANIFEST.MF | 2 +- ide/platform/pom.xml | 2 +- ide/plugins/codegen/META-INF/MANIFEST.MF | 2 +- ide/plugins/codegen/pom.xml | 2 +- ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF | 2 +- ide/plugins/combinatorialtesting/pom.xml | 2 +- ide/plugins/coverageeditor/META-INF/MANIFEST.MF | 2 +- ide/plugins/coverageeditor/pom.xml | 2 +- ide/plugins/csk/META-INF/MANIFEST.MF | 2 +- ide/plugins/csk/pom.xml | 2 +- ide/plugins/developerutils/META-INF/MANIFEST.MF | 2 +- ide/plugins/developerutils/pom.xml | 2 +- ide/plugins/externaleditor/META-INF/MANIFEST.MF | 2 +- ide/plugins/externaleditor/pom.xml | 2 +- ide/plugins/features/codegen/feature.xml | 2 +- ide/plugins/features/codegen/pom.xml | 2 +- ide/plugins/features/combinatorialtesting/feature.xml | 2 +- ide/plugins/features/combinatorialtesting/pom.xml | 2 +- ide/plugins/features/coverageeditor/feature.xml | 2 +- ide/plugins/features/coverageeditor/pom.xml | 2 +- ide/plugins/features/csk/feature.xml | 2 +- ide/plugins/features/csk/pom.xml | 2 +- ide/plugins/features/developerutils/feature.xml | 2 +- ide/plugins/features/developerutils/pom.xml | 2 +- ide/plugins/features/guibuilder/feature.xml | 2 +- ide/plugins/features/guibuilder/pom.xml | 2 +- ide/plugins/features/latex/feature.xml | 2 +- ide/plugins/features/latex/pom.xml | 2 +- ide/plugins/features/pom.xml | 2 +- ide/plugins/features/poviewer/feature.xml | 2 +- ide/plugins/features/poviewer/pom.xml | 2 +- ide/plugins/features/probruntime/feature.xml | 2 +- ide/plugins/features/probruntime/pom.xml | 2 +- ide/plugins/features/quickinterpreter/feature.xml | 2 +- ide/plugins/features/quickinterpreter/pom.xml | 2 +- ide/plugins/features/rttraceviewer/feature.xml | 2 +- ide/plugins/features/rttraceviewer/pom.xml | 2 +- ide/plugins/features/uml2/feature.xml | 2 +- ide/plugins/features/uml2/pom.xml | 2 +- ide/plugins/guibuilder/META-INF/MANIFEST.MF | 2 +- ide/plugins/guibuilder/pom.xml | 2 +- ide/plugins/latex/META-INF/MANIFEST.MF | 2 +- ide/plugins/latex/pom.xml | 2 +- ide/plugins/pom.xml | 2 +- ide/plugins/poviewer/META-INF/MANIFEST.MF | 2 +- ide/plugins/poviewer/pom.xml | 2 +- ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/core/pom.xml | 2 +- ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/linux.x86/pom.xml | 2 +- ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/linux.x86_64/pom.xml | 2 +- ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/macosx.x86_64/pom.xml | 2 +- ide/plugins/prob-runtime/pom.xml | 2 +- ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/win32.win32/pom.xml | 2 +- ide/plugins/quickinterpreter/META-INF/MANIFEST.MF | 2 +- ide/plugins/quickinterpreter/pom.xml | 2 +- ide/plugins/rttraceviewer/META-INF/MANIFEST.MF | 2 +- ide/plugins/rttraceviewer/pom.xml | 2 +- ide/plugins/uml2.tests/META-INF/MANIFEST.MF | 2 +- ide/plugins/uml2.tests/pom.xml | 2 +- ide/plugins/uml2/META-INF/MANIFEST.MF | 2 +- ide/plugins/uml2/pom.xml | 2 +- ide/pom.xml | 6 +++--- ide/product/overture.product | 2 +- ide/product/pom.xml | 2 +- ide/tests/pom.xml | 2 +- ide/tests/ui/META-INF/MANIFEST.MF | 2 +- ide/tests/ui/pom.xml | 2 +- ide/ui/META-INF/MANIFEST.MF | 2 +- ide/ui/pom.xml | 2 +- ide/vdmpp/core/META-INF/MANIFEST.MF | 2 +- ide/vdmpp/core/pom.xml | 2 +- ide/vdmpp/debug/META-INF/MANIFEST.MF | 2 +- ide/vdmpp/debug/pom.xml | 2 +- ide/vdmpp/pom.xml | 2 +- ide/vdmpp/ui/META-INF/MANIFEST.MF | 2 +- ide/vdmpp/ui/pom.xml | 2 +- ide/vdmrt/core/META-INF/MANIFEST.MF | 2 +- ide/vdmrt/core/pom.xml | 2 +- ide/vdmrt/debug/META-INF/MANIFEST.MF | 2 +- ide/vdmrt/debug/pom.xml | 2 +- ide/vdmrt/pom.xml | 2 +- ide/vdmrt/ui/META-INF/MANIFEST.MF | 2 +- ide/vdmrt/ui/pom.xml | 2 +- ide/vdmsl/core/META-INF/MANIFEST.MF | 2 +- ide/vdmsl/core/pom.xml | 2 +- ide/vdmsl/debug/META-INF/MANIFEST.MF | 2 +- ide/vdmsl/debug/pom.xml | 2 +- ide/vdmsl/pom.xml | 2 +- ide/vdmsl/ui/META-INF/MANIFEST.MF | 2 +- ide/vdmsl/ui/pom.xml | 2 +- 111 files changed, 113 insertions(+), 113 deletions(-) diff --git a/ide/builders/pom.xml b/ide/builders/pom.xml index e1ce40baf8..eaf4b5fe65 100644 --- a/ide/builders/pom.xml +++ b/ide/builders/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/builders/vdmj/META-INF/MANIFEST.MF b/ide/builders/vdmj/META-INF/MANIFEST.MF index c12f809116..d5391a2e7a 100644 --- a/ide/builders/vdmj/META-INF/MANIFEST.MF +++ b/ide/builders/vdmj/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/builders/vdmj/pom.xml b/ide/builders/vdmj/pom.xml index 539080df77..77e0383744 100644 --- a/ide/builders/vdmj/pom.xml +++ b/ide/builders/vdmj/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.builders - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/core/META-INF/MANIFEST.MF b/ide/core/META-INF/MANIFEST.MF index 211ca6cd82..1f3340ae47 100644 --- a/ide/core/META-INF/MANIFEST.MF +++ b/ide/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/core/pom.xml b/ide/core/pom.xml index 81e8f99381..70bb4e5be2 100644 --- a/ide/core/pom.xml +++ b/ide/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/debug/META-INF/MANIFEST.MF b/ide/debug/META-INF/MANIFEST.MF index 3b38d8d8b5..3df4767c8b 100644 --- a/ide/debug/META-INF/MANIFEST.MF +++ b/ide/debug/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/debug/pom.xml b/ide/debug/pom.xml index e0ae4c5926..2ea0d19ae9 100644 --- a/ide/debug/pom.xml +++ b/ide/debug/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/features/core/feature.xml b/ide/features/core/feature.xml index c74e2dd7f3..8988d060cb 100644 --- a/ide/features/core/feature.xml +++ b/ide/features/core/feature.xml @@ -2,7 +2,7 @@ diff --git a/ide/features/core/pom.xml b/ide/features/core/pom.xml index 82cd3e18cc..56a7c41fa5 100644 --- a/ide/features/core/pom.xml +++ b/ide/features/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/features/pom.xml b/ide/features/pom.xml index a74a318d6a..d209851966 100644 --- a/ide/features/pom.xml +++ b/ide/features/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/features/rcp/feature.xml b/ide/features/rcp/feature.xml index 3cfba31e35..cfa2e0ef3f 100644 --- a/ide/features/rcp/feature.xml +++ b/ide/features/rcp/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/features/rcp/pom.xml b/ide/features/rcp/pom.xml index 6fa6e17b4a..222b5636a2 100644 --- a/ide/features/rcp/pom.xml +++ b/ide/features/rcp/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/help/META-INF/MANIFEST.MF b/ide/help/META-INF/MANIFEST.MF index c457bb4632..00b8f105b5 100644 --- a/ide/help/META-INF/MANIFEST.MF +++ b/ide/help/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/help/pom.xml b/ide/help/pom.xml index 7ce8ac6772..a3c1fc0d3a 100644 --- a/ide/help/pom.xml +++ b/ide/help/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/parsers/pom.xml b/ide/parsers/pom.xml index 803f11f8e8..4fd8cd9b15 100644 --- a/ide/parsers/pom.xml +++ b/ide/parsers/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/parsers/vdmj/META-INF/MANIFEST.MF b/ide/parsers/vdmj/META-INF/MANIFEST.MF index 01a5a4db0b..81e29e8fab 100644 --- a/ide/parsers/vdmj/META-INF/MANIFEST.MF +++ b/ide/parsers/vdmj/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.parsers.vdmj diff --git a/ide/parsers/vdmj/pom.xml b/ide/parsers/vdmj/pom.xml index 0440451722..ca6fe74dbf 100644 --- a/ide/parsers/vdmj/pom.xml +++ b/ide/parsers/vdmj/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.parsers - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/platform/META-INF/MANIFEST.MF b/ide/platform/META-INF/MANIFEST.MF index e10a566c09..e5cae7e035 100644 --- a/ide/platform/META-INF/MANIFEST.MF +++ b/ide/platform/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.platform Bundle-SymbolicName: org.overture.ide.platform;singleton:=true -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, diff --git a/ide/platform/pom.xml b/ide/platform/pom.xml index 5b757a2b89..bf87b15943 100644 --- a/ide/platform/pom.xml +++ b/ide/platform/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/codegen/META-INF/MANIFEST.MF b/ide/plugins/codegen/META-INF/MANIFEST.MF index 7c9e8e14a9..f6685b5154 100644 --- a/ide/plugins/codegen/META-INF/MANIFEST.MF +++ b/ide/plugins/codegen/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Name: Code Generator Bundle-ManifestVersion: 2 diff --git a/ide/plugins/codegen/pom.xml b/ide/plugins/codegen/pom.xml index 7674efcdce..461437acaf 100644 --- a/ide/plugins/codegen/pom.xml +++ b/ide/plugins/codegen/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF b/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF index e3309753e1..ddaef6a858 100644 --- a/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF +++ b/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/plugins/combinatorialtesting/pom.xml b/ide/plugins/combinatorialtesting/pom.xml index 95451856ba..1aa984c636 100644 --- a/ide/plugins/combinatorialtesting/pom.xml +++ b/ide/plugins/combinatorialtesting/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/coverageeditor/META-INF/MANIFEST.MF b/ide/plugins/coverageeditor/META-INF/MANIFEST.MF index 5c6a28c8ca..46dd443336 100644 --- a/ide/plugins/coverageeditor/META-INF/MANIFEST.MF +++ b/ide/plugins/coverageeditor/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.coverageeditor diff --git a/ide/plugins/coverageeditor/pom.xml b/ide/plugins/coverageeditor/pom.xml index b7332d448b..6345302365 100644 --- a/ide/plugins/coverageeditor/pom.xml +++ b/ide/plugins/coverageeditor/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/csk/META-INF/MANIFEST.MF b/ide/plugins/csk/META-INF/MANIFEST.MF index 240ec9e84f..0fde579675 100644 --- a/ide/plugins/csk/META-INF/MANIFEST.MF +++ b/ide/plugins/csk/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.csk diff --git a/ide/plugins/csk/pom.xml b/ide/plugins/csk/pom.xml index a9c5d37899..a6c3d28acc 100644 --- a/ide/plugins/csk/pom.xml +++ b/ide/plugins/csk/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/developerutils/META-INF/MANIFEST.MF b/ide/plugins/developerutils/META-INF/MANIFEST.MF index 166415a628..3ac2589eed 100644 --- a/ide/plugins/developerutils/META-INF/MANIFEST.MF +++ b/ide/plugins/developerutils/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: Developer Utilities for Overture diff --git a/ide/plugins/developerutils/pom.xml b/ide/plugins/developerutils/pom.xml index 70619e5eb7..6cf9a43ea8 100644 --- a/ide/plugins/developerutils/pom.xml +++ b/ide/plugins/developerutils/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/externaleditor/META-INF/MANIFEST.MF b/ide/plugins/externaleditor/META-INF/MANIFEST.MF index d126cbbdea..15efa0f95e 100644 --- a/ide/plugins/externaleditor/META-INF/MANIFEST.MF +++ b/ide/plugins/externaleditor/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.externaleditor diff --git a/ide/plugins/externaleditor/pom.xml b/ide/plugins/externaleditor/pom.xml index a88325fab6..4b348f3403 100644 --- a/ide/plugins/externaleditor/pom.xml +++ b/ide/plugins/externaleditor/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/codegen/feature.xml b/ide/plugins/features/codegen/feature.xml index 6920f86697..dd19259bf3 100644 --- a/ide/plugins/features/codegen/feature.xml +++ b/ide/plugins/features/codegen/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/codegen/pom.xml b/ide/plugins/features/codegen/pom.xml index e3ef079505..3f964a8dba 100644 --- a/ide/plugins/features/codegen/pom.xml +++ b/ide/plugins/features/codegen/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/combinatorialtesting/feature.xml b/ide/plugins/features/combinatorialtesting/feature.xml index 97713a6deb..a3014df9df 100644 --- a/ide/plugins/features/combinatorialtesting/feature.xml +++ b/ide/plugins/features/combinatorialtesting/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/combinatorialtesting/pom.xml b/ide/plugins/features/combinatorialtesting/pom.xml index ca04e636bd..d2a8e9f167 100644 --- a/ide/plugins/features/combinatorialtesting/pom.xml +++ b/ide/plugins/features/combinatorialtesting/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/coverageeditor/feature.xml b/ide/plugins/features/coverageeditor/feature.xml index 1cf1a47682..b7612eef57 100644 --- a/ide/plugins/features/coverageeditor/feature.xml +++ b/ide/plugins/features/coverageeditor/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/coverageeditor/pom.xml b/ide/plugins/features/coverageeditor/pom.xml index 493c26a0fa..f9074a1cd8 100644 --- a/ide/plugins/features/coverageeditor/pom.xml +++ b/ide/plugins/features/coverageeditor/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/csk/feature.xml b/ide/plugins/features/csk/feature.xml index 0c4995d896..574a2f718d 100644 --- a/ide/plugins/features/csk/feature.xml +++ b/ide/plugins/features/csk/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/csk/pom.xml b/ide/plugins/features/csk/pom.xml index 47b069db4d..567a20b4a8 100644 --- a/ide/plugins/features/csk/pom.xml +++ b/ide/plugins/features/csk/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/developerutils/feature.xml b/ide/plugins/features/developerutils/feature.xml index 28edbaa4fd..a57a539607 100644 --- a/ide/plugins/features/developerutils/feature.xml +++ b/ide/plugins/features/developerutils/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/developerutils/pom.xml b/ide/plugins/features/developerutils/pom.xml index 69b642e0ab..6706b4ccf6 100644 --- a/ide/plugins/features/developerutils/pom.xml +++ b/ide/plugins/features/developerutils/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/guibuilder/feature.xml b/ide/plugins/features/guibuilder/feature.xml index 2cde159c71..8f5ca6856f 100644 --- a/ide/plugins/features/guibuilder/feature.xml +++ b/ide/plugins/features/guibuilder/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/guibuilder/pom.xml b/ide/plugins/features/guibuilder/pom.xml index e224cef4ab..5eb222a940 100644 --- a/ide/plugins/features/guibuilder/pom.xml +++ b/ide/plugins/features/guibuilder/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/latex/feature.xml b/ide/plugins/features/latex/feature.xml index a1310dde55..f0d5577ff2 100644 --- a/ide/plugins/features/latex/feature.xml +++ b/ide/plugins/features/latex/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/latex/pom.xml b/ide/plugins/features/latex/pom.xml index d7dbdd4344..e920ddf9fe 100644 --- a/ide/plugins/features/latex/pom.xml +++ b/ide/plugins/features/latex/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/pom.xml b/ide/plugins/features/pom.xml index 27d8d87a83..2e491cf809 100644 --- a/ide/plugins/features/pom.xml +++ b/ide/plugins/features/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/poviewer/feature.xml b/ide/plugins/features/poviewer/feature.xml index 02b3fb3704..0081849b1c 100644 --- a/ide/plugins/features/poviewer/feature.xml +++ b/ide/plugins/features/poviewer/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/poviewer/pom.xml b/ide/plugins/features/poviewer/pom.xml index 9738461fb9..7764226709 100644 --- a/ide/plugins/features/poviewer/pom.xml +++ b/ide/plugins/features/poviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/probruntime/feature.xml b/ide/plugins/features/probruntime/feature.xml index 5166558510..d292830b66 100644 --- a/ide/plugins/features/probruntime/feature.xml +++ b/ide/plugins/features/probruntime/feature.xml @@ -2,7 +2,7 @@ diff --git a/ide/plugins/features/probruntime/pom.xml b/ide/plugins/features/probruntime/pom.xml index 3e4c254e53..1f415106ed 100644 --- a/ide/plugins/features/probruntime/pom.xml +++ b/ide/plugins/features/probruntime/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/quickinterpreter/feature.xml b/ide/plugins/features/quickinterpreter/feature.xml index c08e8dbc2c..e33dd89b4d 100644 --- a/ide/plugins/features/quickinterpreter/feature.xml +++ b/ide/plugins/features/quickinterpreter/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/quickinterpreter/pom.xml b/ide/plugins/features/quickinterpreter/pom.xml index 11a0882c3b..0e0502cd71 100644 --- a/ide/plugins/features/quickinterpreter/pom.xml +++ b/ide/plugins/features/quickinterpreter/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/rttraceviewer/feature.xml b/ide/plugins/features/rttraceviewer/feature.xml index 34ac522c5b..191cbdaba1 100644 --- a/ide/plugins/features/rttraceviewer/feature.xml +++ b/ide/plugins/features/rttraceviewer/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/rttraceviewer/pom.xml b/ide/plugins/features/rttraceviewer/pom.xml index 01b2babb28..167d272bb7 100644 --- a/ide/plugins/features/rttraceviewer/pom.xml +++ b/ide/plugins/features/rttraceviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/features/uml2/feature.xml b/ide/plugins/features/uml2/feature.xml index 7130c9ab10..42290a44fa 100644 --- a/ide/plugins/features/uml2/feature.xml +++ b/ide/plugins/features/uml2/feature.xml @@ -2,7 +2,7 @@ + version="2.2.1.qualifier"> %description diff --git a/ide/plugins/features/uml2/pom.xml b/ide/plugins/features/uml2/pom.xml index 3ad1774936..0b747a1c89 100644 --- a/ide/plugins/features/uml2/pom.xml +++ b/ide/plugins/features/uml2/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/guibuilder/META-INF/MANIFEST.MF b/ide/plugins/guibuilder/META-INF/MANIFEST.MF index 4356205dc8..a22bed31ad 100644 --- a/ide/plugins/guibuilder/META-INF/MANIFEST.MF +++ b/ide/plugins/guibuilder/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/plugins/guibuilder/pom.xml b/ide/plugins/guibuilder/pom.xml index 9854f8d072..e512697f1e 100644 --- a/ide/plugins/guibuilder/pom.xml +++ b/ide/plugins/guibuilder/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/latex/META-INF/MANIFEST.MF b/ide/plugins/latex/META-INF/MANIFEST.MF index dd45ccc9f1..343c282364 100644 --- a/ide/plugins/latex/META-INF/MANIFEST.MF +++ b/ide/plugins/latex/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.latex diff --git a/ide/plugins/latex/pom.xml b/ide/plugins/latex/pom.xml index 442294da65..3082722075 100644 --- a/ide/plugins/latex/pom.xml +++ b/ide/plugins/latex/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/pom.xml b/ide/plugins/pom.xml index f8c017ea84..418ba7d656 100644 --- a/ide/plugins/pom.xml +++ b/ide/plugins/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/poviewer/META-INF/MANIFEST.MF b/ide/plugins/poviewer/META-INF/MANIFEST.MF index 5197c95d7b..09922b3a33 100644 --- a/ide/plugins/poviewer/META-INF/MANIFEST.MF +++ b/ide/plugins/poviewer/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/plugins/poviewer/pom.xml b/ide/plugins/poviewer/pom.xml index 78bc270f96..cca7dd0a3d 100644 --- a/ide/plugins/poviewer/pom.xml +++ b/ide/plugins/poviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF index c4e96f9b98..f3a53e9e56 100644 --- a/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Name: ProB Runtime diff --git a/ide/plugins/prob-runtime/core/pom.xml b/ide/plugins/prob-runtime/core/pom.xml index 786da511a6..8acc5e3b90 100644 --- a/ide/plugins/prob-runtime/core/pom.xml +++ b/ide/plugins/prob-runtime/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF index ad28517b21..7f0b57deec 100644 --- a/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.linux.x86;singleton:=true -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/linux.x86/pom.xml b/ide/plugins/prob-runtime/linux.x86/pom.xml index 366e190f73..7af846a4ce 100644 --- a/ide/plugins/prob-runtime/linux.x86/pom.xml +++ b/ide/plugins/prob-runtime/linux.x86/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF index 3f66133322..61ca3c9ba4 100644 --- a/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.linux.x86_64;singleton:=true -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/linux.x86_64/pom.xml b/ide/plugins/prob-runtime/linux.x86_64/pom.xml index 3b1562adf7..dd4a1c1de1 100644 --- a/ide/plugins/prob-runtime/linux.x86_64/pom.xml +++ b/ide/plugins/prob-runtime/linux.x86_64/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF index a7ff798191..97bfb2e559 100644 --- a/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.macosx.x86_64;singleton:=true -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/macosx.x86_64/pom.xml b/ide/plugins/prob-runtime/macosx.x86_64/pom.xml index cc8cb494e2..9b7da34398 100644 --- a/ide/plugins/prob-runtime/macosx.x86_64/pom.xml +++ b/ide/plugins/prob-runtime/macosx.x86_64/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/prob-runtime/pom.xml b/ide/plugins/prob-runtime/pom.xml index e54c634f9e..f3e198b57b 100644 --- a/ide/plugins/prob-runtime/pom.xml +++ b/ide/plugins/prob-runtime/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF index dd20ea9400..8c27df989f 100644 --- a/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.win32.win32;singleton:=true -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/win32.win32/pom.xml b/ide/plugins/prob-runtime/win32.win32/pom.xml index d97cae74c8..3b92b1f10a 100644 --- a/ide/plugins/prob-runtime/win32.win32/pom.xml +++ b/ide/plugins/prob-runtime/win32.win32/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF b/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF index f5e0b4b19b..7e010e1a4b 100644 --- a/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF +++ b/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.quickinterpreter diff --git a/ide/plugins/quickinterpreter/pom.xml b/ide/plugins/quickinterpreter/pom.xml index c339af22e3..1883c3161b 100644 --- a/ide/plugins/quickinterpreter/pom.xml +++ b/ide/plugins/quickinterpreter/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF b/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF index bc8db4875f..a3f3ac362c 100644 --- a/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF +++ b/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.rttraceviewer diff --git a/ide/plugins/rttraceviewer/pom.xml b/ide/plugins/rttraceviewer/pom.xml index 39b18cc0df..289b5f9122 100644 --- a/ide/plugins/rttraceviewer/pom.xml +++ b/ide/plugins/rttraceviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/uml2.tests/META-INF/MANIFEST.MF b/ide/plugins/uml2.tests/META-INF/MANIFEST.MF index 7d4ade3ba7..2cd7880966 100644 --- a/ide/plugins/uml2.tests/META-INF/MANIFEST.MF +++ b/ide/plugins/uml2.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.uml2.tests diff --git a/ide/plugins/uml2.tests/pom.xml b/ide/plugins/uml2.tests/pom.xml index 7d4f5fbe16..29439bed9a 100644 --- a/ide/plugins/uml2.tests/pom.xml +++ b/ide/plugins/uml2.tests/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/plugins/uml2/META-INF/MANIFEST.MF b/ide/plugins/uml2/META-INF/MANIFEST.MF index f255e883b3..41cac381eb 100644 --- a/ide/plugins/uml2/META-INF/MANIFEST.MF +++ b/ide/plugins/uml2/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Name: UML2 Translator Bundle-ManifestVersion: 2 diff --git a/ide/plugins/uml2/pom.xml b/ide/plugins/uml2/pom.xml index 4c74cf5e71..5cc3812407 100644 --- a/ide/plugins/uml2/pom.xml +++ b/ide/plugins/uml2/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/pom.xml b/ide/pom.xml index e2aacacafe..20657ee880 100644 --- a/ide/pom.xml +++ b/ide/pom.xml @@ -5,12 +5,12 @@ org.overturetool root - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml - pom - ide + pom + ide Overture IDE Top-level Super POM for all IDE (Eclipse) artifacts. diff --git a/ide/product/overture.product b/ide/product/overture.product index 84c5f63a8c..4ffbbcf872 100644 --- a/ide/product/overture.product +++ b/ide/product/overture.product @@ -1,7 +1,7 @@ - + diff --git a/ide/product/pom.xml b/ide/product/pom.xml index 4edbd0919e..5f6061ac47 100644 --- a/ide/product/pom.xml +++ b/ide/product/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/tests/pom.xml b/ide/tests/pom.xml index 14c3e4d53c..bc9d245e7b 100644 --- a/ide/tests/pom.xml +++ b/ide/tests/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/tests/ui/META-INF/MANIFEST.MF b/ide/tests/ui/META-INF/MANIFEST.MF index 1640e2237c..db974817fd 100644 --- a/ide/tests/ui/META-INF/MANIFEST.MF +++ b/ide/tests/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.tests.ui diff --git a/ide/tests/ui/pom.xml b/ide/tests/ui/pom.xml index c353df58c2..3cead7ff81 100644 --- a/ide/tests/ui/pom.xml +++ b/ide/tests/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.tests - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/ui/META-INF/MANIFEST.MF b/ide/ui/META-INF/MANIFEST.MF index 5df69021c8..efd1a88a79 100644 --- a/ide/ui/META-INF/MANIFEST.MF +++ b/ide/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.ui diff --git a/ide/ui/pom.xml b/ide/ui/pom.xml index 6c107a4910..8cc38ed58f 100644 --- a/ide/ui/pom.xml +++ b/ide/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmpp/core/META-INF/MANIFEST.MF b/ide/vdmpp/core/META-INF/MANIFEST.MF index c2d2019455..766bcb5c89 100644 --- a/ide/vdmpp/core/META-INF/MANIFEST.MF +++ b/ide/vdmpp/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmpp.core diff --git a/ide/vdmpp/core/pom.xml b/ide/vdmpp/core/pom.xml index 1d191d8d54..b13bad8398 100644 --- a/ide/vdmpp/core/pom.xml +++ b/ide/vdmpp/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmpp - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmpp/debug/META-INF/MANIFEST.MF b/ide/vdmpp/debug/META-INF/MANIFEST.MF index 9e4c9fe9ff..c5db33a46e 100644 --- a/ide/vdmpp/debug/META-INF/MANIFEST.MF +++ b/ide/vdmpp/debug/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmpp.debug diff --git a/ide/vdmpp/debug/pom.xml b/ide/vdmpp/debug/pom.xml index 79719db672..eae37812ea 100644 --- a/ide/vdmpp/debug/pom.xml +++ b/ide/vdmpp/debug/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmpp - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmpp/pom.xml b/ide/vdmpp/pom.xml index e82079e959..35796de967 100644 --- a/ide/vdmpp/pom.xml +++ b/ide/vdmpp/pom.xml @@ -4,7 +4,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmpp/ui/META-INF/MANIFEST.MF b/ide/vdmpp/ui/META-INF/MANIFEST.MF index 89bc6d57e5..85aa346c3d 100644 --- a/ide/vdmpp/ui/META-INF/MANIFEST.MF +++ b/ide/vdmpp/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmpp.ui diff --git a/ide/vdmpp/ui/pom.xml b/ide/vdmpp/ui/pom.xml index 6e0b52b1d3..b7750ab3c2 100644 --- a/ide/vdmpp/ui/pom.xml +++ b/ide/vdmpp/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmpp - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmrt/core/META-INF/MANIFEST.MF b/ide/vdmrt/core/META-INF/MANIFEST.MF index 2415c56685..f5f9e71570 100644 --- a/ide/vdmrt/core/META-INF/MANIFEST.MF +++ b/ide/vdmrt/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmrt.core diff --git a/ide/vdmrt/core/pom.xml b/ide/vdmrt/core/pom.xml index 5db43d8d73..149043f2a7 100644 --- a/ide/vdmrt/core/pom.xml +++ b/ide/vdmrt/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmrt - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmrt/debug/META-INF/MANIFEST.MF b/ide/vdmrt/debug/META-INF/MANIFEST.MF index f4ac81067a..e2c927a464 100644 --- a/ide/vdmrt/debug/META-INF/MANIFEST.MF +++ b/ide/vdmrt/debug/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmrt.debug diff --git a/ide/vdmrt/debug/pom.xml b/ide/vdmrt/debug/pom.xml index 4aee909426..8bd6397980 100644 --- a/ide/vdmrt/debug/pom.xml +++ b/ide/vdmrt/debug/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmrt - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmrt/pom.xml b/ide/vdmrt/pom.xml index 4bba612e6b..7a1b3cd3ac 100644 --- a/ide/vdmrt/pom.xml +++ b/ide/vdmrt/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmrt/ui/META-INF/MANIFEST.MF b/ide/vdmrt/ui/META-INF/MANIFEST.MF index 3ed643b291..5d87ba1f7b 100644 --- a/ide/vdmrt/ui/META-INF/MANIFEST.MF +++ b/ide/vdmrt/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmrt.ui diff --git a/ide/vdmrt/ui/pom.xml b/ide/vdmrt/ui/pom.xml index fad2311756..6f08432859 100644 --- a/ide/vdmrt/ui/pom.xml +++ b/ide/vdmrt/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmrt - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmsl/core/META-INF/MANIFEST.MF b/ide/vdmsl/core/META-INF/MANIFEST.MF index c4f57c6ac2..ab38a95d1e 100644 --- a/ide/vdmsl/core/META-INF/MANIFEST.MF +++ b/ide/vdmsl/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmsl.core diff --git a/ide/vdmsl/core/pom.xml b/ide/vdmsl/core/pom.xml index 15203a7d1d..4565adb066 100644 --- a/ide/vdmsl/core/pom.xml +++ b/ide/vdmsl/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmsl - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmsl/debug/META-INF/MANIFEST.MF b/ide/vdmsl/debug/META-INF/MANIFEST.MF index 1ce7984234..5144a14d52 100644 --- a/ide/vdmsl/debug/META-INF/MANIFEST.MF +++ b/ide/vdmsl/debug/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmsl.debug diff --git a/ide/vdmsl/debug/pom.xml b/ide/vdmsl/debug/pom.xml index df327e4577..f9d8946941 100644 --- a/ide/vdmsl/debug/pom.xml +++ b/ide/vdmsl/debug/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.vdmsl - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmsl/pom.xml b/ide/vdmsl/pom.xml index 86ac8b0662..93c35f25ed 100644 --- a/ide/vdmsl/pom.xml +++ b/ide/vdmsl/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml diff --git a/ide/vdmsl/ui/META-INF/MANIFEST.MF b/ide/vdmsl/ui/META-INF/MANIFEST.MF index 625618d583..b73a496d98 100644 --- a/ide/vdmsl/ui/META-INF/MANIFEST.MF +++ b/ide/vdmsl/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.0 +Bundle-Version: 2.2.1.qualifier Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmsl.ui diff --git a/ide/vdmsl/ui/pom.xml b/ide/vdmsl/ui/pom.xml index 4a61a4b362..fb7a905dc6 100644 --- a/ide/vdmsl/ui/pom.xml +++ b/ide/vdmsl/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmsl - 2.2.0 + 2.2.1-SNAPSHOT ../pom.xml From 8e98ba6cf5402ab79e234410e62fbed47e72e8b6 Mon Sep 17 00:00:00 2001 From: Joey Coleman Date: Fri, 13 Feb 2015 10:50:36 +0100 Subject: [PATCH 08/90] disable the auto-update site --- ide/product/src/main/resources/overture.p2.inf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ide/product/src/main/resources/overture.p2.inf b/ide/product/src/main/resources/overture.p2.inf index daade359f5..3e12b8ae2c 100644 --- a/ide/product/src/main/resources/overture.p2.inf +++ b/ide/product/src/main/resources/overture.p2.inf @@ -13,7 +13,8 @@ instructions.configure=\ copy(source:${repo.root}/core/commandline/target/Overture-${project.version}.jar,target:${installFolder}/commandline/Overture-${project.version}.jar,overwrite:true);\ remove(path:${installFolder}/epl-v10.html);\ remove(path:${installFolder}/notice.html);\ - remove(path:${installFolder}/readme);\ + remove(path:${installFolder}/readme); +comment.add.this.to.instructions.configure.after.fixing.the.url=\ addRepository(type:0,name:Overture,enabled:true,location:http${#58}//overture.sourceforge.net/updates/release/);\ addRepository(type:1,name:Overture,enabled:true,location:http${#58}//overture.sourceforge.net/updates/release/); instructions.configure.import=\ From daf163996f2de371f12c54c8ca91bb1ef4e4b90b Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 16 Feb 2015 13:25:42 +0100 Subject: [PATCH 09/90] Fix to type checking of the trace 'let def'. Fixes #416 --- .../test/resources/no_reduction_sl_specs/LetRec1 | 13 +++++++++++++ .../resources/no_reduction_sl_specs/LetRec1.result | 9 +++++++++ .../visitor/TypeCheckerDefinitionVisitor.java | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1 create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1.result diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1 b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1 new file mode 100644 index 0000000000..dbe3644c8e --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1 @@ -0,0 +1,13 @@ +operations + +op : () ==> () +op () == + skip; + +traces + +T1: +let mk_(a,b) = mk_(1,2), + r = a+b +in + op(); diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1.result new file mode 100644 index 0000000000..ea7768a6e4 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/LetRec1.result @@ -0,0 +1,9 @@ + + + + op() + () + + + + diff --git a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java index 7dd5535736..38e2326c43 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java @@ -1543,7 +1543,7 @@ public PType caseALetDefBindingTraceDefinition( for (PDefinition d : node.getLocalDefs()) { question.assistantFactory.createPDefinitionAssistant().typeResolve(d, THIS, question); - d.apply(THIS, question); + d.apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)); local = new FlatCheckedEnvironment(question.assistantFactory, d, local, question.scope); } From 630e5a80584ad6972a255d9378f6c8895ccd19f2 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 16 Feb 2015 19:33:37 +0100 Subject: [PATCH 10/90] Added test revealing problem with code generation of record pattern matching in 'let be st' --- .../resources/pattern_specs/LetBeStRecPattern | 19 +++++ .../pattern_specs/LetBeStRecPattern.result | 79 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern create mode 100644 core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern.result diff --git a/core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern b/core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern new file mode 100644 index 0000000000..d93e3a5235 --- /dev/null +++ b/core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern @@ -0,0 +1,19 @@ +class Entry + +values + +xs : set of (nat | A) = {1,2,3,4,mk_A(5), 6, 7, 8} + +types + +A :: a : int; + +operations + +public static Run : () ==> ? +Run () == +let mk_A(a) in set xs be st a = 5 +in + return a; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern.result b/core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern.result new file mode 100644 index 0000000000..a20718a289 --- /dev/null +++ b/core/codegen/src/test/resources/pattern_specs/LetBeStRecPattern.result @@ -0,0 +1,79 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + private static final VDMSet xs = SetUtil.set(1L, 2L, 3L, 4L, new A(5L), 6L, + 7L, 8L); + + public Entry() { + } + + public static Object Run() { + Object recordPattern_1 = null; + Boolean success_1 = false; + VDMSet set_1 = Utils.clone(xs); + Number a = null; + + for (Iterator iterator_1 = set_1.iterator(); + iterator_1.hasNext() && !(success_1);) { + recordPattern_1 = ((Object) iterator_1.next()); + + if (recordPattern_1 instanceof A) { + success_1 = true; + a = ((A) recordPattern_1).a; + } else { + success_1 = false; + } + + if (!(success_1)) { + continue; + } + + success_1 = Utils.equals(a, 5L); + } + + if (!(success_1)) { + throw new RuntimeException("Let Be St found no applicable bindings"); + } + + return a; + } + + public String toString() { + return "Entry{" + "xs = " + Utils.toString(xs) + "}"; + } + + private static class A implements Record { + public Number a; + + public A(final Number _a) { + a = _a; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof A)) { + return false; + } + + A other = ((A) obj); + + return Utils.equals(a, other.a); + } + + public int hashCode() { + return Utils.hashCode(a); + } + + public A clone() { + return new A(a); + } + + public String toString() { + return "mk_Entry`A" + Utils.formatFields(a); + } + } +} + +########## From c3da817b0541fa784f4d38d09615a2c0efcf89d5 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 16 Feb 2015 19:40:46 +0100 Subject: [PATCH 11/90] Added fix for problem with code generation of record pattern matching in 'let be st' --- .../trans/patterns/PatternTransformation.java | 60 ++++++++++++++----- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java b/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java index a3e054ac67..89792e3ba2 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/patterns/PatternTransformation.java @@ -682,10 +682,24 @@ else if(type instanceof AUnionTypeCG) { ARecordPatternCG recordPattern = (ARecordPatternCG) pattern; ARecordTypeCG recordType = (ARecordTypeCG) recordPattern.getType(); - boolean checkRecordPattern = checkRecordPattern(actualValue); - return consRecordPatternCheck(declarePatternVar, recordPattern, - recordType, patternData, actualValue, checkRecordPattern); + if(type instanceof ARecordTypeCG) + { + + return consRecordPatternCheck(declarePatternVar, recordPattern, + recordType, patternData, actualValue, checkRecordPattern(actualValue)); + + } + else if(type instanceof AUnionTypeCG) + { + return consRecordPatternCheck(declarePatternVar, recordPattern, + recordType, patternData, actualValue, true); + } + else + { + Logger.getLog().printErrorln("Expected record type or union type" + + "in PatternTransformation. Got: " + type); + } } return null; @@ -754,6 +768,18 @@ private ABlockStmCG consRecordPatternCheck(boolean declarePattern, { AIdentifierPatternCG idPattern = getIdPattern(config.getName(recordPattern.getClass())); + AIdentifierVarExpCG recordPatternVar = new AIdentifierVarExpCG(); + recordPatternVar.setType(recordType.clone()); + recordPatternVar.setName(idPattern.getName()); + recordPatternVar.setIsLambda(false); + recordPatternVar.setIsLocal(true); + patternData.setRootPatternVar(recordPatternVar); + + if(!declarePattern) + { + actualValue = recordPatternVar; + } + ABlockStmCG recordPatternBlock = initPattern(declarePattern, recordPattern, recordType, actualValue, idPattern); ARecordDeclCG record = info.getAssistantManager().getDeclAssistant().findRecord(classes, recordType); @@ -773,13 +799,8 @@ private ABlockStmCG consRecordPatternCheck(boolean declarePattern, types.add(currentField.getType()); } - AIdentifierVarExpCG recordPatternVar = new AIdentifierVarExpCG(); - recordPatternVar.setType(recordType.clone()); - recordPatternVar.setName(idPattern.getName()); - recordPatternVar.setIsLambda(false); - recordPatternVar.setIsLocal(true); - - ABlockStmCG fieldCheckBlock = consFieldCheckBlock(patternData, recordPatternVar, recordPattern.getPatterns(), types, false); + ABlockStmCG fieldCheckBlock = consFieldCheckBlock(patternData, recordPatternVar, + recordPattern.getPatterns(), types, checkRecordType && !declarePattern); recordPatternBlock.getStatements().add(fieldCheckBlock); @@ -1066,7 +1087,7 @@ private SExpCG consFieldValueToMatch(AIdentifierVarExpCG patternVar, return consTupleFieldExp(patternVar, fieldNumber, currentType, cast); } else if (patternVar.getType() instanceof ARecordTypeCG) { - return consRecFieldExp(patternVar, fieldNumber, currentType); + return consRecFieldExp(patternVar, fieldNumber, currentType, cast); } return null; @@ -1224,8 +1245,8 @@ private AFieldNumberExpCG consTupleFieldExp( return fieldNumberExp; } - private AFieldExpCG consRecFieldExp(AIdentifierVarExpCG patternVar, int i, - STypeCG currentType) + private SExpCG consRecFieldExp(AIdentifierVarExpCG patternVar, int i, + STypeCG currentType, boolean cast) { ARecordTypeCG recordType = (ARecordTypeCG) patternVar.getType(); @@ -1233,7 +1254,16 @@ private AFieldExpCG consRecFieldExp(AIdentifierVarExpCG patternVar, int i, String fieldName = recordField.getName(); AFieldExpCG fieldExp = consRecFieldExp(patternVar, currentType, fieldName); - + + if(cast) + { + ACastUnaryExpCG casted = new ACastUnaryExpCG(); + casted.setType(recordType.clone()); + casted.setExp(fieldExp.getObject()); + + fieldExp.setObject(casted); + } + return fieldExp; } @@ -1264,7 +1294,7 @@ private DeclarationTag fetchTag(PCG node) return null; } - + private boolean checkRecordPattern(SExpCG actualValue) { return actualValue != null && actualValue.getType() instanceof AUnionTypeCG; From 6b41d7657f761c3d15fd1a08d71ab30b910276a3 Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Tue, 17 Feb 2015 14:02:08 +0100 Subject: [PATCH 12/90] Expose IR-template mapping for use with extensions. [Issue: ] --- .../overture/codegen/merging/TemplateManager.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/merging/TemplateManager.java b/core/codegen/src/main/java/org/overture/codegen/merging/TemplateManager.java index f79dd1bba3..9089d67dd5 100644 --- a/core/codegen/src/main/java/org/overture/codegen/merging/TemplateManager.java +++ b/core/codegen/src/main/java/org/overture/codegen/merging/TemplateManager.java @@ -112,9 +112,13 @@ public class TemplateManager { - private HashMap, String> nodeTemplateFileNames; + /** + * Mapping IR classes and template locations. Initialize with {@link TemplateManager#initNodeTemplateFileNames()} + * and insert/update as necessary. + */ + protected HashMap, String> nodeTemplateFileNames; - private TemplateStructure templateStructure; + protected TemplateStructure templateStructure; public TemplateManager(TemplateStructure templateStructure) { @@ -122,7 +126,11 @@ public TemplateManager(TemplateStructure templateStructure) initNodeTemplateFileNames(); } - private void initNodeTemplateFileNames() + /** + * Initialize the mapping of IR nodes and templates with the most common + * nodes used. Folder structure is specified with {@link TemplateStructure} + */ + protected void initNodeTemplateFileNames() { nodeTemplateFileNames = new HashMap, String>(); From 1cd4ddea746f73dc230a9db8b58f8837a54b0027 Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Tue, 17 Feb 2015 14:26:19 +0100 Subject: [PATCH 13/90] Add extensible constructor to MergeVisitor. [Issue: ] --- .../overture/codegen/merging/MergeVisitor.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java b/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java index 1064aa837d..ce723a221f 100644 --- a/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java +++ b/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java @@ -49,6 +49,11 @@ public class MergeVisitor extends QuestionAdaptor private List mergeErrors; + /** + * Default constructor. NOT for use by extensions. + * @param templateStructure + * @param templateCallables + */ public MergeVisitor(TemplateStructure templateStructure, TemplateCallable[] templateCallables) { @@ -59,6 +64,19 @@ public MergeVisitor(TemplateStructure templateStructure, this.unsupportedInTargLang = new HashSet(); } + /** + * Extensible constructor. + * @param templateManager + * @param templateCallables + */ + public MergeVisitor(TemplateManager templateManager, TemplateCallable[] templateCallables){ + this.templates = templateManager; + this.nodeContexts = new Stack(); + this.templateCallables = templateCallables; + this.mergeErrors = new LinkedList(); + this.unsupportedInTargLang = new HashSet(); + } + public List getMergeErrors() { return mergeErrors; From 9344fe06ec016baf730746bd982ffffd027fc28d Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 15:29:28 +0100 Subject: [PATCH 14/90] Fix for code generator plugin update site. Fixes #418 --- ide/plugins/features/codegen/feature.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ide/plugins/features/codegen/feature.xml b/ide/plugins/features/codegen/feature.xml index dd19259bf3..2cecfc7a33 100644 --- a/ide/plugins/features/codegen/feature.xml +++ b/ide/plugins/features/codegen/feature.xml @@ -16,14 +16,6 @@ %agreement - - - - From af85942d178d067263b450c8aea2c444e96585ad Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 17:42:42 +0100 Subject: [PATCH 15/90] Refactoring code that initialises the IR method node --- .../codegen/assistant/DeclAssistantCG.java | 43 ++++++++++++++++++ .../codegen/visitor/DeclVisitorCG.java | 44 ++++--------------- 2 files changed, 51 insertions(+), 36 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java index 9fe5603eea..7737fd2d4f 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java @@ -29,6 +29,7 @@ import org.overture.ast.analysis.AnalysisException; import org.overture.ast.definitions.AClassClassDefinition; import org.overture.ast.definitions.AEqualsDefinition; +import org.overture.ast.definitions.AExplicitFunctionDefinition; import org.overture.ast.definitions.AValueDefinition; import org.overture.ast.definitions.PDefinition; import org.overture.ast.definitions.SClassDefinition; @@ -39,6 +40,7 @@ import org.overture.codegen.cgast.SDeclCG; import org.overture.codegen.cgast.SExpCG; import org.overture.codegen.cgast.SPatternCG; +import org.overture.codegen.cgast.SStmCG; import org.overture.codegen.cgast.STypeCG; import org.overture.codegen.cgast.declarations.AClassDeclCG; import org.overture.codegen.cgast.declarations.AFieldDeclCG; @@ -51,6 +53,7 @@ import org.overture.codegen.cgast.types.ABoolBasicTypeCG; import org.overture.codegen.cgast.types.ACharBasicTypeCG; import org.overture.codegen.cgast.types.AIntNumericBasicTypeCG; +import org.overture.codegen.cgast.types.AMethodTypeCG; import org.overture.codegen.cgast.types.ANat1NumericBasicTypeCG; import org.overture.codegen.cgast.types.ANatNumericBasicTypeCG; import org.overture.codegen.cgast.types.ARealNumericBasicTypeCG; @@ -486,4 +489,44 @@ public AFieldDeclCG getFieldDecl(List classes, return field; } + + public AMethodDeclCG initMethod(SOperationDefinition node, IRInfo question) throws AnalysisException + { + String access = node.getAccess().getAccess().toString(); + boolean isStatic = question.getTcFactory().createPDefinitionAssistant().isStatic(node); + boolean isAsync = question.getTcFactory().createPAccessSpecifierAssistant().isAsync(node.getAccess()); + String operationName = node.getName().getName(); + STypeCG type = node.getType().apply(question.getTypeVisitor(), question); + + if (!(type instanceof AMethodTypeCG)) + { + return null; + } + + AMethodTypeCG methodType = (AMethodTypeCG) type; + SStmCG body = node.getBody().apply(question.getStmVisitor(), question); + boolean isConstructor = node.getIsConstructor(); + boolean isAbstract = body == null; + + AMethodDeclCG method = new AMethodDeclCG(); + + method.setAccess(access); + method.setStatic(isStatic); + method.setAsync(isAsync); + method.setMethodType(methodType); + method.setName(operationName); + method.setBody(body); + method.setIsConstructor(isConstructor); + method.setAbstract(isAbstract); + + AExplicitFunctionDefinition preCond = node.getPredef(); + SDeclCG preCondCg = preCond != null ? preCond.apply(question.getDeclVisitor(), question) : null; + method.setPreCond(preCondCg); + + AExplicitFunctionDefinition postCond = node.getPostdef(); + SDeclCG postCondCg = postCond != null ? postCond.apply(question.getDeclVisitor(), question) : null; + method.setPostCond(postCondCg); + + return method; + } } diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java index ab5fa6bf53..cfbffe5a6a 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java @@ -58,8 +58,8 @@ import org.overture.codegen.cgast.declarations.AFuncDeclCG; import org.overture.codegen.cgast.declarations.AMethodDeclCG; import org.overture.codegen.cgast.declarations.AMutexSyncDeclCG; -import org.overture.codegen.cgast.declarations.ANamedTypeDeclCG; import org.overture.codegen.cgast.declarations.ANamedTraceDeclCG; +import org.overture.codegen.cgast.declarations.ANamedTypeDeclCG; import org.overture.codegen.cgast.declarations.APersyncDeclCG; import org.overture.codegen.cgast.declarations.ARecordDeclCG; import org.overture.codegen.cgast.declarations.AThreadDeclCG; @@ -320,44 +320,24 @@ public SDeclCG caseAExplicitFunctionDefinition( return method; } - + @Override public SDeclCG caseAExplicitOperationDefinition( AExplicitOperationDefinition node, IRInfo question) throws AnalysisException { - String access = node.getAccess().getAccess().toString(); - boolean isStatic = question.getTcFactory().createPDefinitionAssistant().isStatic(node); - boolean isAsync = question.getTcFactory().createPAccessSpecifierAssistant().isAsync(node.getAccess()); - String operationName = node.getName().getName(); - STypeCG type = node.getType().apply(question.getTypeVisitor(), question); - - if (!(type instanceof AMethodTypeCG)) + AMethodDeclCG method = question.getDeclAssistant().initMethod(node, question); + + if(method == null) { question.addUnsupportedNode(node, "Expected method type for explicit operation. Got: " - + type); + + node.getType()); return null; } - - AMethodTypeCG methodType = (AMethodTypeCG) type; - SStmCG body = node.getBody().apply(question.getStmVisitor(), question); - boolean isConstructor = node.getIsConstructor(); - boolean isAbstract = body == null; - - AMethodDeclCG method = new AMethodDeclCG(); - - method.setAccess(access); - method.setStatic(isStatic); - method.setAsync(isAsync); - method.setMethodType(methodType); - method.setName(operationName); - method.setBody(body); - method.setIsConstructor(isConstructor); - method.setAbstract(isAbstract); - + List ptypes = ((AOperationType) node.getType()).getParameters(); LinkedList paramPatterns = node.getParameterPatterns(); - + LinkedList formalParameters = method.getFormalParams(); for (int i = 0; i < ptypes.size(); i++) @@ -371,14 +351,6 @@ public SDeclCG caseAExplicitOperationDefinition( formalParameters.add(param); } - - AExplicitFunctionDefinition preCond = node.getPredef(); - SDeclCG preCondCg = preCond != null ? preCond.apply(question.getDeclVisitor(), question) : null; - method.setPreCond(preCondCg); - - AExplicitFunctionDefinition postCond = node.getPostdef(); - SDeclCG postCondCg = postCond != null ? postCond.apply(question.getDeclVisitor(), question) : null; - method.setPostCond(postCondCg); return method; } From 6f6f8c0fa0a2ee7cfb922e3c7c6ca672743d3d21 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 19:05:59 +0100 Subject: [PATCH 16/90] Added test to exercise Java code generation of implicit operations --- .../test/resources/pre_post_specs/ImplicitOp | 18 ++++++++ .../pre_post_specs/ImplicitOp.result | 42 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 core/codegen/src/test/resources/pre_post_specs/ImplicitOp create mode 100644 core/codegen/src/test/resources/pre_post_specs/ImplicitOp.result diff --git a/core/codegen/src/test/resources/pre_post_specs/ImplicitOp b/core/codegen/src/test/resources/pre_post_specs/ImplicitOp new file mode 100644 index 0000000000..65f519ea46 --- /dev/null +++ b/core/codegen/src/test/resources/pre_post_specs/ImplicitOp @@ -0,0 +1,18 @@ +class Entry + +operations + +public static Run : () ==> ? +Run () == +let b = not true +in + if b then + return addImpl(5, 7) + else + return 5 + 7; + +static addImpl (left,right: nat) res: nat +pre true +post left + right = res; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/pre_post_specs/ImplicitOp.result b/core/codegen/src/test/resources/pre_post_specs/ImplicitOp.result new file mode 100644 index 0000000000..ce6bd3e7d4 --- /dev/null +++ b/core/codegen/src/test/resources/pre_post_specs/ImplicitOp.result @@ -0,0 +1,42 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + Boolean b = !true; + + if (b) { + return addImpl(5L, 7L); + } else { + return 5L + 7L; + } + } + + private static Number addImpl(final Number left, final Number right) { + if (!(pre_addImpl(left, right))) { + throw new RuntimeException("Precondition failure: pre_addImpl"); + } + + throw new UnsupportedOperationException(); + } + + private static Boolean pre_addImpl(final Number left, final Number right) { + return true; + } + + private static Boolean post_addImpl(final Number left, final Number right, + final Number res, final VDMMap self) { + return Utils.equals(left.longValue() + right.longValue(), res); + } + + public String toString() { + return "Entry{}"; + } +} + +########## From 8bae4b3301819c0015409f3ee87325d718766377 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 19:09:00 +0100 Subject: [PATCH 17/90] Minor improvements to construction of IR methods --- .../overture/codegen/assistant/DeclAssistantCG.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java index 7737fd2d4f..92169970e5 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java @@ -37,6 +37,7 @@ import org.overture.ast.definitions.SOperationDefinition; import org.overture.ast.intf.lex.ILexNameToken; import org.overture.ast.node.INode; +import org.overture.ast.statements.ASubclassResponsibilityStm; import org.overture.codegen.cgast.SDeclCG; import org.overture.codegen.cgast.SExpCG; import org.overture.codegen.cgast.SPatternCG; @@ -504,9 +505,15 @@ public AMethodDeclCG initMethod(SOperationDefinition node, IRInfo question) thro } AMethodTypeCG methodType = (AMethodTypeCG) type; - SStmCG body = node.getBody().apply(question.getStmVisitor(), question); + + SStmCG bodyCg = null; + if (node.getBody() != null) + { + bodyCg = node.getBody().apply(question.getStmVisitor(), question); + } + boolean isConstructor = node.getIsConstructor(); - boolean isAbstract = body == null; + boolean isAbstract = node.getBody() instanceof ASubclassResponsibilityStm; AMethodDeclCG method = new AMethodDeclCG(); @@ -515,7 +522,7 @@ public AMethodDeclCG initMethod(SOperationDefinition node, IRInfo question) thro method.setAsync(isAsync); method.setMethodType(methodType); method.setName(operationName); - method.setBody(body); + method.setBody(bodyCg); method.setIsConstructor(isConstructor); method.setAbstract(isAbstract); From 6df8c1d00cc67f8be02d6edb829862ae81accc11 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 19:17:16 +0100 Subject: [PATCH 18/90] Added Java code generation support for implicit operations --- .../codegen/visitor/DeclVisitorCG.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java index cfbffe5a6a..e677f5e2fe 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java @@ -29,6 +29,7 @@ import org.overture.ast.definitions.AClassInvariantDefinition; import org.overture.ast.definitions.AExplicitFunctionDefinition; import org.overture.ast.definitions.AExplicitOperationDefinition; +import org.overture.ast.definitions.AImplicitOperationDefinition; import org.overture.ast.definitions.AInstanceVariableDefinition; import org.overture.ast.definitions.AMutexSyncDefinition; import org.overture.ast.definitions.ANamedTraceDefinition; @@ -39,6 +40,7 @@ import org.overture.ast.definitions.traces.ATraceDefinitionTerm; import org.overture.ast.expressions.PExp; import org.overture.ast.intf.lex.ILexNameToken; +import org.overture.ast.patterns.APatternListTypePair; import org.overture.ast.patterns.PPattern; import org.overture.ast.statements.PStm; import org.overture.ast.types.AFieldField; @@ -67,6 +69,7 @@ import org.overture.codegen.cgast.expressions.ALambdaExpCG; import org.overture.codegen.cgast.expressions.ANotImplementedExpCG; import org.overture.codegen.cgast.name.ATokenNameCG; +import org.overture.codegen.cgast.statements.ANotImplementedStmCG; import org.overture.codegen.cgast.traces.ATraceDeclTermCG; import org.overture.codegen.cgast.types.AMethodTypeCG; import org.overture.codegen.cgast.types.ATemplateTypeCG; @@ -354,6 +357,50 @@ public SDeclCG caseAExplicitOperationDefinition( return method; } + + @Override + public SDeclCG caseAImplicitOperationDefinition( + AImplicitOperationDefinition node, IRInfo question) + throws AnalysisException + { + AMethodDeclCG method = question.getDeclAssistant().initMethod(node, question); + + if(method == null) + { + question.addUnsupportedNode(node, "Expected method type for explicit operation. Got: " + + node.getType()); + return null; + } + + // The curent IR construction does not include: + // + // Name of result and its type: + // APatternTypePair res = node.getResult(); + // Ext clauses (read and write): + // LinkedList externals = node.getExternals(); + // Exceptions thrown: + // LinkedList errors = node.getErrors(); + + method.setBody(new ANotImplementedStmCG()); + + for(APatternListTypePair patternListPair : node.getParameterPatterns()) + { + STypeCG pairTypeCg = patternListPair.getType().apply(question.getTypeVisitor(), question); + + for(PPattern p : patternListPair.getPatterns()) + { + SPatternCG patternCg = p.apply(question.getPatternVisitor(), question); + + AFormalParamLocalParamCG paramCg = new AFormalParamLocalParamCG(); + paramCg.setPattern(patternCg); + paramCg.setType(pairTypeCg.clone()); + + method.getFormalParams().add(paramCg); + } + } + + return method; + } @Override public SDeclCG caseAInstanceVariableDefinition( From 2bf3475c6e37ababffb79727bbe6ab784e90166e Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 20:44:28 +0100 Subject: [PATCH 19/90] Added test to exercise Java code generation of implicit functions --- .../resources/pre_post_specs/ImplicitFunc | 20 +++++++ .../pre_post_specs/ImplicitFunc.result | 55 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 core/codegen/src/test/resources/pre_post_specs/ImplicitFunc create mode 100644 core/codegen/src/test/resources/pre_post_specs/ImplicitFunc.result diff --git a/core/codegen/src/test/resources/pre_post_specs/ImplicitFunc b/core/codegen/src/test/resources/pre_post_specs/ImplicitFunc new file mode 100644 index 0000000000..ed0708d9cf --- /dev/null +++ b/core/codegen/src/test/resources/pre_post_specs/ImplicitFunc @@ -0,0 +1,20 @@ +class Entry + +operations + +public static Run : () ==> (nat * nat) +Run () == +let b = not true +in + if b then + return doImpl(5, 7) + else + return mk_(7, 5); + +functions + +doImpl (left,right: nat) res: nat, res2 : nat +pre true +post left + right = res; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/pre_post_specs/ImplicitFunc.result b/core/codegen/src/test/resources/pre_post_specs/ImplicitFunc.result new file mode 100644 index 0000000000..700fb381da --- /dev/null +++ b/core/codegen/src/test/resources/pre_post_specs/ImplicitFunc.result @@ -0,0 +1,55 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Tuple Run() { + Boolean b = !true; + + if (b) { + return doImpl(5L, 7L); + } else { + return Tuple.mk_(7L, 5L); + } + } + + private static Tuple doImpl(final Number left, final Number right) { + if (!(pre_doImpl(left, right))) { + throw new RuntimeException("Precondition failure: pre_doImpl"); + } + + throw new UnsupportedOperationException(); + } + + private static Boolean pre_doImpl(final Number left, final Number right) { + return true; + } + + private static Boolean post_doImpl(final Number left, final Number right, + final Tuple tuplePattern_1) { + Boolean success_1 = tuplePattern_1.compatible(Number.class, Number.class); + Number res = null; + Number res2 = null; + + if (success_1) { + res = ((Number) tuplePattern_1.get(0)); + res2 = ((Number) tuplePattern_1.get(1)); + } + + if (!(success_1)) { + throw new RuntimeException("Tuple pattern match failed"); + } + + return Utils.equals(left.longValue() + right.longValue(), res); + } + + public String toString() { + return "Entry{}"; + } +} + +########## From ea8d9711602e44e2631cdb698bef5351d8646004 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 20:50:21 +0100 Subject: [PATCH 20/90] Added support for Java code generation of implicit functions --- .../codegen/assistant/DeclAssistantCG.java | 27 +++++++ .../codegen/visitor/DeclVisitorCG.java | 76 ++++++++++++++----- 2 files changed, 85 insertions(+), 18 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java index 92169970e5..cc702ff00a 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java @@ -37,6 +37,8 @@ import org.overture.ast.definitions.SOperationDefinition; import org.overture.ast.intf.lex.ILexNameToken; import org.overture.ast.node.INode; +import org.overture.ast.patterns.APatternListTypePair; +import org.overture.ast.patterns.PPattern; import org.overture.ast.statements.ASubclassResponsibilityStm; import org.overture.codegen.cgast.SDeclCG; import org.overture.codegen.cgast.SExpCG; @@ -45,6 +47,7 @@ import org.overture.codegen.cgast.STypeCG; import org.overture.codegen.cgast.declarations.AClassDeclCG; import org.overture.codegen.cgast.declarations.AFieldDeclCG; +import org.overture.codegen.cgast.declarations.AFormalParamLocalParamCG; import org.overture.codegen.cgast.declarations.AMethodDeclCG; import org.overture.codegen.cgast.declarations.ARecordDeclCG; import org.overture.codegen.cgast.declarations.ATypeDeclCG; @@ -536,4 +539,28 @@ public AMethodDeclCG initMethod(SOperationDefinition node, IRInfo question) thro return method; } + + + public List consFormalParams( + List params, IRInfo question) + throws AnalysisException + { + List paramsCg = new LinkedList<>(); + for(APatternListTypePair patternListPair : params) + { + STypeCG pairTypeCg = patternListPair.getType().apply(question.getTypeVisitor(), question); + + for(PPattern p : patternListPair.getPatterns()) + { + SPatternCG patternCg = p.apply(question.getPatternVisitor(), question); + + AFormalParamLocalParamCG paramCg = new AFormalParamLocalParamCG(); + paramCg.setPattern(patternCg); + paramCg.setType(pairTypeCg.clone()); + + paramsCg.add(paramCg); + } + } + return paramsCg; + } } diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java index e677f5e2fe..ef5e52c805 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java @@ -29,6 +29,7 @@ import org.overture.ast.definitions.AClassInvariantDefinition; import org.overture.ast.definitions.AExplicitFunctionDefinition; import org.overture.ast.definitions.AExplicitOperationDefinition; +import org.overture.ast.definitions.AImplicitFunctionDefinition; import org.overture.ast.definitions.AImplicitOperationDefinition; import org.overture.ast.definitions.AInstanceVariableDefinition; import org.overture.ast.definitions.AMutexSyncDefinition; @@ -40,7 +41,6 @@ import org.overture.ast.definitions.traces.ATraceDefinitionTerm; import org.overture.ast.expressions.PExp; import org.overture.ast.intf.lex.ILexNameToken; -import org.overture.ast.patterns.APatternListTypePair; import org.overture.ast.patterns.PPattern; import org.overture.ast.statements.PStm; import org.overture.ast.types.AFieldField; @@ -324,6 +324,61 @@ public SDeclCG caseAExplicitFunctionDefinition( return method; } + @Override + public SDeclCG caseAImplicitFunctionDefinition( + AImplicitFunctionDefinition node, IRInfo question) + throws AnalysisException + { + String accessCg = node.getAccess().getAccess().toString(); + String funcNameCg = node.getName().getName(); + + STypeCG typeCg = node.getType().apply(question.getTypeVisitor(), question); + + if (!(typeCg instanceof AMethodTypeCG)) + { + question.addUnsupportedNode(node, "Expected method type for implicit function. Got: " + + typeCg); + return null; + } + + AFuncDeclCG func = new AFuncDeclCG(); + AExplicitFunctionDefinition preCond = node.getPredef(); + SDeclCG preCondCg = preCond != null ? preCond.apply(question.getDeclVisitor(), question) : null; + func.setPreCond(preCondCg); + + AExplicitFunctionDefinition postCond = node.getPostdef(); + SDeclCG postCondCg = postCond != null ? postCond.apply(question.getDeclVisitor(), question) : null; + func.setPostCond(postCondCg); + + + // If the function uses any type parameters they will be + // registered as part of the method declaration + List typeParams = node.getTypeParams(); + for (int i = 0; i < typeParams.size(); i++) + { + ILexNameToken typeParam = typeParams.get(i); + ATemplateTypeCG templateType = new ATemplateTypeCG(); + templateType.setName(typeParam.getName()); + func.getTemplateTypes().add(templateType); + } + + func.setAbstract(false); + func.setAccess(accessCg); + // TODO: Why can this be async? + func.setAsync(false); + func.setBody(new ANotImplementedExpCG()); + func.setFormalParams(question.getDeclAssistant(). + consFormalParams(node.getParamPatterns(), question)); + func.setMethodType((AMethodTypeCG) typeCg); + func.setName(funcNameCg); + + // The implicit function is currently constructed without the result information: + //SPatternCG resPatternCg = node.getResult().getPattern().apply(question.getPatternVisitor(), question); + //STypeCG resTypeCg = node.getResult().getType().apply(question.getTypeVisitor(), question); + + return func; + } + @Override public SDeclCG caseAExplicitOperationDefinition( AExplicitOperationDefinition node, IRInfo question) @@ -382,23 +437,8 @@ public SDeclCG caseAImplicitOperationDefinition( // LinkedList errors = node.getErrors(); method.setBody(new ANotImplementedStmCG()); - - for(APatternListTypePair patternListPair : node.getParameterPatterns()) - { - STypeCG pairTypeCg = patternListPair.getType().apply(question.getTypeVisitor(), question); - - for(PPattern p : patternListPair.getPatterns()) - { - SPatternCG patternCg = p.apply(question.getPatternVisitor(), question); - - AFormalParamLocalParamCG paramCg = new AFormalParamLocalParamCG(); - paramCg.setPattern(patternCg); - paramCg.setType(pairTypeCg.clone()); - - method.getFormalParams().add(paramCg); - } - } - + method.setFormalParams(question.getDeclAssistant(). + consFormalParams(node.getParameterPatterns(), question)); return method; } From 31a322818989bdfedce7c2fd365461d0846a6e3d Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 21:02:01 +0100 Subject: [PATCH 21/90] Functions could accidently be set to async, which of course, does not make sense --- .../main/java/org/overture/codegen/visitor/DeclVisitorCG.java | 2 -- core/codegen/src/main/resources/cg.astv2 | 1 - 2 files changed, 3 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java index ef5e52c805..015807691a 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java @@ -364,8 +364,6 @@ public SDeclCG caseAImplicitFunctionDefinition( func.setAbstract(false); func.setAccess(accessCg); - // TODO: Why can this be async? - func.setAsync(false); func.setBody(new ANotImplementedExpCG()); func.setFormalParams(question.getDeclAssistant(). consFormalParams(node.getParamPatterns(), question)); diff --git a/core/codegen/src/main/resources/cg.astv2 b/core/codegen/src/main/resources/cg.astv2 index a57e798e8f..f8dbf25368 100644 --- a/core/codegen/src/main/resources/cg.astv2 +++ b/core/codegen/src/main/resources/cg.astv2 @@ -99,7 +99,6 @@ CG {-> package='org.overture.codegen.cgast' (preCond):CG.#decl (postCond):CG.#decl [access]:java_String - [async]:java_Boolean [abstract]:java_Boolean [methodType]:CG.#type.method [name]:java_String From 568f124006d191e0f63f1a26a2de248419982465 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 22:14:36 +0100 Subject: [PATCH 22/90] Fix: The type of the 'time' expression in the IR was missing --- .../java/org/overture/codegen/visitor/ExpVisitorCG.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java index e2403dc016..add34aa46c 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java @@ -201,7 +201,12 @@ public SExpCG caseANotYetSpecifiedExp(ANotYetSpecifiedExp node, public SExpCG caseATimeExp(ATimeExp node, IRInfo question) throws AnalysisException { - return new ATimeExpCG(); + STypeCG typeCg = node.getType().apply(question.getTypeVisitor(), question); + + ATimeExpCG timeExp = new ATimeExpCG(); + timeExp.setType(typeCg); + + return timeExp; } @Override From cdd140186d56792580f4f2b1781b7827adda3fe5 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 22:18:10 +0100 Subject: [PATCH 23/90] Made the Java code generator output more user friendly for the commandline based version --- .../java/org/overture/codegen/vdm2java/JavaCodeGenMain.java | 4 ++-- .../java/org/overture/codegen/vdm2java/JavaCodeGenUtil.java | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenMain.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenMain.java index 86cdce0b9e..dbd0a9a036 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenMain.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenMain.java @@ -91,13 +91,13 @@ public static void main(String[] args) if(generatedClass.hasUnsupportedIrNodes()) { - Logger.getLog().println("Following VDM constructs are not supported by the IR:"); + Logger.getLog().println("Following VDM constructs are not supported by the code generator:"); JavaCodeGenUtil.printUnsupportedIrNodes(generatedClass.getUnsupportedInIr()); } if(generatedClass.hasUnsupportedTargLangNodes()) { - Logger.getLog().println("Following IR constructs are not supported by the backend/target languages:"); + Logger.getLog().println("Following constructs are not supported by the code generator:"); JavaCodeGenUtil.printUnsupportedNodes(generatedClass.getUnsupportedInTargLang()); } diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenUtil.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenUtil.java index 415a9cf31a..0e1153ca69 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenUtil.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGenUtil.java @@ -336,8 +336,6 @@ public static void printUnsupportedIrNodes(Set unsupportedNodes) List nodesSorted = locationAssistant.getVdmNodeInfoLocationSorted(unsupportedNodes); - Logger.getLog().println("Following VDM constructs are not supported by the IR: "); - for (VdmNodeInfo vdmNodeInfo : nodesSorted) { Logger.getLog().print(vdmNodeInfo.getNode().toString()); From b1f5219bf315c0de704b0de8b294b422ee533da6 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Tue, 17 Feb 2015 22:30:10 +0100 Subject: [PATCH 24/90] Changed the Java code generator plugin to use more user friendly output when reporting unsupported constructs --- .../ide/plugins/codegen/commands/Vdm2JavaCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java index f31901985a..df27e08c65 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java @@ -348,7 +348,7 @@ private void outputUserspecifiedModules(File outputFolder, LocationAssistantCG locationAssistant = assistantManager.getLocationAssistant(); List unsupportedInIr = locationAssistant.getVdmNodeInfoLocationSorted(generatedModule.getUnsupportedInIr()); - CodeGenConsole.GetInstance().println("Following VDM constructs are not supported by the IR: "); + CodeGenConsole.GetInstance().println("Following VDM constructs are not supported by the code generator:"); for (VdmNodeInfo nodeInfo : unsupportedInIr) { @@ -362,7 +362,7 @@ private void outputUserspecifiedModules(File outputFolder, if(generatedModule.hasUnsupportedTargLangNodes()) { Set unsupportedInTargLang = generatedModule.getUnsupportedInTargLang(); - CodeGenConsole.GetInstance().println("Following constructs are not supported by the backend/target language:"); + CodeGenConsole.GetInstance().println("Following constructs are not supported by the code generator:"); for (IrNodeInfo nodeInfo : unsupportedInTargLang) { @@ -383,7 +383,7 @@ private void outputUserspecifiedModules(File outputFolder, if(!warnings.isEmpty()) { - CodeGenConsole.GetInstance().println("The following transformation warnings were found for class " + generatedModule.getName() + ":"); + CodeGenConsole.GetInstance().println("The following warnings were found for class " + generatedModule.getName() + ":"); for (IrNodeInfo nodeInfo : warnings) { From 9dd7ff5d1244b2219642b7051c9d865ff93faeed Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Wed, 18 Feb 2015 10:22:21 +0100 Subject: [PATCH 25/90] completion scanner tryount --- .../ui/templates/VdmCompleteProcesser.java | 6 +-- .../templates/VdmContentAssistProcessor.java | 43 ++++++++++++++++--- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java index 3cfc4b4acb..9d2b247467 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java @@ -154,7 +154,7 @@ private void addContainerTypes(INode def, boolean recordTypesOnly, if (name.toLowerCase().startsWith(info2.prefix.toString().toLowerCase())) { proposals.add(new CompletionProposal(name, offset - - info2.prefix.length(), info2.prefix.length(), name.length(), imgProvider.getImageLabel(element, 0), name, info, name)); + - info2.prefix.length(), info2.prefix.length(), name.length(), imgProvider.getImageLabel(element, 0), name, info, element.toString())); } } } @@ -356,7 +356,7 @@ private ICompletionProposal createProposal(INode node, int offset, + name; } IContextInformation info2 = new ContextInformation(name, name); //$NON-NLS-1$ - return new CompletionProposal(name, offset - info.proposal.length(), info.proposal.length(), name.length(), imgProvider.getImageLabel(node, 0), name, info2, name); + return new CompletionProposal(name, offset - info.proposal.length(), info.proposal.length(), name.length(), imgProvider.getImageLabel(node, 0), name, info2, node.toString()); } private INode getType(String typeName, List ast) @@ -463,7 +463,7 @@ private List getAst(VdmDocument document) { List ast = new Vector(); ast.addAll(document.getProject().getModel().getRootElementList()); - ast.addAll(document.getSourceUnit().getParseList()); + ast.addAll(document.getSourceUnit().getParseList());//maybe add broken parse tree return ast; } diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java index 132edf99d2..fd4caba05b 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java @@ -28,6 +28,7 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposal; +import org.overture.ast.lex.VDMToken; import org.overture.ide.ui.editor.core.VdmDocument; import org.overture.ide.ui.internal.viewsupport.VdmElementImageProvider; import org.overture.ide.ui.templates.VdmContentAssistProcessor.VdmCompletionContext.SearchType; @@ -72,7 +73,9 @@ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, } if (modList.size() > 0) + { return (ICompletionProposal[]) modList.toArray(new ICompletionProposal[modList.size()]); + } return completionProposals; } @@ -91,7 +94,7 @@ enum SearchType StringBuffer fieldType = new StringBuffer(); boolean afterNew = false; boolean afterMk = false; - public StringBuffer prefix= new StringBuffer(); + public StringBuffer prefix = new StringBuffer(); public void add(char c) { @@ -110,9 +113,11 @@ public void add(char c) break; } - - if(Character.isJavaIdentifierPart(c)) -prefix.append(c); + + if (Character.isJavaIdentifierPart(c)) + { + prefix.append(c); + } } public void reverse() @@ -120,7 +125,7 @@ public void reverse() proposal = proposal.reverse(); field = field.reverse(); // fieldType = fieldType.reverse(); - prefix =prefix.reverse(); + prefix = prefix.reverse(); } @Override @@ -133,12 +138,26 @@ public String toString() } } + VDMToken getToken(char c) + { + String name = "" + c; + for (VDMToken token : VDMToken.values()) + { + if (token.toString() != null && token.toString().equals(name)) + { + return token; + } + } + return null; + } + private VdmCompletionContext computeVdmCompletionContext(IDocument doc, int documentOffset) { // Use string buffer to collect characters StringBuffer buf = new StringBuffer(); + StringBuffer scanned = new StringBuffer(); char lastChar = '\0'; VdmCompletionContext info = new VdmCompletionContext(); while (true) @@ -148,6 +167,20 @@ private VdmCompletionContext computeVdmCompletionContext(IDocument doc, // Read character backwards char c = doc.getChar(--documentOffset); + + + VDMToken token = null; + if ((token = getToken(c)) != null)//'`' == null + { + if (token != VDMToken.POINT/* . */|| token != VDMToken.BRA /* ( */) + { + break; + } + } + + scanned.append(c); + + if (c == '.' && info.type == SearchType.Proposal) { From 2df07f4f3b40cb046e0d19ad49fa09759e1f29e9 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 18 Feb 2015 13:36:58 +0100 Subject: [PATCH 26/90] Added initial version of a new completion feature --- .../overture/ide/ui/templates/SearchType.java | 17 ++ .../ui/templates/VdmCompleteProcesser.java | 80 ++++----- .../ui/templates/VdmCompletionContext.java | 82 +++++++++ .../templates/VdmContentAssistProcessor.java | 169 +----------------- 4 files changed, 144 insertions(+), 204 deletions(-) create mode 100644 ide/ui/src/main/java/org/overture/ide/ui/templates/SearchType.java create mode 100644 ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/SearchType.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/SearchType.java new file mode 100644 index 0000000000..abeadc9386 --- /dev/null +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/SearchType.java @@ -0,0 +1,17 @@ +package org.overture.ide.ui.templates; + +public enum SearchType +{ +// Proposal, Field, Unknown, Type + Quote, + + New, + + Mk, + + CallParam, + + Dot, + + Types, +}; \ No newline at end of file diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java index 9d2b247467..bd1424e104 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java @@ -52,7 +52,6 @@ import org.overture.ide.ui.VdmUIPlugin; import org.overture.ide.ui.editor.core.VdmDocument; import org.overture.ide.ui.internal.viewsupport.VdmElementImageProvider; -import org.overture.ide.ui.templates.VdmContentAssistProcessor.VdmCompletionContext; import org.overture.ide.ui.utility.ast.AstLocationSearcher2; import org.overture.ide.ui.utility.ast.AstLocationSearcher2.TextReference; import org.overture.ide.ui.utility.ast.AstNameUtil; @@ -72,8 +71,7 @@ public void computeCompletionProposals(VdmCompletionContext info, // } else // { // completeFields(info, document, calculatedProposals, offset); - // } - completeFields(info, document, calculatedProposals, offset); + // completeFields(info, document, calculatedProposals, offset); completeTypes(info, document, calculatedProposals, offset); List replacementDisplayString = new Vector(); @@ -99,27 +97,27 @@ public void computeCompletionProposals(VdmCompletionContext info, public void completeTypes(VdmCompletionContext info, VdmDocument document, List proposals, int offset) { - boolean modulesOnly = info.afterNew || info.isEmpty; - boolean recordTypesOnly = info.afterMk || info.isEmpty; - String typeName = info.field.toString(); +// boolean modulesOnly = info.afterNew || info.isEmpty; +// boolean recordTypesOnly = info.afterMk || info.isEmpty; +// String typeName = info.field.toString(); for (INode element : getAst(document)) { - if (modulesOnly) + if (info.type==SearchType.Types) { String name = AstNameUtil.getName(element); - if (name.startsWith(typeName) || name.length() == 0) + if (name.startsWith(info.proposalPrefix) || name.length() == 0) { IContextInformation ctxtInfo = new ContextInformation(name, name); //$NON-NLS-1$ proposals.add(new CompletionProposal(name, offset, 0, name.length(), imgProvider.getImageLabel(element, 0), name, ctxtInfo, name)); } } - addContainerTypes(element, recordTypesOnly, offset, proposals, info); + addContainerTypes(element, offset, proposals, info); } } - private void addContainerTypes(INode def, boolean recordTypesOnly, + private void addContainerTypes(INode def, final int offset, final List proposals, final VdmCompletionContext info2) { @@ -151,10 +149,10 @@ private void addContainerTypes(INode def, boolean recordTypesOnly, String name = prefix + element.getName(); IContextInformation info = new ContextInformation(name, name); //$NON-NLS-1$ - if (name.toLowerCase().startsWith(info2.prefix.toString().toLowerCase())) + if (name.toLowerCase().startsWith(info2.proposalPrefix.toString().toLowerCase())) { proposals.add(new CompletionProposal(name, offset - - info2.prefix.length(), info2.prefix.length(), name.length(), imgProvider.getImageLabel(element, 0), name, info, element.toString())); + - info2.proposalPrefix.length(), info2.proposalPrefix.length(), name.length(), imgProvider.getImageLabel(element, 0), name, info, element.toString())); } } } @@ -185,11 +183,11 @@ void populateQuotes(INode node, String baseValue, IContextInformation info = new ContextInformation(name, name); //$NON-NLS-1$ - int curOffset = offset - info2.prefix.length(); + int curOffset = offset - info2.proposalPrefix.length(); int length = name.length(); - int replacementLength = info2.prefix.length(); + int replacementLength = info2.proposalPrefix.length(); - if (info2.prefix.toString().equals(baseValue)) + if (info2.proposalPrefix.toString().equals("<"+baseValue+">")) { // replacementLength+=1; // length+=1; @@ -197,7 +195,7 @@ void populateQuotes(INode node, String baseValue, replacementLength = 0; } - if (baseValue.toLowerCase().startsWith(info2.prefix.toString().toLowerCase())) + if (("<"+baseValue).toLowerCase().startsWith(info2.proposalPrefix.toString().toLowerCase())) { proposals.add(new CompletionProposal(name, curOffset, replacementLength, length, imgProvider.getImageLabel(node, 0), name, info, name)); } @@ -240,7 +238,7 @@ public void completeFields(VdmCompletionContext info, VdmDocument document, for (AFieldField field : rt.getFields()) { - if (field.getTag().toLowerCase().startsWith(info.proposal.toString().toLowerCase())) + if (field.getTag().toLowerCase().startsWith(info.proposalPrefix.toString().toLowerCase())) { proposals.add(createProposal(field, offset, info)); } @@ -250,29 +248,29 @@ public void completeFields(VdmCompletionContext info, VdmDocument document, { // FIXME old code - if (info.fieldType.toString().trim().length() != 0) - { - completeFromType(info.fieldType.toString(), info.proposal.toString(), proposals, offset, ast); - } else - { - List possibleMatch = new Vector(); - for (INode node : getLocalFileAst(document)) - { - for (INode field : getFields(node)) - { - if (AstNameUtil.getName(field).equals(info.field.toString())) - { - // Ok match then complete it - completeFromType(getTypeName(field), info.proposal.toString(), proposals, offset, ast); - } else if (AstNameUtil.getName(field).startsWith(info.field.toString())) - { - possibleMatch.add(field); - } - - } - - } - } +// if (info.fieldType.toString().trim().length() != 0) +// { +// completeFromType(info.fieldType.toString(), info.proposalPrefix.toString(), proposals, offset, ast); +// } else +// { +// List possibleMatch = new Vector(); +// for (INode node : getLocalFileAst(document)) +// { +// for (INode field : getFields(node)) +// { +// if (AstNameUtil.getName(field).equals(info.field.toString())) +// { +// // Ok match then complete it +// completeFromType(getTypeName(field), info.proposalPrefix.toString(), proposals, offset, ast); +// } else if (AstNameUtil.getName(field).startsWith(info.field.toString())) +// { +// possibleMatch.add(field); +// } +// +// } +// +// } +// } } } catch (Exception e) { @@ -356,7 +354,7 @@ private ICompletionProposal createProposal(INode node, int offset, + name; } IContextInformation info2 = new ContextInformation(name, name); //$NON-NLS-1$ - return new CompletionProposal(name, offset - info.proposal.length(), info.proposal.length(), name.length(), imgProvider.getImageLabel(node, 0), name, info2, node.toString()); + return new CompletionProposal(name, offset - info.proposalPrefix.length(), info.proposalPrefix.length(), name.length(), imgProvider.getImageLabel(node, 0), name, info2, node.toString()); } private INode getType(String typeName, List ast) diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java new file mode 100644 index 0000000000..440435edd4 --- /dev/null +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java @@ -0,0 +1,82 @@ +package org.overture.ide.ui.templates; + +import java.util.Iterator; +import java.util.List; + +public class VdmCompletionContext +{ + // boolean isEmpty = false; + // // SearchType type = SearchType.Proposal; + // StringBuffer proposal = new StringBuffer(); + // StringBuffer field = new StringBuffer(); + // StringBuffer fieldType = new StringBuffer(); + // boolean afterNew = false; + // boolean afterMk = false; + // public StringBuffer prefix = new StringBuffer(); + + // new + public StringBuffer rawScan; + public StringBuffer processedScan; + public int offset; + SearchType type = SearchType.Types; + + public String proposalPrefix; + + public List root; + + public VdmCompletionContext(StringBuffer rawScan) + { + this.rawScan = rawScan; + init(); + } + + private void init() + { + calcSearchType(); + + } + + private void calcSearchType() + { + int index = rawScan.toString().lastIndexOf("<"); + + if (index !=-1) + { + // quote + processedScan = new StringBuffer(rawScan.subSequence(index, rawScan.length())); + proposalPrefix = processedScan.toString(); + offset = index; + type = SearchType.Quote; + } + } + + @Override + public String toString() + { + return type + " - Root: " + getQualifiedSource() + " Proposal: " + + proposalPrefix; + } + + String getQualifiedSource() + { + String res = ""; + if (root != null && !root.isEmpty()) + { + for (Iterator itr = root.iterator(); itr.hasNext();) + { + res += itr.next(); + if (itr.hasNext()) + res += "."; + } + } + return res; + } + + // @Override + // public String toString() + // { + // return "Type: \"" + fieldType + "\" " + (afterMk ? "mk_" : "") + // + (afterNew ? "new " : "") + "\"" + // + (field.length() != 0 ? field + "." : "") + proposal + "\""; + // } +} \ No newline at end of file diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java index fd4caba05b..013adab84c 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java @@ -29,9 +29,9 @@ import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.overture.ast.lex.VDMToken; +import org.overture.ide.ui.VdmUIPlugin; import org.overture.ide.ui.editor.core.VdmDocument; import org.overture.ide.ui.internal.viewsupport.VdmElementImageProvider; -import org.overture.ide.ui.templates.VdmContentAssistProcessor.VdmCompletionContext.SearchType; public abstract class VdmContentAssistProcessor extends VdmTemplateAssistProcessor @@ -80,64 +80,6 @@ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, return completionProposals; } - public static class VdmCompletionContext - { - enum SearchType - { - Proposal, Field, Unknown, Type - }; - - boolean isEmpty = false; - SearchType type = SearchType.Proposal; - StringBuffer proposal = new StringBuffer(); - StringBuffer field = new StringBuffer(); - StringBuffer fieldType = new StringBuffer(); - boolean afterNew = false; - boolean afterMk = false; - public StringBuffer prefix = new StringBuffer(); - - public void add(char c) - { - switch (type) - { - case Field: - field.append(c); - break; - case Proposal: - proposal.append(c); - break; - case Type: - fieldType.append(c); - break; - case Unknown: - break; - - } - - if (Character.isJavaIdentifierPart(c)) - { - prefix.append(c); - } - } - - public void reverse() - { - proposal = proposal.reverse(); - field = field.reverse(); - // fieldType = fieldType.reverse(); - prefix = prefix.reverse(); - } - - @Override - public String toString() - { - return "Type: \"" + fieldType + "\" " + (afterMk ? "mk_" : "") - + (afterNew ? "new " : "") + "\"" - + (field.length() != 0 ? field + "." : "") + proposal - + "\""; - } - } - VDMToken getToken(char c) { String name = "" + c; @@ -154,132 +96,33 @@ VDMToken getToken(char c) private VdmCompletionContext computeVdmCompletionContext(IDocument doc, int documentOffset) { - // Use string buffer to collect characters - StringBuffer buf = new StringBuffer(); StringBuffer scanned = new StringBuffer(); - char lastChar = '\0'; - VdmCompletionContext info = new VdmCompletionContext(); while (true) { try { - // Read character backwards char c = doc.getChar(--documentOffset); - VDMToken token = null; - if ((token = getToken(c)) != null)//'`' == null + if ((token = getToken(c)) != null)// '`' == null { - if (token != VDMToken.POINT/* . */|| token != VDMToken.BRA /* ( */) + if (!(token == VDMToken.LT || token == VDMToken.POINT/* . */|| token == VDMToken.BRA /* ( */)) { break; } } - scanned.append(c); - - - - if (c == '.' && info.type == SearchType.Proposal) - { - info.type = SearchType.Field; - continue; - } - if (Character.isWhitespace(c) - && info.type == SearchType.Proposal) - { - // Ok maybe this is a field, lets try to search for it - info.field = info.proposal; - info.proposal = new StringBuffer(); - info.type = SearchType.Field; - // break; - } - - if (info.type == SearchType.Field && Character.isWhitespace(c)) - { - info.type = SearchType.Type; - continue; - } - - if (info.type == SearchType.Type) - { - if (Character.isWhitespace(c)) - { - continue; - } - buf.append(c); - // System.out.println("Buf: \""+buf+"\t\t\""+info.field+"\""); - if (buf.length() >= info.field.length() - && buf.substring(buf.length() - info.field.length()).equals(info.field.toString())) - { - StringBuffer tmp = new StringBuffer(buf).reverse(); - int index = tmp.indexOf("="); - int index2 = tmp.indexOf(":="); - int length = info.field.length() + 1; - if (index2 != -1 && index > index2) - { - index = index2; - - } - - if (index > 0 && length < index) - { - - String tmp2 = tmp.substring(length, index); - info.fieldType.append(tmp2); - } - break; - } - - } else - { - info.add(c); - } - - if (c == '=' && lastChar == '=') - { - break; - } - lastChar = c; } catch (BadLocationException e) { - + e.printStackTrace(); + VdmUIPlugin.log("completion failed", e); // Document start reached, no tag found - return info; } } + return new VdmCompletionContext(scanned.reverse()); - if (buf.length() >= 3) - { - if (buf.substring(0, 3).equals("wen")) - { - info.afterNew = true; - } - if (buf.substring(0, 3).equals("_km")) - { - info.afterMk = true; - } - } - - info.reverse(); - - if (buf.length() >= 3 && info.field.length() >= 3 - && info.field.substring(0, 3).equals("mk_")) - { - info.afterMk = true; - info.field = info.field.delete(0, 3); - } - - if (info.field.toString().trim().length() == 0) - { - info.isEmpty = true; - } - - System.out.println(info); - - return info; } } From 3b76d7ff8650191842995160791693346d61c922 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 18 Feb 2015 14:46:15 +0100 Subject: [PATCH 27/90] Added completion of constructors (the 'new' keyword case) --- .../ui/templates/VdmCompleteProcesser.java | 154 +++++++++++++----- .../ui/templates/VdmCompletionContext.java | 41 ++++- .../templates/VdmContentAssistProcessor.java | 11 ++ 3 files changed, 161 insertions(+), 45 deletions(-) diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java index bd1424e104..46193e956c 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java @@ -21,6 +21,7 @@ */ package org.overture.ide.ui.templates; +import java.util.Iterator; import java.util.List; import java.util.Vector; @@ -30,6 +31,7 @@ import org.eclipse.jface.text.contentassist.IContextInformation; import org.overture.ast.analysis.AnalysisException; import org.overture.ast.analysis.DepthFirstAnalysisAdaptor; +import org.overture.ast.assistant.definition.PAccessSpecifierAssistant; import org.overture.ast.definitions.AExplicitFunctionDefinition; import org.overture.ast.definitions.AExplicitOperationDefinition; import org.overture.ast.definitions.AImplicitFunctionDefinition; @@ -44,6 +46,7 @@ import org.overture.ast.expressions.PExp; import org.overture.ast.modules.AModuleModules; import org.overture.ast.node.INode; +import org.overture.ast.patterns.PPattern; import org.overture.ast.statements.PStm; import org.overture.ast.types.AFieldField; import org.overture.ast.types.AQuoteType; @@ -71,8 +74,31 @@ public void computeCompletionProposals(VdmCompletionContext info, // } else // { // completeFields(info, document, calculatedProposals, offset); - // completeFields(info, document, calculatedProposals, offset); - completeTypes(info, document, calculatedProposals, offset); + // completeFields(info, document, calculatedProposals, offset); + + switch(info.type) + { + case CallParam: + break; + case Dot: + break; + case Mk: + break; + case New: + completeNew(info, document, calculatedProposals, offset); + break; + case Quote: + break; + case Types: + completeTypes(info, document, calculatedProposals, offset); + break; + default: + break; + + } + + + List replacementDisplayString = new Vector(); for (ICompletionProposal proposal : calculatedProposals) @@ -94,16 +120,68 @@ public void computeCompletionProposals(VdmCompletionContext info, } } + private void completeNew(final VdmCompletionContext info, + VdmDocument document, final List proposals, + final int offset) + { + for (INode container : getAst(document)) + { + try + { + container.apply(new DepthFirstAnalysisAdaptor() + { + @Override + public void caseAExplicitOperationDefinition( + AExplicitOperationDefinition node) + throws AnalysisException + { + + if (node.getIsConstructor() + && new PAccessSpecifierAssistant(null).isPublic(node.getAccess())) + { + String name = node.getName().getName(); + if (info.proposalPrefix.isEmpty() + || name.toLowerCase().startsWith(info.proposalPrefix.toLowerCase())) + { + IContextInformation infoComplete = new ContextInformation(name, name); + + String replacementString =name+"("; + + for (Iterator iterator = node.getParameterPatterns().iterator(); iterator.hasNext();) + { + PPattern pattern = iterator.next(); + + replacementString+=pattern.toString(); + if(iterator.hasNext()) + replacementString+=", "; + + } + replacementString+=")"; + + proposals.add(new CompletionProposal(replacementString, offset + + info.offset, info.proposalPrefix.length(), replacementString.length(), imgProvider.getImageLabel(node, 0), replacementString, infoComplete, node.toString())); + } + } + } + }); + } catch (AnalysisException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + public void completeTypes(VdmCompletionContext info, VdmDocument document, List proposals, int offset) { -// boolean modulesOnly = info.afterNew || info.isEmpty; -// boolean recordTypesOnly = info.afterMk || info.isEmpty; -// String typeName = info.field.toString(); + // boolean modulesOnly = info.afterNew || info.isEmpty; + // boolean recordTypesOnly = info.afterMk || info.isEmpty; + // String typeName = info.field.toString(); for (INode element : getAst(document)) { - if (info.type==SearchType.Types) + if (info.type == SearchType.Types) { String name = AstNameUtil.getName(element); if (name.startsWith(info.proposalPrefix) || name.length() == 0) @@ -112,13 +190,13 @@ public void completeTypes(VdmCompletionContext info, VdmDocument document, proposals.add(new CompletionProposal(name, offset, 0, name.length(), imgProvider.getImageLabel(element, 0), name, ctxtInfo, name)); } } - addContainerTypes(element, offset, proposals, info); + addContainerTypes(element, offset, proposals, info); } } - private void addContainerTypes(INode def, - final int offset, final List proposals, + private void addContainerTypes(INode def, final int offset, + final List proposals, final VdmCompletionContext info2) { if (def instanceof SClassDefinition) @@ -183,11 +261,12 @@ void populateQuotes(INode node, String baseValue, IContextInformation info = new ContextInformation(name, name); //$NON-NLS-1$ - int curOffset = offset - info2.proposalPrefix.length(); + int curOffset = offset + info2.offset;// - info2.proposalPrefix.length(); int length = name.length(); int replacementLength = info2.proposalPrefix.length(); - if (info2.proposalPrefix.toString().equals("<"+baseValue+">")) + if (info2.proposalPrefix.toString().equals("<" + + baseValue + ">")) { // replacementLength+=1; // length+=1; @@ -195,7 +274,7 @@ void populateQuotes(INode node, String baseValue, replacementLength = 0; } - if (("<"+baseValue).toLowerCase().startsWith(info2.proposalPrefix.toString().toLowerCase())) + if (("<" + baseValue).toLowerCase().startsWith(info2.proposalPrefix.toString().toLowerCase())) { proposals.add(new CompletionProposal(name, curOffset, replacementLength, length, imgProvider.getImageLabel(node, 0), name, info, name)); } @@ -248,29 +327,29 @@ public void completeFields(VdmCompletionContext info, VdmDocument document, { // FIXME old code -// if (info.fieldType.toString().trim().length() != 0) -// { -// completeFromType(info.fieldType.toString(), info.proposalPrefix.toString(), proposals, offset, ast); -// } else -// { -// List possibleMatch = new Vector(); -// for (INode node : getLocalFileAst(document)) -// { -// for (INode field : getFields(node)) -// { -// if (AstNameUtil.getName(field).equals(info.field.toString())) -// { -// // Ok match then complete it -// completeFromType(getTypeName(field), info.proposalPrefix.toString(), proposals, offset, ast); -// } else if (AstNameUtil.getName(field).startsWith(info.field.toString())) -// { -// possibleMatch.add(field); -// } -// -// } -// -// } -// } + // if (info.fieldType.toString().trim().length() != 0) + // { + // completeFromType(info.fieldType.toString(), info.proposalPrefix.toString(), proposals, offset, ast); + // } else + // { + // List possibleMatch = new Vector(); + // for (INode node : getLocalFileAst(document)) + // { + // for (INode field : getFields(node)) + // { + // if (AstNameUtil.getName(field).equals(info.field.toString())) + // { + // // Ok match then complete it + // completeFromType(getTypeName(field), info.proposalPrefix.toString(), proposals, offset, ast); + // } else if (AstNameUtil.getName(field).startsWith(info.field.toString())) + // { + // possibleMatch.add(field); + // } + // + // } + // + // } + // } } } catch (Exception e) { @@ -354,7 +433,8 @@ private ICompletionProposal createProposal(INode node, int offset, + name; } IContextInformation info2 = new ContextInformation(name, name); //$NON-NLS-1$ - return new CompletionProposal(name, offset - info.proposalPrefix.length(), info.proposalPrefix.length(), name.length(), imgProvider.getImageLabel(node, 0), name, info2, node.toString()); + return new CompletionProposal(name, offset + - info.proposalPrefix.length(), info.proposalPrefix.length(), name.length(), imgProvider.getImageLabel(node, 0), name, info2, node.toString()); } private INode getType(String typeName, List ast) @@ -461,7 +541,7 @@ private List getAst(VdmDocument document) { List ast = new Vector(); ast.addAll(document.getProject().getModel().getRootElementList()); - ast.addAll(document.getSourceUnit().getParseList());//maybe add broken parse tree + ast.addAll(document.getSourceUnit().getParseList());// maybe add broken parse tree return ast; } diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java index 440435edd4..2b56763551 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompletionContext.java @@ -2,6 +2,7 @@ import java.util.Iterator; import java.util.List; +import java.util.Vector; public class VdmCompletionContext { @@ -15,14 +16,14 @@ public class VdmCompletionContext // public StringBuffer prefix = new StringBuffer(); // new - public StringBuffer rawScan; - public StringBuffer processedScan; + private StringBuffer rawScan; + private StringBuffer processedScan; public int offset; SearchType type = SearchType.Types; - public String proposalPrefix; + public String proposalPrefix = ""; - public List root; + public List root = new Vector(); public VdmCompletionContext(StringBuffer rawScan) { @@ -34,27 +35,51 @@ private void init() { calcSearchType(); + System.out.println("Computed completion context: "+toString()); } private void calcSearchType() { int index = rawScan.toString().lastIndexOf("<"); - if (index !=-1) + if (index != -1) { // quote processedScan = new StringBuffer(rawScan.subSequence(index, rawScan.length())); proposalPrefix = processedScan.toString(); - offset = index; + offset = -(rawScan.length() - index); type = SearchType.Quote; + return; + } + + index = rawScan.toString().indexOf("new"); + + if (index == 0) + { + // quote + processedScan = new StringBuffer(rawScan.subSequence(index + + "new".length(), rawScan.length())); + proposalPrefix = processedScan.toString().trim(); + + for (int i = index + "new".length(); i < rawScan.length(); i++) + { + if (Character.isJavaIdentifierStart(rawScan.charAt(i))) + { + offset = -(rawScan.length() - i); + break; + } + } + + type = SearchType.New; + return; } } @Override public String toString() { - return type + " - Root: " + getQualifiedSource() + " Proposal: " - + proposalPrefix; + return type + " - Root: '" + getQualifiedSource() + "' Proposal: '" + + proposalPrefix+"'" +" offset: "+offset; } String getQualifiedSource() diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java index 013adab84c..23dfb6fe3e 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java @@ -45,6 +45,9 @@ public boolean enableTemplate() return true; } + /** + * @param offset an offset within the document for which completions should be computed + */ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { @@ -113,7 +116,15 @@ private VdmCompletionContext computeVdmCompletionContext(IDocument doc, break; } } + scanned.append(c); + + if(c=='n' && scanned.length()>3&& scanned.substring(scanned.length()-4, scanned.length()).matches("\\swen")) + { + + break; + } + } catch (BadLocationException e) { From e24b0fe2a64e6f503559a71fce1c493a2354c506 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 18 Feb 2015 15:04:15 +0100 Subject: [PATCH 28/90] Improved completion of quotes. Now it also works in PP models --- .../ui/templates/VdmCompleteProcesser.java | 136 ++++++++++-------- .../templates/VdmContentAssistProcessor.java | 6 + 2 files changed, 82 insertions(+), 60 deletions(-) diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java index 46193e956c..e763926234 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmCompleteProcesser.java @@ -75,8 +75,8 @@ public void computeCompletionProposals(VdmCompletionContext info, // { // completeFields(info, document, calculatedProposals, offset); // completeFields(info, document, calculatedProposals, offset); - - switch(info.type) + + switch (info.type) { case CallParam: break; @@ -88,17 +88,15 @@ public void computeCompletionProposals(VdmCompletionContext info, completeNew(info, document, calculatedProposals, offset); break; case Quote: + completeQuotes(info, document, calculatedProposals, offset); break; case Types: completeTypes(info, document, calculatedProposals, offset); break; default: break; - + } - - - List replacementDisplayString = new Vector(); for (ICompletionProposal proposal : calculatedProposals) @@ -120,9 +118,20 @@ public void computeCompletionProposals(VdmCompletionContext info, } } + private void completeQuotes(final VdmCompletionContext info, + VdmDocument document, final List proposals, + int offset) + { + for (INode def : getAst(document)) + { + completeQuotes(offset, proposals, info, def); + } + + } + private void completeNew(final VdmCompletionContext info, VdmDocument document, final List proposals, - final int offset) + final int offset) { for (INode container : getAst(document)) { @@ -144,20 +153,20 @@ && new PAccessSpecifierAssistant(null).isPublic(node.getAccess())) || name.toLowerCase().startsWith(info.proposalPrefix.toLowerCase())) { IContextInformation infoComplete = new ContextInformation(name, name); - - String replacementString =name+"("; - + + String replacementString = name + "("; + for (Iterator iterator = node.getParameterPatterns().iterator(); iterator.hasNext();) { - PPattern pattern = iterator.next(); - - replacementString+=pattern.toString(); - if(iterator.hasNext()) - replacementString+=", "; - + PPattern pattern = iterator.next(); + + replacementString += pattern.toString(); + if (iterator.hasNext()) + replacementString += ", "; + } - replacementString+=")"; - + replacementString += ")"; + proposals.add(new CompletionProposal(replacementString, offset + info.offset, info.proposalPrefix.length(), replacementString.length(), imgProvider.getImageLabel(node, 0), replacementString, infoComplete, node.toString())); } @@ -210,7 +219,9 @@ private void addContainerTypes(INode def, final int offset, IContextInformation info = new ContextInformation(name, name); //$NON-NLS-1$ proposals.add(new CompletionProposal(name, offset, 0, name.length(), imgProvider.getImageLabel(element, 0), name, info, name)); } + } + completeQuotes(offset, proposals, info2, def); } else if (def instanceof AModuleModules) { AModuleModules m = (AModuleModules) def; @@ -235,60 +246,65 @@ private void addContainerTypes(INode def, final int offset, } } - try + completeQuotes(offset, proposals, info2, m); + } + + } + + private void completeQuotes(final int offset, + final List proposals, + final VdmCompletionContext info2, INode m) + { + try + { + m.apply(new DepthFirstAnalysisAdaptor() { - m.apply(new DepthFirstAnalysisAdaptor() + @Override + public void caseAQuoteLiteralExp(AQuoteLiteralExp node) + throws AnalysisException { - @Override - public void caseAQuoteLiteralExp(AQuoteLiteralExp node) - throws AnalysisException - { - populateQuotes(node, node.getValue().getValue(), node.toString()); - } + populateQuotes(node, node.getValue().getValue(), node.toString()); + } - @Override - public void caseAQuoteType(AQuoteType node) - throws AnalysisException - { - populateQuotes(node, node.getValue().getValue(), node.toString()); - } + @Override + public void caseAQuoteType(AQuoteType node) + throws AnalysisException + { + populateQuotes(node, node.getValue().getValue(), node.toString()); + } - void populateQuotes(INode node, String baseValue, - String name) + void populateQuotes(INode node, String baseValue, String name) + { + // if (!info2.prefix.toString().equals(baseValue)) { - // if (!info2.prefix.toString().equals(baseValue)) - { - IContextInformation info = new ContextInformation(name, name); //$NON-NLS-1$ + IContextInformation info = new ContextInformation(name, name); //$NON-NLS-1$ - int curOffset = offset + info2.offset;// - info2.proposalPrefix.length(); - int length = name.length(); - int replacementLength = info2.proposalPrefix.length(); + int curOffset = offset + info2.offset;// - info2.proposalPrefix.length(); + int length = name.length(); + int replacementLength = info2.proposalPrefix.length(); - if (info2.proposalPrefix.toString().equals("<" - + baseValue + ">")) - { - // replacementLength+=1; - // length+=1; - curOffset = offset; - replacementLength = 0; - } + if (info2.proposalPrefix.toString().equals("<" + + baseValue + ">")) + { + // replacementLength+=1; + // length+=1; + curOffset = offset; + replacementLength = 0; + } - if (("<" + baseValue).toLowerCase().startsWith(info2.proposalPrefix.toString().toLowerCase())) - { - proposals.add(new CompletionProposal(name, curOffset, replacementLength, length, imgProvider.getImageLabel(node, 0), name, info, name)); - } + if (("<" + baseValue).toLowerCase().startsWith(info2.proposalPrefix.toString().toLowerCase())) + { + proposals.add(new CompletionProposal(name, curOffset, replacementLength, length, imgProvider.getImageLabel(node, 0), name, info, name)); } } - }); - } catch (AnalysisException e) - { - VdmUIPlugin.log("Completion error in " - + getClass().getSimpleName() - + "faild during quote search", e); - } + } + }); + } catch (AnalysisException e) + { + VdmUIPlugin.log("Completion error in " + getClass().getSimpleName() + + "faild during quote search", e); } - } public void completeFields(VdmCompletionContext info, VdmDocument document, diff --git a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java index 23dfb6fe3e..6f748a1159 100644 --- a/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java +++ b/ide/ui/src/main/java/org/overture/ide/ui/templates/VdmContentAssistProcessor.java @@ -105,6 +105,11 @@ private VdmCompletionContext computeVdmCompletionContext(IDocument doc, { try { + if(documentOffset-1==-1) + { + //EOF + break; + } // Read character backwards char c = doc.getChar(--documentOffset); @@ -131,6 +136,7 @@ private VdmCompletionContext computeVdmCompletionContext(IDocument doc, e.printStackTrace(); VdmUIPlugin.log("completion failed", e); // Document start reached, no tag found + break; } } return new VdmCompletionContext(scanned.reverse()); From 971f772b11f514d5b0713b5b607822e5f145640d Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Wed, 18 Feb 2015 16:34:16 +0100 Subject: [PATCH 29/90] Disable POG auto refresh. Too aggressive atm. [Issue: ] --- .../ide/plugins/poviewer/view/PoOverviewTableView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ide/plugins/poviewer/src/main/java/org/overture/ide/plugins/poviewer/view/PoOverviewTableView.java b/ide/plugins/poviewer/src/main/java/org/overture/ide/plugins/poviewer/view/PoOverviewTableView.java index 6a68149dc9..e83989d3eb 100644 --- a/ide/plugins/poviewer/src/main/java/org/overture/ide/plugins/poviewer/view/PoOverviewTableView.java +++ b/ide/plugins/poviewer/src/main/java/org/overture/ide/plugins/poviewer/view/PoOverviewTableView.java @@ -241,13 +241,13 @@ public void run() { * The constructor. */ public PoOverviewTableView() { - VdmCore.addElementChangedListener(vdmlistner); +// VdmCore.addElementChangedListener(vdmlistner); } @Override public void dispose() { super.dispose(); - VdmCore.removeElementChangedListener(vdmlistner); + // VdmCore.removeElementChangedListener(vdmlistner); } /** From a7f19ca686fedec3dc94203dbe274f207774f2e8 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 00:18:43 +0100 Subject: [PATCH 30/90] Fix: The 'MergeVisitor' did not initialise correctly The 'MergeVisitor' did not clear the data structure containing nodes that are not supported by the backend --- .../org/overture/codegen/merging/MergeVisitor.java | 13 +++++++------ .../org/overture/codegen/vdm2java/JavaFormat.java | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java b/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java index ce723a221f..d822a3af30 100644 --- a/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java +++ b/core/codegen/src/main/java/org/overture/codegen/merging/MergeVisitor.java @@ -87,12 +87,6 @@ public boolean hasMergeErrors() return !mergeErrors.isEmpty(); } - public void dropMergeErrors() - { - // Don't clear it if others are using the list - mergeErrors = new LinkedList(); - } - public Set getUnsupportedInTargLang() { return unsupportedInTargLang; @@ -103,6 +97,13 @@ public boolean hasUnsupportedTargLangNodes() return unsupportedInTargLang != null && !unsupportedInTargLang.isEmpty(); } + public void init() + { + // Avoid clearing the data structures if others are using them + mergeErrors = new LinkedList(); + unsupportedInTargLang = new HashSet(); + } + private void initCodeGenContext(INode node, TemplateCallable[] templateCallables) { diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java index d12d62e123..2f94cac57a 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java @@ -177,7 +177,7 @@ public JavaSettings getJavaSettings() public void init() { - mergeVisitor.dropMergeErrors(); + mergeVisitor.init(); } public void setClasses(List classes) From 43c151abc28ad80d37be7f8597fd5347e5f6d746 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 16:34:07 +0100 Subject: [PATCH 31/90] Updated the CT runtime with test support for OO specs --- .../overture/ct/ctruntime/utils/CtHelper.java | 50 ++++++++++++------- .../tests/CtNoReductionPpTestCase.java | 45 +++++++++++++++++ ...Case.java => CtNoReductionSlTestCase.java} | 19 +++++-- ....java => CtRandomReductionSlTestCase.java} | 25 +++++++--- .../ct/ctruntime/tests/CtTestCaseBase.java | 27 +++++++--- .../tests/util/TestSourceFinder.java | 8 +-- 6 files changed, 130 insertions(+), 44 deletions(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java rename core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/{CtNoReductionTestCase.java => CtNoReductionSlTestCase.java} (73%) rename core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/{CtRandomReductionTestCase.java => CtRandomReductionSlTestCase.java} (88%) diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java index 12d3c59170..8bdbf86b13 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java @@ -29,45 +29,59 @@ import java.net.ServerSocket; import java.net.Socket; +import org.overture.ast.lex.Dialect; +import org.overture.config.Release; + public class CtHelper { - public String[] buildArgs(final String traceName, final int port, - File traceFolder, File specfile) - + public static class CtTestData { - // Passing 'null' indicates no trace reduction - return buildArgs(traceName, port, traceFolder, specfile, null); + public final String traceName; + public final int port; + public final File traceFolder; + public final File specFile; + public TraceReductionInfo reduction; + + public CtTestData(String traceName, int port, File traceFolder, + File specFile, TraceReductionInfo second) + { + this.traceName = traceName; + this.port = port; + this.traceFolder = traceFolder; + this.specFile = specFile; + this.reduction = second; + + } } - public String[] buildArgs(final String traceName, final int port, - File traceFolder, File specfile, TraceReductionInfo info) + public String[] buildArgs(Dialect dialect, Release release, CtTestData data) { - if (info == null) + if (data.reduction == null) { - info = new TraceReductionInfo(); + data.reduction= new TraceReductionInfo(); } String[] args = new String[] { "-h", "localhost", "-p", - port + "", + data.port + "", "-k", "whatever", "-e", - "DEFAULT", - "-vdmsl", + dialect == Dialect.VDM_SL ? "DEFAULT" : "Entry", + dialect.getArgstring(), "-r", "vdm10", "-t", - traceName, + data.traceName, "-tracefolder", - traceFolder.toURI().toASCIIString(), - specfile.toURI().toASCIIString(), + data.traceFolder.toURI().toASCIIString(), + data.specFile.toURI().toASCIIString(), "-traceReduction", - "{" + info.getSubset() + "," - + info.getReductionType().toString() + "," - + info.getSeed() + "}" }; + "{" + data.reduction.getSubset() + "," + + data.reduction.getReductionType().toString() + "," + + data.reduction.getSeed() + "}" }; return args; } diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java new file mode 100644 index 0000000000..f5cbb257b1 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java @@ -0,0 +1,45 @@ +package org.overture.ct.ctruntime.tests; + +import java.io.File; +import java.util.Collection; + +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; +import org.overture.ast.lex.Dialect; +import org.overture.config.Release; +import org.overture.config.Settings; +import org.overture.ct.ctruntime.tests.util.TestSourceFinder; +import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; +import org.overture.test.framework.Properties; + +@RunWith(value = Parameterized.class) +public class CtNoReductionPpTestCase extends CtTestCaseBase +{ + private static String TEST_NAME = "CT no reduction PP tests"; + private static final String ROOT = "src/test/resources/no_reduction_pp_specs"; + + @Parameters(name = "{0}") + public static Collection getData() + { + Properties.recordTestResults = false; + + Collection tests = TestSourceFinder.createTestCompleteFile(Dialect.VDM_PP, TEST_NAME, ROOT, "", ""); + + return tests; + } + + public CtNoReductionPpTestCase(String name, File file, File traceFolder, + CtTestData args) + { + super(file, traceFolder, args); + } + + @Override + public void setUp() throws Exception + { + Settings.dialect = Dialect.VDM_PP; + Settings.release = Release.VDM_10; + } + +} diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java similarity index 73% rename from core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionTestCase.java rename to core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java index 1a22d3e47a..39409a1f6f 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionTestCase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java @@ -28,13 +28,16 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import org.overture.ast.lex.Dialect; +import org.overture.config.Release; +import org.overture.config.Settings; import org.overture.ct.ctruntime.tests.util.TestSourceFinder; +import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; import org.overture.test.framework.Properties; @RunWith(value = Parameterized.class) -public class CtNoReductionTestCase extends CtTestCaseBase +public class CtNoReductionSlTestCase extends CtTestCaseBase { - private static String TEST_NAME = "CT tests"; + private static String TEST_NAME = "CT no reduction SL tests"; private static final String ROOT = "src/test/resources/no_reduction_sl_specs"; @Parameters(name = "{0}") @@ -42,15 +45,21 @@ public static Collection getData() { Properties.recordTestResults = false; - Collection tests = TestSourceFinder.createTestCompleteFile(Dialect.VDM_PP, TEST_NAME, ROOT, "", ""); + Collection tests = TestSourceFinder.createTestCompleteFile(Dialect.VDM_SL, TEST_NAME, ROOT, "", ""); return tests; } - public CtNoReductionTestCase(String name, File file, File traceFolder, - String[] args) + public CtNoReductionSlTestCase(String name, File file, File traceFolder, + CtTestData args) { super(file, traceFolder, args); } + @Override + public void setUp() throws Exception + { + Settings.dialect = Dialect.VDM_SL; + Settings.release = Release.VDM_10; + } } diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java similarity index 88% rename from core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionTestCase.java rename to core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java index f1f60ffa4c..bd60ff8c7e 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionTestCase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java @@ -29,14 +29,17 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.overture.ct.ctruntime.utils.CtHelper; +import org.overture.ast.lex.Dialect; +import org.overture.config.Release; +import org.overture.config.Settings; +import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; import org.overture.ct.ctruntime.utils.TraceReductionInfo; import org.overture.interpreter.traces.TraceReductionType; import org.overture.interpreter.traces.util.Pair; import org.overture.test.framework.Properties; @RunWith(value = Parameterized.class) -public class CtRandomReductionTestCase extends CtTestCaseBase +public class CtRandomReductionSlTestCase extends CtTestCaseBase { //The name of the test input folder private static final String TEST_INPUT_FOLDER = "random_reduction_sl_specs"; @@ -68,7 +71,7 @@ public static Collection getData() testReductionInfo2.add(new Pair("PaperCaseStudy", new TraceReductionInfo(0.01F, TraceReductionType.SHAPES_VARVALUES, SEED))); Collection tests = new Vector(); - CtHelper testHelper = new CtHelper(); + File root = new File(RESOURCES); @@ -82,20 +85,28 @@ public static Collection getData() traceName + " " + entry.second, specFile, traceFolder, - testHelper.buildArgs(TRACE_NAME, PORT, traceFolder, specFile, entry.second), + new CtTestData( TRACE_NAME, PORT, traceFolder, specFile, entry.second), entry.second }); } return tests; } - - public CtRandomReductionTestCase(String name, File file, File traceFolder, - String[] args, TraceReductionInfo reductionInfo) + + public CtRandomReductionSlTestCase(String name, File file, File traceFolder, + CtTestData args, TraceReductionInfo reductionInfo) { super(file, traceFolder, args); this.reductionInfo = reductionInfo; } + + @Override + public void setUp() throws Exception + { + Settings.dialect = Dialect.VDM_SL; + Settings.release = Release.VDM_10; + } + @Override protected File getResultFile(String filename) { diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java index f926d3c2d5..a8881a0aae 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java @@ -36,10 +36,10 @@ import org.junit.Before; import org.junit.Test; import org.overture.ast.lex.Dialect; -import org.overture.config.Release; import org.overture.config.Settings; import org.overture.ct.ctruntime.TraceRunnerMain; import org.overture.ct.ctruntime.utils.CtHelper; +import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; import org.overture.ct.ctruntime.utils.Data; import org.overture.ct.ctruntime.utils.TraceResult; import org.overture.ct.ctruntime.utils.TraceResultReader; @@ -66,25 +66,30 @@ public abstract class CtTestCaseBase extends TestResourcesResultTestCase4 // protected CtTestHelper testHelper; private String[] args; private File traceFolder; + private CtTestData testdata; public CtTestCaseBase() { super(); } - public CtTestCaseBase(File file, File traceFolder, String[] args) + public CtTestCaseBase(File file, File traceFolder, CtTestData args) { super(file); - this.args = args; + + this.testdata = args; this.traceFolder = traceFolder; } @Before - public void setUp() throws Exception + public void internalSetup() throws Exception { - Settings.dialect = Dialect.VDM_SL; - Settings.release = Release.VDM_10; + setUp(); + CtHelper testHelper = new CtHelper(); + this.args = testHelper.buildArgs(Settings.dialect, Settings.release, testdata); } + + abstract public void setUp() throws Exception; @After public void tearDown() throws Exception @@ -109,7 +114,7 @@ public void test() throws Exception } File actualResultsFile = computeActualResults(TRACE_NAME); - + if (Properties.recordTestResults) { try @@ -153,11 +158,13 @@ public void test() throws Exception } } + @Override protected File createResultFile(String filename) { return new File(filename + ".result"); } + @Override protected File getResultFile(String filename) { return new File(filename + ".result"); @@ -175,7 +182,11 @@ public File computeActualResults(final String spec) throws IOException, String traceName = "T1"; - final File actualOutputFile = new File(traceFolder,"DEFAULT-" + traceName + ".xml"); + String actualOutputFileName = (Settings.dialect == Dialect.VDM_SL ? "DEFAULT-" + : "Entry-") + + traceName + ".xml"; + + final File actualOutputFile = new File(traceFolder, actualOutputFileName); CtHelper testHelper = new CtHelper(); Thread t = testHelper.consCtClientThread(socket, data); diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java index fa8cc22b80..8539f9cc97 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java @@ -34,7 +34,7 @@ import org.overture.ast.lex.Dialect; import org.overture.ct.ctruntime.tests.CtTestCaseBase; -import org.overture.ct.ctruntime.utils.CtHelper; +import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; public class TestSourceFinder { @@ -142,11 +142,7 @@ private static Collection createCompleteFile(Dialect dialect, traceName = traceName.substring(0, traceName.length() - 6); File traceFolder = new File((CtTestCaseBase.TRACE_OUTPUT_FOLDER + traceName).replace('/', File.separatorChar)); - CtHelper testHelper = new CtHelper(); - - String[] args = testHelper.buildArgs("T1", CtTestCaseBase.PORT, traceFolder, file); - - tests.add(new Object[] { traceName, file, traceFolder, args }); + tests.add(new Object[] { traceName, file, traceFolder, new CtTestData("T1", CtTestCaseBase.PORT, traceFolder, file,null) }); } return tests; From 790c35117ba39c7961df3fe7cb334b468b1e1919 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 16:38:41 +0100 Subject: [PATCH 32/90] Updates to CT will change the order of tests in one of the CT test result files --- ...rCaseStudy-1_00%SHAPES_VARVALUES.vdmsl.result | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/random_reduction_sl_specs/PaperCaseStudy-1_00%SHAPES_VARVALUES.vdmsl.result b/core/combinatorialtesting/ctruntime/src/test/resources/random_reduction_sl_specs/PaperCaseStudy-1_00%SHAPES_VARVALUES.vdmsl.result index f518e41002..7eb27d4e5c 100644 --- a/core/combinatorialtesting/ctruntime/src/test/resources/random_reduction_sl_specs/PaperCaseStudy-1_00%SHAPES_VARVALUES.vdmsl.result +++ b/core/combinatorialtesting/ctruntime/src/test/resources/random_reduction_sl_specs/PaperCaseStudy-1_00%SHAPES_VARVALUES.vdmsl.result @@ -13,21 +13,21 @@ () op2(3) () - op2(5) + op1(2, 3) () - op1(3, 1) + op2(5) () - op2(4) + op1(3, 1) () - op1(3, 2) + op2(4) () - op1(2, 3) + op1(3, 2) () - op1(2, 4) + op2(5) () - op2(6) + op1(2, 4) () - op2(5) + op2(6) () op1(3, 4) () From f6d3b18d4835db410c630708791440acfdf11d40 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 17:07:27 +0100 Subject: [PATCH 33/90] Fix for problem with the alternative trace node. Closes #376. The fix also includes a test that exercises this part of CT --- .../no_reduction_pp_specs/NestingLetsWithObjBind | 16 ++++++++++++++++ .../NestingLetsWithObjBind.result | 9 +++++++++ .../interpreter/traces/AlternativeTraceNode.java | 11 +++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind.result diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind new file mode 100644 index 0000000000..05485cbbac --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind @@ -0,0 +1,16 @@ +class Entry + +operations + +public op : Entry ==> () +op (c) == skip; + +traces + + T1: let x = new Entry() + in + let y in set {new Entry()} + in + x.op(y) + +end Entry \ No newline at end of file diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind.result new file mode 100644 index 0000000000..057c681770 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/NestingLetsWithObjBind.result @@ -0,0 +1,9 @@ + + + + x.op(y) + () + + + + diff --git a/core/interpreter/src/main/java/org/overture/interpreter/traces/AlternativeTraceNode.java b/core/interpreter/src/main/java/org/overture/interpreter/traces/AlternativeTraceNode.java index f4439b2740..333654ff83 100644 --- a/core/interpreter/src/main/java/org/overture/interpreter/traces/AlternativeTraceNode.java +++ b/core/interpreter/src/main/java/org/overture/interpreter/traces/AlternativeTraceNode.java @@ -58,10 +58,17 @@ public CallSequence get(int index) if(tmp instanceof IIterableTraceNode) { IIterableTraceNode in = (IIterableTraceNode) tmp; - return in.get(v.second); + + CallSequence callSeq = tmp.getVariables(); + callSeq.addAll(in.get(v.second)); + + return callSeq; }else { - return tmp.getTests().get(v.second); + CallSequence callSeq = tmp.getVariables(); + callSeq.addAll(tmp.getTests().get(v.second)); + + return callSeq; } } From 10ee873f92c73f913b5ee11b4fe36e4c7f82e14a Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 16:39:34 +0000 Subject: [PATCH 34/90] iii --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 36f061f3e4..dbf39bae9c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,8 @@ 4.0.0 - + + org.sonatype.oss oss-parent From 43807d131a595f41340084b88c3cdc7c279bda91 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 17:43:19 +0100 Subject: [PATCH 35/90] Minor cleanup to pom that was added by accident --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dbf39bae9c..36f061f3e4 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,7 @@ 4.0.0 - - + org.sonatype.oss oss-parent From 0ba599e584a40ee9308a18bbfc9d5d837f14b1a4 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 23:39:55 +0100 Subject: [PATCH 36/90] Added test revealing problem with code generation of 'let defs' inside lambdas --- .../function_value_specs/LambdaWithLet | 11 ++++++ .../function_value_specs/LambdaWithLet.result | 34 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 core/codegen/src/test/resources/function_value_specs/LambdaWithLet create mode 100644 core/codegen/src/test/resources/function_value_specs/LambdaWithLet.result diff --git a/core/codegen/src/test/resources/function_value_specs/LambdaWithLet b/core/codegen/src/test/resources/function_value_specs/LambdaWithLet new file mode 100644 index 0000000000..ca2c0009af --- /dev/null +++ b/core/codegen/src/test/resources/function_value_specs/LambdaWithLet @@ -0,0 +1,11 @@ +class Entry + +operations + +public static Run : () ==> ? +Run () == +let f = (lambda x : nat & let y = x in y) +in + return f(2); + +end Entry diff --git a/core/codegen/src/test/resources/function_value_specs/LambdaWithLet.result b/core/codegen/src/test/resources/function_value_specs/LambdaWithLet.result new file mode 100644 index 0000000000..271b9aa07d --- /dev/null +++ b/core/codegen/src/test/resources/function_value_specs/LambdaWithLet.result @@ -0,0 +1,34 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + Func_1 f = new Func_1() { + public Number eval(final Number x) { + { + Number y = x; + + return y; + } + } + }; + + return f.eval(2L); + } + + public String toString() { + return "Entry{}"; + } +} + +########## +public interface Func_1 { + public abstract T_2 eval(final T_1 param_1); +} + +########## From 63dc668d33740bca9930868839284fd8d8b0d37c Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 23:42:57 +0100 Subject: [PATCH 37/90] Added fix for problem with code generation of 'let defs' inside lambdas --- .../codegen/assistant/ExpAssistantCG.java | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java index 00e07e57f7..3a8eb0e82b 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java @@ -21,8 +21,10 @@ */ package org.overture.codegen.assistant; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Set; import org.overture.ast.analysis.AnalysisException; import org.overture.ast.definitions.AAssignmentDefinition; @@ -33,6 +35,7 @@ import org.overture.ast.definitions.SFunctionDefinition; import org.overture.ast.definitions.SOperationDefinition; import org.overture.ast.expressions.ACaseAlternative; +import org.overture.ast.expressions.ALambdaExp; import org.overture.ast.expressions.ARealLiteralExp; import org.overture.ast.expressions.PExp; import org.overture.ast.expressions.SBinaryExp; @@ -299,17 +302,41 @@ public AStringLiteralExpCG getDefaultStringlValue() public boolean isAssigned(PExp exp) { - SClassDefinition classDef = exp.getAncestor(SClassDefinition.class); + org.overture.ast.node.INode parent = exp.parent(); - if (classDef == null) + if (parent == null) { return false; } - return exp.getAncestor(AInstanceVariableDefinition.class) != null - || exp.getAncestor(AValueDefinition.class) != null - || exp.getAncestor(AAssignmentDefinition.class) != null - || exp.getAncestor(AAssignmentStm.class) != null; + Set visitedNodes = new HashSet<>(); + visitedNodes.add(parent); + + do + { + if (parent instanceof AInstanceVariableDefinition + | parent instanceof AValueDefinition + | parent instanceof AAssignmentDefinition + | parent instanceof AAssignmentStm) + { + return true; + } + + if (parent instanceof ALambdaExp) + { + return false; + } + + parent = parent.parent(); + + if (parent != null) + { + visitedNodes.add(parent); + } + + } while (parent != null && !visitedNodes.contains(parent)); + + return false; } public AHeaderLetBeStCG consHeader(ASetMultipleBindCG binding, From a27c5537503701c4f26cc760ec3351e2e976a43b Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 19 Feb 2015 23:49:39 +0100 Subject: [PATCH 38/90] Import cleanup --- .../main/java/org/overture/codegen/assistant/ExpAssistantCG.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java index 3a8eb0e82b..3bd50e81dd 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/ExpAssistantCG.java @@ -31,7 +31,6 @@ import org.overture.ast.definitions.AInstanceVariableDefinition; import org.overture.ast.definitions.AValueDefinition; import org.overture.ast.definitions.PDefinition; -import org.overture.ast.definitions.SClassDefinition; import org.overture.ast.definitions.SFunctionDefinition; import org.overture.ast.definitions.SOperationDefinition; import org.overture.ast.expressions.ACaseAlternative; From 151d60a27070f91c01d77e2e1f34daf191ce8785 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sat, 21 Feb 2015 14:11:49 +0100 Subject: [PATCH 39/90] Implemented hashCode computation in codegen utility class --- .../overture/codegen/utils/LexNameTokenWrapper.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/utils/LexNameTokenWrapper.java b/core/codegen/src/main/java/org/overture/codegen/utils/LexNameTokenWrapper.java index f34244b72f..2d281b34ba 100644 --- a/core/codegen/src/main/java/org/overture/codegen/utils/LexNameTokenWrapper.java +++ b/core/codegen/src/main/java/org/overture/codegen/utils/LexNameTokenWrapper.java @@ -46,10 +46,14 @@ public String toString() @Override public int hashCode() { - return 0; - // This ensures that equals are being - // used when instances of this class are - // stored in collections + int hashCode = 0; + + if(name != null) + { + hashCode += name.hashCode(); + } + + return hashCode; } @Override From c5aefbd52d122955cff74d2cf1e4cc12dd7a927e Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sat, 21 Feb 2015 14:20:25 +0100 Subject: [PATCH 40/90] Updated the pom of the Java code generator plugin to include the Java code generator runtime library --- ide/plugins/codegen/pom.xml | 272 +++++++++++++++++++++--------------- 1 file changed, 160 insertions(+), 112 deletions(-) diff --git a/ide/plugins/codegen/pom.xml b/ide/plugins/codegen/pom.xml index 461437acaf..7b01542af7 100644 --- a/ide/plugins/codegen/pom.xml +++ b/ide/plugins/codegen/pom.xml @@ -1,118 +1,166 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 - - org.overturetool.ide - org.overture.ide.plugins - 2.2.1-SNAPSHOT - ../pom.xml - + + org.overturetool.ide + org.overture.ide.plugins + 2.2.1-SNAPSHOT + ../pom.xml + - eclipse-plugin + eclipse-plugin - org.overturetool.ide.plugins - org.overture.ide.plugins.codegen - Code Generator Plugin - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - process-sources - - copy - - - ${basedir}/jars - true - true - true - true - - - org.overturetool.core - codegen - ${project.version} - - - org.apache.velocity - velocity - 1.7 - - - commons-collections - commons-collections - 3.2.1 - - - commons-lang - commons-lang - 2.4 - - - jalopy - jalopy - 1.5rc3 - - - log4j - log4j - 1.2.8 - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - false - - - ${basedir}/jars - false - - - - - + org.overturetool.ide.plugins + org.overture.ide.plugins.codegen + Code Generator Plugin - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-dependency-plugin - [1.0.0,) - - copy - - - - - false - - - - - - - - - - + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + process-sources + + copy + + + ${basedir}/jars + true + true + true + true + + + org.overturetool.core + codegen-runtime + ${project.version} + + + org.overturetool.core + codegen + ${project.version} + + + org.apache.velocity + velocity + 1.7 + + + commons-collections + commons-collections + 3.2.1 + + + commons-lang + commons-lang + 2.4 + + + jalopy + jalopy + 1.5rc3 + + + log4j + log4j + 1.2.8 + + + + + + copy + process-resources + + copy + + + + + org.overturetool.core + codegen-runtime + ${project.version} + jar + true + ${basedir}/target/runtime + codegen-runtime.jar + + + + + + + + + maven-resources-plugin + + + copy-resources + process-classes + + copy-resources + + + ${project.build.outputDirectory} + + + ${basedir}/target/runtime + false + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + + false + + + ${basedir}/jars + false + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + [1.0.0,) + + copy + + + + + false + + + + + + + + + + From 3811b3170e1ca78d21fa37e76fab1f789e7b7b92 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sat, 21 Feb 2015 14:40:23 +0100 Subject: [PATCH 41/90] Added utility fuctionality to support the Java code generator plugin with copying of files --- .../codegen/util/PluginVdm2JavaUtil.java | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java index aa2fefd940..fa42071c0e 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java @@ -22,6 +22,10 @@ package org.overture.ide.plugins.codegen.util; import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -53,13 +57,21 @@ import org.overture.ide.core.resources.IVdmSourceUnit; import org.overture.ide.core.utility.FileUtility; import org.overture.ide.plugins.codegen.ICodeGenConstants; +import org.overture.ide.plugins.codegen.commands.Vdm2JavaCommand; public class PluginVdm2JavaUtil { - private static final String JAVA_FOLDER = "java"; - private static final String QUOTES_FOLDER = "quotes"; - private static final String UTILS_FOLDER = "utils"; + public static final String JAVA_FOLDER = "java"; + public static final String QUOTES_FOLDER = "quotes"; + public static final String UTILS_FOLDER = "utils"; + public static final String CODEGEN_RUNTIME_FILE_NAME = "codegen-runtime.jar"; + public static final String ECLIPSE_CLASSPATH_FILE_NAME = ".classpath"; + public static final String ECLIPSE_PROJECT_FILE_NAME = ".project"; + public static final String ECLIPSE_RES_FILES_FOLDER_NAME = "eclipsefiles"; + public static final String CODEGEN_RUNTIME_SRC_FOLDER_NAME = "src"; + public static final String CODEGEN_RUNTIME_LIB_FOLDER_NAME = "lib"; + private PluginVdm2JavaUtil() { } @@ -241,6 +253,45 @@ private static File getFolder(File parent, String folder) return resultingFolder; } + public static void copyCodeGenFile(String inOutFileName, File outputFolder) throws IOException + { + copyCodeGenFile(inOutFileName, inOutFileName, outputFolder); + } + + public static void copyCodeGenFile(String inputFileName, String outputFileName, File outputFolder) throws IOException + { + InputStream input = Vdm2JavaCommand.class.getResourceAsStream('/' + inputFileName); + + if(input == null) + { + throw new IOException("Could not find resource: " + inputFileName); + } + + byte[] buffer = new byte[8 * 1024]; + + try { + File outputFile = new File(outputFolder, outputFileName); + + outputFile.getParentFile().mkdirs(); + if(!outputFile.exists()) + { + outputFile.createNewFile(); + } + + OutputStream output = new FileOutputStream(outputFile); + try { + int bytesRead; + while ((bytesRead = input.read(buffer)) != -1) { + output.write(buffer, 0, bytesRead); + } + } finally { + output.close(); + } + } finally { + input.close(); + } + } + public static List getClassesToSkip() { Preferences preferences = InstanceScope.INSTANCE.getNode(ICodeGenConstants.PLUGIN_ID); From db240b7b0c3c51880e267df996540a09bd44582c Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sat, 21 Feb 2015 14:41:17 +0100 Subject: [PATCH 42/90] The Java code generator now outputs the generated Java code in an Eclipse project by default --- .../codegen/utils/GeneralCodeGenUtils.java | 5 +++ .../codegen/commands/Vdm2JavaCommand.java | 41 ++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/utils/GeneralCodeGenUtils.java b/core/codegen/src/main/java/org/overture/codegen/utils/GeneralCodeGenUtils.java index ed877edbba..ca131b3ea5 100644 --- a/core/codegen/src/main/java/org/overture/codegen/utils/GeneralCodeGenUtils.java +++ b/core/codegen/src/main/java/org/overture/codegen/utils/GeneralCodeGenUtils.java @@ -109,6 +109,11 @@ public static TypeCheckResult validateExp(String exp) return typeCheckResult; } + public static void replaceInFile(File file, String regex, String replacement) + { + replaceInFile(file.getAbsolutePath(), regex, replacement); + } + public static void replaceInFile(String filePath, String regex, String replacement) { diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java index df27e08c65..e092b7913d 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java @@ -53,6 +53,7 @@ import org.overture.codegen.ir.IrNodeInfo; import org.overture.codegen.ir.VdmNodeInfo; import org.overture.codegen.utils.AnalysisExceptionCG; +import org.overture.codegen.utils.GeneralCodeGenUtils; import org.overture.codegen.utils.GeneralUtils; import org.overture.codegen.utils.GeneratedData; import org.overture.codegen.utils.GeneratedModule; @@ -198,7 +199,8 @@ protected IStatus run(IProgressMonitor monitor) try { - vdm2java.generateJavaSourceFiles(outputFolder, generatedData.getClasses()); + File javaOutputFolder = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_SRC_FOLDER_NAME); + vdm2java.generateJavaSourceFiles(javaOutputFolder, generatedData.getClasses()); } catch (Exception e) { CodeGenConsole.GetInstance().printErrorln("Problems saving the code generated Java source files to disk."); @@ -215,6 +217,37 @@ protected IStatus run(IProgressMonitor monitor) return Status.CANCEL_STATUS; } + try + { + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_FILE_NAME, + new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_LIB_FOLDER_NAME)); + outputRuntime(outputFolder); + } + catch(Exception e) + { + CodeGenConsole.GetInstance().printErrorln("Problems copying the Java code generator runtime library to " + outputFolder.getAbsolutePath()); + CodeGenConsole.GetInstance().printErrorln("Reason: " + e.getMessage()); + } + + try + { + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.ECLIPSE_RES_FILES_FOLDER_NAME + "/" + + PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME, PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME, outputFolder); + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.ECLIPSE_RES_FILES_FOLDER_NAME + "/" + + PluginVdm2JavaUtil.ECLIPSE_CLASSPATH_FILE_NAME, PluginVdm2JavaUtil.ECLIPSE_CLASSPATH_FILE_NAME, outputFolder); + + GeneralCodeGenUtils.replaceInFile(new File(outputFolder, PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME), "%s", project.getName()); + + CodeGenConsole.GetInstance().println("Generated Eclipse project with Java generated code.\n"); + + } catch (Exception e) + { + e.printStackTrace(); + CodeGenConsole.GetInstance().printErrorln("Problems generating the eclipse project with the generated Java code"); + CodeGenConsole.GetInstance().printErrorln("Reason: " + + e.getMessage()); + } + outputUserspecifiedModules(outputFolder, generatedData.getClasses()); // Quotes generation @@ -322,6 +355,12 @@ private void outputRenamings(List allRenamings) CodeGenConsole.GetInstance().println(JavaCodeGenUtil.constructVarRenamingString(allRenamings));; } } + + private void outputRuntime(File outputFolder) + { + File runtime = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_FILE_NAME); + CodeGenConsole.GetInstance().println("Copied Java code generator runtime library to " + runtime.getAbsolutePath() + "\n"); + } private void outputUserspecifiedModules(File outputFolder, List userspecifiedClasses) From d56a5c6825845f8036cfd0d1f823a59b7cc7eca1 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sun, 22 Feb 2015 00:16:08 +0100 Subject: [PATCH 43/90] Attach sources to the Java code generator runtime --- core/codegen-runtime/pom.xml | 39 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/core/codegen-runtime/pom.xml b/core/codegen-runtime/pom.xml index a5117f8bdf..16796caf76 100644 --- a/core/codegen-runtime/pom.xml +++ b/core/codegen-runtime/pom.xml @@ -1,15 +1,32 @@ - - 4.0.0 + + 4.0.0 - - org.overturetool - core - 2.2.1-SNAPSHOT - ../pom.xml - + + org.overturetool + core + 2.2.1-SNAPSHOT + ../pom.xml + - org.overturetool.core - codegen-runtime - VDM Code Generator Runtime + org.overturetool.core + codegen-runtime + VDM Code Generator Runtime + + + + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + + From d27716eeafa95861f7ef2f3236d5ff7f82735aa6 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sun, 22 Feb 2015 00:16:59 +0100 Subject: [PATCH 44/90] Add the jar with the attached sources to the Java code generator plugin --- ide/plugins/codegen/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ide/plugins/codegen/pom.xml b/ide/plugins/codegen/pom.xml index 7b01542af7..d01f957f9e 100644 --- a/ide/plugins/codegen/pom.xml +++ b/ide/plugins/codegen/pom.xml @@ -89,6 +89,16 @@ ${basedir}/target/runtime codegen-runtime.jar + + org.overturetool.core + codegen-runtime + ${project.version} + sources + jar + true + ${basedir}/target/runtime + codegen-runtime-sources.jar + From 44647c660f118aeba45788d6323ebc4de2cbc973 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sun, 22 Feb 2015 00:33:08 +0100 Subject: [PATCH 45/90] The Java code generator plugin now also outputs a jar with the runtime library sources --- .../codegen/commands/Vdm2JavaCommand.java | 28 +++++++++++++++---- .../codegen/util/PluginVdm2JavaUtil.java | 3 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java index e092b7913d..8fc5404345 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java @@ -219,9 +219,9 @@ protected IStatus run(IProgressMonitor monitor) try { - PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_FILE_NAME, + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_BIN_FILE_NAME, new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_LIB_FOLDER_NAME)); - outputRuntime(outputFolder); + outputRuntimeBinaries(outputFolder); } catch(Exception e) { @@ -229,6 +229,18 @@ protected IStatus run(IProgressMonitor monitor) CodeGenConsole.GetInstance().printErrorln("Reason: " + e.getMessage()); } + try + { + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_SOURCES_FILE_NAME, + new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_LIB_FOLDER_NAME)); + outputRuntimeSources(outputFolder); + } + catch(Exception e) + { + CodeGenConsole.GetInstance().printErrorln("Problems copying the Java code generator runtime library sources to " + outputFolder.getAbsolutePath()); + CodeGenConsole.GetInstance().printErrorln("Reason: " + e.getMessage()); + } + try { PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.ECLIPSE_RES_FILES_FOLDER_NAME + "/" @@ -356,10 +368,16 @@ private void outputRenamings(List allRenamings) } } - private void outputRuntime(File outputFolder) + private void outputRuntimeBinaries(File outputFolder) + { + File runtime = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_BIN_FILE_NAME); + CodeGenConsole.GetInstance().println("Copied the Java code generator runtime library to " + runtime.getAbsolutePath() + "\n"); + } + + private void outputRuntimeSources(File outputFolder) { - File runtime = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_FILE_NAME); - CodeGenConsole.GetInstance().println("Copied Java code generator runtime library to " + runtime.getAbsolutePath() + "\n"); + File runtime = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_SOURCES_FILE_NAME); + CodeGenConsole.GetInstance().println("Copied the Java code generator runtime library sources to " + runtime.getAbsolutePath() + "\n"); } private void outputUserspecifiedModules(File outputFolder, diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java index fa42071c0e..7246b3f954 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java @@ -64,7 +64,8 @@ public class PluginVdm2JavaUtil public static final String JAVA_FOLDER = "java"; public static final String QUOTES_FOLDER = "quotes"; public static final String UTILS_FOLDER = "utils"; - public static final String CODEGEN_RUNTIME_FILE_NAME = "codegen-runtime.jar"; + public static final String CODEGEN_RUNTIME_BIN_FILE_NAME = "codegen-runtime.jar"; + public static final String CODEGEN_RUNTIME_SOURCES_FILE_NAME = "codegen-runtime-sources.jar"; public static final String ECLIPSE_CLASSPATH_FILE_NAME = ".classpath"; public static final String ECLIPSE_PROJECT_FILE_NAME = ".project"; public static final String ECLIPSE_RES_FILES_FOLDER_NAME = "eclipsefiles"; From 96ea70af72fddd8f97286e91e2f6ebd51802af4b Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sun, 22 Feb 2015 00:59:09 +0100 Subject: [PATCH 46/90] The 'eclipsefiles' folder was missing from the Java code generator plugin build properties --- ide/plugins/codegen/build.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/ide/plugins/codegen/build.properties b/ide/plugins/codegen/build.properties index 4359f35676..22229cd04a 100644 --- a/ide/plugins/codegen/build.properties +++ b/ide/plugins/codegen/build.properties @@ -3,6 +3,7 @@ bin.includes = META-INF/,\ plugin.xml,\ .,\ textfiles/,\ + eclipsefiles/,\ icons/,\ jars/ From eca698f4a615e03ecc979ba1460aa6ce461a2976 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Sun, 22 Feb 2015 01:36:17 +0100 Subject: [PATCH 47/90] Corrected output folder for Java code generated quotes --- .../codegen/commands/Vdm2JavaCommand.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java index 8fc5404345..4cc3c8c077 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java @@ -197,9 +197,10 @@ protected IStatus run(IProgressMonitor monitor) outputUserSpecifiedSkippedClasses(classesToSkip); outputSkippedClasses(generatedData.getSkippedClasses()); + File javaOutputFolder = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_SRC_FOLDER_NAME); + try { - File javaOutputFolder = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_SRC_FOLDER_NAME); vdm2java.generateJavaSourceFiles(javaOutputFolder, generatedData.getClasses()); } catch (Exception e) { @@ -217,11 +218,11 @@ protected IStatus run(IProgressMonitor monitor) return Status.CANCEL_STATUS; } + File libFolder = new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_LIB_FOLDER_NAME); try { - PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_BIN_FILE_NAME, - new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_LIB_FOLDER_NAME)); - outputRuntimeBinaries(outputFolder); + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_BIN_FILE_NAME, libFolder); + outputRuntimeBinaries(libFolder); } catch(Exception e) { @@ -231,9 +232,8 @@ protected IStatus run(IProgressMonitor monitor) try { - PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_SOURCES_FILE_NAME, - new File(outputFolder, PluginVdm2JavaUtil.CODEGEN_RUNTIME_LIB_FOLDER_NAME)); - outputRuntimeSources(outputFolder); + PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.CODEGEN_RUNTIME_SOURCES_FILE_NAME, libFolder); + outputRuntimeSources(libFolder); } catch(Exception e) { @@ -260,10 +260,11 @@ protected IStatus run(IProgressMonitor monitor) + e.getMessage()); } - outputUserspecifiedModules(outputFolder, generatedData.getClasses()); + outputUserspecifiedModules(javaOutputFolder, generatedData.getClasses()); // Quotes generation - outputQuotes(vdmProject, outputFolder, vdm2java, generatedData.getQuoteValues()); + outputQuotes(vdmProject, new File(javaOutputFolder, PluginVdm2JavaUtil.QUOTES_FOLDER), + vdm2java, generatedData.getQuoteValues()); // Renaming of variables shadowing other variables outputRenamings(generatedData.getAllRenamings()); @@ -459,15 +460,13 @@ private void outputQuotes(IVdmProject vdmProject, File outputFolder, { if (quotes != null && !quotes.isEmpty()) { - File quotesFolder = PluginVdm2JavaUtil.getQuotesFolder(vdmProject); - for(GeneratedModule q : quotes) { - vdm2java.generateJavaSourceFile(quotesFolder, q); + vdm2java.generateJavaSourceFile(outputFolder, q); } CodeGenConsole.GetInstance().println("Quotes generated to folder: " - + quotesFolder.getAbsolutePath()); + + outputFolder.getAbsolutePath()); CodeGenConsole.GetInstance().println(""); } } From 34507589c1846b90530deea986b85593c2307e85 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Sun, 22 Feb 2015 17:48:00 +0100 Subject: [PATCH 48/90] fixed update sites issue. Not closing it because the release procedure must be updated first. * on release the release repo should be enabled and the development one disabled. * the release+development builds on the build server already published the #412 --- ide/product/src/main/resources/overture.p2.inf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ide/product/src/main/resources/overture.p2.inf b/ide/product/src/main/resources/overture.p2.inf index 3e12b8ae2c..ef19a53213 100644 --- a/ide/product/src/main/resources/overture.p2.inf +++ b/ide/product/src/main/resources/overture.p2.inf @@ -13,10 +13,11 @@ instructions.configure=\ copy(source:${repo.root}/core/commandline/target/Overture-${project.version}.jar,target:${installFolder}/commandline/Overture-${project.version}.jar,overwrite:true);\ remove(path:${installFolder}/epl-v10.html);\ remove(path:${installFolder}/notice.html);\ - remove(path:${installFolder}/readme); -comment.add.this.to.instructions.configure.after.fixing.the.url=\ - addRepository(type:0,name:Overture,enabled:true,location:http${#58}//overture.sourceforge.net/updates/release/);\ - addRepository(type:1,name:Overture,enabled:true,location:http${#58}//overture.sourceforge.net/updates/release/); + remove(path:${installFolder}/readme);\ + addRepository(type:0,name:Overture,enabled:false,location:http${#58}//dl.bintray.com/overturetool/overturetool/);\ + addRepository(type:1,name:Overture,enabled:false,location:http${#58}//dl.bintray.com/overturetool/overturetool/);\ + addRepository(type:0,name:Overture Development,enabled:true,location:http${#58}//dl.bintray.com/overturetool/overturetool-development/);\ + addRepository(type:1,name:Overture Development,enabled:true,location:http${#58}//dl.bintray.com/overturetool/overturetool-development/); instructions.configure.import=\ org.eclipse.equinox.p2.touchpoint.natives.chmod,\ org.eclipse.equinox.p2.touchpoint.natives.copy,\ From 12baf28332991eab77589518714d4a444c9c74ac Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Sun, 22 Feb 2015 22:42:18 +0100 Subject: [PATCH 49/90] fixed ct test class, assumed special filename length. Removed and made it optional --- .../overture/ct/ctruntime/tests/util/TestSourceFinder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java index 8539f9cc97..af0d645531 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java @@ -139,7 +139,10 @@ private static Collection createCompleteFile(Dialect dialect, } else { String traceName = file.getName(); - traceName = traceName.substring(0, traceName.length() - 6); + if(traceName.contains(".")) + { + traceName = traceName.substring(0, traceName.lastIndexOf('.')); + } File traceFolder = new File((CtTestCaseBase.TRACE_OUTPUT_FOLDER + traceName).replace('/', File.separatorChar)); tests.add(new Object[] { traceName, file, traceFolder, new CtTestData("T1", CtTestCaseBase.PORT, traceFolder, file,null) }); From 2908ba4852087ea2b1171b798c00323b61f7c88a Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Sun, 22 Feb 2015 23:19:20 +0100 Subject: [PATCH 50/90] update to ct tester, enable print of ct result when result file is missing --- .../org/overture/ct/ctruntime/tests/CtTestCaseBase.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java index a8881a0aae..27b5d1d709 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java @@ -134,11 +134,14 @@ public void test() throws Exception { File resultFile = getResultFile(file.getAbsolutePath()); - Assert.assertTrue("No result file found for test: " + file, resultFile.exists()); + TraceResultReader reader = new TraceResultReader(); - List expectedResults = reader.read(resultFile); List actualResults = reader.read(actualResultsFile); + + Assert.assertTrue("No result file found for test: " + file+"\n\n"+actualResults, resultFile.exists()); + List expectedResults = reader.read(resultFile); + Assert.assertTrue(expectedResults.size() == actualResults.size()); From fc68dc4a9c0254248673c80f4e09a07174c17075 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Sun, 22 Feb 2015 23:44:31 +0100 Subject: [PATCH 51/90] corrected type in typecheck method for TraceVariableStatement avoiding runtime cast errors --- .../traces/TraceVariableStatement.java | 42 +------------------ 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/core/interpreter/src/main/java/org/overture/interpreter/traces/TraceVariableStatement.java b/core/interpreter/src/main/java/org/overture/interpreter/traces/TraceVariableStatement.java index 56ea2d705e..7a9457d167 100644 --- a/core/interpreter/src/main/java/org/overture/interpreter/traces/TraceVariableStatement.java +++ b/core/interpreter/src/main/java/org/overture/interpreter/traces/TraceVariableStatement.java @@ -38,7 +38,6 @@ import org.overture.interpreter.runtime.Context; import org.overture.interpreter.values.Value; import org.overture.interpreter.values.VoidValue; -import org.overture.typechecker.Environment; import org.overture.typechecker.FlatEnvironment; public class TraceVariableStatement extends PStmBase @@ -53,28 +52,11 @@ public TraceVariableStatement(TraceVariable var) this.var = var; } - public void typeCheck(Environment env, NameScope scope) + public void typeCheck(FlatEnvironment env, NameScope scope) { - FlatEnvironment flat = (FlatEnvironment) env; - flat.add(AstFactoryTC.newALocalDefinition(var.name.getLocation(), var.name, scope, var.type)); - // return var.type; + env.add(AstFactoryTC.newALocalDefinition(var.name.getLocation(), var.name, scope, var.type)); } - // @Override - // public Value eval(Context ctxt) - // { - // location.hit(); - // Value val = var.value; - // - // if (val.isType(ObjectValue.class)) - // { - // val = (Value)var.value.clone(); // To allow updates to objects - // } - // - // ctxt.put(var.name, val); - // return new VoidValue(); - // } - public static Value eval(TraceVariableStatement stmt, Context ctxt) { stmt.getLocation().hit(); @@ -89,13 +71,6 @@ public static Value eval(TraceVariableStatement stmt, Context ctxt) return new VoidValue(); } - // - // @Override - // public String kind() - // { - // return "trace variable"; - // } - // @Override public String toString() { @@ -105,28 +80,24 @@ public String toString() @Override public PStm clone() { - // TODO Auto-generated method stub return null; } @Override public PStm clone(Map oldToNewMap) { - // TODO Auto-generated method stub return null; } @Override public void apply(IAnalysis analysis) throws AnalysisException { - // TODO Auto-generated method stub } @Override public A apply(IAnswer caller) throws AnalysisException { - // TODO Auto-generated method stub return null; } @@ -134,7 +105,6 @@ public A apply(IAnswer caller) throws AnalysisException public void apply(IQuestion caller, Q question) throws AnalysisException { - // TODO Auto-generated method stub } @@ -142,15 +112,7 @@ public void apply(IQuestion caller, Q question) public A apply(IQuestionAnswer caller, Q question) throws AnalysisException { - // TODO Auto-generated method stub return null; } - // @Override - // public Type typeCheck(Environment env, NameScope scope) - // { - // FlatEnvironment flat = (FlatEnvironment)env; - // flat.add(new LocalDefinition(location, var.name, scope, var.type)); - // return var.type; - // } } From 9db18598f5d417a0e463e0e3915539436fb8f9d9 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Sun, 22 Feb 2015 23:45:36 +0100 Subject: [PATCH 52/90] fix for issue #415, we need to record the expected test results + add more inv depended tests --- .../ct/ctruntime/TraceInterpreter.java | 31 ++- .../no_reduction_sl_specs/Simple_inv | 14 ++ .../test/resources/no_reduction_sl_specs/XO | 199 ++++++++++++++++++ 3 files changed, 235 insertions(+), 9 deletions(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java index 84b23aceec..2f8e158e56 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java @@ -31,6 +31,7 @@ import org.overture.ast.definitions.PDefinition; import org.overture.ast.definitions.SClassDefinition; import org.overture.ast.modules.AModuleModules; +import org.overture.ast.node.INode; import org.overture.ast.statements.PStm; import org.overture.ast.typechecker.NameScope; import org.overture.config.Settings; @@ -46,8 +47,8 @@ import org.overture.interpreter.traces.TraceReductionType; import org.overture.interpreter.traces.TraceVariableStatement; import org.overture.interpreter.traces.Verdict; -import org.overture.typechecker.Environment; import org.overture.typechecker.FlatEnvironment; +import org.overture.typechecker.ModuleEnvironment; import org.overture.typechecker.PrivateClassEnvironment; import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory; @@ -283,7 +284,12 @@ private void evaluateTests(String className, TraceXmlWrapper storage, boolean typeOk = false; try { + if(interpreter instanceof ClassInterpreter) + { typeCheck(mtd.getClassDefinition(), interpreter, test); + }else{ + typeCheck(mtd.parent(), interpreter, test); + } typeOk = true; } catch (Exception e) { @@ -398,28 +404,35 @@ private void evaluateTests(String className, TraceXmlWrapper storage, * @throws AnalysisException * @throws Exception */ - protected void typeCheck(SClassDefinition classdef, + protected void typeCheck(INode classdef, Interpreter interpreter, CallSequence test) throws AnalysisException, Exception { - Environment env = null; + FlatEnvironment env = null; - if (interpreter instanceof ClassInterpreter) + if (classdef instanceof SClassDefinition) { - env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), new PrivateClassEnvironment(interpreter.getAssistantFactory(), classdef, interpreter.getGlobalEnvironment())); + env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), new PrivateClassEnvironment(interpreter.getAssistantFactory(), (SClassDefinition)classdef, interpreter.getGlobalEnvironment())); } else { - env = new FlatEnvironment(interpreter.getAssistantFactory(), new Vector(), interpreter.getGlobalEnvironment()); + List defs = new Vector(); + defs.addAll(((AModuleModules)classdef).getDefs()); + ModuleEnvironment mEnv = new ModuleEnvironment(interpreter.getAssistantFactory(), (AModuleModules) classdef); + env = new FlatEnvironment(interpreter.getAssistantFactory(), new Vector(),mEnv); } - - for (PStm statement : test) + + for (int i = 0; i < test.size(); i++) { + PStm statement = test.get(i); + if (statement instanceof TraceVariableStatement) { ((TraceVariableStatement) statement).typeCheck(env, NameScope.NAMESANDSTATE); } else { - interpreter.typeCheck(statement.clone(), env); + statement = statement.clone(); + test.set(i, statement); + interpreter.typeCheck(statement, env); } } diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv new file mode 100644 index 0000000000..e9b5d85cf2 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv @@ -0,0 +1,14 @@ +module DEFAULT +definitions +types + R :: a: nat + inv r == r.a < 10; + +operations + op: R ==> () + op(-) == skip; + +traces + T1: op(mk_R(1)); + +end DEFAULT \ No newline at end of file diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO new file mode 100644 index 0000000000..7202393f9d --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO @@ -0,0 +1,199 @@ +-- +-- A simple model of a tic-tac-toe game (noughts and crosses) +-- + +module XO +exports all +definitions +values + SIZE:nat1 = 3; -- The size of the board (3x3) + MAX:nat1 = SIZE * SIZE; -- The maximum number of moves + +types + Player = | ; -- Just two players + + Pos :: -- A position for a move + row : nat1 + col : nat1 + inv p == + p.row <= SIZE and p.col <= SIZE; -- Row/col must be on the board + + Game = map Pos to Player -- A game (who has moved where) + inv g == + forall p1, p2 : Player & -- No player is ever more than one move ahead + card dom (g :> {p1}) - card dom (g :> {p2}) in set {-1, 0, 1} + + +values + S:set of nat1 = {1, ..., SIZE}; + + winningLines = dunion -- Sets of Pos for winning lines + { + {{ mk_Pos(r, c) | c in set S } | r in set S }, -- All rows + {{ mk_Pos(r, c) | r in set S } | c in set S }, -- All columns + {{ mk_Pos(x, x) | x in set S }}, -- Diagnonal + {{ mk_Pos(x, SIZE-x+1) | x in set S }} -- Other diagonal + }; + + +functions + hasWon: Game * Player -> bool + hasWon(g, p) == + let moves = movesForPlayer(g, p) in + exists line in set winningLines & + line subset moves; + + + whoWon: Game -> Player + whoWon(g) == + iota p:Player & hasWon(g, p) + pre isWon(g); + + + isWon: Game -> bool + isWon(g) == + exists1 p:Player & hasWon(g, p); + + + isDraw: Game -> bool + isDraw(g) == + not isWon(g) and moveCountLeft(g) = 0; + + + isUnfinished: Game -> bool + isUnfinished(g) == + not isWon(g) and not isDraw(g); + + + movesSoFar: Game -> set of Pos + movesSoFar(g) == + dom g; + + + moveCountSoFar: Game -> nat + moveCountSoFar(g) == + card movesSoFar(g); + + + moveCountLeft: Game -> nat + moveCountLeft(g) == + MAX - moveCountSoFar(g); + + + movesForPlayer: Game * Player -> set of Pos + movesForPlayer(g, p) == + dom (g :> {p}); + + +values + PLAYERS = { p | p:Player }; -- The set of all Players + +types + Moves = seq of Pos -- A legal game play sequence + inv moves == + len moves = card elems moves and -- Has no duplicated moves + len moves > card PLAYERS * (SIZE - 1) and -- Has minimum moves to win + len moves <= MAX; -- Hasn't too many moves + + PlayOrder = seq1 of Player -- The order of play of the players + inv order == + len order = card elems order and -- No duplicates in the list + elems order = PLAYERS -- Order contains all players + + +state Sigma of + game : Game -- The game board, initialized by the play operation +end + + +operations + move: Player * Pos ==> () + move(p, pos) == + game(pos) := p + pre pos not in set movesSoFar(game) and + moveCountLeft(game) > 0 + post game = game~ munion {pos |-> p} and + moveCountSoFar(game) = moveCountSoFar(game~) + 1; + + + play: PlayOrder * Moves ==> Player | | + play(playorder, moves) == + ( + dcl order:PlayOrder := playorder; -- hd order is always next to play + game := {|->}; + + for m in moves do + let player = hd order in + ( + move(player, m); + + if isWon(game) then + return whoWon(game) + elseif isDraw(game) then + return + else + order := tl order ^ [player] + ); + + return + ) + post if RESULT = then isDraw(game) + else if RESULT = then isUnfinished(game) + else RESULT = whoWon(game); + +end XO + + +-- +-- A simple model of a tic-tac-toe game (noughts and crosses) +-- + +module DEFAULT +imports from XO + operations + play + types + Pos renamed Pos; + PlayOrder renamed PlayOrder; + Moves renamed Moves; + Player renamed Player + values + SIZE renamed SIZE + +exports all +definitions + +-- Test data and supporting operations/traces + +values + OX = [, ]; + XO = [, ]; + XX = []; + + --T1 = [mk_Pos(1,1), mk_Pos(1,2), mk_Pos(2,1), mk_Pos(1,3), mk_Pos(3,1)]; + T2 = [mk_Pos(1,1), mk_Pos(1,2), mk_Pos(1,3), mk_Pos(2,2), mk_Pos(3,1), mk_Pos(3,2)]; + E1 = [mk_Pos(1,1), mk_Pos(1,1), mk_Pos(1,2), mk_Pos(2,1), mk_Pos(1,3)]; + + S = {1, ..., SIZE} + +operations + test: PlayOrder * Moves ==> Player | | + test(playorder, moves) == + XO`play(playorder, moves); + +traces + T1: + let ALLPOS = { mk_Pos(r, c) | r, c in set S } in -- All 3x3 = 9 positions + let m1 in set ALLPOS in -- 9 1st moves +-- let m2 in set ALLPOS \ {m1} in -- 72 1st-2nd pairs +-- let m3 in set ALLPOS \ {m1, m2} in -- 504 1st-2nd-3rd etc... +-- let m4 in set ALLPOS \ {m1, m2, m3} in -- 3024 +-- let m5 in set ALLPOS \ {m1, m2, m3, m4} in -- 15120 (minimum) +-- let m6 in set ALLPOS \ {m1, m2, m3, m4, m5} in -- 60480 +-- let m7 in set ALLPOS \ {m1, m2, m3, m4, m5, m6} in -- 181440 +-- let m8 in set ALLPOS \ {m1, m2, m3, m4, m5, m6, m7} in -- 362880 +-- let m9 in set ALLPOS \ {m1, m2, m3, m4, m5, m6, m7, m8} in -- 362880 + XO`play(XO, [m1]); + +end DEFAULT + From f24ac97026cc6d883ef0e32b198850372a4f6459 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 23 Feb 2015 08:25:22 +0100 Subject: [PATCH 53/90] Added result files to confirm the fix for issue #415 --- .../no_reduction_sl_specs/Simple_inv.result | 9 +++++++ .../resources/no_reduction_sl_specs/XO.result | 25 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv.result create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO.result diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv.result new file mode 100644 index 0000000000..e24af95e54 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/Simple_inv.result @@ -0,0 +1,9 @@ + + + + op(mk_R(1)) + () + + + + diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO.result new file mode 100644 index 0000000000..a16fa9b461 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_sl_specs/XO.result @@ -0,0 +1,25 @@ + + + + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(1, 1)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(1, 2)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(1, 3)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(2, 1)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(2, 2)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(2, 3)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(3, 1)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(3, 2)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + XO`play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(3, 3)]) + Error 4060: Type invariant violated for Moves in 'DEFAULT' at line 196:4 + + + + From 460c36ecf589be8c182226b16b75e2073a9286fc Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 23 Feb 2015 10:02:06 +0100 Subject: [PATCH 54/90] Fix for eclipse files generated by the Java CG --- ide/plugins/codegen/eclipsefiles/cg.classpath | 7 +++++++ ide/plugins/codegen/eclipsefiles/cg.project | 17 +++++++++++++++++ .../codegen/commands/Vdm2JavaCommand.java | 4 ++-- .../codegen/util/PluginVdm2JavaUtil.java | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 ide/plugins/codegen/eclipsefiles/cg.classpath create mode 100644 ide/plugins/codegen/eclipsefiles/cg.project diff --git a/ide/plugins/codegen/eclipsefiles/cg.classpath b/ide/plugins/codegen/eclipsefiles/cg.classpath new file mode 100644 index 0000000000..ea32e05f55 --- /dev/null +++ b/ide/plugins/codegen/eclipsefiles/cg.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ide/plugins/codegen/eclipsefiles/cg.project b/ide/plugins/codegen/eclipsefiles/cg.project new file mode 100644 index 0000000000..68ffe98696 --- /dev/null +++ b/ide/plugins/codegen/eclipsefiles/cg.project @@ -0,0 +1,17 @@ + + + %s + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java index 4cc3c8c077..72f32135df 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/commands/Vdm2JavaCommand.java @@ -244,9 +244,9 @@ protected IStatus run(IProgressMonitor monitor) try { PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.ECLIPSE_RES_FILES_FOLDER_NAME + "/" - + PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME, PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME, outputFolder); + + PluginVdm2JavaUtil.ECLIPSE_PROJECT_TEMPLATE_FILE_NAME, PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME, outputFolder); PluginVdm2JavaUtil.copyCodeGenFile(PluginVdm2JavaUtil.ECLIPSE_RES_FILES_FOLDER_NAME + "/" - + PluginVdm2JavaUtil.ECLIPSE_CLASSPATH_FILE_NAME, PluginVdm2JavaUtil.ECLIPSE_CLASSPATH_FILE_NAME, outputFolder); + + PluginVdm2JavaUtil.ECLIPSE_CLASSPATH_TEMPLATE_FILE_NAME, PluginVdm2JavaUtil.ECLIPSE_CLASSPATH_FILE_NAME, outputFolder); GeneralCodeGenUtils.replaceInFile(new File(outputFolder, PluginVdm2JavaUtil.ECLIPSE_PROJECT_FILE_NAME), "%s", project.getName()); diff --git a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java index 7246b3f954..3f0d4b0943 100644 --- a/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java +++ b/ide/plugins/codegen/src/main/java/org/overture/ide/plugins/codegen/util/PluginVdm2JavaUtil.java @@ -66,6 +66,8 @@ public class PluginVdm2JavaUtil public static final String UTILS_FOLDER = "utils"; public static final String CODEGEN_RUNTIME_BIN_FILE_NAME = "codegen-runtime.jar"; public static final String CODEGEN_RUNTIME_SOURCES_FILE_NAME = "codegen-runtime-sources.jar"; + public static final String ECLIPSE_CLASSPATH_TEMPLATE_FILE_NAME = "cg.classpath"; + public static final String ECLIPSE_PROJECT_TEMPLATE_FILE_NAME = "cg.project"; public static final String ECLIPSE_CLASSPATH_FILE_NAME = ".classpath"; public static final String ECLIPSE_PROJECT_FILE_NAME = ".project"; public static final String ECLIPSE_RES_FILES_FOLDER_NAME = "eclipsefiles"; From 545c1952f54a212859e83b92df76ce4e6fe22477 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 23 Feb 2015 11:30:27 +0100 Subject: [PATCH 55/90] Guard parent was not set in AstFactory --- .../src/main/java/org/overture/ast/factory/AstFactory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java b/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java index aaae1f9e39..102b8fb7d1 100644 --- a/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java +++ b/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java @@ -989,6 +989,11 @@ public static APerSyncDefinition newAPerSyncDefinition( result.setOpname(opname); result.setGuard(guard); + + if(guard != null) + { + guard.parent(result); + } return result; } From 44fef872f4b8c3b0a742023dddc5017756ea98f2 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Mon, 23 Feb 2015 12:56:18 +0100 Subject: [PATCH 56/90] #415 Added PP test to exercise problem with type check --- .../no_reduction_pp_specs/Simple_inv | 13 ++ .../no_reduction_pp_specs/Simple_inv.result | 9 + .../test/resources/no_reduction_pp_specs/XO | 166 ++++++++++++++++++ .../resources/no_reduction_pp_specs/XO.result | 25 +++ 4 files changed, 213 insertions(+) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv.result create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO.result diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv new file mode 100644 index 0000000000..d49a6f2c29 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv @@ -0,0 +1,13 @@ +class Entry +types + R :: a: nat + inv r == r.a < 10; + +operations + op: R ==> () + op(-) == skip; + +traces + T1: op(mk_R(1)); + +end Entry \ No newline at end of file diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv.result new file mode 100644 index 0000000000..f714045cc4 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/Simple_inv.result @@ -0,0 +1,9 @@ + + + + op(mk_R(1)) + () + + + + diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO new file mode 100644 index 0000000000..7debb0bb2f --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO @@ -0,0 +1,166 @@ +-- +-- A simple model of a tic-tac-toe game (noughts and crosses) +-- + +class Entry +values + SIZE:nat1 = 3; -- The size of the board (3x3) + MAX:nat1 = SIZE * SIZE; -- The maximum number of moves + +types + Player = | ; -- Just two players + + Pos :: -- A position for a move + row : nat1 + col : nat1 + inv p == + p.row <= SIZE and p.col <= SIZE; -- Row/col must be on the board + + Game = map Pos to Player -- A game (who has moved where) + inv g == + forall p1, p2 : Player & -- No player is ever more than one move ahead + card dom (g :> {p1}) - card dom (g :> {p2}) in set {-1, 0, 1} + + +values + S:set of nat1 = {1, ..., SIZE}; + + winningLines = dunion -- Sets of Pos for winning lines + { + {{ mk_Pos(r, c) | c in set S } | r in set S }, -- All rows + {{ mk_Pos(r, c) | r in set S } | c in set S }, -- All columns + {{ mk_Pos(x, x) | x in set S }}, -- Diagnonal + {{ mk_Pos(x, SIZE-x+1) | x in set S }} -- Other diagonal + }; + + +functions + hasWon: Game * Player -> bool + hasWon(g, p) == + let moves = movesForPlayer(g, p) in + exists line in set winningLines & + line subset moves; + + + whoWon: Game -> Player + whoWon(g) == + iota p:Player & hasWon(g, p) + pre isWon(g); + + + isWon: Game -> bool + isWon(g) == + exists1 p:Player & hasWon(g, p); + + + isDraw: Game -> bool + isDraw(g) == + not isWon(g) and moveCountLeft(g) = 0; + + + isUnfinished: Game -> bool + isUnfinished(g) == + not isWon(g) and not isDraw(g); + + + movesSoFar: Game -> set of Pos + movesSoFar(g) == + dom g; + + + moveCountSoFar: Game -> nat + moveCountSoFar(g) == + card movesSoFar(g); + + + moveCountLeft: Game -> nat + moveCountLeft(g) == + MAX - moveCountSoFar(g); + + + movesForPlayer: Game * Player -> set of Pos + movesForPlayer(g, p) == + dom (g :> {p}); + + +values + PLAYERS = { p | p:Player }; -- The set of all Players + +types + Moves = seq of Pos -- A legal game play sequence + inv moves == + len moves = card elems moves and -- Has no duplicated moves + len moves > card PLAYERS * (SIZE - 1) and -- Has minimum moves to win + len moves <= MAX; -- Hasn't too many moves + + PlayOrder = seq1 of Player -- The order of play of the players + inv order == + len order = card elems order and -- No duplicates in the list + elems order = PLAYERS -- Order contains all players + + +instance variables + game : Game -- The game board, initialized by the play operation + +operations + move: Player * Pos ==> () + move(p, pos) == + game(pos) := p + pre pos not in set movesSoFar(game) and + moveCountLeft(game) > 0 + post game = game~ munion {pos |-> p} and + moveCountSoFar(game) = moveCountSoFar(game~) + 1; + + + play: PlayOrder * Moves ==> Player | | + play(playorder, moves) == + ( + dcl order:PlayOrder := playorder; -- hd order is always next to play + game := {|->}; + + for m in moves do + let player = hd order in + ( + move(player, m); + + if isWon(game) then + return whoWon(game) + elseif isDraw(game) then + return + else + order := tl order ^ [player] + ); + + return + ) + post if RESULT = then isDraw(game) + else if RESULT = then isUnfinished(game) + else RESULT = whoWon(game); + +-- Test data and supporting operations/traces + +values + OX = [, ]; + XO = [, ]; + XX = []; + +operations + test: PlayOrder * Moves ==> Player | | + test(playorder, moves) == + play(playorder, moves); + +traces + T1: + let ALLPOS = { mk_Pos(r, c) | r, c in set S } in -- All 3x3 = 9 positions + let m1 in set ALLPOS in -- 9 1st moves +-- let m2 in set ALLPOS \ {m1} in -- 72 1st-2nd pairs +-- let m3 in set ALLPOS \ {m1, m2} in -- 504 1st-2nd-3rd etc... +-- let m4 in set ALLPOS \ {m1, m2, m3} in -- 3024 +-- let m5 in set ALLPOS \ {m1, m2, m3, m4} in -- 15120 (minimum) +-- let m6 in set ALLPOS \ {m1, m2, m3, m4, m5} in -- 60480 +-- let m7 in set ALLPOS \ {m1, m2, m3, m4, m5, m6} in -- 181440 +-- let m8 in set ALLPOS \ {m1, m2, m3, m4, m5, m6, m7} in -- 362880 +-- let m9 in set ALLPOS \ {m1, m2, m3, m4, m5, m6, m7, m8} in -- 362880 + play(XO, [m1]); + +end Entry diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO.result new file mode 100644 index 0000000000..2c456f5d51 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/XO.result @@ -0,0 +1,25 @@ + + + + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(1, 1)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(1, 2)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(1, 3)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(2, 1)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(2, 2)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(2, 3)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(3, 1)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(3, 2)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + play([&lt;CROSS&gt;, &lt;NOUGHT&gt;], [mk_Pos(3, 3)]) + Error 4060: Type invariant violated for Moves in 'Entry' at line 164:4 + + + + From ed7a42c7aab19b39f80ba15e222dacd601c78943 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Mon, 23 Feb 2015 13:53:01 +0100 Subject: [PATCH 57/90] removed fixme's from the gui builder, no one is working on it, and they were mostly about design improvements --- .../overture/guibuilder/internal/Driver.java | 154 +----------------- .../InstanceWindowContainerBridge.java | 4 +- .../guibuilder/internal/SwiXMLGenerator.java | 8 +- .../guibuilder/internal/UiInterface.java | 10 +- .../internal/VdmjVdmInterpreterWrapper.java | 2 +- .../internal/ir/AnnotationReader.java | 6 +- .../internal/ir/VdmjVdmClassReader.java | 45 +---- 7 files changed, 26 insertions(+), 203 deletions(-) diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/Driver.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/Driver.java index 4b1fee0edd..66c1f218c5 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/Driver.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/Driver.java @@ -47,159 +47,9 @@ public static void printUsage() public static void main(String[] args) throws Exception { - // // NOTE: hardcoded for VDM++ ONLY - // final Dialect dialect = Dialect.VDM_PP; - // - // // command line arguments parsing - // - // OptionParser parser = new OptionParser("p:i:as"); - // OptionSet options = null; - // try { - // options = parser.parse(args); - // } catch (Exception e) { - // System.out.println("Error: " + e.getMessage()); printUsage(); return; - // } - // - // if(!options.has("p")) - // { printUsage(); return; } - // - // // list of files, or directory from which to extract the specification - // // List largs = (List) options.valuesOf("p"); - // final Vector files = GetFiles(largs, dialect); - // // if there is the i switch do not generate - // if ( options.has("i")) { - // ToolSettings.GENERATE = false; - // // largs = (List) options.valuesOf("i"); - // } - // final Vector xmlFiles = GetXMLFiles(largs); - // // if there is the 'a' switch generation mode is annotation only - // if(options.has("a")) { - // // ToolSettings.GENERATION_SETTINGS = GENERATION_MODE.ANNOTATIONS; - // } - // // if there is the 's' switch the xml description is saved - // if(options.has("s")) { - // ToolSettings.SAVE_XML = true; - // } - // - // //assuming the last directory name is the project name - // String path = null; - // path = files.get(0).getPath(); - // if ( path.contains("/") ) { // sanity checks - // path = path.substring(0, path.lastIndexOf("/")); - // if (path.contains("/")) - // path = path.substring(path.lastIndexOf("/")+1); - // } - // final String projectName = path; - // - // java.awt.EventQueue.invokeLater( new Runnable() { - // - // @Override - // public void run() { - // - // try { - // VdmjVdmInterpreterWrapper interpreter = new VdmjVdmInterpreterWrapper(dialect); - // interpreter.parseFilesAndTypeCheck(files); - // org.overture.guibuilder.internal.ir.IVdmClassReader reader = new - // org.overture.guibuilder.internal.ir.VdmjVdmClassReader(); - // reader.readFiles( files ); // we only care for VDM++ - // - // UiInterface ui = new UiInterface(interpreter); - // if ( ToolSettings.GENERATE ) { - // // Generation Mode - // if ( ToolSettings.SAVE_XML) { - // ui.buildAndRender(reader, projectName, files.get(0).getPath().substring(0, - // files.get(0).getPath().lastIndexOf("/") + 1)); - // } else { - // ui.buildAndRender(reader, projectName); - // } - // } else { - // ui.Render(reader, projectName, xmlFiles); - // } - // ui.setVisible(true); - // } catch (Exception e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - // - // }} ); + } - // - // /** - // * Gets the list of xml files contained in a directory - // * @param largs Directory containing xml files. - // * @return - // */ - // private static Vector GetXMLFiles(List largs) { - // - // Vector filenames = new Vector(); - // if (largs != null) { - // for ( String s : largs ) { - // File dir = new File(s); - // - // if (dir.isDirectory()) { // directory - // // contents of directory - // for (File file: dir.listFiles(new FilenameFilter(){ - // // filter for xml files (checks if the filename contains ".xml" - // // FIXME: ugly - // @Override - // public boolean accept(File arg0, String arg1) { - // if ( arg1.contains(".xml") ) - // return true; - // return false; - // }})) - // { - // if(file.isFile()) { - // filenames.add(file); - // } - // } // end for - // } else { - // filenames.add(dir); - // } // end directory - // } - // - // } - // if (filenames.size() == 0) - // return null; - // - // return filenames; - // } - // - // - // /** - // * Static function for obtaining the files from a directory or a single file, - // * according to a given vdm dialect - // * @param names of files and/or directory path - // * @param dialect - // * @return - // */ - // private static Vector GetFiles(List largs, Dialect dialect) { - // - // Vector filenames = new Vector(); - // - // if(largs != null) { - // // arguments parsing - // for (Iterator i = largs.iterator(); i.hasNext();) - // { - // String arg = i.next(); - // File dir = new File(arg); - // - // if(dir.isDirectory()) - // { - // // contents of directory - // for (File file: dir.listFiles(dialect.getFilter())) - // { - // if(file.isFile()) { - // filenames.add(file); - // } - // } // end for - // } else { - // filenames.add(dir); - // } // end if (dir.isDirectory()) - // } // end for - // } - // - // return filenames; - // } + } diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/InstanceWindowContainerBridge.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/InstanceWindowContainerBridge.java index 67e6ac2a67..aa8ddf93d1 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/InstanceWindowContainerBridge.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/InstanceWindowContainerBridge.java @@ -210,7 +210,7 @@ private void refreshVisibleContents() } // updates the value of labels - // FIXME: It's better to use a list with the methods... + // It's better to use a list with the methods... if (methodWidgetsVisible) { for (String id : idMap.keySet()) @@ -240,7 +240,7 @@ private void refreshVisibleContents() */ public void submitOK() { - // FIXME: Only one constructor is taken into account... + // Only one constructor is taken into account... String className = NamingPolicies.extractClassName(id); String instanceName = NamingPolicies.getInstanceName(className); diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/SwiXMLGenerator.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/SwiXMLGenerator.java index 0a6e002e18..48bce9771a 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/SwiXMLGenerator.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/SwiXMLGenerator.java @@ -109,7 +109,7 @@ public void buildMainWindow(IVdmClassReader classReader, String title) root = frame; } - // FIXME: Generated window is very simple... + // Generated window is very simple... /** * Function to build the elements of a main window * @@ -177,7 +177,7 @@ public void buildInstanceWindowFor(VdmClass classDef) Frame rootFrame = objFactory.createFrame(); rootFrame.setSize("320,520"); - // FIXME: Get the name from the annotation + // Get the name from the annotation rootFrame.setTitle(classDef.getName()); // the root's id is based on the class's name rootFrame.setId(NamingPolicies.getObjectWindowId(classDef.getName())); // id for the window @@ -294,7 +294,7 @@ private void addAnnotationGuidedElements(Panel panel, VdmMethod def) Vector annotations = def.getAnnotations(); for (VdmAnnotation annotation : annotations) { - // FIXME: with a press annotation we just call addGenericElements() + // with a press annotation we just call addGenericElements() // @press if (annotation.getName().equals(NamingPolicies.PRESS_ANNOTATION)) { @@ -360,7 +360,7 @@ private void addGenericElements(Panel panel, VdmMethod def) */ private Panel createConstructorArgumentsPanel(VdmClass classDef) { - // FIXME: we only handle one constructor + // we only handle one constructor Panel panel = objFactory.createPanel(); panel.setId(NamingPolicies.getConstWidgetsContainerId(0)); for (IVdmDefinition vdmDef : classDef.getDefinitions()) diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/UiInterface.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/UiInterface.java index 968b641c3a..bd5ffd4261 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/UiInterface.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/UiInterface.java @@ -83,7 +83,7 @@ public void renderFile(File file, String name) throws Exception containerTable.put(name, c); } else { - // FIXME: Find a better identifier than 'main' when main String is null + // Find a better identifier than 'main' when main String is null containerTable.put("main", c); } } @@ -107,7 +107,7 @@ private void renderInstanceWindow(File file, String name) throws Exception containerTable.put(name, c); } else { - // FIXME: Find a better identifier than 'main' when main String is null + // Find a better identifier than 'main' when main String is null containerTable.put("main", c); } } @@ -130,7 +130,7 @@ private void renderMainWindow(File file, String name) throws Exception containerTable.put(name, c); } else { - // FIXME: Find a better identifier than 'main' when main String is null + // Find a better identifier than 'main' when main String is null containerTable.put("main", c); } } @@ -335,7 +335,7 @@ public void buildAndRender(IVdmClassReader reader, String projectName, // checking if we have more than one class to use for (IVdmDefinition c : this.classList) { - // FIXME: this works as there is only one possible annotation for classes + // this works as there is only one possible annotation for classes if (c.hasAnnotations()) { --i; @@ -405,7 +405,7 @@ public void buildAndRender(IVdmClassReader reader, String projectName) // checking if we have more than one class to use for (IVdmDefinition c : this.classList) { - // FIXME: this works as there is only one possible annotation for classes + // this works as there is only one possible annotation for classes if (c.hasAnnotations()) { --i; diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/VdmjVdmInterpreterWrapper.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/VdmjVdmInterpreterWrapper.java index 478ff025a7..cfe971f0a3 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/VdmjVdmInterpreterWrapper.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/VdmjVdmInterpreterWrapper.java @@ -57,7 +57,7 @@ public VdmjVdmInterpreterWrapper(Dialect dialect) throws Exception { // global VDMJ settings - Settings.usingCmdLine = true; // FIXME: not really sure what this is for... + Settings.usingCmdLine = true; Settings.usingDBGP = false; Settings.dialect = dialect; diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/AnnotationReader.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/AnnotationReader.java index 3d7d25db1b..182b6ffc08 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/AnnotationReader.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/AnnotationReader.java @@ -90,7 +90,7 @@ public void readFiles(Vector files) } } - // FIXME: DIRTY, VERY DIRTY. A proper parser should be used for this. + // DIRTY, VERY DIRTY. A proper parser should be used for this. // This method only does simple line by line reading. /** * Reads a single plain text file containing a vdm++ specification @@ -121,7 +121,7 @@ private void readFile(File file) } // found a annotation - // FIXME: We don't take into account multiple annotations for a class or method + // We don't take into account multiple annotations for a class or method if (annotationPatern.matcher(strLine).lookingAt()) { String[] result = strLine.split("="); @@ -178,7 +178,7 @@ private void readFile(File file) } // lookinAt() else if (strLine.contains("public") || strLine.contains("private")) - { // FIXME: Redundant + { // Redundant String split[] = strLine.split(" "); if (split.length >= 2) { diff --git a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/VdmjVdmClassReader.java b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/VdmjVdmClassReader.java index 68f017f704..9de15d5538 100644 --- a/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/VdmjVdmClassReader.java +++ b/core/guibuilder/src/main/java/org/overture/guibuilder/internal/ir/VdmjVdmClassReader.java @@ -170,14 +170,13 @@ private void readVdmjClass(SClassDefinition c, if (assistantFactory.createPDefinitionAssistant().isFunctionOrOperation(def)) { // now we check what sub class it is... - // FIXME: Better way of doing this ? if (def instanceof AExplicitOperationDefinition) { AExplicitOperationDefinition operation = (AExplicitOperationDefinition) def; - // FIXME: In terms of type only 'class types' are treated + // In terms of type only 'class types' are treated VdmType type = getType(((AOperationType) operation.getType()).getResult(), assistantFactory); newDefinition = new VdmMethod(operation.getName().getName(), operation.getIsConstructor(), type); - // FIXME: Temporary solution, just to check if there's a return + // Temporary solution, just to check if there's a return /* * if (!operation.type.result.equals("()")) newDefinition.setType( "" ); */// fetching the arguments @@ -203,7 +202,7 @@ private void readVdmjClass(SClassDefinition c, { AImplicitOperationDefinition operation = (AImplicitOperationDefinition) def; VdmType type = null; - // FIXME: In terms of type only 'class types' are treated + // In terms of type only 'class types' are treated type = getType(((AOperationType) operation.getType()).getResult(), assistantFactory); newDefinition = new VdmMethod(operation.getName().getName(), operation.getIsConstructor(), type); @@ -231,7 +230,7 @@ private void readVdmjClass(SClassDefinition c, { AExplicitFunctionDefinition function = (AExplicitFunctionDefinition) def; VdmType type = null; - // FIXME: In terms of type only 'class types' are treated + // In terms of type only 'class types' are treated type = getType(((AFunctionType) function.getType()).getResult(), assistantFactory); newDefinition = new VdmMethod(function.getName().getName(), false, type); // fetching the arguments @@ -259,7 +258,7 @@ private void readVdmjClass(SClassDefinition c, { AImplicitFunctionDefinition function = (AImplicitFunctionDefinition) def; VdmType type = null; - // FIXME: In terms of type only 'class types' are treated + // In terms of type only 'class types' are treated type = getType(((AFunctionType) function.getType()).getResult(), assistantFactory); newDefinition = new VdmMethod(function.getName().getName(), false, type); // fetching the arguments @@ -309,7 +308,7 @@ private void readVdmjClass(SClassDefinition c, } } - // FIXME we only have one annotation for classes, so we can get away with this, but + // we only have one annotation for classes, so we can get away with this, but // a sanity check is needed... if (!(ToolSettings.GENERATION_SETTINGS == ToolSettings.GENERATION_MODE.ANNOTATIONS && vdmClass.hasAnnotations())) { @@ -318,34 +317,8 @@ private void readVdmjClass(SClassDefinition c, } - // public static boolean isClass(PType type) - // { - // // FIXME - // if (type instanceof ANamedInvariantType) - // { - // ANamedInvariantType in = (ANamedInvariantType) type; - // if (in.getOpaque()) - // { - // return false; - // } - // return isClass(in.getType()); - // } else if (type instanceof AOptionalType) - // { - // AOptionalType opt = (AOptionalType) type; - // return isClass(opt.getType()); - // } else if (type instanceof AParameterType) - // { - // return true; - // } else if (type instanceof AUnionType) - // { - // AUnionType ut = (AUnionType) type; - // return AUnionTypeAssistantInterpreter.getClassType(ut) != null; - // } else if (type instanceof AUnknownType) - // { - // return true; - // } - // return false; - // } + + public static VdmType getType(PType type, ITypeCheckerAssistantFactory assistantFactory) // added parameter for the assistantFactory @@ -379,7 +352,7 @@ public Vector getClassNames() */ private String extractTypeName(PType type, int n) { - // FIXME: rewrite + // rewrite String ret = type.toString(); // System.out.println(ret); ret = ret.replaceAll("\\(", ""); From 1434ff561dfed79a2a41a3b476063d8a68d61372 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Mon, 23 Feb 2015 13:53:44 +0100 Subject: [PATCH 58/90] removed fixme's from the type checker, which were questions which has been answered --- .../definition/PDefinitionAssistantTC.java | 44 ++++++++----------- .../assistant/expression/PExpAssistantTC.java | 2 +- .../assistant/module/PExportAssistantTC.java | 4 +- .../assistant/module/PImportAssistantTC.java | 2 +- .../assistant/statement/PStmAssistantTC.java | 2 +- .../assistant/type/PTypeAssistantTC.java | 12 ++--- 6 files changed, 29 insertions(+), 37 deletions(-) diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/PDefinitionAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/PDefinitionAssistantTC.java index 3bfc99e29e..512832f1fb 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/PDefinitionAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/PDefinitionAssistantTC.java @@ -73,7 +73,7 @@ public boolean equals(PDefinition d, Object other) // Used for sets of definitio { try { - return d.apply(af.getDefinitionEqualityChecker(), other);// FIXME: should we handle exceptions like this + return d.apply(af.getDefinitionEqualityChecker(), other); } catch (AnalysisException e) { return false; @@ -132,10 +132,7 @@ public PDefinition findType(PDefinition d, ILexNameToken sought, { try { - return d.apply(af.getDefinitionFinder(), new DefinitionFinder.Newquestion(sought, fromModule));// FIXME: - // should we - // handle exceptions - // like this + return d.apply(af.getDefinitionFinder(), new DefinitionFinder.Newquestion(sought, fromModule)); } catch (AnalysisException e) { return null; @@ -148,8 +145,7 @@ public PDefinition findName(PDefinition d, ILexNameToken sought, try { - return d.apply(af.getNameFinder(), new NameFinder.Newquestion(sought, scope));// FIXME: should we handle - // exceptions like this + return d.apply(af.getNameFinder(), new NameFinder.Newquestion(sought, scope)); } catch (AnalysisException e) { return null; @@ -185,7 +181,7 @@ public void markUsed(PDefinition d) { try { - d.apply(af.getUsedMarker());// FIXME: should we handle exceptions like this + d.apply(af.getUsedMarker()); } catch (AnalysisException e) { @@ -196,7 +192,7 @@ public void unusedCheck(PDefinition d) { try { - d.apply(af.getUnusedChecker());// FIXME: should we handle exceptions like this + d.apply(af.getUnusedChecker()); } catch (AnalysisException e) { @@ -218,7 +214,7 @@ public List getDefinitions(PDefinition d) { try { - return d.apply(af.getDefinitionCollector());// FIXME: should we handle exceptions like this + return d.apply(af.getDefinitionCollector()); } catch (AnalysisException e) { return null; @@ -230,7 +226,7 @@ public PDefinition getSelfDefinition(PDefinition d) { try { - return d.apply(af.getSelfDefinitionFinder());// FIXME: should we handle exceptions like this + return d.apply(af.getSelfDefinitionFinder()); } catch (AnalysisException e) { return null; @@ -242,7 +238,7 @@ public LexNameList getVariableNames(PDefinition d) { try { - return d.apply(af.getVariableNameCollector());// FIXME: should we handle exceptions like this + return d.apply(af.getVariableNameCollector()); } catch (AnalysisException e) { return null; @@ -259,7 +255,7 @@ public PDefinition deref(PDefinition d) { try { - return d.apply(af.getDereferer());// FIXME: should we handle exceptions like this + return d.apply(af.getDereferer()); } catch (AnalysisException e) { return null; @@ -271,7 +267,7 @@ public boolean isCallableOperation(PDefinition d) { try { - return d.apply(af.getCallableOperationChecker());// FIXME: should we handle exceptions like this + return d.apply(af.getCallableOperationChecker()); } catch (AnalysisException e) { return false; @@ -283,7 +279,7 @@ public boolean isUsed(PDefinition d) { try { - return d.apply(af.getUsedChecker());// FIXME: should we handle exceptions like this + return d.apply(af.getUsedChecker()); } catch (AnalysisException e) { return false; @@ -295,7 +291,7 @@ public void implicitDefinitions(PDefinition d, Environment env) { try { - d.apply(af.getImplicitDefinitionFinder(), env);// FIXME: should we handle exceptions like this + d.apply(af.getImplicitDefinitionFinder(), env); } catch (AnalysisException e) { @@ -309,11 +305,7 @@ public void typeResolve(PDefinition d, { try { - d.apply(af.getDefinitionTypeResolver(), new DefinitionTypeResolver.NewQuestion(rootVisitor, question));// FIXME: - // should - // we - // handle exceptions - // like this + d.apply(af.getDefinitionTypeResolver(), new DefinitionTypeResolver.NewQuestion(rootVisitor, question)); } catch (AnalysisException e) { @@ -325,7 +317,7 @@ public PType getType(PDefinition d) { try { - return d.apply(af.getDefinitionTypeFinder());// FIXME: should we handle exceptions like this + return d.apply(af.getDefinitionTypeFinder()); } catch (AnalysisException e) { return null; @@ -337,7 +329,7 @@ public boolean isUpdatable(PDefinition d) { try { - return d.apply(af.getUpdatableChecker());// FIXME: should we handle exceptions like this + return d.apply(af.getUpdatableChecker()); } catch (AnalysisException e) { return false; @@ -348,7 +340,7 @@ public String kind(PDefinition d) { try { - return d.apply(af.getKindFinder());// FIXME: should we handle exceptions like this + return d.apply(af.getKindFinder()); } catch (AnalysisException e) { return null; @@ -360,7 +352,7 @@ public boolean isFunction(PDefinition d) { try { - return d.apply(af.getFunctionChecker());// FIXME: should we handle exceptions like this + return d.apply(af.getFunctionChecker()); } catch (AnalysisException e) { return false; @@ -371,7 +363,7 @@ public boolean isOperation(PDefinition d) { try { - return d.apply(af.getOperationChecker());// FIXME: should we handle exceptions like this + return d.apply(af.getOperationChecker()); } catch (AnalysisException e) { return false; diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/expression/PExpAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/expression/PExpAssistantTC.java index 784458ecb0..0252214415 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/expression/PExpAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/expression/PExpAssistantTC.java @@ -45,7 +45,7 @@ public ILexNameToken getPreName(PExp expression) { try { - return expression.apply(af.getPreNameFinder());// FIXME: should we handle exceptions like this + return expression.apply(af.getPreNameFinder()); } catch (AnalysisException e) { return null; diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PExportAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PExportAssistantTC.java index 7e4a5f4173..415975f600 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PExportAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PExportAssistantTC.java @@ -45,7 +45,7 @@ public Collection getDefinition(PExport exp, { try { - return exp.apply(af.getExportDefinitionFinder(), actualDefs);// FIXME: should we handle exceptions like this + return exp.apply(af.getExportDefinitionFinder(), actualDefs); } catch (AnalysisException e) { return null; @@ -57,7 +57,7 @@ public Collection getDefinition(PExport exp) { try { - return exp.apply(af.getExportDefinitionListFinder());// FIXME: should we handle exceptions like this + return exp.apply(af.getExportDefinitionListFinder()); } catch (AnalysisException e) { return null; diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PImportAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PImportAssistantTC.java index bbdae03cb7..df5b96912b 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PImportAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/module/PImportAssistantTC.java @@ -44,7 +44,7 @@ public List getDefinitions(PImport imp, AModuleModules from) { try { - return imp.apply(af.getImportDefinitionFinder(), from);// FIXME: should we handle exceptions like this + return imp.apply(af.getImportDefinitionFinder(), from); } catch (AnalysisException e) { return null; diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/statement/PStmAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/statement/PStmAssistantTC.java index f7cc04b21e..be986ca47e 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/statement/PStmAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/statement/PStmAssistantTC.java @@ -41,7 +41,7 @@ public PTypeSet exitCheck(PStm statement) { try { - return statement.apply(af.getExitTypeCollector());// FIXME: should we handle exceptions like this + return statement.apply(af.getExitTypeCollector()); } catch (AnalysisException e) { return new PTypeSet(af); diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/type/PTypeAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/type/PTypeAssistantTC.java index f5d9de532b..15c4d96f09 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/type/PTypeAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/type/PTypeAssistantTC.java @@ -71,7 +71,7 @@ public boolean isType(PType type, Class typeclass) { try { - return type.apply(af.getPTypeExtendedChecker(), typeclass);// FIXME: should we handle exceptions like this + return type.apply(af.getPTypeExtendedChecker(), typeclass); } catch (AnalysisException e) { return false; @@ -108,7 +108,7 @@ public boolean isUnion(PType type) { try { - return type.apply(af.getUnionBasisChecker());// FIXME: should we handle exceptions like this + return type.apply(af.getUnionBasisChecker()); } catch (AnalysisException e) { return false; @@ -119,7 +119,7 @@ public AUnionType getUnion(PType type) { try { - return type.apply(af.getUnionTypeFinder());// FIXME: should we handle exceptions like this + return type.apply(af.getUnionTypeFinder()); } catch (AnalysisException e) { return null; @@ -130,7 +130,7 @@ public boolean isFunction(PType type) { try { - return type.apply(af.getPTypeFunctionChecker());// FIXME: should we handle exceptions like this + return type.apply(af.getPTypeFunctionChecker()); } catch (AnalysisException e) { return false; @@ -141,7 +141,7 @@ public AFunctionType getFunction(PType type) { try { - return type.apply(af.getFunctionTypeFinder());// FIXME: should we handle exceptions like this + return type.apply(af.getFunctionTypeFinder()); } catch (AnalysisException e) { return null; @@ -165,7 +165,7 @@ public void unResolve(PType type) { try { - type.apply(af.getTypeUnresolver());// FIXME: should we handle exceptions like this + type.apply(af.getTypeUnresolver()); } catch (AnalysisException e) { From 3c21660fca71589ed483011001464d87f70b17ba Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 15:01:24 +0100 Subject: [PATCH 59/90] improved ctruntime test framework --- .../overture/ct/ctruntime/utils/CtHelper.java | 5 +- .../tests/CtNoReductionPpTestCase.java | 9 +- .../tests/CtNoReductionSlTestCase.java | 25 ++- .../tests/CtRandomReductionSlTestCase.java | 10 +- .../ct/ctruntime/tests/CtTestCaseBase.java | 160 +++++++++++++----- .../tests/util/TestSourceFinder.java | 2 +- 6 files changed, 156 insertions(+), 55 deletions(-) diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java index 8bdbf86b13..2e8a9ee8d2 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java @@ -37,16 +37,15 @@ public class CtHelper public static class CtTestData { public final String traceName; - public final int port; + public int port; public final File traceFolder; public final File specFile; public TraceReductionInfo reduction; - public CtTestData(String traceName, int port, File traceFolder, + public CtTestData(String traceName, File traceFolder, File specFile, TraceReductionInfo second) { this.traceName = traceName; - this.port = port; this.traceFolder = traceFolder; this.specFile = specFile; this.reduction = second; diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java index f5cbb257b1..2f9753dc11 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionPpTestCase.java @@ -11,7 +11,6 @@ import org.overture.config.Settings; import org.overture.ct.ctruntime.tests.util.TestSourceFinder; import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; -import org.overture.test.framework.Properties; @RunWith(value = Parameterized.class) public class CtNoReductionPpTestCase extends CtTestCaseBase @@ -22,8 +21,6 @@ public class CtNoReductionPpTestCase extends CtTestCaseBase @Parameters(name = "{0}") public static Collection getData() { - Properties.recordTestResults = false; - Collection tests = TestSourceFinder.createTestCompleteFile(Dialect.VDM_PP, TEST_NAME, ROOT, "", ""); return tests; @@ -41,5 +38,11 @@ public void setUp() throws Exception Settings.dialect = Dialect.VDM_PP; Settings.release = Release.VDM_10; } + + @Override + protected String getPropertyId() + { + return "pp.no"; + } } diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java index 39409a1f6f..43692a6274 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtNoReductionSlTestCase.java @@ -24,6 +24,8 @@ import java.io.File; import java.util.Collection; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -32,19 +34,30 @@ import org.overture.config.Settings; import org.overture.ct.ctruntime.tests.util.TestSourceFinder; import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; -import org.overture.test.framework.Properties; @RunWith(value = Parameterized.class) public class CtNoReductionSlTestCase extends CtTestCaseBase { + @BeforeClass + public static void s() + { + System.out.println(); + } + + @AfterClass + public static void e() + { + System.out.println(); + } +// @Rule +// public TestRule benchmarkRun = new BenchmarkRule(); + private static String TEST_NAME = "CT no reduction SL tests"; private static final String ROOT = "src/test/resources/no_reduction_sl_specs"; @Parameters(name = "{0}") public static Collection getData() { - Properties.recordTestResults = false; - Collection tests = TestSourceFinder.createTestCompleteFile(Dialect.VDM_SL, TEST_NAME, ROOT, "", ""); return tests; @@ -62,4 +75,10 @@ public void setUp() throws Exception Settings.dialect = Dialect.VDM_SL; Settings.release = Release.VDM_10; } + + @Override + protected String getPropertyId() + { + return "sl.no"; + } } diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java index bd60ff8c7e..6d56c16b8b 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtRandomReductionSlTestCase.java @@ -36,7 +36,6 @@ import org.overture.ct.ctruntime.utils.TraceReductionInfo; import org.overture.interpreter.traces.TraceReductionType; import org.overture.interpreter.traces.util.Pair; -import org.overture.test.framework.Properties; @RunWith(value = Parameterized.class) public class CtRandomReductionSlTestCase extends CtTestCaseBase @@ -57,7 +56,6 @@ public class CtRandomReductionSlTestCase extends CtTestCaseBase @Parameters(name = "{0}") public static Collection getData() { - Properties.recordTestResults = false; List> testReductionInfo2 = new Vector>(); testReductionInfo2.add(new Pair("OpRepeatedTenTimes", new TraceReductionInfo(0.15F, TraceReductionType.RANDOM, SEED))); @@ -85,7 +83,7 @@ public static Collection getData() traceName + " " + entry.second, specFile, traceFolder, - new CtTestData( TRACE_NAME, PORT, traceFolder, specFile, entry.second), + new CtTestData( TRACE_NAME, traceFolder, specFile, entry.second), entry.second }); } @@ -131,4 +129,10 @@ private String consResultFileName(String filename, int index) + reductionInfo.toString().replace(',', '_').replace('.', '_') + filename.substring(index); } + + @Override + protected String getPropertyId() + { + return "sl.random"; + } } diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java index 27b5d1d709..c0a38c874e 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java @@ -36,6 +36,7 @@ import org.junit.Before; import org.junit.Test; import org.overture.ast.lex.Dialect; +import org.overture.ast.lex.LexLocation; import org.overture.config.Settings; import org.overture.ct.ctruntime.TraceRunnerMain; import org.overture.ct.ctruntime.utils.CtHelper; @@ -53,10 +54,14 @@ @SuppressWarnings("rawtypes") public abstract class CtTestCaseBase extends TestResourcesResultTestCase4 { + private static final String TESTS_CT_RUNTIME_PROPERTY_PREFIX = "tests.ctruntime.override."; + // The socket is used to communicate with the trace interpreter protected ServerSocket socket; protected static final int SOCKET_TIMEOUT = 0; - public static final int PORT = 8889; +// public static final int PORT = 8889; + private static final int FROM_PORT = 10000; + private static final int TO_PORT = 50000; // Used a fixed trace name for simplicity protected static final String TRACE_NAME = "T1"; @@ -64,7 +69,7 @@ public abstract class CtTestCaseBase extends TestResourcesResultTestCase4 public static final String TRACE_OUTPUT_FOLDER = "target/trace-output/"; // protected CtTestHelper testHelper; - private String[] args; +// private String[] args; private File traceFolder; private CtTestData testdata; @@ -76,7 +81,7 @@ public CtTestCaseBase() public CtTestCaseBase(File file, File traceFolder, CtTestData args) { super(file); - + this.testdata = args; this.traceFolder = traceFolder; } @@ -85,10 +90,9 @@ public CtTestCaseBase(File file, File traceFolder, CtTestData args) public void internalSetup() throws Exception { setUp(); - CtHelper testHelper = new CtHelper(); - this.args = testHelper.buildArgs(Settings.dialect, Settings.release, testdata); + } - + abstract public void setUp() throws Exception; @After @@ -113,52 +117,59 @@ public void test() throws Exception return; } - File actualResultsFile = computeActualResults(TRACE_NAME); - - if (Properties.recordTestResults) + try { - try - { - File resultFile = createResultFile(file.getAbsolutePath()); - resultFile.getParentFile().mkdirs(); + configureResultGeneration(); - // Overwrite result file - FileUtils.copyFile(actualResultsFile, resultFile); + File actualResultsFile = computeActualResults(TRACE_NAME); - } catch (Exception e) + if (Properties.recordTestResults) { - Assert.fail("The produced results could not be stored: " - + e.getMessage()); - } - } else - { - File resultFile = getResultFile(file.getAbsolutePath()); + try + { + File resultFile = createResultFile(file.getAbsolutePath()); + resultFile.getParentFile().mkdirs(); + + // Overwrite result file + FileUtils.copyFile(actualResultsFile, resultFile); + + } catch (Exception e) + { + Assert.fail("The produced results could not be stored: " + + e.getMessage()); + } + } else + { + File resultFile = getResultFile(file.getAbsolutePath()); - + TraceResultReader reader = new TraceResultReader(); + List actualResults = reader.read(actualResultsFile); - TraceResultReader reader = new TraceResultReader(); - List actualResults = reader.read(actualResultsFile); - - Assert.assertTrue("No result file found for test: " + file+"\n\n"+actualResults, resultFile.exists()); - List expectedResults = reader.read(resultFile); - + Assert.assertTrue("No result file found for test: " + file + + "\n\n" + actualResults, resultFile.exists()); + List expectedResults = reader.read(resultFile); - Assert.assertTrue(expectedResults.size() == actualResults.size()); + Assert.assertTrue(expectedResults.size() == actualResults.size()); - int size = expectedResults.size(); + int size = expectedResults.size(); - for (int i = 0; i < size; i++) - { - TraceResult expected = expectedResults.get(i); - TraceResult actual = actualResults.get(i); - - Assert.assertTrue("Actual results differs from expected results for test: " - + file - + "\nExpected: " - + expectedResults - + "\n\nActual: " + actualResults, expected.equals(actual)); + for (int i = 0; i < size; i++) + { + TraceResult expected = expectedResults.get(i); + TraceResult actual = actualResults.get(i); + + Assert.assertTrue("Actual results differs from expected results for test: " + + file + + "\nExpected: " + + expectedResults + + "\n\nActual: " + actualResults, expected.equals(actual)); + } } + } finally + { + unconfigureResultGeneration(); } + } @Override @@ -177,7 +188,8 @@ public File computeActualResults(final String spec) throws IOException, XPathExpressionException, SAXException, ParserConfigurationException { - socket = new ServerSocket(PORT); + int port =findAvailablePort(FROM_PORT, TO_PORT); + socket = new ServerSocket(port); socket.setSoTimeout(SOCKET_TIMEOUT); final Data data = new Data(); @@ -197,6 +209,12 @@ public File computeActualResults(final String spec) throws IOException, t.start(); TraceRunnerMain.USE_SYSTEM_EXIT = false; + + this.testdata.port = port; + + + String[] args = testHelper.buildArgs(Settings.dialect, Settings.release, testdata); + TraceRunnerMain.main(args); final String message = data.getMessage(); @@ -224,4 +242,62 @@ protected boolean assertEqualResults(Object expected, Object actual, { return false; } + + protected void configureResultGeneration() + { + LexLocation.absoluteToStringLocation = false; + if (System.getProperty(TESTS_CT_RUNTIME_PROPERTY_PREFIX + "all") != null + || getPropertyId() != null + && System.getProperty(TESTS_CT_RUNTIME_PROPERTY_PREFIX + + getPropertyId()) != null) + { + Properties.recordTestResults = true; + } + + } + + protected void unconfigureResultGeneration() + { + Properties.recordTestResults = false; + } + + protected abstract String getPropertyId(); + + + + public static int findAvailablePort(int fromPort, int toPort) + { + if (fromPort > toPort) + { + throw new IllegalArgumentException("startPortShouldBeLessThanOrEqualToEndPort"); + } + + int port = fromPort; + ServerSocket socket = null; + while (port <= toPort) + { + try + { + socket = new ServerSocket(port); + return port; + } catch (IOException e) + { + ++port; + } finally + { + if (socket != null) + { + try + { + socket.close(); + } catch (IOException e) + { + e.printStackTrace(); + } + } + } + } + + return -1; + } } diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java index af0d645531..a88e126320 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java @@ -145,7 +145,7 @@ private static Collection createCompleteFile(Dialect dialect, } File traceFolder = new File((CtTestCaseBase.TRACE_OUTPUT_FOLDER + traceName).replace('/', File.separatorChar)); - tests.add(new Object[] { traceName, file, traceFolder, new CtTestData("T1", CtTestCaseBase.PORT, traceFolder, file,null) }); + tests.add(new Object[] { traceName, file, traceFolder, new CtTestData("T1", traceFolder, file,null) }); } return tests; From 9ea372b35a6f3655c222dad1ed3ce21e6dc52d84 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 15:03:16 +0100 Subject: [PATCH 60/90] removed system out from repeat trace node in ctruntime --- .../java/org/overture/interpreter/traces/RepeatTraceNode.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/interpreter/src/main/java/org/overture/interpreter/traces/RepeatTraceNode.java b/core/interpreter/src/main/java/org/overture/interpreter/traces/RepeatTraceNode.java index e868eec524..2ab138ce8b 100644 --- a/core/interpreter/src/main/java/org/overture/interpreter/traces/RepeatTraceNode.java +++ b/core/interpreter/src/main/java/org/overture/interpreter/traces/RepeatTraceNode.java @@ -148,7 +148,6 @@ public int size() size++; } } - System.out.println(size); return size; } From b50b68cfe899380bc0ee3a6ca1d267289efe6206 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 15:04:21 +0100 Subject: [PATCH 61/90] fixed missing global modules in ct test type check --- .../ct/ctruntime/TraceInterpreter.java | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java index 2f8e158e56..af5b34fd90 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java @@ -48,7 +48,6 @@ import org.overture.interpreter.traces.TraceVariableStatement; import org.overture.interpreter.traces.Verdict; import org.overture.typechecker.FlatEnvironment; -import org.overture.typechecker.ModuleEnvironment; import org.overture.typechecker.PrivateClassEnvironment; import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory; @@ -178,7 +177,7 @@ private void processTraces(List definitions, String className, } infoCompleted(); - + if (DEBUG) { System.out.println("Completed"); @@ -256,7 +255,7 @@ private void evaluateTests(String className, TraceXmlWrapper storage, tests = ctxt.assistantFactory.createANamedTraceDefinitionAssistant().getTests(mtd, ctxt, subset, traceReductionType, seed); int size = tests.size(); - + infoProcessingTrace(className, mtd.getName().getName(), size); if (storage != null) { @@ -270,7 +269,7 @@ private void evaluateTests(String className, TraceXmlWrapper storage, int skippedCount = 0; StopWatch.set(); - + for (CallSequence test : tests) { StopWatch.stop("Getting test"); @@ -284,10 +283,11 @@ private void evaluateTests(String className, TraceXmlWrapper storage, boolean typeOk = false; try { - if(interpreter instanceof ClassInterpreter) + if (interpreter instanceof ClassInterpreter) + { + typeCheck(mtd.getClassDefinition(), interpreter, test); + } else { - typeCheck(mtd.getClassDefinition(), interpreter, test); - }else{ typeCheck(mtd.parent(), interpreter, test); } typeOk = true; @@ -347,8 +347,7 @@ private void evaluateTests(String className, TraceXmlWrapper storage, { storage.AddSkippedResult(new Integer(n).toString()); } - } - else + } else { if (verdict == Verdict.ERROR) @@ -404,23 +403,19 @@ private void evaluateTests(String className, TraceXmlWrapper storage, * @throws AnalysisException * @throws Exception */ - protected void typeCheck(INode classdef, - Interpreter interpreter, CallSequence test) - throws AnalysisException, Exception + protected void typeCheck(INode classdef, Interpreter interpreter, + CallSequence test) throws AnalysisException, Exception { FlatEnvironment env = null; if (classdef instanceof SClassDefinition) { - env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), new PrivateClassEnvironment(interpreter.getAssistantFactory(), (SClassDefinition)classdef, interpreter.getGlobalEnvironment())); + env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), new PrivateClassEnvironment(interpreter.getAssistantFactory(), (SClassDefinition) classdef, interpreter.getGlobalEnvironment())); } else { - List defs = new Vector(); - defs.addAll(((AModuleModules)classdef).getDefs()); - ModuleEnvironment mEnv = new ModuleEnvironment(interpreter.getAssistantFactory(), (AModuleModules) classdef); - env = new FlatEnvironment(interpreter.getAssistantFactory(), new Vector(),mEnv); + env = new FlatEnvironment(interpreter.getAssistantFactory(), new Vector(), interpreter.getGlobalEnvironment()); } - + for (int i = 0; i < test.size(); i++) { PStm statement = test.get(i); From 8ff0f3355440527362e5bfbea6aead37e9795e39 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 15:09:10 +0100 Subject: [PATCH 62/90] improved static type check of traces --- .../visitor/TypeCheckerDefinitionVisitor.java | 48 +++++-------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java index 38e2326c43..4eeed792d0 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.List; import java.util.Vector; +import java.util.Map.Entry; import org.overture.ast.analysis.AnalysisException; import org.overture.ast.analysis.intf.IQuestionAnswer; @@ -1265,7 +1266,7 @@ public PType caseAPerSyncDefinition(APerSyncDefinition node, Boolean isStatic = null; List definitions = question.assistantFactory.createPDefinitionAssistant().getDefinitions(classdef); - + for (PDefinition def : definitions) { if (def.getName() != null @@ -1539,18 +1540,7 @@ public PType caseALetDefBindingTraceDefinition( ALetDefBindingTraceDefinition node, TypeCheckInfo question) throws AnalysisException { - Environment local = question.env; - for (PDefinition d : node.getLocalDefs()) - { - question.assistantFactory.createPDefinitionAssistant().typeResolve(d, THIS, question); - d.apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)); - local = new FlatCheckedEnvironment(question.assistantFactory, d, local, question.scope); - } - - node.getBody().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)); - local.unusedCheck(question.env); - - return null; + return typeCheckLet(node, node.getLocalDefs(), node.getBody(), question); } @Override @@ -1558,37 +1548,25 @@ public PType caseALetBeStBindingTraceDefinition( ALetBeStBindingTraceDefinition node, TypeCheckInfo question) throws AnalysisException { - node.setDef(AstFactory.newAMultiBindListDefinition(node.getBind().getLocation(), question.assistantFactory.createPMultipleBindAssistant().getMultipleBindList(node.getBind()))); - node.getDef().apply(THIS, question); - Environment local = new FlatCheckedEnvironment(question.assistantFactory, node.getDef(), question.env, question.scope); - - if (node.getStexp() != null - && !question.assistantFactory.createPTypeAssistant().isType(node.getStexp().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)), ABooleanBasicType.class)) - { - TypeCheckerErrors.report(3225, "Such that clause is not boolean", node.getStexp().getLocation(), node); - } - - node.getBody().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)); - local.unusedCheck(); - - return null; + Entry res = typecheckLetBeSt(node, node.getLocation(), node.getBind(), node.getStexp(), node.getBody(), question); + node.setDef(res.getValue()); + return res.getKey(); } @Override public PType caseARepeatTraceDefinition(ARepeatTraceDefinition node, TypeCheckInfo question) throws AnalysisException { - // Environment local = question.env; - node.getCore().apply(THIS, question); - if (node.getFrom() > node.getTo()) { TypeCheckerErrors.report(3277, "Trace repeat illegal values", node.getLocation(), node); } - return null; + // Environment local = question.env; + return node.getCore().apply(THIS, question); + } - + @Override public PType caseAConcurrentExpressionTraceCoreDefinition( AConcurrentExpressionTraceCoreDefinition node, @@ -1598,7 +1576,7 @@ public PType caseAConcurrentExpressionTraceCoreDefinition( { d.apply(THIS, question); } - + return null; } @@ -1623,8 +1601,8 @@ public PType caseAApplyExpressionTraceCoreDefinition( AApplyExpressionTraceCoreDefinition node, TypeCheckInfo question) throws AnalysisException { - node.getCallStatement().apply(THIS, question); - return null; + return node.getCallStatement().apply(THIS, question); + } } From 2de1ebcf59cbe18e2fa29084809f39a9701629fe Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 15:55:26 +0100 Subject: [PATCH 63/90] optimized object creation in TC of CT tests --- .../ct/ctruntime/TraceInterpreter.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java index af5b34fd90..823c0a86a9 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java @@ -47,7 +47,9 @@ import org.overture.interpreter.traces.TraceReductionType; import org.overture.interpreter.traces.TraceVariableStatement; import org.overture.interpreter.traces.Verdict; +import org.overture.typechecker.Environment; import org.overture.typechecker.FlatEnvironment; +import org.overture.typechecker.ModuleEnvironment; import org.overture.typechecker.PrivateClassEnvironment; import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory; @@ -262,6 +264,16 @@ private void evaluateTests(String className, TraceXmlWrapper storage, storage.StartTrace(mtd.getName().getName(), mtd.getLocation().getFile().getName(), mtd.getLocation().getStartLine(), mtd.getLocation().getStartPos(), size, new Float(subset), TraceReductionType.valueOf(traceReductionType.toString()), new Long(seed)); } + Environment rootEnv = null; + if (interpreter instanceof ClassInterpreter) + { + rootEnv = new PrivateClassEnvironment(interpreter.getAssistantFactory(), mtd.getClassDefinition(), interpreter.getGlobalEnvironment()); + ; + } else + { + rootEnv = new ModuleEnvironment(interpreter.getAssistantFactory(), (AModuleModules) mtd.parent()); + } + int n = 1; int faildCount = 0; @@ -285,10 +297,10 @@ private void evaluateTests(String className, TraceXmlWrapper storage, { if (interpreter instanceof ClassInterpreter) { - typeCheck(mtd.getClassDefinition(), interpreter, test); + typeCheck(mtd.getClassDefinition(), interpreter, test, rootEnv); } else { - typeCheck(mtd.parent(), interpreter, test); + typeCheck(mtd.parent(), interpreter, test, rootEnv); } typeOk = true; } catch (Exception e) @@ -404,16 +416,19 @@ private void evaluateTests(String className, TraceXmlWrapper storage, * @throws Exception */ protected void typeCheck(INode classdef, Interpreter interpreter, - CallSequence test) throws AnalysisException, Exception + CallSequence test, Environment outer) throws AnalysisException, + Exception { FlatEnvironment env = null; if (classdef instanceof SClassDefinition) { - env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), new PrivateClassEnvironment(interpreter.getAssistantFactory(), (SClassDefinition) classdef, interpreter.getGlobalEnvironment())); + + env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), outer); } else { - env = new FlatEnvironment(interpreter.getAssistantFactory(), new Vector(), interpreter.getGlobalEnvironment()); + + env = new FlatEnvironment(interpreter.getAssistantFactory(), new Vector(), outer); } for (int i = 0; i < test.size(); i++) From da179fd5380a996c33f5a209dfea821b553e91d5 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 19:51:21 +0100 Subject: [PATCH 64/90] extended ct testing to support multi spec files (VDMSL) --- .../overture/ct/ctruntime/utils/CtHelper.java | 33 +++++++- .../CtMultiFileNoReductionSlTestCase.java | 84 +++++++++++++++++++ .../ct/ctruntime/tests/CtTestCaseBase.java | 3 + .../tests/util/TestSourceFinder.java | 51 ++++++++++- .../simple_2f/TestSL.vdmsl | 3 + .../simple_2f/TestSL2.vdmsl | 6 ++ 6 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtMultiFileNoReductionSlTestCase.java create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL.vdmsl create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL2.vdmsl diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java index 2e8a9ee8d2..5eea7460ab 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/utils/CtHelper.java @@ -28,6 +28,10 @@ import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; import org.overture.ast.lex.Dialect; import org.overture.config.Release; @@ -39,7 +43,7 @@ public static class CtTestData public final String traceName; public int port; public final File traceFolder; - public final File specFile; + public final List specFiles= new Vector<>(); public TraceReductionInfo reduction; public CtTestData(String traceName, File traceFolder, @@ -47,7 +51,16 @@ public CtTestData(String traceName, File traceFolder, { this.traceName = traceName; this.traceFolder = traceFolder; - this.specFile = specFile; + this.specFiles.add( specFile); + this.reduction = second; + + } + public CtTestData(String traceName, File traceFolder, + List specFiles, TraceReductionInfo second) + { + this.traceName = traceName; + this.traceFolder = traceFolder; + this.specFiles.addAll( specFiles); this.reduction = second; } @@ -59,6 +72,8 @@ public String[] buildArgs(Dialect dialect, Release release, CtTestData data) { data.reduction= new TraceReductionInfo(); } + + String[] args = new String[] { "-h", @@ -76,12 +91,22 @@ public String[] buildArgs(Dialect dialect, Release release, CtTestData data) data.traceName, "-tracefolder", data.traceFolder.toURI().toASCIIString(), - data.specFile.toURI().toASCIIString(), + // spec files here "-traceReduction", "{" + data.reduction.getSubset() + "," + data.reduction.getReductionType().toString() + "," + data.reduction.getSeed() + "}" }; - return args; + + List argArray = new Vector(Arrays.asList(args)); + + + for (Iterator itr = data.specFiles.iterator(); itr.hasNext();) + { + argArray.add(argArray.size()-2, itr.next().toURI().toASCIIString()); + + } + + return argArray.toArray(new String[argArray.size()]); } public Thread consCtClientThread(final ServerSocket socket, final Data data) diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtMultiFileNoReductionSlTestCase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtMultiFileNoReductionSlTestCase.java new file mode 100644 index 0000000000..8381d1cc9d --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtMultiFileNoReductionSlTestCase.java @@ -0,0 +1,84 @@ +/* + * #%~ + * Combinatorial Testing Runtime + * %% + * Copyright (C) 2008 - 2014 Overture + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #~% + */ +package org.overture.ct.ctruntime.tests; + +import java.io.File; +import java.util.Collection; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; +import org.overture.ast.lex.Dialect; +import org.overture.config.Release; +import org.overture.config.Settings; +import org.overture.ct.ctruntime.tests.util.TestSourceFinder; +import org.overture.ct.ctruntime.utils.CtHelper.CtTestData; + +@RunWith(value = Parameterized.class) +public class CtMultiFileNoReductionSlTestCase extends CtTestCaseBase +{ + @BeforeClass + public static void s() + { + System.out.println(); + } + + @AfterClass + public static void e() + { + System.out.println(); + } +// @Rule +// public TestRule benchmarkRun = new BenchmarkRule(); + + private static String TEST_NAME = "CT no reduction SL tests"; + private static final String ROOT = "src/test/resources/multi_no_reduction_sl_specs"; + + @Parameters(name = "{0}") + public static Collection getData() + { + Collection tests = TestSourceFinder.createTestMultiFileFile(Dialect.VDM_SL, TEST_NAME, ROOT, "", ""); + + return tests; + } + + public CtMultiFileNoReductionSlTestCase(String name, File file, File traceFolder, + CtTestData args) + { + super(file, traceFolder, args); + } + + @Override + public void setUp() throws Exception + { + Settings.dialect = Dialect.VDM_SL; + Settings.release = Release.VDM_10; + } + + @Override + protected String getPropertyId() + { + return "sl.multi.no"; + } +} diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java index c0a38c874e..6f25b1588c 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java @@ -26,6 +26,7 @@ import java.io.PrintWriter; import java.net.ServerSocket; import java.util.List; +import java.util.Vector; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; @@ -72,6 +73,8 @@ public abstract class CtTestCaseBase extends TestResourcesResultTestCase4 // private String[] args; private File traceFolder; private CtTestData testdata; + + public CtTestCaseBase() { diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java index a88e126320..1b95bc2593 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/util/TestSourceFinder.java @@ -39,6 +39,52 @@ public class TestSourceFinder { + public static Collection createTestMultiFileFile(Dialect dialect, + String name, String testRootPath, String... extensions) + + { + File testRoot = getFile(testRootPath); + + // TestSuite suite = new TestSourceFinder(name); + Collection tests = new LinkedList(); + + if (testRoot != null && testRoot.exists()) + { + for (File file : testRoot.listFiles()) + { + if (file.isDirectory() && !file.getName().startsWith(".")) + { + //tests.addAll(createCompleteFile(dialect, name, file, testRoot, extensions)); + List specFiles = new Vector(); + for (File f : file.listFiles()) + { + if(isNotAcceptedFile(f, Arrays.asList(extensions))) + { + continue; + } + specFiles.add(f); + } + + if(!specFiles.isEmpty()) + { + String traceName = file.getName(); + if (traceName.contains(".")) + { + traceName = traceName.substring(0, traceName.lastIndexOf('.')); + } + + File traceFolder = new File((CtTestCaseBase.TRACE_OUTPUT_FOLDER + traceName).replace('/', File.separatorChar)); + tests.add(new Object[] { traceName, file, traceFolder, + new CtTestData("T1", traceFolder, specFiles, null) }); + } + + } + } + } + return tests; + + } + /** * Utility method to create a test suite from files * @@ -139,13 +185,14 @@ private static Collection createCompleteFile(Dialect dialect, } else { String traceName = file.getName(); - if(traceName.contains(".")) + if (traceName.contains(".")) { traceName = traceName.substring(0, traceName.lastIndexOf('.')); } File traceFolder = new File((CtTestCaseBase.TRACE_OUTPUT_FOLDER + traceName).replace('/', File.separatorChar)); - tests.add(new Object[] { traceName, file, traceFolder, new CtTestData("T1", traceFolder, file,null) }); + tests.add(new Object[] { traceName, file, traceFolder, + new CtTestData("T1", traceFolder, file, null) }); } return tests; diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL.vdmsl b/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL.vdmsl new file mode 100644 index 0000000000..5d4951e082 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL.vdmsl @@ -0,0 +1,3 @@ +types + R :: f:nat + inv t == t.f > 10; diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL2.vdmsl b/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL2.vdmsl new file mode 100644 index 0000000000..9920ef42c5 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f/TestSL2.vdmsl @@ -0,0 +1,6 @@ +operations + op: R ==> nat + op(a) == return a.f + 1; + +traces + T1: op(mk_R(11)); From 4c7e8338784ba0bfa6c1632451a9712f81067e6d Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 20:41:28 +0100 Subject: [PATCH 65/90] improved tostring for modules --- core/ast/src/main/resources/overtureII.astv2.tostring | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/ast/src/main/resources/overtureII.astv2.tostring b/core/ast/src/main/resources/overtureII.astv2.tostring index 99c9f46841..d4c5aa44e2 100644 --- a/core/ast/src/main/resources/overtureII.astv2.tostring +++ b/core/ast/src/main/resources/overtureII.astv2.tostring @@ -186,6 +186,9 @@ import org.overture.ast.util.ToStringUtil; %definition->value = [pattern] +$($[type]$ == null ? "" : ":" + $[type]$) + " = " +$ [expression] +%modules->module= "module " [name]$.getName()+ "\n definitions\n" + ToStringUtil.getDefinitionListString($[defs]$)$ + + "end " [name]$.getName()$ + "\n" +//return (_name!=null?_name.toString():this.getClass().getSimpleName())+ (_imports!=null?_imports.toString():this.getClass().getSimpleName())+ (_exports!=null?_exports.toString():this.getClass().getSimpleName())+ (_defs!=null?_defs.toString():this.getClass().getSimpleName())+ (_files!=null?_files.toString():this.getClass().getSimpleName())+ (_importdefs!=null?_importdefs.toString():this.getClass().getSimpleName())+ (_exportdefs!=null?_exportdefs.toString():this.getClass().getSimpleName())+ (_isFlat!=null?_isFlat.toString():this.getClass().getSimpleName())+ (_typeChecked!=null?_typeChecked.toString():this.getClass().getSimpleName())+ (_isDLModule!=null?_isDLModule.toString():this.getClass().getSimpleName()); //%definition->value = [pattern] " : " [expType] " = " [expression] From 62ae3695c5d8815b064c3406fa6aeb0ada75f6f7 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 20:41:50 +0100 Subject: [PATCH 66/90] removed warnings for unused imports --- .../java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java index 6f25b1588c..60c9522913 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java @@ -26,7 +26,6 @@ import java.io.PrintWriter; import java.net.ServerSocket; import java.util.List; -import java.util.Vector; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; @@ -60,7 +59,6 @@ public abstract class CtTestCaseBase extends TestResourcesResultTestCase4 // The socket is used to communicate with the trace interpreter protected ServerSocket socket; protected static final int SOCKET_TIMEOUT = 0; -// public static final int PORT = 8889; private static final int FROM_PORT = 10000; private static final int TO_PORT = 50000; @@ -69,8 +67,6 @@ public abstract class CtTestCaseBase extends TestResourcesResultTestCase4 public static final String TRACE_OUTPUT_FOLDER = "target/trace-output/"; - // protected CtTestHelper testHelper; -// private String[] args; private File traceFolder; private CtTestData testdata; From 837d2a2089414b3cd3d390c17185a973f6dab39b Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 20:44:20 +0100 Subject: [PATCH 67/90] fixed issue with ct runtime when using VDM-SL with flat specs. The issue were that the trace should be ran in the compined module and not the DEFAULT one that contains the trace if it was flat since the containing one might only hold part of the spec --- .../ct/ctruntime/TraceInterpreter.java | 22 ++++++++++++++++--- .../simple_2f.result | 9 ++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f.result diff --git a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java index 823c0a86a9..e331a479bb 100644 --- a/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java +++ b/core/combinatorialtesting/ctruntime/src/main/java/org/overture/ct/ctruntime/TraceInterpreter.java @@ -34,6 +34,7 @@ import org.overture.ast.node.INode; import org.overture.ast.statements.PStm; import org.overture.ast.typechecker.NameScope; +import org.overture.ast.util.modules.CombinedDefaultModule; import org.overture.config.Settings; import org.overture.ct.utils.TraceXmlWrapper; import org.overture.interpreter.runtime.ClassInterpreter; @@ -264,14 +265,29 @@ private void evaluateTests(String className, TraceXmlWrapper storage, storage.StartTrace(mtd.getName().getName(), mtd.getLocation().getFile().getName(), mtd.getLocation().getStartLine(), mtd.getLocation().getStartPos(), size, new Float(subset), TraceReductionType.valueOf(traceReductionType.toString()), new Long(seed)); } + INode traceContainer = null; Environment rootEnv = null; if (interpreter instanceof ClassInterpreter) { + traceContainer = mtd.getClassDefinition(); rootEnv = new PrivateClassEnvironment(interpreter.getAssistantFactory(), mtd.getClassDefinition(), interpreter.getGlobalEnvironment()); ; } else { - rootEnv = new ModuleEnvironment(interpreter.getAssistantFactory(), (AModuleModules) mtd.parent()); + traceContainer = mtd.parent(); + if(((AModuleModules)traceContainer).getIsFlat()) + { + //search for the combined module + for(AModuleModules m : ((ModuleInterpreter)interpreter).modules) + { + if(m instanceof CombinedDefaultModule) + { + traceContainer = m; + break; + } + } + } + rootEnv = new ModuleEnvironment(interpreter.getAssistantFactory(), (AModuleModules) traceContainer); } int n = 1; @@ -297,10 +313,10 @@ private void evaluateTests(String className, TraceXmlWrapper storage, { if (interpreter instanceof ClassInterpreter) { - typeCheck(mtd.getClassDefinition(), interpreter, test, rootEnv); + typeCheck(traceContainer, interpreter, test, rootEnv); } else { - typeCheck(mtd.parent(), interpreter, test, rootEnv); + typeCheck(traceContainer, interpreter, test, rootEnv); } typeOk = true; } catch (Exception e) diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f.result b/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f.result new file mode 100644 index 0000000000..96cd32ecb8 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/multi_no_reduction_sl_specs/simple_2f.result @@ -0,0 +1,9 @@ + + + + op(mk_R(11)) + 12 + + + + From 8f74c7b7a15e25e0d5264193377128735f64892e Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Tue, 24 Feb 2015 21:03:53 +0100 Subject: [PATCH 68/90] optimized CPUValue such that the CPU definition and type only is created when needed. Otherwise we reuse the same definition. This matters for traces (CT) --- .../java/org/overture/interpreter/values/CPUValue.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/interpreter/src/main/java/org/overture/interpreter/values/CPUValue.java b/core/interpreter/src/main/java/org/overture/interpreter/values/CPUValue.java index 47901f3568..8828617710 100644 --- a/core/interpreter/src/main/java/org/overture/interpreter/values/CPUValue.java +++ b/core/interpreter/src/main/java/org/overture/interpreter/values/CPUValue.java @@ -131,6 +131,8 @@ public boolean isVirtual() { return resource.isVirtual(); } + + transient static AClassType cpuType = null; public static void init(ResourceScheduler scheduler, IInterpreterAssistantFactory assistantFactory) @@ -138,8 +140,12 @@ public static void init(ResourceScheduler scheduler, try { CPUResource.init(); - SClassDefinition def = AstFactoryTC.newACpuClassDefinition(assistantFactory); - vCPU = new CPUValue((AClassType) assistantFactory.createSClassDefinitionAssistant().getType(def)); + if(cpuType==null) + { + SClassDefinition cpu = AstFactoryTC.newACpuClassDefinition(assistantFactory); + cpuType = (AClassType) assistantFactory.createSClassDefinitionAssistant().getType(cpu); + } + vCPU = new CPUValue(cpuType); vCPU.setup(scheduler, "vCPU"); } catch (Exception e) { From 724ea778659c7825e7b9dc58428c0b01dcdae557 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 00:07:28 +0100 Subject: [PATCH 69/90] Added three tests revealing problem with code generation of field object designators when the 'object' is a record --- .../FieldDesignatorOfRecObj | 19 +++ .../FieldDesignatorOfRecObj.result | 57 +++++++++ .../FieldDesignatorOfRecObjChainOfThree | 25 ++++ ...FieldDesignatorOfRecObjChainOfThree.result | 117 ++++++++++++++++++ .../FieldDesignatorOfRecObjChainOfTwo | 22 ++++ .../FieldDesignatorOfRecObjChainOfTwo.result | 87 +++++++++++++ 6 files changed, 327 insertions(+) create mode 100644 core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj create mode 100644 core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj.result create mode 100644 core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree create mode 100644 core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree.result create mode 100644 core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo create mode 100644 core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo.result diff --git a/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj new file mode 100644 index 0000000000..8bcfd1f04f --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj @@ -0,0 +1,19 @@ +class Entry + +types + +public R :: + e : [Entry]; + +operations + +public static Run : () ==> ? +Run () == op1(mk_R(new Entry())); + +public static op1 : R ==> nat +op1(r) == r.e.getConst(); + +public getConst: () ==> nat +getConst() == return 1; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj.result b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj.result new file mode 100644 index 0000000000..b9f66a55a9 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObj.result @@ -0,0 +1,57 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + return op1(new R(new Entry())); + } + + public static Number op1(final R r) { + return r.e.getConst(); + } + + public Number getConst() { + return 1L; + } + + public String toString() { + return "Entry{}"; + } + + public static class R implements Record { + public Entry e; + + public R(final Entry _e) { + e = (_e != null) ? _e : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof R)) { + return false; + } + + R other = ((R) obj); + + return Utils.equals(e, other.e); + } + + public int hashCode() { + return Utils.hashCode(e); + } + + public R clone() { + return new R(e); + } + + public String toString() { + return "mk_Entry`R" + Utils.formatFields(e); + } + } +} + +########## diff --git a/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree new file mode 100644 index 0000000000..c4564f56d6 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree @@ -0,0 +1,25 @@ +class Entry + +types + +public R1 :: + r2 : R2; + +public R2 :: + r3 : R3; + +public R3 :: + e : [Entry]; + +operations + +public static Run : () ==> ? +Run () == op1(mk_R1(mk_R2(mk_R3(new Entry())))); + +public static op1 : R1 ==> nat +op1(r1) == r1.r2.r3.e.getConst(); + +public getConst: () ==> nat +getConst() == return 3; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree.result b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree.result new file mode 100644 index 0000000000..4602a3070d --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfThree.result @@ -0,0 +1,117 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + return op1(new R1(new R2(new R3(new Entry())))); + } + + public static Number op1(final R1 r1) { + return r1.r2.r3.e.getConst(); + } + + public Number getConst() { + return 3L; + } + + public String toString() { + return "Entry{}"; + } + + public static class R1 implements Record { + public R2 r2; + + public R1(final R2 _r2) { + r2 = (_r2 != null) ? Utils.clone(_r2) : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof R1)) { + return false; + } + + R1 other = ((R1) obj); + + return Utils.equals(r2, other.r2); + } + + public int hashCode() { + return Utils.hashCode(r2); + } + + public R1 clone() { + return new R1(r2); + } + + public String toString() { + return "mk_Entry`R1" + Utils.formatFields(r2); + } + } + + public static class R2 implements Record { + public R3 r3; + + public R2(final R3 _r3) { + r3 = (_r3 != null) ? Utils.clone(_r3) : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof R2)) { + return false; + } + + R2 other = ((R2) obj); + + return Utils.equals(r3, other.r3); + } + + public int hashCode() { + return Utils.hashCode(r3); + } + + public R2 clone() { + return new R2(r3); + } + + public String toString() { + return "mk_Entry`R2" + Utils.formatFields(r3); + } + } + + public static class R3 implements Record { + public Entry e; + + public R3(final Entry _e) { + e = (_e != null) ? _e : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof R3)) { + return false; + } + + R3 other = ((R3) obj); + + return Utils.equals(e, other.e); + } + + public int hashCode() { + return Utils.hashCode(e); + } + + public R3 clone() { + return new R3(e); + } + + public String toString() { + return "mk_Entry`R3" + Utils.formatFields(e); + } + } +} + +########## diff --git a/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo new file mode 100644 index 0000000000..bd273da9d3 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo @@ -0,0 +1,22 @@ +class Entry + +types + +public R1 :: + r2 : R2; + +public R2 :: + e : [Entry]; + +operations + +public static Run : () ==> ? +Run () == op1(mk_R1(mk_R2(new Entry()))); + +public static op1 : R1 ==> nat +op1(r1) == r1.r2.e.getConst(); + +public getConst: () ==> nat +getConst() == return 2; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo.result b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo.result new file mode 100644 index 0000000000..6960632d56 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/FieldDesignatorOfRecObjChainOfTwo.result @@ -0,0 +1,87 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + return op1(new R1(new R2(new Entry()))); + } + + public static Number op1(final R1 r1) { + return r1.r2.e.getConst(); + } + + public Number getConst() { + return 2L; + } + + public String toString() { + return "Entry{}"; + } + + public static class R1 implements Record { + public R2 r2; + + public R1(final R2 _r2) { + r2 = (_r2 != null) ? Utils.clone(_r2) : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof R1)) { + return false; + } + + R1 other = ((R1) obj); + + return Utils.equals(r2, other.r2); + } + + public int hashCode() { + return Utils.hashCode(r2); + } + + public R1 clone() { + return new R1(r2); + } + + public String toString() { + return "mk_Entry`R1" + Utils.formatFields(r2); + } + } + + public static class R2 implements Record { + public Entry e; + + public R2(final Entry _e) { + e = (_e != null) ? _e : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof R2)) { + return false; + } + + R2 other = ((R2) obj); + + return Utils.equals(e, other.e); + } + + public int hashCode() { + return Utils.hashCode(e); + } + + public R2 clone() { + return new R2(e); + } + + public String toString() { + return "mk_Entry`R2" + Utils.formatFields(e); + } + } +} + +########## From b53b41bf65c835a2e5d80e5bf66ff70873aa9939 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 00:09:33 +0100 Subject: [PATCH 70/90] Fix for IR construction of field object designators. The 'field' and 'module' needed to be accessed in a different way --- .../overture/codegen/visitor/ObjectDesignatorVisitorCG.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java index d3c7b0384b..26eae22fe8 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java @@ -27,7 +27,6 @@ import org.overture.ast.expressions.ANewExp; import org.overture.ast.expressions.AVariableExp; import org.overture.ast.expressions.PExp; -import org.overture.ast.intf.lex.ILexNameToken; import org.overture.ast.statements.AApplyObjectDesignator; import org.overture.ast.statements.AFieldObjectDesignator; import org.overture.ast.statements.AIdentifierObjectDesignator; @@ -74,11 +73,10 @@ public SObjectDesignatorCG caseAFieldObjectDesignator( AFieldObjectDesignator node, IRInfo question) throws AnalysisException { - ILexNameToken field = node.getField(); PObjectDesignator obj = node.getObject(); - String fieldCg = field.getName(); - String fieldModuleCg = field.getModule(); + String fieldCg = node.getFieldName().getName(); + String fieldModuleCg = node.getField() != null ? node.getField().getModule() : null; SObjectDesignatorCG objCg = obj.apply(question.getObjectDesignatorVisitor(), question); AFieldObjectDesignatorCG fieldObjDesignator = new AFieldObjectDesignatorCG(); From 8477ce54de4a60fba5621c1b7a0a24e0336cb7fe Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 00:13:12 +0100 Subject: [PATCH 71/90] Fix for finding the field type of a field expression when the 'object' is a record --- .../uniontypes/ObjectDesignatorToExpCG.java | 76 ++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java index ec83ec50e7..8b7f7c0aaf 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java @@ -42,10 +42,13 @@ import org.overture.codegen.cgast.statements.ASelfObjectDesignatorCG; import org.overture.codegen.cgast.types.AClassTypeCG; import org.overture.codegen.cgast.types.AMethodTypeCG; +import org.overture.codegen.cgast.types.ARecordTypeCG; +import org.overture.codegen.cgast.types.AUnknownTypeCG; import org.overture.codegen.cgast.types.SMapTypeCG; import org.overture.codegen.cgast.types.SSeqTypeCG; import org.overture.codegen.ir.IRInfo; import org.overture.codegen.ir.SourceNode; +import org.overture.codegen.logging.Logger; public class ObjectDesignatorToExpCG extends AnswerAdaptor { @@ -116,7 +119,78 @@ public SExpCG caseAFieldObjectDesignatorCG(AFieldObjectDesignatorCG node) fieldExpType = typeAssistant.getMethodType(info, classes, fieldModule, fieldName, args); } else { - fieldExpType = typeAssistant.getFieldType(classes, fieldModule, fieldName); + if (fieldModule != null) + { + // It is a class + fieldExpType = typeAssistant.getFieldType(classes, fieldModule, fieldName); + } + else + { + boolean error = false; + ARecordTypeCG recType = null; + + // It is a record so the obj must be an identifier or a field + if(obj instanceof AIdentifierObjectDesignatorCG) + { + SExpCG objId = ((AIdentifierObjectDesignatorCG) obj).getExp(); + recType = (ARecordTypeCG) objId.getType(); + } + else + { + List fieldNames = new LinkedList(); + SObjectDesignatorCG nextField = obj; + + while(nextField instanceof AFieldObjectDesignatorCG) + { + AFieldObjectDesignatorCG tmpField = (AFieldObjectDesignatorCG) nextField; + fieldNames.add(0, tmpField.getFieldName()); + nextField = tmpField.getObject(); + } + + if (nextField instanceof AIdentifierObjectDesignatorCG) + { + AIdentifierObjectDesignatorCG lastObj = ((AIdentifierObjectDesignatorCG) nextField); + + if (lastObj.getExp().getType() instanceof ARecordTypeCG) + { + recType = (ARecordTypeCG) lastObj.getExp().getType(); + + for (int i = 0; i < fieldNames.size(); i++) + { + String currentFieldName = fieldNames.get(i); + STypeCG currentFieldType = info.getTypeAssistant().getFieldType(classes, recType, currentFieldName); + + if (currentFieldType instanceof ARecordTypeCG) + { + recType = (ARecordTypeCG) currentFieldType; + } + else + { + error = true; + break; + } + } + + } + } + } + + if(!error && recType != null) + { + fieldExpType = info.getTypeAssistant().getFieldType(classes, recType, fieldName); + + if(fieldExpType == null) + { + Logger.getLog().printErrorln("Lookup of field type gave nothing in 'ObjectDesignatorToExpCG'"); + } + + } + else + { + Logger.getLog().printErrorln("Could not determine field type of field expression in 'ObjectDesignatorToExpCG'"); + fieldExpType = new AUnknownTypeCG(); + } + } } SExpCG objExp = obj.apply(this); From ce5a81882173b4a4a891dd2df5357d221ea02899 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 00:42:14 +0100 Subject: [PATCH 72/90] Correcting IR construction of the field object designator --- .../visitor/ObjectDesignatorVisitorCG.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java index 26eae22fe8..d921964990 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java @@ -75,8 +75,19 @@ public SObjectDesignatorCG caseAFieldObjectDesignator( { PObjectDesignator obj = node.getObject(); - String fieldCg = node.getFieldName().getName(); - String fieldModuleCg = node.getField() != null ? node.getField().getModule() : null; + String fieldCg = null; + String fieldModuleCg = null; + + if(node.getField() != null) + { + fieldCg = node.getField().getName(); + fieldModuleCg = node.getField().getModule(); + } + else + { + fieldCg = node.getFieldName() != null ? node.getFieldName().getName() : null; + } + SObjectDesignatorCG objCg = obj.apply(question.getObjectDesignatorVisitor(), question); AFieldObjectDesignatorCG fieldObjDesignator = new AFieldObjectDesignatorCG(); From 105de2a501f52328a7edcae4db3e251d80cdcb37 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Wed, 25 Feb 2015 13:07:45 +0100 Subject: [PATCH 73/90] added time elapsed to ct console messages --- .../internal/TraceTestEngine.java | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TraceTestEngine.java b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TraceTestEngine.java index 8baad12e69..ae6f8ab918 100644 --- a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TraceTestEngine.java +++ b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TraceTestEngine.java @@ -22,6 +22,7 @@ package org.overture.ide.plugins.combinatorialtesting.internal; import java.io.File; +import java.util.concurrent.TimeUnit; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; @@ -53,7 +54,7 @@ public void launch(final TraceExecutionSetup texe, @Override protected IStatus run(final IProgressMonitor monitor) { - monitor.beginTask("Executing trace: "+texe.traceName, 100); + monitor.beginTask("Executing trace: " + texe.traceName, 100); IPreferenceStore preferences = OvertureTracesPlugin.getDefault().getPreferenceStore(); if (!texe.coverageFolder.exists() @@ -75,6 +76,9 @@ protected IStatus run(final IProgressMonitor monitor) { port = 1213; } + + final long startTime = System.currentTimeMillis(); + conn = new ConnectionListener(port, new IClientMonitor() { int worked = 0; @@ -94,29 +98,43 @@ public void initialize(String module) public void progress(String traceName, Integer progress) { + long millis = System.currentTimeMillis() + - startTime; + + String elapsed = String.format("%d min, %d sec.", TimeUnit.MILLISECONDS.toMinutes(millis), TimeUnit.MILLISECONDS.toSeconds(millis) + - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))); + out.println(texe.project.getName() + ":" - + traceName + " Worked " + progress + "%"); + + traceName + " Worked " + progress + + "%. Time elapsed: " + elapsed); - int tmp = progress-worked; + int tmp = progress - worked; if (worked == 0) { worked = progress; } else { - worked = progress ; + worked = progress; } if (tmp > 100) { - tmp= 100; + tmp = 100; } monitor.worked(tmp); } public void completed() { + long millis = System.currentTimeMillis() + - startTime; + + String elapsed = String.format("%d min, %d sec.", TimeUnit.MILLISECONDS.toMinutes(millis), TimeUnit.MILLISECONDS.toSeconds(millis) + - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))); + out.println(texe.project.getName() - + " Completed execution"); + + " Completed execution. Time elapsed: " + + elapsed); monitor.done(); display.updateView(texe.project); From 13e14a8633073a4be0fe84d8e9e15dd814cdfebf Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Wed, 25 Feb 2015 13:08:16 +0100 Subject: [PATCH 74/90] added VM args preference option for CT --- .../OvertureTracesPlugin.java | 3 +++ .../internal/TestEngineDelegate.java | 18 +++++++++++++++++- .../WorkbenchPreferencePageMain.java | 4 ++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/OvertureTracesPlugin.java b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/OvertureTracesPlugin.java index 4a1cf86c9e..18e408deec 100644 --- a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/OvertureTracesPlugin.java +++ b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/OvertureTracesPlugin.java @@ -27,6 +27,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.overture.ide.debug.core.IDebugConstants; /** * The activator class controls the plug-in life cycle @@ -151,6 +152,8 @@ public static void initializeDefaultMainPreferences(IPreferenceStore store) store.setDefault(ITracesConstants.TRACE_REDUCTION_TYPE, ITracesConstants.TRACE_REDUCTION_DEFAULT_TYPE); store.setDefault(ITracesConstants.TRACE_SEED, ITracesConstants.TRACE_FILTERING_DEFAULT_SEED); store.setDefault(ITracesConstants.TRACE_SUBSET_LIMITATION, ITracesConstants.TRACE_SUBSET_LIMITATION_DEFAULT); + store.setDefault(IDebugConstants.VDM_LAUNCH_CONFIG_VM_MEMORY_OPTION, ""); + } } diff --git a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TestEngineDelegate.java b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TestEngineDelegate.java index 3f7bade52a..cd87132606 100644 --- a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TestEngineDelegate.java +++ b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/internal/TestEngineDelegate.java @@ -38,6 +38,7 @@ import org.overture.combinatorialtesting.vdmj.server.common.Utils; import org.overture.ide.core.resources.IVdmProject; import org.overture.ide.core.resources.IVdmSourceUnit; +import org.overture.ide.debug.core.IDebugConstants; import org.overture.ide.debug.core.IDebugPreferenceConstants; import org.overture.ide.debug.core.VdmDebugPlugin; import org.overture.ide.debug.core.launching.VdmLaunchConfigurationDelegate; @@ -191,7 +192,22 @@ private List initializeLaunch(TraceExecutionSetup texe, private Collection getVmArguments( IPreferenceStore preferences) { - return new Vector(); + List options = new Vector(); + String opt = preferences.getString(IDebugConstants.VDM_LAUNCH_CONFIG_VM_MEMORY_OPTION); + if (opt.trim().length() != 0) + { + String[] opts = opt.split(" "); + for (String o : opts) + { + o = o.trim(); + if (o.startsWith("-")) + { + options.add(o); + } + } + } + + return options; } private synchronized int getSessionId() diff --git a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/preferences/WorkbenchPreferencePageMain.java b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/preferences/WorkbenchPreferencePageMain.java index 282e170dad..39a913390e 100644 --- a/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/preferences/WorkbenchPreferencePageMain.java +++ b/ide/plugins/combinatorialtesting/src/main/java/org/overture/ide/plugins/combinatorialtesting/preferences/WorkbenchPreferencePageMain.java @@ -29,8 +29,10 @@ import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; +import org.overture.ide.debug.core.IDebugConstants; import org.overture.ide.plugins.combinatorialtesting.ITracesConstants; import org.overture.ide.plugins.combinatorialtesting.OvertureTracesPlugin; import org.overture.interpreter.traces.TraceReductionType; @@ -82,6 +84,8 @@ protected void createFieldEditors() IntegerFieldEditor subsetLimitation = new IntegerFieldEditor(ITracesConstants.TRACE_SUBSET_LIMITATION, "Subset limitation (%)", getFieldEditorParent()); subsetLimitation.setValidRange(1, 100); addField(subsetLimitation); + + addField(new StringFieldEditor(IDebugConstants.VDM_LAUNCH_CONFIG_VM_MEMORY_OPTION, "Additional VM arguments:", getFieldEditorParent())); } @Override From f889f223a48ad90943b1e37111a8ccb7e802ccb9 Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Wed, 25 Feb 2015 15:56:40 +0100 Subject: [PATCH 75/90] added comment to error message from ct test when the trace container isnt named correctly --- .../java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java index 60c9522913..a620fb9d9c 100644 --- a/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java +++ b/core/combinatorialtesting/ctruntime/src/test/java/org/overture/ct/ctruntime/tests/CtTestCaseBase.java @@ -218,7 +218,7 @@ public File computeActualResults(final String spec) throws IOException, final String message = data.getMessage(); - Assert.assertTrue("Test did not succed", message.contains("status=\"completed\" progress=\"100\"")); + Assert.assertTrue("Test did not succed. Are you sure that it contains "+ (Settings.dialect==Dialect.VDM_SL?"'DEFAULT`T1'" : "'Entry`T1'"), message.contains("status=\"completed\" progress=\"100\"")); return actualOutputFile; } From e462395f3c65df811e3b40454560a1d92567eb2f Mon Sep 17 00:00:00 2001 From: Kenneth Lausdahl Date: Wed, 25 Feb 2015 16:00:37 +0100 Subject: [PATCH 76/90] added a fix to try to catch deadlocked signals during ct execution. It is the case that the CTMain thread either gets a TERMINATE or DEADLOCKED signal and then a thread Death exception. However, this is nondeterministic, but in either case the setSignal is called prior to the ThreadDeathException with the DEADLOCKED signal. I added an overriden method to catch the signal this way it always reports the DEADLOCKED status + Verdict FAILED when it reaches a DEADLOCK no matter which signal comes first --- .../no_reduction_pp_specs/DeadlockTest | 40 +++++++++++++++++++ .../no_reduction_pp_specs/DeadlockTest.result | 9 +++++ .../interpreter/scheduler/CTMainThread.java | 25 +++++++++++- 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest create mode 100644 core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest.result diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest new file mode 100644 index 0000000000..1d6daaa28a --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest @@ -0,0 +1,40 @@ +class Entry +instance variables + x:nat := 0; + +operations + public deadlock: () ==> () + deadlock() == skip; + + public runtime: () ==> real + runtime() == return 123/x; + + public runtime2: () ==> real + runtime2() == return runtime(); + + public go: () ==> () + go() == ( start(self); finished() ); + + finished: () ==> () + finished() == skip; + + get: () ==> nat + get() == return x; + + inc: () ==> () + inc() == x := x + 1; + +sync + per deadlock => #fin(deadlock) > 0; + per finished => x > 0; + +thread + deadlock(); + +traces + T1: get(); deadlock(); get(); + --T1: get(); runtime(); get(); + --T1: get(); go(); get(); + --T1: inc(){1,3}; get() + +end Entry \ No newline at end of file diff --git a/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest.result b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest.result new file mode 100644 index 0000000000..1fb6caf871 --- /dev/null +++ b/core/combinatorialtesting/ctruntime/src/test/resources/no_reduction_pp_specs/DeadlockTest.result @@ -0,0 +1,9 @@ + + + + get(); deadlock(); get() + 0 ; DEADLOCK detected + + + + diff --git a/core/interpreter/src/main/java/org/overture/interpreter/scheduler/CTMainThread.java b/core/interpreter/src/main/java/org/overture/interpreter/scheduler/CTMainThread.java index cb35ec5426..dc1fc44113 100644 --- a/core/interpreter/src/main/java/org/overture/interpreter/scheduler/CTMainThread.java +++ b/core/interpreter/src/main/java/org/overture/interpreter/scheduler/CTMainThread.java @@ -157,6 +157,10 @@ public void body() } } catch (Throwable e) { + if (e instanceof ThreadDeath) + { + return; + } if (result.lastIndexOf(Verdict.FAILED) < 0) { if (!getExceptions().isEmpty()) @@ -172,13 +176,30 @@ public void body() } } + @Override + public synchronized void setSignal(Signal sig) + { + if (sig == Signal.DEADLOCKED) + { + if (result.lastIndexOf(Verdict.FAILED) < 0) + { + result.add("DEADLOCK detected"); + result.add(Verdict.FAILED); + } + } + super.setSignal(sig); + } + @Override protected void handleSignal(Signal sig, Context lctxt, ILexLocation location) { if (sig == Signal.DEADLOCKED) { - result.add("DEADLOCK detected"); - result.add(Verdict.FAILED); + if (result.lastIndexOf(Verdict.FAILED) < 0) + { + result.add("DEADLOCK detected"); + result.add(Verdict.FAILED); + } } super.handleSignal(sig, lctxt, location); From bce4342ba6424529739a9af2d632fe256867db16 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 22:22:54 +0100 Subject: [PATCH 77/90] Guarding against null checks in the IR construction of expressions --- .../codegen/visitor/ExpVisitorCG.java | 78 +++++++++++++++---- 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java index add34aa46c..7d830efc96 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java @@ -432,7 +432,14 @@ public SExpCG caseASetEnumSetExp(ASetEnumSetExp node, IRInfo question) for (PExp member : members) { - membersCg.add(member.apply(question.getExpVisitor(), question)); + SExpCG memberCg = member.apply(question.getExpVisitor(), question); + if (memberCg != null) + { + membersCg.add(memberCg); + } else + { + return null; + } } return enumSet; @@ -666,7 +673,15 @@ public SExpCG caseATupleExp(ATupleExp node, IRInfo question) for (PExp exp : args) { SExpCG expCg = exp.apply(question.getExpVisitor(), question); - tupleExp.getArgs().add(expCg); + + if (expCg != null) + { + tupleExp.getArgs().add(expCg); + } + else + { + return null; + } } return tupleExp; @@ -707,7 +722,14 @@ public SExpCG caseAFuncInstatiationExp(AFuncInstatiationExp node, for (PType actualType : actualTypes) { STypeCG actualTypeCg = actualType.apply(question.getTypeVisitor(), question); - methodInst.getActualTypes().add(actualTypeCg); + + if (actualTypeCg != null) + { + methodInst.getActualTypes().add(actualTypeCg); + } else + { + return null; + } } methodInst.setFunc(funcCg); @@ -856,7 +878,15 @@ public SExpCG caseAMkTypeExp(AMkTypeExp node, IRInfo question) for (PExp arg : nodeArgs) { - newExpArgs.add(arg.apply(question.getExpVisitor(), question)); + SExpCG argCg = arg.apply(question.getExpVisitor(), question); + + if (argCg != null) + { + newExpArgs.add(argCg); + } else + { + return null; + } } return newExp; @@ -1009,16 +1039,18 @@ public SExpCG caseAMapEnumMapExp(AMapEnumMapExp node, IRInfo question) LinkedList members = node.getMembers(); for (PExp member : members) { - SExpCG exp = member.apply(question.getExpVisitor(), question); + SExpCG memberCg = member.apply(question.getExpVisitor(), question); - if (!(exp instanceof AMapletExpCG)) + if (!(memberCg instanceof AMapletExpCG)) { question.addUnsupportedNode(node, - "Got expected map enumeration member: " + exp); + "Got expected map enumeration member: " + memberCg); return null; } - - enumMap.getMembers().add((AMapletExpCG) exp); + else + { + enumMap.getMembers().add((AMapletExpCG) memberCg); + } } return enumMap; @@ -1091,6 +1123,7 @@ public SExpCG caseAMapCompMapExp(AMapCompMapExp node, IRInfo question) { question.addUnsupportedNode(node, "Generation of map comprehension expected a maplet expression. Got: " + firstCg); + return null; } AMapletExpCG mapletExpCg = (AMapletExpCG) firstCg; @@ -1213,12 +1246,14 @@ public SExpCG caseASeqEnumSeqExp(ASeqEnumSeqExp node, IRInfo question) { SExpCG memberCg = member.apply(question.getExpVisitor(), question); - if(memberCg == null) + if(memberCg != null) + { + enumSeq.getMembers().add(memberCg); + } + else { return null; } - - enumSeq.getMembers().add(memberCg); } return enumSeq; @@ -1275,14 +1310,15 @@ public SExpCG caseAApplyExp(AApplyExp node, IRInfo question) { SExpCG argCg = arg.apply(question.getExpVisitor(), question); - if (argCg == null) + if (argCg != null) + { + applyExp.getArgs().add(argCg); + } + else { - question.addUnsupportedNode(node, "Apply expression is not supported for the argument: " - + arg); return null; } - applyExp.getArgs().add(argCg); } return applyExp; @@ -1398,7 +1434,15 @@ public SExpCG caseANewExp(ANewExp node, IRInfo question) LinkedList newExpArgs = newExp.getArgs(); for (PExp arg : nodeArgs) { - newExpArgs.add(arg.apply(question.getExpVisitor(), question)); + SExpCG argCg = arg.apply(question.getExpVisitor(), question); + + if (argCg != null) + { + newExpArgs.add(argCg); + } else + { + return null; + } } return newExp; From 07838a1ddaaf59c53718e472165106e25ee5488e Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 22:24:17 +0100 Subject: [PATCH 78/90] Added convenience method to look up a field declaration in class --- .../overture/codegen/assistant/DeclAssistantCG.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java index cc702ff00a..92d1cd7420 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/DeclAssistantCG.java @@ -418,6 +418,19 @@ public AFieldDeclCG getFieldDecl(List classes, return record.getFields().get(number); } + + public AFieldDeclCG getFieldDecl(AClassDeclCG clazz, String fieldName) + { + for(AFieldDeclCG field : clazz.getFields()) + { + if(field.getName().equals(fieldName)) + { + return field; + } + } + + return null; + } public AFieldDeclCG getFieldDecl(List classes, ARecordTypeCG recordType, String memberName) From 310962b5e791b31f083b8c1ebe34b1d96ec7e0d9 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 22:33:58 +0100 Subject: [PATCH 79/90] Fix to construction of field expression types --- .../codegen/assistant/TypeAssistantCG.java | 139 +++++++++++++++--- .../uniontypes/ObjectDesignatorToExpCG.java | 89 +---------- 2 files changed, 128 insertions(+), 100 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java index b763efc23f..6fb4ff89e5 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java @@ -39,6 +39,7 @@ import org.overture.ast.types.PType; import org.overture.ast.types.SSeqTypeBase; import org.overture.ast.util.PTypeSet; +import org.overture.codegen.cgast.INode; import org.overture.codegen.cgast.SExpCG; import org.overture.codegen.cgast.SObjectDesignatorCG; import org.overture.codegen.cgast.STypeCG; @@ -75,6 +76,7 @@ import org.overture.codegen.cgast.types.ATokenBasicTypeCG; import org.overture.codegen.cgast.types.ATupleTypeCG; import org.overture.codegen.cgast.types.AUnionTypeCG; +import org.overture.codegen.cgast.types.AUnknownTypeCG; import org.overture.codegen.cgast.types.SBasicTypeCG; import org.overture.codegen.cgast.types.SMapTypeCG; import org.overture.codegen.cgast.types.SSeqTypeCG; @@ -93,6 +95,114 @@ public TypeAssistantCG(AssistantManager assistantManager) super(assistantManager); } + public STypeCG getFieldExpType(IRInfo info, List classes, String fieldName, String fieldModule, + SObjectDesignatorCG obj, INode parent) + throws AnalysisException, org.overture.codegen.cgast.analysis.AnalysisException + { + if (parent instanceof AApplyObjectDesignatorCG) + { + AApplyObjectDesignatorCG apply = (AApplyObjectDesignatorCG) parent; + LinkedList args = apply.getArgs(); + + if (fieldModule != null) + { + // It is a class + AClassDeclCG clazz = info.getDeclAssistant().findClass(classes, fieldModule); + AFieldDeclCG field = info.getDeclAssistant().getFieldDecl(clazz, fieldModule); + + if(field != null) + { + return field.getType().clone(); + } + else + { + // It must be a method + return info.getTypeAssistant().getMethodType(info, classes, fieldModule, fieldName, args); + } + } + } + return getFieldType(info, classes, fieldName, fieldModule, obj); + } + + private STypeCG getFieldType(IRInfo info, List classes, String fieldName, String fieldModule, + SObjectDesignatorCG obj) + { + STypeCG fieldExpType; + if (fieldModule != null) + { + // It is a class + fieldExpType = info.getTypeAssistant().getFieldType(classes, fieldModule, fieldName); + } + else + { + boolean error = false; + ARecordTypeCG recType = null; + + // It is a record so the obj must be an identifier or a field + if(obj instanceof AIdentifierObjectDesignatorCG) + { + SExpCG objId = ((AIdentifierObjectDesignatorCG) obj).getExp(); + recType = (ARecordTypeCG) objId.getType(); + } + else + { + List fieldNames = new LinkedList(); + SObjectDesignatorCG nextField = obj; + + while(nextField instanceof AFieldObjectDesignatorCG) + { + AFieldObjectDesignatorCG tmpField = (AFieldObjectDesignatorCG) nextField; + fieldNames.add(0, tmpField.getFieldName()); + nextField = tmpField.getObject(); + } + + if (nextField instanceof AIdentifierObjectDesignatorCG) + { + AIdentifierObjectDesignatorCG lastObj = ((AIdentifierObjectDesignatorCG) nextField); + + if (lastObj.getExp().getType() instanceof ARecordTypeCG) + { + recType = (ARecordTypeCG) lastObj.getExp().getType(); + + for (int i = 0; i < fieldNames.size(); i++) + { + String currentFieldName = fieldNames.get(i); + STypeCG currentFieldType = info.getTypeAssistant().getFieldType(classes, recType, currentFieldName); + + if (currentFieldType instanceof ARecordTypeCG) + { + recType = (ARecordTypeCG) currentFieldType; + } + else + { + error = true; + break; + } + } + + } + } + } + + if(!error && recType != null) + { + fieldExpType = info.getTypeAssistant().getFieldType(classes, recType, fieldName); + + if(fieldExpType == null) + { + Logger.getLog().printErrorln("Lookup of field type gave nothing in 'ObjectDesignatorToExpCG'"); + } + + } + else + { + Logger.getLog().printErrorln("Could not determine field type of field expression in 'ObjectDesignatorToExpCG'"); + fieldExpType = new AUnknownTypeCG(); + } + } + return fieldExpType; + } + public AMethodTypeCG getMethodType(IRInfo info, List classes, String fieldModule, String fieldName, List args) throws org.overture.codegen.cgast.analysis.AnalysisException @@ -358,7 +468,15 @@ public STypeCG findElementType(AApplyObjectDesignatorCG designator, AFieldObjectDesignatorCG fieldObj = (AFieldObjectDesignatorCG) object; object = fieldObj.getObject(); - return findElementType(classes, info, appliesCount, mostRecentApply, fieldObj); + try + { + return findElementType(classes, info, appliesCount, mostRecentApply, fieldObj); + } catch (AnalysisException + | org.overture.codegen.cgast.analysis.AnalysisException e) + { + Logger.getLog().printErrorln("Could not determine element type of " + fieldObj + " in 'TypeAssistantCG'"); + return null; + } } else { return null; @@ -404,24 +522,11 @@ private STypeCG findElementType(int appliesCount, STypeCG type) private STypeCG findElementType(List classes, IRInfo info, int appliesCount, AApplyObjectDesignatorCG mostRecentApply, - AFieldObjectDesignatorCG fieldObj) + AFieldObjectDesignatorCG fieldObj) throws AnalysisException, org.overture.codegen.cgast.analysis.AnalysisException { - try - { - STypeCG type = getFieldType(classes, fieldObj.getFieldModule(), fieldObj.getFieldName()); + STypeCG type = getFieldExpType(info, classes, fieldObj.getFieldName(), fieldObj.getFieldModule(), fieldObj.getObject(), fieldObj.parent()); - if (type == null) - { - type = getMethodType(info, classes, fieldObj.getFieldModule(), fieldObj.getFieldName(), mostRecentApply.getArgs()); - } - - return findElementType(appliesCount, type); - - } catch (org.overture.codegen.cgast.analysis.AnalysisException e) - { - e.printStackTrace(); - return null; - } + return findElementType(appliesCount, type); } public PType getType(IRInfo question, AUnionType unionType, PPattern pattern) diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java index 8b7f7c0aaf..91fd5c051b 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/ObjectDesignatorToExpCG.java @@ -24,7 +24,6 @@ import java.util.LinkedList; import java.util.List; -import org.overture.codegen.assistant.TypeAssistantCG; import org.overture.codegen.cgast.INode; import org.overture.codegen.cgast.SExpCG; import org.overture.codegen.cgast.SObjectDesignatorCG; @@ -42,7 +41,6 @@ import org.overture.codegen.cgast.statements.ASelfObjectDesignatorCG; import org.overture.codegen.cgast.types.AClassTypeCG; import org.overture.codegen.cgast.types.AMethodTypeCG; -import org.overture.codegen.cgast.types.ARecordTypeCG; import org.overture.codegen.cgast.types.AUnknownTypeCG; import org.overture.codegen.cgast.types.SMapTypeCG; import org.overture.codegen.cgast.types.SSeqTypeCG; @@ -106,91 +104,16 @@ public SExpCG caseAFieldObjectDesignatorCG(AFieldObjectDesignatorCG node) SObjectDesignatorCG obj = node.getObject(); SourceNode sourceNode = node.getSourceNode(); - STypeCG fieldExpType = null; - - TypeAssistantCG typeAssistant = info.getAssistantManager().getTypeAssistant(); - INode parent = node.parent(); - if (parent instanceof AApplyObjectDesignatorCG) + STypeCG fieldExpType = null; + try { - AApplyObjectDesignatorCG apply = (AApplyObjectDesignatorCG) parent; - LinkedList args = apply.getArgs(); - fieldExpType = typeAssistant.getMethodType(info, classes, fieldModule, fieldName, args); - } else + fieldExpType = info.getTypeAssistant().getFieldExpType(info, classes, fieldName, fieldModule, obj, parent); + } catch (org.overture.ast.analysis.AnalysisException e) { - if (fieldModule != null) - { - // It is a class - fieldExpType = typeAssistant.getFieldType(classes, fieldModule, fieldName); - } - else - { - boolean error = false; - ARecordTypeCG recType = null; - - // It is a record so the obj must be an identifier or a field - if(obj instanceof AIdentifierObjectDesignatorCG) - { - SExpCG objId = ((AIdentifierObjectDesignatorCG) obj).getExp(); - recType = (ARecordTypeCG) objId.getType(); - } - else - { - List fieldNames = new LinkedList(); - SObjectDesignatorCG nextField = obj; - - while(nextField instanceof AFieldObjectDesignatorCG) - { - AFieldObjectDesignatorCG tmpField = (AFieldObjectDesignatorCG) nextField; - fieldNames.add(0, tmpField.getFieldName()); - nextField = tmpField.getObject(); - } - - if (nextField instanceof AIdentifierObjectDesignatorCG) - { - AIdentifierObjectDesignatorCG lastObj = ((AIdentifierObjectDesignatorCG) nextField); - - if (lastObj.getExp().getType() instanceof ARecordTypeCG) - { - recType = (ARecordTypeCG) lastObj.getExp().getType(); - - for (int i = 0; i < fieldNames.size(); i++) - { - String currentFieldName = fieldNames.get(i); - STypeCG currentFieldType = info.getTypeAssistant().getFieldType(classes, recType, currentFieldName); - - if (currentFieldType instanceof ARecordTypeCG) - { - recType = (ARecordTypeCG) currentFieldType; - } - else - { - error = true; - break; - } - } - - } - } - } - - if(!error && recType != null) - { - fieldExpType = info.getTypeAssistant().getFieldType(classes, recType, fieldName); - - if(fieldExpType == null) - { - Logger.getLog().printErrorln("Lookup of field type gave nothing in 'ObjectDesignatorToExpCG'"); - } - - } - else - { - Logger.getLog().printErrorln("Could not determine field type of field expression in 'ObjectDesignatorToExpCG'"); - fieldExpType = new AUnknownTypeCG(); - } - } + Logger.getLog().printErrorln("Could not find field expression type of " + node + " in 'ObjectDesignatorToExpCG'"); + fieldExpType = new AUnknownTypeCG(); } SExpCG objExp = obj.apply(this); From 15d64e538c798087e3c209e2487c999e3361e1e8 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Wed, 25 Feb 2015 23:49:58 +0100 Subject: [PATCH 80/90] Simplified construction of field expressions types using visitors --- .../codegen/assistant/TypeAssistantCG.java | 82 +++++-------------- 1 file changed, 20 insertions(+), 62 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java index 6fb4ff89e5..bc6af50b23 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java @@ -84,6 +84,7 @@ import org.overture.codegen.ir.IRInfo; import org.overture.codegen.ir.SourceNode; import org.overture.codegen.logging.Logger; +import org.overture.codegen.trans.uniontypes.ObjectDesignatorToExpCG; import org.overture.typechecker.TypeComparator; import org.overture.typechecker.assistant.definition.PDefinitionAssistantTC; import org.overture.typechecker.assistant.type.PTypeAssistantTC; @@ -124,83 +125,40 @@ public STypeCG getFieldExpType(IRInfo info, List classes, String f return getFieldType(info, classes, fieldName, fieldModule, obj); } - private STypeCG getFieldType(IRInfo info, List classes, String fieldName, String fieldModule, - SObjectDesignatorCG obj) + private STypeCG getFieldType(IRInfo info, List classes, + String fieldName, String fieldModule, SObjectDesignatorCG obj) { - STypeCG fieldExpType; if (fieldModule != null) { // It is a class - fieldExpType = info.getTypeAssistant().getFieldType(classes, fieldModule, fieldName); - } - else + return info.getTypeAssistant().getFieldType(classes, fieldModule, fieldName); + } else { - boolean error = false; - ARecordTypeCG recType = null; - - // It is a record so the obj must be an identifier or a field - if(obj instanceof AIdentifierObjectDesignatorCG) - { - SExpCG objId = ((AIdentifierObjectDesignatorCG) obj).getExp(); - recType = (ARecordTypeCG) objId.getType(); - } - else + // It is a record + try { - List fieldNames = new LinkedList(); - SObjectDesignatorCG nextField = obj; - - while(nextField instanceof AFieldObjectDesignatorCG) - { - AFieldObjectDesignatorCG tmpField = (AFieldObjectDesignatorCG) nextField; - fieldNames.add(0, tmpField.getFieldName()); - nextField = tmpField.getObject(); - } + ObjectDesignatorToExpCG converter = new ObjectDesignatorToExpCG(info, classes); + SExpCG objExp = obj.apply(converter); - if (nextField instanceof AIdentifierObjectDesignatorCG) + if (objExp.getType() instanceof ARecordTypeCG) { - AIdentifierObjectDesignatorCG lastObj = ((AIdentifierObjectDesignatorCG) nextField); - - if (lastObj.getExp().getType() instanceof ARecordTypeCG) - { - recType = (ARecordTypeCG) lastObj.getExp().getType(); - - for (int i = 0; i < fieldNames.size(); i++) - { - String currentFieldName = fieldNames.get(i); - STypeCG currentFieldType = info.getTypeAssistant().getFieldType(classes, recType, currentFieldName); - - if (currentFieldType instanceof ARecordTypeCG) - { - recType = (ARecordTypeCG) currentFieldType; - } - else - { - error = true; - break; - } - } + STypeCG fieldExpType = info.getTypeAssistant().getFieldType(classes, (ARecordTypeCG) objExp.getType(), fieldName); + if (fieldExpType == null) + { + Logger.getLog().printErrorln("Lookup of field type gave nothing in 'TypeAssistantCG'"); } - } - } - - if(!error && recType != null) - { - fieldExpType = info.getTypeAssistant().getFieldType(classes, recType, fieldName); - if(fieldExpType == null) - { - Logger.getLog().printErrorln("Lookup of field type gave nothing in 'ObjectDesignatorToExpCG'"); + return fieldExpType; } - - } - else + } + catch (org.overture.codegen.cgast.analysis.AnalysisException e) { - Logger.getLog().printErrorln("Could not determine field type of field expression in 'ObjectDesignatorToExpCG'"); - fieldExpType = new AUnknownTypeCG(); } } - return fieldExpType; + + Logger.getLog().printErrorln("Could not determine field type of field expression in 'TypeAssistantCG'"); + return new AUnknownTypeCG(); } public AMethodTypeCG getMethodType(IRInfo info, List classes, From 01a8cd26d12ef540ff021728caafb9e1a97e2df4 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 00:17:40 +0100 Subject: [PATCH 81/90] Updated test results related to generation of object designators --- .../resources/classic_specs/CashDispenserPP.result | 6 +++--- .../resources/cloning_specs/CashDispenserPP.result | 6 +++--- .../ApplyObjectDesignatorClone.result | 4 ++-- .../ApplyObjectDesignatorMapLookup.result | 2 +- .../ApplyObjectDesignatorMapType.result | 14 ++++++++------ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/core/codegen/src/test/resources/classic_specs/CashDispenserPP.result b/core/codegen/src/test/resources/classic_specs/CashDispenserPP.result index 3807366f65..678c85d2a6 100644 --- a/core/codegen/src/test/resources/classic_specs/CashDispenserPP.result +++ b/core/codegen/src/test/resources/classic_specs/CashDispenserPP.result @@ -49,7 +49,7 @@ public class SimpleTest { Number pglid1 = 1L; resource.AddAccount(pglid1, pglacc1); resource.AddLetterbox(clock, new Letterbox()); - ((Till) tills.get(1L)).InsertCard(c1); + ((Till) MapUtil.get(tills, 1L)).InsertCard(c1); if (Utils.equals(((Till) MapUtil.get(tills, 1L)).Validate( 123456L), quotes.PinOk.getInstance())) { @@ -346,7 +346,7 @@ public class CentralResource { public Number GetBalance(final Number accountId) { if (MapUtil.dom(Utils.clone(accounts)).contains(accountId)) { - return ((Account) accounts.get(accountId)).GetBalance(); + return ((Account) MapUtil.get(accounts, accountId)).GetBalance(); } else { return null; } @@ -355,7 +355,7 @@ public class CentralResource { public Boolean Withdrawal(final Number accountId, final Number cardId, final Number amount) { if (IsLegalCard(accountId, cardId)) { - return ((Account) accounts.get(accountId)).Withdrawal(cardId, + return ((Account) MapUtil.get(accounts, accountId)).Withdrawal(cardId, amount, clock.GetDate()); } else { return false; diff --git a/core/codegen/src/test/resources/cloning_specs/CashDispenserPP.result b/core/codegen/src/test/resources/cloning_specs/CashDispenserPP.result index e61c9bc022..45306dc236 100644 --- a/core/codegen/src/test/resources/cloning_specs/CashDispenserPP.result +++ b/core/codegen/src/test/resources/cloning_specs/CashDispenserPP.result @@ -49,7 +49,7 @@ public class SimpleTest { Number pglid1 = 1L; resource.AddAccount(pglid1, pglacc1); resource.AddLetterbox(clock, new Letterbox()); - ((Till) tills.get(1L)).InsertCard(c1); + ((Till) MapUtil.get(tills, 1L)).InsertCard(c1); if (Utils.equals(((Till) MapUtil.get(tills, 1L)).Validate( 123456L), quotes.PinOk.getInstance())) { @@ -341,7 +341,7 @@ public class CentralResource { public Number GetBalance(final Number accountId) { if (MapUtil.dom(accounts).contains(accountId)) { - return ((Account) accounts.get(accountId)).GetBalance(); + return ((Account) MapUtil.get(accounts, accountId)).GetBalance(); } else { return null; } @@ -350,7 +350,7 @@ public class CentralResource { public Boolean Withdrawal(final Number accountId, final Number cardId, final Number amount) { if (IsLegalCard(accountId, cardId)) { - return ((Account) accounts.get(accountId)).Withdrawal(cardId, + return ((Account) MapUtil.get(accounts, accountId)).Withdrawal(cardId, amount, clock.GetDate()); } else { return false; diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorClone.result b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorClone.result index b840e594b3..af5c0856c2 100644 --- a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorClone.result +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorClone.result @@ -17,14 +17,14 @@ public class A { public Number op1() { Tuple a = Tuple.mk_(1L, 2L); - return ((A) x.get(a)).no(); + return ((A) MapUtil.get(x, a)).no(); } public Number op2() { Tuple a = Tuple.mk_('x', 'y'); Tuple b = Tuple.mk_(1L, 2L); - return ((A) m(Utils.clone(a), Utils.clone(a)).get(b)).no(); + return ((A) MapUtil.get(m(Utils.clone(a), Utils.clone(a)), b)).no(); } public VDMMap m(final Tuple p, final Tuple q) { diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapLookup.result b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapLookup.result index ac5e4ddb66..dcbcb01dce 100644 --- a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapLookup.result +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapLookup.result @@ -48,7 +48,7 @@ public class Entry { public static Object Run() { Storage s = new Storage(); - return ((X) s.getXs().get(1L)).fun(); + return ((X) MapUtil.get(s.getXs(), 1L)).fun(); } public String toString() { diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapType.result b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapType.result index a909f1afdb..a1a2ebbe54 100644 --- a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapType.result +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorMapType.result @@ -15,15 +15,16 @@ public class X { } public Number m1() { - return ((X) xs.get(1L)).f(); + return ((X) MapUtil.get(xs, 1L)).f(); } public Number m2() { - return ((X) ((VDMMap) ys.get(1L)).get(1L)).f(); + return ((X) MapUtil.get(((VDMMap) MapUtil.get(ys, 1L)), 1L)).f(); } public Number m3() { - return ((X) ((VDMMap) ((VDMMap) zs.get(1L)).get(1L)).get(1L)).f(); + return ((X) MapUtil.get(((VDMMap) MapUtil.get( + ((VDMMap) MapUtil.get(zs, 1L)), 1L)), 1L)).f(); } public Number m4() { @@ -31,15 +32,16 @@ public class X { } public Number m5() { - return ((X) map_xs(1L, 2L).get(1L)).f(); + return ((X) MapUtil.get(map_xs(1L, 2L), 1L)).f(); } public Number m6() { - return ((X) ((VDMMap) map_ys(1L, 2L).get(1L)).get(1L)).f(); + return ((X) MapUtil.get(((VDMMap) MapUtil.get(map_ys(1L, 2L), 1L)), 1L)).f(); } public Number m7() { - return ((X) ((VDMMap) ((VDMMap) map_zs(1L, 2L).get(1L)).get(1L)).get(1L)).f(); + return ((X) MapUtil.get(((VDMMap) MapUtil.get( + ((VDMMap) MapUtil.get(map_zs(1L, 2L), 1L)), 1L)), 1L)).f(); } public VDMMap map_xs(final Number pa, final Number pb) { From 9261302c076304a3a189ec77bd20931fadde38bc Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 00:39:09 +0100 Subject: [PATCH 82/90] Added test revealing problem with generation of object designators --- .../ApplyObjectDesignatorWithRecFieldObj1 | 23 ++++++++ ...plyObjectDesignatorWithRecFieldObj1.result | 59 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1 create mode 100644 core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1.result diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1 b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1 new file mode 100644 index 0000000000..5e4d60a1b9 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1 @@ -0,0 +1,23 @@ +class Entry + +types + +public +A :: + es : seq of Entry; + +operations + +public static Run : () ==> ? +Run () == +let a = mk_A([new Entry()]) +in + op(a); + +public static op : A ==> nat +op (a) == a.es(1).getConst(); + +public getConst : () ==> nat +getConst () == return 5; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1.result b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1.result new file mode 100644 index 0000000000..3ef5f80dd5 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj1.result @@ -0,0 +1,59 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + A a = new A(SeqUtil.seq(new Entry())); + + return op(Utils.clone(a)); + } + + public static Number op(final A a) { + return ((Entry) a.es.get(Utils.index(1L))).getConst(); + } + + public Number getConst() { + return 5L; + } + + public String toString() { + return "Entry{}"; + } + + public static class A implements Record { + public VDMSeq es; + + public A(final VDMSeq _es) { + es = (_es != null) ? Utils.clone(_es) : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof A)) { + return false; + } + + A other = ((A) obj); + + return Utils.equals(es, other.es); + } + + public int hashCode() { + return Utils.hashCode(es); + } + + public A clone() { + return new A(es); + } + + public String toString() { + return "mk_Entry`A" + Utils.formatFields(es); + } + } +} + +########## From 79a249c04a892cc308b24bd72b0867e51774ad94 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 00:41:13 +0100 Subject: [PATCH 83/90] Added IR transformation to replace object designators in call object statements --- .../trans/CallObjStmTransformation.java | 44 +++++++++++++++++++ .../codegen/vdm2java/JavaTransSeries.java | 3 ++ 2 files changed, 47 insertions(+) create mode 100644 core/codegen/src/main/java/org/overture/codegen/trans/CallObjStmTransformation.java diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/CallObjStmTransformation.java b/core/codegen/src/main/java/org/overture/codegen/trans/CallObjStmTransformation.java new file mode 100644 index 0000000000..89c2fd428f --- /dev/null +++ b/core/codegen/src/main/java/org/overture/codegen/trans/CallObjStmTransformation.java @@ -0,0 +1,44 @@ +package org.overture.codegen.trans; + +import java.util.List; + +import org.overture.codegen.cgast.analysis.AnalysisException; +import org.overture.codegen.cgast.analysis.DepthFirstAnalysisAdaptor; +import org.overture.codegen.cgast.declarations.AClassDeclCG; +import org.overture.codegen.cgast.statements.ACallObjectExpStmCG; +import org.overture.codegen.cgast.statements.ACallObjectStmCG; +import org.overture.codegen.ir.IRInfo; +import org.overture.codegen.logging.Logger; +import org.overture.codegen.trans.uniontypes.ObjectDesignatorToExpCG; + +public class CallObjStmTransformation extends DepthFirstAnalysisAdaptor +{ + private ObjectDesignatorToExpCG converter; + + public CallObjStmTransformation(IRInfo info, List classes) + { + this.converter = new ObjectDesignatorToExpCG(info, classes); + } + + @Override + public void caseACallObjectStmCG(ACallObjectStmCG node) + throws AnalysisException + { + ACallObjectExpStmCG callObjExpStm = new ACallObjectExpStmCG(); + callObjExpStm.setArgs(node.getArgs()); + callObjExpStm.setObj(node.getDesignator().apply(converter)); + callObjExpStm.setFieldName(node.getFieldName()); + callObjExpStm.setSourceNode(node.getSourceNode()); + callObjExpStm.setTag(node.getTag()); + callObjExpStm.setType(node.getType()); + + if(node.parent() != null) + { + node.parent().replaceChild(node, callObjExpStm); + } + else + { + Logger.getLog().printErrorln("Could not find parent of " + node + " in " + "'CallObjStmTransformation'"); + } + } +} diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java index b9f198e2a8..8c0ff383b4 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaTransSeries.java @@ -7,6 +7,7 @@ import org.overture.codegen.cgast.expressions.AIntLiteralExpCG; import org.overture.codegen.cgast.types.AExternalTypeCG; import org.overture.codegen.ir.IRInfo; +import org.overture.codegen.trans.CallObjStmTransformation; import org.overture.codegen.trans.IPostCheckCreator; import org.overture.codegen.trans.IsExpTransformation; import org.overture.codegen.trans.PostCheckTransformation; @@ -51,6 +52,7 @@ public DepthFirstAnalysisAdaptor[] consAnalyses(List classes, FuncTransformation funcTransformation = new FuncTransformation(transAssistant); IRInfo irInfo = codeGen.getIRGenerator().getIRInfo(); + CallObjStmTransformation callObjTransformation = new CallObjStmTransformation(irInfo, classes); PrePostTransformation prePostTransformation = new PrePostTransformation(irInfo); IfExpTransformation ifExpTransformation = new IfExpTransformation(transAssistant); FunctionValueTransformation funcValueTransformation = new FunctionValueTransformation(irInfo, transAssistant, functionValueAssistant, INTERFACE_NAME_PREFIX, TEMPLATE_TYPE_PREFIX, EVAL_METHOD_PREFIX, PARAM_NAME_PREFIX); @@ -72,6 +74,7 @@ public DepthFirstAnalysisAdaptor[] consAnalyses(List classes, JavaClassToStringTrans javaToStringTransformation = new JavaClassToStringTrans(irInfo); DepthFirstAnalysisAdaptor[] analyses = new DepthFirstAnalysisAdaptor[] { + callObjTransformation, funcTransformation, prePostTransformation, ifExpTransformation, funcValueTransformation, transVisitor, patternTransformation, preCheckTransformation, postCheckTransformation, From 4b375b2ff4f2842e98369a57a0c840aeacbf78b0 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 00:42:45 +0100 Subject: [PATCH 84/90] Updated the union type transformation now that object designators have been removed from the IR --- .../trans/uniontypes/UnionTypeTransformation.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java index 9c3e81c34e..7fe64771cb 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java @@ -57,6 +57,7 @@ import org.overture.codegen.cgast.expressions.SNumericBinaryExpCG; import org.overture.codegen.cgast.expressions.SUnaryExpCG; import org.overture.codegen.cgast.expressions.SVarExpBase; +import org.overture.codegen.cgast.expressions.SVarExpCG; import org.overture.codegen.cgast.patterns.AIdentifierPatternCG; import org.overture.codegen.cgast.statements.ABlockStmCG; import org.overture.codegen.cgast.statements.ACallObjectExpStmCG; @@ -686,7 +687,7 @@ private void handleCallStm(SCallStmCG node, String className) throws AnalysisExc @SuppressWarnings("unchecked") @Override - public void inACallObjectStmCG(ACallObjectStmCG node) + public void inACallObjectExpStmCG(ACallObjectExpStmCG node) throws AnalysisException { for (SExpCG arg : node.getArgs()) @@ -694,11 +695,7 @@ public void inACallObjectStmCG(ACallObjectStmCG node) arg.apply(this); } - SObjectDesignatorCG designator = node.getDesignator(); - - ObjectDesignatorToExpCG converter = new ObjectDesignatorToExpCG(info, classes); - - SExpCG objExp = designator.apply(converter); + SExpCG objExp = node.getObj(); STypeCG objType = objExp.getType(); if (!(objType instanceof AUnionTypeCG)) @@ -722,11 +719,10 @@ public void inACallObjectStmCG(ACallObjectStmCG node) ABlockStmCG replacementBlock = new ABlockStmCG(); - if (!(designator instanceof AIdentifierObjectDesignatorCG)) + if (!(objExp instanceof SVarExpCG)) { String callStmObjName = info.getTempVarNameGen().nextVarName(callStmObjPrefix); - AIdentifierPatternCG id = new AIdentifierPatternCG(); id.setName(callStmObjName); AVarDeclCG objDecl = info.getDeclAssistant(). From a2f43e02eb1f2ec77d83805d9b1f645290beabab Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 01:15:20 +0100 Subject: [PATCH 85/90] Removed code that is not needed anymore due to object designators being transformed out of the IR --- .../codegen/assistant/TypeAssistantCG.java | 92 +------------------ .../conc/InstanceVarPPEvalTransformation.java | 10 +- .../uniontypes/UnionTypeTransformation.java | 3 - .../overture/codegen/vdm2java/JavaFormat.java | 8 +- .../codegen/vdm2java/JavaValueSemantics.java | 15 --- .../JavaTemplates/ObjectDesignator/Apply.vm | 9 -- .../JavaTemplates/ObjectDesignator/Field.vm | 1 - .../ObjectDesignator/Identifier.vm | 1 - .../JavaTemplates/ObjectDesignator/New.vm | 1 - .../JavaTemplates/ObjectDesignator/Self.vm | 1 - 10 files changed, 5 insertions(+), 136 deletions(-) delete mode 100644 core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Apply.vm delete mode 100644 core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Field.vm delete mode 100644 core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Identifier.vm delete mode 100644 core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/New.vm delete mode 100644 core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Self.vm diff --git a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java index bc6af50b23..9586cdf6da 100644 --- a/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/assistant/TypeAssistantCG.java @@ -50,8 +50,6 @@ import org.overture.codegen.cgast.expressions.AApplyExpCG; import org.overture.codegen.cgast.expressions.SBinaryExpCG; import org.overture.codegen.cgast.statements.AApplyObjectDesignatorCG; -import org.overture.codegen.cgast.statements.AFieldObjectDesignatorCG; -import org.overture.codegen.cgast.statements.AIdentifierObjectDesignatorCG; import org.overture.codegen.cgast.types.ABoolBasicTypeCG; import org.overture.codegen.cgast.types.ABoolBasicTypeWrappersTypeCG; import org.overture.codegen.cgast.types.ACharBasicTypeCG; @@ -398,95 +396,7 @@ public boolean isUnionOfType(AUnionType unionType, return true; } - - public STypeCG findElementType(AApplyObjectDesignatorCG designator, - List classes, IRInfo info) - { - int appliesCount = 0; - - AApplyObjectDesignatorCG mostRecentApply = designator; - SObjectDesignatorCG object = designator.getObject(); - - while (object != null) - { - if (object instanceof AIdentifierObjectDesignatorCG) - { - AIdentifierObjectDesignatorCG id = (AIdentifierObjectDesignatorCG) object; - - STypeCG type = id.getExp().getType(); - - return findElementType(appliesCount, type); - } else if (object instanceof AApplyObjectDesignatorCG) - { - mostRecentApply = (AApplyObjectDesignatorCG) object; - appliesCount++; - object = mostRecentApply.getObject(); - } else if (object instanceof AFieldObjectDesignatorCG) - { - AFieldObjectDesignatorCG fieldObj = (AFieldObjectDesignatorCG) object; - object = fieldObj.getObject(); - - try - { - return findElementType(classes, info, appliesCount, mostRecentApply, fieldObj); - } catch (AnalysisException - | org.overture.codegen.cgast.analysis.AnalysisException e) - { - Logger.getLog().printErrorln("Could not determine element type of " + fieldObj + " in 'TypeAssistantCG'"); - return null; - } - } else - { - return null; - } - } - - return null; - } - - private STypeCG findElementType(int appliesCount, STypeCG type) - { - int methodTypesCount = 0; - - while (type instanceof AMethodTypeCG) - { - methodTypesCount++; - AMethodTypeCG methodType = (AMethodTypeCG) type; - type = methodType.getResult(); - } - - while (type instanceof SSeqTypeCG || type instanceof SMapTypeCG) - { - if (type instanceof SSeqTypeCG) - { - type = ((SSeqTypeCG) type).getSeqOf(); - } - - if (type instanceof SMapTypeCG) - { - type = ((SMapTypeCG) type).getTo(); - } - - if (appliesCount == methodTypesCount) - { - return type; - } - - methodTypesCount++; - } - - return null; - } - - private STypeCG findElementType(List classes, IRInfo info, - int appliesCount, AApplyObjectDesignatorCG mostRecentApply, - AFieldObjectDesignatorCG fieldObj) throws AnalysisException, org.overture.codegen.cgast.analysis.AnalysisException - { - STypeCG type = getFieldExpType(info, classes, fieldObj.getFieldName(), fieldObj.getFieldModule(), fieldObj.getObject(), fieldObj.parent()); - - return findElementType(appliesCount, type); - } - + public PType getType(IRInfo question, AUnionType unionType, PPattern pattern) { PTypeSet possibleTypes = new PTypeSet(question.getTcFactory()); diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/conc/InstanceVarPPEvalTransformation.java b/core/codegen/src/main/java/org/overture/codegen/trans/conc/InstanceVarPPEvalTransformation.java index d6daf6d9a1..f89cc1cb5a 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/conc/InstanceVarPPEvalTransformation.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/conc/InstanceVarPPEvalTransformation.java @@ -10,8 +10,7 @@ import org.overture.codegen.cgast.expressions.AIdentifierVarExpCG; import org.overture.codegen.cgast.statements.AAssignmentStmCG; import org.overture.codegen.cgast.statements.ABlockStmCG; -import org.overture.codegen.cgast.statements.ACallObjectStmCG; -import org.overture.codegen.cgast.statements.AIdentifierObjectDesignatorCG; +import org.overture.codegen.cgast.statements.ACallObjectExpStmCG; import org.overture.codegen.cgast.types.AVoidTypeCG; import org.overture.codegen.ir.IRGeneratedTag; import org.overture.codegen.ir.IRInfo; @@ -82,11 +81,8 @@ public void caseAAssignmentStmCG(AAssignmentStmCG node) sentinelVar.setName(SENTINEL_FIELD_NAME); sentinelVar.setType(fieldType); - AIdentifierObjectDesignatorCG sentinel = new AIdentifierObjectDesignatorCG(); - sentinel.setExp(sentinelVar); - - ACallObjectStmCG callSentinel = new ACallObjectStmCG(); - callSentinel.setDesignator(sentinel); + ACallObjectExpStmCG callSentinel = new ACallObjectExpStmCG(); + callSentinel.setObj(sentinelVar); callSentinel.setFieldName("stateChanged"); callSentinel.setType(new AVoidTypeCG()); diff --git a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java index 7fe64771cb..b1f7725705 100644 --- a/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java +++ b/core/codegen/src/main/java/org/overture/codegen/trans/uniontypes/UnionTypeTransformation.java @@ -30,7 +30,6 @@ import org.overture.codegen.assistant.TypeAssistantCG; import org.overture.codegen.cgast.INode; import org.overture.codegen.cgast.SExpCG; -import org.overture.codegen.cgast.SObjectDesignatorCG; import org.overture.codegen.cgast.SStmCG; import org.overture.codegen.cgast.STypeCG; import org.overture.codegen.cgast.analysis.AnalysisException; @@ -61,9 +60,7 @@ import org.overture.codegen.cgast.patterns.AIdentifierPatternCG; import org.overture.codegen.cgast.statements.ABlockStmCG; import org.overture.codegen.cgast.statements.ACallObjectExpStmCG; -import org.overture.codegen.cgast.statements.ACallObjectStmCG; import org.overture.codegen.cgast.statements.AElseIfStmCG; -import org.overture.codegen.cgast.statements.AIdentifierObjectDesignatorCG; import org.overture.codegen.cgast.statements.AIfStmCG; import org.overture.codegen.cgast.statements.ALocalAssignmentStmCG; import org.overture.codegen.cgast.statements.APlainCallStmCG; diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java index 2f94cac57a..11618aabb6 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaFormat.java @@ -68,7 +68,6 @@ import org.overture.codegen.cgast.expressions.SUnaryExpCG; import org.overture.codegen.cgast.expressions.SVarExpCG; import org.overture.codegen.cgast.name.ATypeNameCG; -import org.overture.codegen.cgast.statements.AApplyObjectDesignatorCG; import org.overture.codegen.cgast.statements.AAssignmentStmCG; import org.overture.codegen.cgast.statements.ABlockStmCG; import org.overture.codegen.cgast.statements.AForLoopStmCG; @@ -840,12 +839,7 @@ public String nextVarName(String prefix) { return info.getTempVarNameGen().nextVarName(prefix); } - - public STypeCG findElementType(AApplyObjectDesignatorCG designator) - { - return info.getAssistantManager().getTypeAssistant().findElementType(designator, classes, info); - } - + public boolean isLoopVar(AVarDeclCG localVar) { return localVar.parent() instanceof AForLoopStmCG; diff --git a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaValueSemantics.java b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaValueSemantics.java index cd6cdfcd7a..f02ed76072 100644 --- a/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaValueSemantics.java +++ b/core/codegen/src/main/java/org/overture/codegen/vdm2java/JavaValueSemantics.java @@ -49,9 +49,7 @@ import org.overture.codegen.cgast.expressions.ASetSubsetBinaryExpCG; import org.overture.codegen.cgast.expressions.ATupleCompatibilityExpCG; import org.overture.codegen.cgast.expressions.ATupleSizeExpCG; -import org.overture.codegen.cgast.statements.AApplyObjectDesignatorCG; import org.overture.codegen.cgast.statements.AForAllStmCG; -import org.overture.codegen.cgast.statements.AIdentifierObjectDesignatorCG; import org.overture.codegen.cgast.statements.ALocalAssignmentStmCG; import org.overture.codegen.cgast.types.AExternalTypeCG; import org.overture.codegen.cgast.types.AMethodTypeCG; @@ -166,19 +164,6 @@ public boolean shouldClone(SExpCG exp) return false; } - if (parent instanceof AIdentifierObjectDesignatorCG) - { - // Don't clone the variable associated with an identifier object designator - return false; - } - - if (parent instanceof AApplyObjectDesignatorCG) - { - // No need to clone the expression - we only use it for lookup - return usesStructuralEquivalence(exp.getType()) - && javaFormat.findElementType((AApplyObjectDesignatorCG) parent) == null; - } - if (parent instanceof ALocalAssignmentStmCG) { ALocalAssignmentStmCG assignment = (ALocalAssignmentStmCG) parent; diff --git a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Apply.vm b/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Apply.vm deleted file mode 100644 index fd9b9db5e8..0000000000 --- a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Apply.vm +++ /dev/null @@ -1,9 +0,0 @@ -#set( $args = $JavaFormat.formatArgs($node.getArgs()) ) -## -#set( $elementType = $JavaFormat.findElementType($node) ) -## -#if ( $JavaFormat.isNull($elementType) ) - ${JavaFormat.format($node.getObject())}(${args}) -#else - ((${JavaFormat.format($elementType)}) ${JavaFormat.format($node.getObject())}.get(${args})) -#end diff --git a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Field.vm b/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Field.vm deleted file mode 100644 index f6c8b96598..0000000000 --- a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Field.vm +++ /dev/null @@ -1 +0,0 @@ -$JavaFormat.format($node.getObject()).$node.getFieldName() \ No newline at end of file diff --git a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Identifier.vm b/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Identifier.vm deleted file mode 100644 index 4951d20597..0000000000 --- a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Identifier.vm +++ /dev/null @@ -1 +0,0 @@ -$JavaFormat.format($node.getExp()) \ No newline at end of file diff --git a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/New.vm b/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/New.vm deleted file mode 100644 index 4951d20597..0000000000 --- a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/New.vm +++ /dev/null @@ -1 +0,0 @@ -$JavaFormat.format($node.getExp()) \ No newline at end of file diff --git a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Self.vm b/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Self.vm deleted file mode 100644 index a2a3f4f1e3..0000000000 --- a/core/codegen/src/main/resources/JavaTemplates/ObjectDesignator/Self.vm +++ /dev/null @@ -1 +0,0 @@ -this \ No newline at end of file From 806e2ccbbb5995b1548d8ee5fc7a8d1d3aa826c1 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 01:29:34 +0100 Subject: [PATCH 86/90] Added test to exercise code generation of a complicated case for object designators --- .../ApplyObjectDesignatorWithRecFieldObj2 | 32 +++++ ...plyObjectDesignatorWithRecFieldObj2.result | 119 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2 create mode 100644 core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2.result diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2 b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2 new file mode 100644 index 0000000000..54951bbabb --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2 @@ -0,0 +1,32 @@ +class Entry + +types + +public +A :: + bs : seq of B; + +public +B :: + c : C; + +public +C :: + e : Entry; + + +operations + +public static Run : () ==> ? +Run () == +let a = mk_A([mk_B(mk_C(new Entry()))]) +in + op(a); + +public static op : A ==> nat +op (a) == a.bs(1).c.e.getConst(); + +public getConst : () ==> nat +getConst () == return 5; + +end Entry \ No newline at end of file diff --git a/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2.result b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2.result new file mode 100644 index 0000000000..2b54f7dc66 --- /dev/null +++ b/core/codegen/src/test/resources/complex_expressions/ApplyObjectDesignatorWithRecFieldObj2.result @@ -0,0 +1,119 @@ +import org.overture.codegen.runtime.*; + +import java.util.*; + + +public class Entry { + public Entry() { + } + + public static Object Run() { + A a = new A(SeqUtil.seq(new B(new C(new Entry())))); + + return op(Utils.clone(a)); + } + + public static Number op(final A a) { + return ((B) a.bs.get(Utils.index(1L))).c.e.getConst(); + } + + public Number getConst() { + return 5L; + } + + public String toString() { + return "Entry{}"; + } + + public static class A implements Record { + public VDMSeq bs; + + public A(final VDMSeq _bs) { + bs = (_bs != null) ? Utils.clone(_bs) : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof A)) { + return false; + } + + A other = ((A) obj); + + return Utils.equals(bs, other.bs); + } + + public int hashCode() { + return Utils.hashCode(bs); + } + + public A clone() { + return new A(bs); + } + + public String toString() { + return "mk_Entry`A" + Utils.formatFields(bs); + } + } + + public static class B implements Record { + public C c; + + public B(final C _c) { + c = (_c != null) ? Utils.clone(_c) : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof B)) { + return false; + } + + B other = ((B) obj); + + return Utils.equals(c, other.c); + } + + public int hashCode() { + return Utils.hashCode(c); + } + + public B clone() { + return new B(c); + } + + public String toString() { + return "mk_Entry`B" + Utils.formatFields(c); + } + } + + public static class C implements Record { + public Entry e; + + public C(final Entry _e) { + e = (_e != null) ? _e : null; + } + + public boolean equals(final Object obj) { + if (!(obj instanceof C)) { + return false; + } + + C other = ((C) obj); + + return Utils.equals(e, other.e); + } + + public int hashCode() { + return Utils.hashCode(e); + } + + public C clone() { + return new C(e); + } + + public String toString() { + return "mk_Entry`C" + Utils.formatFields(e); + } + } +} + +########## From 9ec4fb7826c4548ef0e6ef67421845c9721bdf68 Mon Sep 17 00:00:00 2001 From: Peter Joergensen Date: Thu, 26 Feb 2015 09:59:36 +0100 Subject: [PATCH 87/90] Cleanup of reporting of unsupported VDNM constructs --- .../codegen/visitor/AbstractVisitorCG.java | 4 -- .../codegen/visitor/DeclVisitorCG.java | 3 +- .../codegen/visitor/ExpVisitorCG.java | 1 + .../visitor/MultipleBindVisitorCG.java | 10 +++- .../visitor/ObjectDesignatorVisitorCG.java | 9 +++- .../codegen/visitor/PatternVisitorCG.java | 20 ++++++- .../codegen/visitor/StmVisitorCG.java | 53 ++++++++++++------- .../codegen/visitor/TypeVisitorCG.java | 21 ++++++-- 8 files changed, 90 insertions(+), 31 deletions(-) diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/AbstractVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/AbstractVisitorCG.java index 4d167fc887..24f5fa4f78 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/AbstractVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/AbstractVisitorCG.java @@ -30,7 +30,6 @@ public class AbstractVisitorCG extends QuestionAnswerAdaptor { - @Override public A defaultINode(INode node, Q question) throws AnalysisException { @@ -40,8 +39,6 @@ public A defaultINode(INode node, Q question) throws AnalysisException } question.addUnsupportedNode(node); - // Logger.getLog().printErrorln("Code generation does not support the following VDM construct: " + - // node.getClass().getName() + ": " + node.toString()); return null; } @@ -59,5 +56,4 @@ public A createNewReturnValue(Object node, Q question) { return null; } - } diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java index 015807691a..97dd934fe5 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/DeclVisitorCG.java @@ -121,6 +121,7 @@ public SDeclCG caseANamedTraceDefinition(ANamedTraceDefinition node, else { Logger.getLog().printErrorln("Expected term to be of type ATraceDeclTermCG. Got: " + termCg); + return null; } } @@ -164,8 +165,6 @@ public SDeclCG caseARecordInvariantType(ARecordInvariantType node, recordFields.add(fieldDecl); } else { - question.addUnsupportedNode(node, - "Could not generate fields of record: " + name); return null; } } diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java index 7d830efc96..9c35a3e452 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/ExpVisitorCG.java @@ -526,6 +526,7 @@ public SExpCG caseASetCompSetExp(ASetCompSetExp node, IRInfo question) { question.addUnsupportedNode(node, "Generation of a multiple set bind was expected to yield a ASetMultipleBindCG. Got: " + multipleBindCg); + return null; } bindingsCg.add((ASetMultipleBindCG) multipleBindCg); diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/MultipleBindVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/MultipleBindVisitorCG.java index 60f3604751..388925a2a3 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/MultipleBindVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/MultipleBindVisitorCG.java @@ -49,7 +49,15 @@ public SMultipleBindCG caseASetMultipleBind(ASetMultipleBind node, for (PPattern pattern : patterns) { SPatternCG patternTempCg = pattern.apply(question.getPatternVisitor(), question); - patternsCg.add(patternTempCg); + + if (patternTempCg != null) + { + patternsCg.add(patternTempCg); + } + else + { + return null; + } } SExpCG setCg = set.apply(question.getExpVisitor(), question); diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java index d921964990..78ae74a0fb 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/ObjectDesignatorVisitorCG.java @@ -62,7 +62,14 @@ public SObjectDesignatorCG caseAApplyObjectDesignator( for (PExp arg : node.getArgs()) { SExpCG argCg = arg.apply(question.getExpVisitor(), question); - newExpArgs.add(argCg); + + if (argCg != null) + { + newExpArgs.add(argCg); + } else + { + return null; + } } return applyObjDesignator; diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/PatternVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/PatternVisitorCG.java index 3e748c41af..c4774660d0 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/PatternVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/PatternVisitorCG.java @@ -159,7 +159,15 @@ public SPatternCG caseATuplePattern(ATuplePattern node, IRInfo question) for (PPattern currentPattern : node.getPlist()) { SPatternCG patternCg = currentPattern.apply(question.getPatternVisitor(), question); - tuplePatternCg.getPatterns().add(patternCg); + + if(patternCg != null) + { + tuplePatternCg.getPatterns().add(patternCg); + } + else + { + return null; + } } return tuplePatternCg; @@ -181,7 +189,15 @@ public SPatternCG caseARecordPattern(ARecordPattern node, IRInfo question) for (PPattern currentPattern : node.getPlist()) { SPatternCG patternCg = currentPattern.apply(question.getPatternVisitor(), question); - recordPatternCg.getPatterns().add(patternCg); + + if(patternCg != null) + { + recordPatternCg.getPatterns().add(patternCg); + } + else + { + return null; + } } return recordPatternCg; diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/StmVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/StmVisitorCG.java index 6a0ab27202..2daadb5762 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/StmVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/StmVisitorCG.java @@ -126,7 +126,15 @@ public SStmCG caseAPeriodicStm(APeriodicStm node, IRInfo question) for(PExp exp : node.getArgs()) { SExpCG expCg = exp.apply(question.getExpVisitor(), question); - periodicStmCg.getArgs().add(expCg); + + if(expCg != null) + { + periodicStmCg.getArgs().add(expCg); + } + else + { + return null; + } } return periodicStmCg; @@ -143,7 +151,16 @@ public SStmCG caseAAtomicStm(AAtomicStm node, IRInfo question) for (AAssignmentStm assignment : assignments) { - stmsCg.add(assignment.apply(question.getStmVisitor(), question)); + SStmCG stmCg = assignment.apply(question.getStmVisitor(), question); + + if(stmCg != null) + { + stmsCg.add(stmCg); + } + else + { + return null; + } } return stmBlock; @@ -168,8 +185,6 @@ public SStmCG caseALetBeStStm(ALetBeStStm node, IRInfo question) if (!(multipleBindCg instanceof ASetMultipleBindCG)) { - question.addUnsupportedNode(node, "Generation of a multiple set bind was expected to yield a ASetMultipleBindCG. Got: " - + multipleBindCg); return null; } @@ -259,6 +274,10 @@ public SStmCG caseABlockSimpleBlockStm(ABlockSimpleBlockStm node, { blockStm.getStatements().add(stmCg); } + else + { + return null; + } } return blockStm; @@ -340,19 +359,18 @@ public SStmCG caseACallStm(ACallStm node, IRInfo question) List argsCg = new LinkedList(); - for (int i = 0; i < args.size(); i++) + for (PExp arg : args) { - PExp arg = args.get(i); SExpCG argCg = arg.apply(question.getExpVisitor(), question); - if (argCg == null) + if (argCg != null) + { + argsCg.add(argCg); + } + else { - question.addUnsupportedNode(node, "A Call statement is not supported for the argument: " - + arg); return null; } - - argsCg.add(argCg); } boolean isStatic = question.getTcFactory().createPDefinitionAssistant().isStatic(rootdef); @@ -465,19 +483,18 @@ public SStmCG caseACallObjectStm(ACallObjectStm node, IRInfo question) callObject.setDesignator(objectDesignatorCg); callObject.setFieldName(fieldNameCg); - for (int i = 0; i < args.size(); i++) + for (PExp arg : args) { - PExp arg = args.get(i); SExpCG argCg = arg.apply(question.getExpVisitor(), question); - if (argCg == null) + if (argCg != null) + { + callObject.getArgs().add(argCg); + } + else { - question.addUnsupportedNode(node, "A Call object statement is not supported for the argument: " - + arg); return null; } - - callObject.getArgs().add(argCg); } return callObject; diff --git a/core/codegen/src/main/java/org/overture/codegen/visitor/TypeVisitorCG.java b/core/codegen/src/main/java/org/overture/codegen/visitor/TypeVisitorCG.java index 7921fed5e9..93ba95e9fc 100644 --- a/core/codegen/src/main/java/org/overture/codegen/visitor/TypeVisitorCG.java +++ b/core/codegen/src/main/java/org/overture/codegen/visitor/TypeVisitorCG.java @@ -113,7 +113,15 @@ public STypeCG caseAUnionType(AUnionType node, IRInfo question) for (PType type : types) { STypeCG typeCg = type.apply(question.getTypeVisitor(), question); - unionTypeCg.getTypes().add(typeCg); + + if(typeCg != null) + { + unionTypeCg.getTypes().add(typeCg); + } + else + { + return null; + } } return unionTypeCg; @@ -188,8 +196,15 @@ public STypeCG caseAProductType(AProductType node, IRInfo question) for (PType type : types) { STypeCG typeCg = type.apply(question.getTypeVisitor(), question); - tuple.getTypes().add(typeCg); - + + if (typeCg != null) + { + tuple.getTypes().add(typeCg); + } + else + { + return null; + } } return tuple; From c305752f3eead511e844c26f9840548cb1e3dcc8 Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Thu, 26 Feb 2015 12:48:31 +0100 Subject: [PATCH 88/90] Add release notes for 2.2.2. [Issue: ] --- .../releasenotes/ReleaseNotes_2.2.2.md | 80 +++++++++++++++++++ .../releasenotes/ReleaseNotes_2.2.2_abbrev.md | 37 +++++++++ 2 files changed, 117 insertions(+) create mode 100644 documentation/releasenotes/ReleaseNotes_2.2.2.md create mode 100644 documentation/releasenotes/ReleaseNotes_2.2.2_abbrev.md diff --git a/documentation/releasenotes/ReleaseNotes_2.2.2.md b/documentation/releasenotes/ReleaseNotes_2.2.2.md new file mode 100644 index 0000000000..5fd8b9cbdd --- /dev/null +++ b/documentation/releasenotes/ReleaseNotes_2.2.2.md @@ -0,0 +1,80 @@ +# Overture 2.2.0 Release Notes — 27 February 2015 + +## What's New? + +This is a hotfix release that fixes critical bugs in the Combinatorial Testing +plug-in. + +## System Requirements + +Overture is based on the Eclipse platform. To run it, you must have a Java runtime system installed, version 7 or later. + +## Download & Installation + +Documentation, including tutorials and a language manual, are bundled in the download package, and are also available from the [Overture website](http://www.overturetool.org/). + +Overture can be downloaded from GitHub at . + +The download file is a ZIP archive. To install the tool, unzip the file in a convenient location. The main executable is in the top level directory, called `Overture`. + +We will be making an exe-based installer available for Windows user at a future point. + + +### Upgrading: + +* ATTENTION: If you are using the ZIP archive to update and if your workspace was located inside the previous installation directory, DO NOT FORGET TO BACKUP the workspace or it will be lost when the old version is deleted. +* If you are upgrading with the ZIP archive: do not unzip the latest version on top of the oldest one. You will need to delete the previous version before continuing the installation. + + +### Uninstalling + +To uninstall Overture, remove the contents of the directory where you installed it. There are no other files stored on the system, apart from any workspace files you may have created. + +For Windows users, if the Overture installer was used previously, it is possible to uninstall via the uninstall shortcut created by the installer in the start programs or via the Uninstall menu in the Control Panel. + + +## Reporting Problems and Troubleshooting + +Please report bugs, problems, and other issues with the tool at . + +If you encounter a problem with the Overture IDE itself, please contact the Overture project and we will try to help. You can contact us at info@overturetool.org, or use [StackOverflow](http://stackoverflow.com/questions/tagged/vdm%2b%2b) — we monitor for questions using the `vdm`, `vdm++`, or `vdmrt` tags. + +If you encounter a problem with a VDM specification, please try to make a small example that illustrates the problem before you contact us. If you are sure the bug is not already known in the GitHub issues list, you can create a new bug report. + + +## Frequently Asked Questions + +* Who's behind Overture? +> Overture was written by the members of the Overture project, a group of industry and academic researchers interested in the use of VDM. + +* How is Overture licensed? +> Overture is open source. It is released under a GPLv3 license. + +* What can I do to help? +> If you are interested in helping you can drop a mail to info@overturetool.org. You are also very welcome to fork our code on GitHub and send us pull requests. + +* Where is Overture source code? +> Overture source code is hosted by GitHub, within the [overturetool](https://github.com/overturetool) organisation account. + + +## Other Resources and Links + +* [Overture Community site](http://www.overturetool.org) +* [VDM Tutorials](http://overturetool.org/documentation/tutorials.html) +* [VDM Examples](http://overturetool.org/download/examples/) +* [Wikipedia on VDM](http://en.wikipedia.org/wiki/Vienna_Development_Method) +* [Overture Developers Wiki on GitHub](https://github.com/overturetool/overture/wiki/) +* [The Old Overture Wiki for developers](http://wiki.overturetool.org) + + +## Bug fixes + +Please note that the interactive list is at + +* [#418 Problem with code generator update site](https://github.com/overturetool/overture/issues/418) +* [#416 Problem with patterns in traces](https://github.com/overturetool/overture/issues/416) +* [#415 Tic-tac-toe CT errors in 2.2.0](https://github.com/overturetool/overture/issues/415) +* [#414 Problems running Overture with JDK/JRE 8 on Windows](https://github.com/overturetool/overture/issues/414) +* [#413 Problem running the SmokkingPP examples](https://github.com/overturetool/overture/issues/413) +* [#376 Scoping for traces does not work correctly](https://github.com/overturetool/overture/issues/376) + diff --git a/documentation/releasenotes/ReleaseNotes_2.2.2_abbrev.md b/documentation/releasenotes/ReleaseNotes_2.2.2_abbrev.md new file mode 100644 index 0000000000..2dba409884 --- /dev/null +++ b/documentation/releasenotes/ReleaseNotes_2.2.2_abbrev.md @@ -0,0 +1,37 @@ +# Overture 2.2.0 Release Notes — 27 February 2015 + +## What's New? + +This is a hotfix release that fixes critical bugs in the Combinatorial Testing +plug-in. + +## Reporting Problems and Troubleshooting + +Please report bugs, problems, and other issues with the tool at . + +If you encounter a problem with the Overture IDE itself, please contact the Overture project and we will try to help. You can contact us at info@overturetool.org, or use [StackOverflow](http://stackoverflow.com/questions/tagged/vdm%2b%2b) — we monitor for questions using the `vdm`, `vdm++`, or `vdmrt` tags. + +If you encounter a problem with a VDM specification, please try to make a small example that illustrates the problem before you contact us. If you are sure the bug is not already known in the GitHub issues list, you can create a new bug report. + + +## Other Resources and Links + +* [Overture Community site](http://www.overturetool.org) +* [VDM Tutorials](http://overturetool.org/documentation/tutorials.html) +* [VDM Examples](http://overturetool.org/download/examples/) +* [Wikipedia on VDM](http://en.wikipedia.org/wiki/Vienna_Development_Method) +* [Overture Developers Wiki on GitHub](https://github.com/overturetool/overture/wiki/) +* [The Old Overture Wiki for developers](http://wiki.overturetool.org) + + +## Bug fixes + +Please note that the interactive list is at + +* [#418 Problem with code generator update site](https://github.com/overturetool/overture/issues/418) +* [#416 Problem with patterns in traces](https://github.com/overturetool/overture/issues/416) +* [#415 Tic-tac-toe CT errors in 2.2.0](https://github.com/overturetool/overture/issues/415) +* [#414 Problems running Overture with JDK/JRE 8 on Windows](https://github.com/overturetool/overture/issues/414) +* [#413 Problem running the SmokkingPP examples](https://github.com/overturetool/overture/issues/413) +* [#376 Scoping for traces does not work correctly](https://github.com/overturetool/overture/issues/376) + From 6743b10509b8e18efc21677f2ffd99faffe4e8ad Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Thu, 26 Feb 2015 13:53:38 +0100 Subject: [PATCH 89/90] [maven-release-plugin] prepare release Release/2.2.2 --- core/ast/pom.xml | 2 +- core/codegen-runtime/pom.xml | 5 ++--- core/codegen/pom.xml | 2 +- core/combinatorialtesting/ctruntime/pom.xml | 2 +- core/combinatorialtesting/ctutils/pom.xml | 2 +- core/combinatorialtesting/pom.xml | 2 +- core/commandline/pom.xml | 2 +- core/guibuilder/pom.xml | 2 +- core/interpreter/pom.xml | 2 +- core/modelcheckers/pom.xml | 2 +- core/modelcheckers/probsolver/pom.xml | 2 +- core/modelcheckers/probsolverintegration/pom.xml | 2 +- core/parser/pom.xml | 2 +- core/pog/pom.xml | 2 +- core/pom.xml | 2 +- core/prettyprinting/npp/pom.xml | 2 +- core/prettyprinting/pom.xml | 2 +- core/prettyprinting/prettyprinter/pom.xml | 2 +- core/testframework/pom.xml | 2 +- core/testing/exsupport/pom.xml | 2 +- core/testing/extests/pom.xml | 2 +- core/testing/framework/pom.xml | 2 +- core/testing/pom.xml | 2 +- core/testing/tests/pom.xml | 2 +- core/typechecker/pom.xml | 2 +- core/vdmjc/pom.xml | 2 +- externals/documentation/pom.xml | 2 +- externals/examples/pom.xml | 2 +- externals/pom.xml | 2 +- pom.xml | 4 ++-- 30 files changed, 32 insertions(+), 33 deletions(-) diff --git a/core/ast/pom.xml b/core/ast/pom.xml index 2b55d54b40..b7eb5cf946 100644 --- a/core/ast/pom.xml +++ b/core/ast/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/codegen-runtime/pom.xml b/core/codegen-runtime/pom.xml index 16796caf76..a7385e8cf2 100644 --- a/core/codegen-runtime/pom.xml +++ b/core/codegen-runtime/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/codegen/pom.xml b/core/codegen/pom.xml index 20e2849d97..7eef63c03a 100644 --- a/core/codegen/pom.xml +++ b/core/codegen/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/combinatorialtesting/ctruntime/pom.xml b/core/combinatorialtesting/ctruntime/pom.xml index 025214ce1f..c298804a73 100644 --- a/core/combinatorialtesting/ctruntime/pom.xml +++ b/core/combinatorialtesting/ctruntime/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core combinatorialtesting - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/combinatorialtesting/ctutils/pom.xml b/core/combinatorialtesting/ctutils/pom.xml index bc98f74db6..9cc9f4ef21 100644 --- a/core/combinatorialtesting/ctutils/pom.xml +++ b/core/combinatorialtesting/ctutils/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core combinatorialtesting - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/combinatorialtesting/pom.xml b/core/combinatorialtesting/pom.xml index 82da663a60..5a07c129a3 100644 --- a/core/combinatorialtesting/pom.xml +++ b/core/combinatorialtesting/pom.xml @@ -4,7 +4,7 @@ core org.overturetool - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/commandline/pom.xml b/core/commandline/pom.xml index af1885dc7f..215e92ad17 100644 --- a/core/commandline/pom.xml +++ b/core/commandline/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/guibuilder/pom.xml b/core/guibuilder/pom.xml index c337ca30a3..ee8e36d670 100644 --- a/core/guibuilder/pom.xml +++ b/core/guibuilder/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/interpreter/pom.xml b/core/interpreter/pom.xml index fe03fafc52..71f845f80d 100644 --- a/core/interpreter/pom.xml +++ b/core/interpreter/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/modelcheckers/pom.xml b/core/modelcheckers/pom.xml index 8a77c9ba69..1213a0baf7 100644 --- a/core/modelcheckers/pom.xml +++ b/core/modelcheckers/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/modelcheckers/probsolver/pom.xml b/core/modelcheckers/probsolver/pom.xml index 7374ef1c1e..6b8980f532 100644 --- a/core/modelcheckers/probsolver/pom.xml +++ b/core/modelcheckers/probsolver/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core modelcheckers - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/modelcheckers/probsolverintegration/pom.xml b/core/modelcheckers/probsolverintegration/pom.xml index 05b1c9f424..6d27874be3 100644 --- a/core/modelcheckers/probsolverintegration/pom.xml +++ b/core/modelcheckers/probsolverintegration/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core modelcheckers - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/parser/pom.xml b/core/parser/pom.xml index 9f70009e38..aed18c08cd 100644 --- a/core/parser/pom.xml +++ b/core/parser/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/pog/pom.xml b/core/pog/pom.xml index 3500863d75..c377954970 100644 --- a/core/pog/pom.xml +++ b/core/pog/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/pom.xml b/core/pom.xml index db2d041025..12d1dbd2eb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.overturetool root - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/prettyprinting/npp/pom.xml b/core/prettyprinting/npp/pom.xml index f2e5543c2a..f5af905ec1 100644 --- a/core/prettyprinting/npp/pom.xml +++ b/core/prettyprinting/npp/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core prettyprinting - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/prettyprinting/pom.xml b/core/prettyprinting/pom.xml index 1729aded99..8d2beb21fe 100644 --- a/core/prettyprinting/pom.xml +++ b/core/prettyprinting/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/prettyprinting/prettyprinter/pom.xml b/core/prettyprinting/prettyprinter/pom.xml index 1082eca075..819e34ed88 100644 --- a/core/prettyprinting/prettyprinter/pom.xml +++ b/core/prettyprinting/prettyprinter/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core prettyprinting - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/testframework/pom.xml b/core/testframework/pom.xml index 9dd657dc3e..fcb6ad3770 100644 --- a/core/testframework/pom.xml +++ b/core/testframework/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/testing/exsupport/pom.xml b/core/testing/exsupport/pom.xml index 1f7ca8a498..f859a3449a 100644 --- a/core/testing/exsupport/pom.xml +++ b/core/testing/exsupport/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/testing/extests/pom.xml b/core/testing/extests/pom.xml index e2bb97b9d8..b1691df297 100644 --- a/core/testing/extests/pom.xml +++ b/core/testing/extests/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/testing/framework/pom.xml b/core/testing/framework/pom.xml index 655dd57039..4799aad591 100644 --- a/core/testing/framework/pom.xml +++ b/core/testing/framework/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/testing/pom.xml b/core/testing/pom.xml index afd6fdf27b..fdcd45eeb4 100644 --- a/core/testing/pom.xml +++ b/core/testing/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/testing/tests/pom.xml b/core/testing/tests/pom.xml index 34e3d6a918..d09890b45d 100644 --- a/core/testing/tests/pom.xml +++ b/core/testing/tests/pom.xml @@ -4,7 +4,7 @@ org.overturetool.core testing - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/typechecker/pom.xml b/core/typechecker/pom.xml index 3bce799a38..e1f25210bd 100644 --- a/core/typechecker/pom.xml +++ b/core/typechecker/pom.xml @@ -4,7 +4,7 @@ org.overturetool core - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/core/vdmjc/pom.xml b/core/vdmjc/pom.xml index 8e08ce0e44..37deb29acd 100644 --- a/core/vdmjc/pom.xml +++ b/core/vdmjc/pom.xml @@ -4,7 +4,7 @@ core org.overturetool - 2.2.1-SNAPSHOT + 2.2.2 org.overturetool.core diff --git a/externals/documentation/pom.xml b/externals/documentation/pom.xml index e38b6c3c07..97fa0b26d2 100644 --- a/externals/documentation/pom.xml +++ b/externals/documentation/pom.xml @@ -4,7 +4,7 @@ org.overturetool externals - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/externals/examples/pom.xml b/externals/examples/pom.xml index cd951438dc..9da1424a57 100644 --- a/externals/examples/pom.xml +++ b/externals/examples/pom.xml @@ -4,7 +4,7 @@ org.overturetool externals - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/externals/pom.xml b/externals/pom.xml index 4a7f1bfa65..f23978a0a9 100644 --- a/externals/pom.xml +++ b/externals/pom.xml @@ -4,7 +4,7 @@ org.overturetool root - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/pom.xml b/pom.xml index 36f061f3e4..06337f2cf6 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.overturetool root - 2.2.1-SNAPSHOT + 2.2.2 The Overture Tool Platform root @@ -302,7 +302,7 @@ git@github.com:overturetool/overture.git scm:git:git://github.com/overturetool/overture.git scm:git:git@github.com:overturetool/overture.git - HEAD + Release/2.2.2 From 3e2d2a8d1b72e027ba5e4ea4fda452fd0a65bfa2 Mon Sep 17 00:00:00 2001 From: Luis Diogo Couto Date: Thu, 26 Feb 2015 18:18:00 +0100 Subject: [PATCH 90/90] Bump ide/ to version 2.2.2 [Issue: ] --- ide/builders/pom.xml | 2 +- ide/builders/vdmj/META-INF/MANIFEST.MF | 2 +- ide/builders/vdmj/pom.xml | 2 +- ide/core/META-INF/MANIFEST.MF | 2 +- ide/core/pom.xml | 2 +- ide/debug/META-INF/MANIFEST.MF | 2 +- ide/debug/pom.xml | 2 +- ide/features/core/feature.xml | 2 +- ide/features/core/pom.xml | 2 +- ide/features/pom.xml | 2 +- ide/features/rcp/feature.xml | 2 +- ide/features/rcp/pom.xml | 2 +- ide/help/META-INF/MANIFEST.MF | 2 +- ide/help/pom.xml | 2 +- ide/parsers/pom.xml | 2 +- ide/parsers/vdmj/META-INF/MANIFEST.MF | 2 +- ide/parsers/vdmj/pom.xml | 2 +- ide/platform/META-INF/MANIFEST.MF | 2 +- ide/platform/pom.xml | 2 +- ide/plugins/codegen/META-INF/MANIFEST.MF | 2 +- ide/plugins/codegen/pom.xml | 2 +- ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF | 2 +- ide/plugins/combinatorialtesting/pom.xml | 2 +- ide/plugins/coverageeditor/META-INF/MANIFEST.MF | 2 +- ide/plugins/coverageeditor/pom.xml | 2 +- ide/plugins/csk/META-INF/MANIFEST.MF | 2 +- ide/plugins/csk/pom.xml | 2 +- ide/plugins/developerutils/META-INF/MANIFEST.MF | 2 +- ide/plugins/developerutils/pom.xml | 2 +- ide/plugins/externaleditor/META-INF/MANIFEST.MF | 2 +- ide/plugins/externaleditor/pom.xml | 2 +- ide/plugins/features/codegen/feature.xml | 2 +- ide/plugins/features/codegen/pom.xml | 2 +- ide/plugins/features/combinatorialtesting/feature.xml | 2 +- ide/plugins/features/combinatorialtesting/pom.xml | 2 +- ide/plugins/features/coverageeditor/feature.xml | 2 +- ide/plugins/features/coverageeditor/pom.xml | 2 +- ide/plugins/features/csk/feature.xml | 2 +- ide/plugins/features/csk/pom.xml | 2 +- ide/plugins/features/developerutils/feature.xml | 2 +- ide/plugins/features/developerutils/pom.xml | 2 +- ide/plugins/features/guibuilder/feature.xml | 2 +- ide/plugins/features/guibuilder/pom.xml | 2 +- ide/plugins/features/latex/feature.xml | 2 +- ide/plugins/features/latex/pom.xml | 2 +- ide/plugins/features/pom.xml | 2 +- ide/plugins/features/poviewer/feature.xml | 2 +- ide/plugins/features/poviewer/pom.xml | 2 +- ide/plugins/features/probruntime/feature.xml | 2 +- ide/plugins/features/probruntime/pom.xml | 2 +- ide/plugins/features/quickinterpreter/feature.xml | 2 +- ide/plugins/features/quickinterpreter/pom.xml | 2 +- ide/plugins/features/rttraceviewer/feature.xml | 2 +- ide/plugins/features/rttraceviewer/pom.xml | 2 +- ide/plugins/features/uml2/feature.xml | 2 +- ide/plugins/features/uml2/pom.xml | 2 +- ide/plugins/guibuilder/META-INF/MANIFEST.MF | 2 +- ide/plugins/guibuilder/pom.xml | 2 +- ide/plugins/latex/META-INF/MANIFEST.MF | 2 +- ide/plugins/latex/pom.xml | 2 +- ide/plugins/pom.xml | 2 +- ide/plugins/poviewer/META-INF/MANIFEST.MF | 2 +- ide/plugins/poviewer/pom.xml | 2 +- ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/core/pom.xml | 2 +- ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/linux.x86/pom.xml | 2 +- ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/linux.x86_64/pom.xml | 2 +- ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/macosx.x86_64/pom.xml | 2 +- ide/plugins/prob-runtime/pom.xml | 2 +- ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF | 2 +- ide/plugins/prob-runtime/win32.win32/pom.xml | 2 +- ide/plugins/quickinterpreter/META-INF/MANIFEST.MF | 2 +- ide/plugins/quickinterpreter/pom.xml | 2 +- ide/plugins/rttraceviewer/META-INF/MANIFEST.MF | 2 +- ide/plugins/rttraceviewer/pom.xml | 2 +- ide/plugins/uml2.tests/META-INF/MANIFEST.MF | 2 +- ide/plugins/uml2.tests/pom.xml | 2 +- ide/plugins/uml2/META-INF/MANIFEST.MF | 2 +- ide/plugins/uml2/pom.xml | 2 +- ide/pom.xml | 4 ++-- ide/product/overture.product | 2 +- ide/product/pom.xml | 2 +- ide/tests/pom.xml | 2 +- ide/tests/ui/META-INF/MANIFEST.MF | 2 +- ide/tests/ui/pom.xml | 2 +- ide/ui/META-INF/MANIFEST.MF | 2 +- ide/ui/pom.xml | 2 +- ide/vdmpp/core/META-INF/MANIFEST.MF | 2 +- ide/vdmpp/core/pom.xml | 2 +- ide/vdmpp/debug/META-INF/MANIFEST.MF | 2 +- ide/vdmpp/debug/pom.xml | 2 +- ide/vdmpp/pom.xml | 2 +- ide/vdmpp/ui/META-INF/MANIFEST.MF | 2 +- ide/vdmpp/ui/pom.xml | 2 +- ide/vdmrt/core/META-INF/MANIFEST.MF | 2 +- ide/vdmrt/core/pom.xml | 2 +- ide/vdmrt/debug/META-INF/MANIFEST.MF | 2 +- ide/vdmrt/debug/pom.xml | 2 +- ide/vdmrt/pom.xml | 2 +- ide/vdmrt/ui/META-INF/MANIFEST.MF | 2 +- ide/vdmrt/ui/pom.xml | 2 +- ide/vdmsl/core/META-INF/MANIFEST.MF | 2 +- ide/vdmsl/core/pom.xml | 2 +- ide/vdmsl/debug/META-INF/MANIFEST.MF | 2 +- ide/vdmsl/debug/pom.xml | 2 +- ide/vdmsl/pom.xml | 2 +- ide/vdmsl/ui/META-INF/MANIFEST.MF | 2 +- ide/vdmsl/ui/pom.xml | 2 +- 111 files changed, 112 insertions(+), 112 deletions(-) diff --git a/ide/builders/pom.xml b/ide/builders/pom.xml index eaf4b5fe65..63fb61f2ce 100644 --- a/ide/builders/pom.xml +++ b/ide/builders/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/builders/vdmj/META-INF/MANIFEST.MF b/ide/builders/vdmj/META-INF/MANIFEST.MF index d5391a2e7a..ab1b11ea4d 100644 --- a/ide/builders/vdmj/META-INF/MANIFEST.MF +++ b/ide/builders/vdmj/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/builders/vdmj/pom.xml b/ide/builders/vdmj/pom.xml index 77e0383744..f16b05858f 100644 --- a/ide/builders/vdmj/pom.xml +++ b/ide/builders/vdmj/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.builders - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/core/META-INF/MANIFEST.MF b/ide/core/META-INF/MANIFEST.MF index 1f3340ae47..5661135d34 100644 --- a/ide/core/META-INF/MANIFEST.MF +++ b/ide/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/core/pom.xml b/ide/core/pom.xml index 70bb4e5be2..611ddbab99 100644 --- a/ide/core/pom.xml +++ b/ide/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/debug/META-INF/MANIFEST.MF b/ide/debug/META-INF/MANIFEST.MF index 3df4767c8b..20b83b6ec6 100644 --- a/ide/debug/META-INF/MANIFEST.MF +++ b/ide/debug/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/debug/pom.xml b/ide/debug/pom.xml index 2ea0d19ae9..d33ce6605d 100644 --- a/ide/debug/pom.xml +++ b/ide/debug/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/features/core/feature.xml b/ide/features/core/feature.xml index 8988d060cb..93f9693d66 100644 --- a/ide/features/core/feature.xml +++ b/ide/features/core/feature.xml @@ -2,7 +2,7 @@ diff --git a/ide/features/core/pom.xml b/ide/features/core/pom.xml index 56a7c41fa5..0fcdfe5b45 100644 --- a/ide/features/core/pom.xml +++ b/ide/features/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/features/pom.xml b/ide/features/pom.xml index d209851966..8e78cd4009 100644 --- a/ide/features/pom.xml +++ b/ide/features/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/features/rcp/feature.xml b/ide/features/rcp/feature.xml index cfa2e0ef3f..9a5a333c3b 100644 --- a/ide/features/rcp/feature.xml +++ b/ide/features/rcp/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/features/rcp/pom.xml b/ide/features/rcp/pom.xml index 222b5636a2..be9e2b65d4 100644 --- a/ide/features/rcp/pom.xml +++ b/ide/features/rcp/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/help/META-INF/MANIFEST.MF b/ide/help/META-INF/MANIFEST.MF index 00b8f105b5..7b0198faa3 100644 --- a/ide/help/META-INF/MANIFEST.MF +++ b/ide/help/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/help/pom.xml b/ide/help/pom.xml index a3c1fc0d3a..af0a77c6fb 100644 --- a/ide/help/pom.xml +++ b/ide/help/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/parsers/pom.xml b/ide/parsers/pom.xml index 4fd8cd9b15..0bb7b6c976 100644 --- a/ide/parsers/pom.xml +++ b/ide/parsers/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/parsers/vdmj/META-INF/MANIFEST.MF b/ide/parsers/vdmj/META-INF/MANIFEST.MF index 81e29e8fab..a4387d3d9c 100644 --- a/ide/parsers/vdmj/META-INF/MANIFEST.MF +++ b/ide/parsers/vdmj/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.parsers.vdmj diff --git a/ide/parsers/vdmj/pom.xml b/ide/parsers/vdmj/pom.xml index ca6fe74dbf..8367e3ce11 100644 --- a/ide/parsers/vdmj/pom.xml +++ b/ide/parsers/vdmj/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.parsers - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/platform/META-INF/MANIFEST.MF b/ide/platform/META-INF/MANIFEST.MF index e5cae7e035..714967b0a4 100644 --- a/ide/platform/META-INF/MANIFEST.MF +++ b/ide/platform/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.platform Bundle-SymbolicName: org.overture.ide.platform;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, diff --git a/ide/platform/pom.xml b/ide/platform/pom.xml index bf87b15943..e5b80cd368 100644 --- a/ide/platform/pom.xml +++ b/ide/platform/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/codegen/META-INF/MANIFEST.MF b/ide/plugins/codegen/META-INF/MANIFEST.MF index f6685b5154..fd5065243a 100644 --- a/ide/plugins/codegen/META-INF/MANIFEST.MF +++ b/ide/plugins/codegen/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Name: Code Generator Bundle-ManifestVersion: 2 diff --git a/ide/plugins/codegen/pom.xml b/ide/plugins/codegen/pom.xml index d01f957f9e..61638f7664 100644 --- a/ide/plugins/codegen/pom.xml +++ b/ide/plugins/codegen/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF b/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF index ddaef6a858..fe77506e7b 100644 --- a/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF +++ b/ide/plugins/combinatorialtesting/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/plugins/combinatorialtesting/pom.xml b/ide/plugins/combinatorialtesting/pom.xml index 1aa984c636..a7b743723a 100644 --- a/ide/plugins/combinatorialtesting/pom.xml +++ b/ide/plugins/combinatorialtesting/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/coverageeditor/META-INF/MANIFEST.MF b/ide/plugins/coverageeditor/META-INF/MANIFEST.MF index 46dd443336..a23aba0b6f 100644 --- a/ide/plugins/coverageeditor/META-INF/MANIFEST.MF +++ b/ide/plugins/coverageeditor/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.coverageeditor diff --git a/ide/plugins/coverageeditor/pom.xml b/ide/plugins/coverageeditor/pom.xml index 6345302365..81fdc83175 100644 --- a/ide/plugins/coverageeditor/pom.xml +++ b/ide/plugins/coverageeditor/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/csk/META-INF/MANIFEST.MF b/ide/plugins/csk/META-INF/MANIFEST.MF index 0fde579675..a17e91e2a6 100644 --- a/ide/plugins/csk/META-INF/MANIFEST.MF +++ b/ide/plugins/csk/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.csk diff --git a/ide/plugins/csk/pom.xml b/ide/plugins/csk/pom.xml index a6c3d28acc..47215b75cf 100644 --- a/ide/plugins/csk/pom.xml +++ b/ide/plugins/csk/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/developerutils/META-INF/MANIFEST.MF b/ide/plugins/developerutils/META-INF/MANIFEST.MF index 3ac2589eed..b8f031d046 100644 --- a/ide/plugins/developerutils/META-INF/MANIFEST.MF +++ b/ide/plugins/developerutils/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: Developer Utilities for Overture diff --git a/ide/plugins/developerutils/pom.xml b/ide/plugins/developerutils/pom.xml index 6cf9a43ea8..80d94f4bc6 100644 --- a/ide/plugins/developerutils/pom.xml +++ b/ide/plugins/developerutils/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/externaleditor/META-INF/MANIFEST.MF b/ide/plugins/externaleditor/META-INF/MANIFEST.MF index 15efa0f95e..4b42f397e0 100644 --- a/ide/plugins/externaleditor/META-INF/MANIFEST.MF +++ b/ide/plugins/externaleditor/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.externaleditor diff --git a/ide/plugins/externaleditor/pom.xml b/ide/plugins/externaleditor/pom.xml index 4b348f3403..8bace15f06 100644 --- a/ide/plugins/externaleditor/pom.xml +++ b/ide/plugins/externaleditor/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/codegen/feature.xml b/ide/plugins/features/codegen/feature.xml index 2cecfc7a33..40e0b95a1e 100644 --- a/ide/plugins/features/codegen/feature.xml +++ b/ide/plugins/features/codegen/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/codegen/pom.xml b/ide/plugins/features/codegen/pom.xml index 3f964a8dba..f518fe50a4 100644 --- a/ide/plugins/features/codegen/pom.xml +++ b/ide/plugins/features/codegen/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/combinatorialtesting/feature.xml b/ide/plugins/features/combinatorialtesting/feature.xml index a3014df9df..2f678e6ca1 100644 --- a/ide/plugins/features/combinatorialtesting/feature.xml +++ b/ide/plugins/features/combinatorialtesting/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/combinatorialtesting/pom.xml b/ide/plugins/features/combinatorialtesting/pom.xml index d2a8e9f167..96931aedaf 100644 --- a/ide/plugins/features/combinatorialtesting/pom.xml +++ b/ide/plugins/features/combinatorialtesting/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/coverageeditor/feature.xml b/ide/plugins/features/coverageeditor/feature.xml index b7612eef57..113422d83a 100644 --- a/ide/plugins/features/coverageeditor/feature.xml +++ b/ide/plugins/features/coverageeditor/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/coverageeditor/pom.xml b/ide/plugins/features/coverageeditor/pom.xml index f9074a1cd8..a3c0329a96 100644 --- a/ide/plugins/features/coverageeditor/pom.xml +++ b/ide/plugins/features/coverageeditor/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/csk/feature.xml b/ide/plugins/features/csk/feature.xml index 574a2f718d..2019088f6b 100644 --- a/ide/plugins/features/csk/feature.xml +++ b/ide/plugins/features/csk/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/csk/pom.xml b/ide/plugins/features/csk/pom.xml index 567a20b4a8..8fa7b8eb7c 100644 --- a/ide/plugins/features/csk/pom.xml +++ b/ide/plugins/features/csk/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/developerutils/feature.xml b/ide/plugins/features/developerutils/feature.xml index a57a539607..3c12b3ecdb 100644 --- a/ide/plugins/features/developerutils/feature.xml +++ b/ide/plugins/features/developerutils/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/developerutils/pom.xml b/ide/plugins/features/developerutils/pom.xml index 6706b4ccf6..20b3fc56aa 100644 --- a/ide/plugins/features/developerutils/pom.xml +++ b/ide/plugins/features/developerutils/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/guibuilder/feature.xml b/ide/plugins/features/guibuilder/feature.xml index 8f5ca6856f..23122ced4a 100644 --- a/ide/plugins/features/guibuilder/feature.xml +++ b/ide/plugins/features/guibuilder/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/guibuilder/pom.xml b/ide/plugins/features/guibuilder/pom.xml index 5eb222a940..a6b5e43c59 100644 --- a/ide/plugins/features/guibuilder/pom.xml +++ b/ide/plugins/features/guibuilder/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/latex/feature.xml b/ide/plugins/features/latex/feature.xml index f0d5577ff2..c70c4b83cd 100644 --- a/ide/plugins/features/latex/feature.xml +++ b/ide/plugins/features/latex/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/latex/pom.xml b/ide/plugins/features/latex/pom.xml index e920ddf9fe..4507e9e2c1 100644 --- a/ide/plugins/features/latex/pom.xml +++ b/ide/plugins/features/latex/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/pom.xml b/ide/plugins/features/pom.xml index 2e491cf809..c8762f2d1d 100644 --- a/ide/plugins/features/pom.xml +++ b/ide/plugins/features/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/poviewer/feature.xml b/ide/plugins/features/poviewer/feature.xml index 0081849b1c..b465b49670 100644 --- a/ide/plugins/features/poviewer/feature.xml +++ b/ide/plugins/features/poviewer/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/poviewer/pom.xml b/ide/plugins/features/poviewer/pom.xml index 7764226709..113e280eba 100644 --- a/ide/plugins/features/poviewer/pom.xml +++ b/ide/plugins/features/poviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/probruntime/feature.xml b/ide/plugins/features/probruntime/feature.xml index d292830b66..2f2128226d 100644 --- a/ide/plugins/features/probruntime/feature.xml +++ b/ide/plugins/features/probruntime/feature.xml @@ -2,7 +2,7 @@ diff --git a/ide/plugins/features/probruntime/pom.xml b/ide/plugins/features/probruntime/pom.xml index 1f415106ed..b907745d9e 100644 --- a/ide/plugins/features/probruntime/pom.xml +++ b/ide/plugins/features/probruntime/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/quickinterpreter/feature.xml b/ide/plugins/features/quickinterpreter/feature.xml index e33dd89b4d..f4b39a3a93 100644 --- a/ide/plugins/features/quickinterpreter/feature.xml +++ b/ide/plugins/features/quickinterpreter/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/quickinterpreter/pom.xml b/ide/plugins/features/quickinterpreter/pom.xml index 0e0502cd71..e3e60a7505 100644 --- a/ide/plugins/features/quickinterpreter/pom.xml +++ b/ide/plugins/features/quickinterpreter/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/rttraceviewer/feature.xml b/ide/plugins/features/rttraceviewer/feature.xml index 191cbdaba1..4e86afc93f 100644 --- a/ide/plugins/features/rttraceviewer/feature.xml +++ b/ide/plugins/features/rttraceviewer/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/rttraceviewer/pom.xml b/ide/plugins/features/rttraceviewer/pom.xml index 167d272bb7..095f483d0a 100644 --- a/ide/plugins/features/rttraceviewer/pom.xml +++ b/ide/plugins/features/rttraceviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/features/uml2/feature.xml b/ide/plugins/features/uml2/feature.xml index 42290a44fa..09b2f8138c 100644 --- a/ide/plugins/features/uml2/feature.xml +++ b/ide/plugins/features/uml2/feature.xml @@ -2,7 +2,7 @@ + version="2.2.2"> %description diff --git a/ide/plugins/features/uml2/pom.xml b/ide/plugins/features/uml2/pom.xml index 0b747a1c89..c8429130f1 100644 --- a/ide/plugins/features/uml2/pom.xml +++ b/ide/plugins/features/uml2/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.features - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/guibuilder/META-INF/MANIFEST.MF b/ide/plugins/guibuilder/META-INF/MANIFEST.MF index a22bed31ad..6ee88a6859 100644 --- a/ide/plugins/guibuilder/META-INF/MANIFEST.MF +++ b/ide/plugins/guibuilder/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/plugins/guibuilder/pom.xml b/ide/plugins/guibuilder/pom.xml index e512697f1e..d068eacca2 100644 --- a/ide/plugins/guibuilder/pom.xml +++ b/ide/plugins/guibuilder/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/latex/META-INF/MANIFEST.MF b/ide/plugins/latex/META-INF/MANIFEST.MF index 343c282364..7ea536f5ab 100644 --- a/ide/plugins/latex/META-INF/MANIFEST.MF +++ b/ide/plugins/latex/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.latex diff --git a/ide/plugins/latex/pom.xml b/ide/plugins/latex/pom.xml index 3082722075..ac6bc4155a 100644 --- a/ide/plugins/latex/pom.xml +++ b/ide/plugins/latex/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/pom.xml b/ide/plugins/pom.xml index 418ba7d656..6353a258e4 100644 --- a/ide/plugins/pom.xml +++ b/ide/plugins/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/poviewer/META-INF/MANIFEST.MF b/ide/plugins/poviewer/META-INF/MANIFEST.MF index 09922b3a33..7c4c3d826b 100644 --- a/ide/plugins/poviewer/META-INF/MANIFEST.MF +++ b/ide/plugins/poviewer/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Localization: plugin diff --git a/ide/plugins/poviewer/pom.xml b/ide/plugins/poviewer/pom.xml index cca7dd0a3d..543903e2f6 100644 --- a/ide/plugins/poviewer/pom.xml +++ b/ide/plugins/poviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF index f3a53e9e56..23b5f360fc 100644 --- a/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/core/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Eclipse-BundleShape: dir Bundle-Name: ProB Runtime diff --git a/ide/plugins/prob-runtime/core/pom.xml b/ide/plugins/prob-runtime/core/pom.xml index 8acc5e3b90..bc2c45dc06 100644 --- a/ide/plugins/prob-runtime/core/pom.xml +++ b/ide/plugins/prob-runtime/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF index 7f0b57deec..45efc3bfc8 100644 --- a/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/linux.x86/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.linux.x86;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/linux.x86/pom.xml b/ide/plugins/prob-runtime/linux.x86/pom.xml index 7af846a4ce..ac985fda09 100644 --- a/ide/plugins/prob-runtime/linux.x86/pom.xml +++ b/ide/plugins/prob-runtime/linux.x86/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF index 61ca3c9ba4..264a9fdf94 100644 --- a/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/linux.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.linux.x86_64;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/linux.x86_64/pom.xml b/ide/plugins/prob-runtime/linux.x86_64/pom.xml index dd4a1c1de1..b66a0f5765 100644 --- a/ide/plugins/prob-runtime/linux.x86_64/pom.xml +++ b/ide/plugins/prob-runtime/linux.x86_64/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF index 97bfb2e559..20a5681fd1 100644 --- a/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/macosx.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.macosx.x86_64;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/macosx.x86_64/pom.xml b/ide/plugins/prob-runtime/macosx.x86_64/pom.xml index 9b7da34398..ad477ea5b3 100644 --- a/ide/plugins/prob-runtime/macosx.x86_64/pom.xml +++ b/ide/plugins/prob-runtime/macosx.x86_64/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/prob-runtime/pom.xml b/ide/plugins/prob-runtime/pom.xml index f3e198b57b..d98174d180 100644 --- a/ide/plugins/prob-runtime/pom.xml +++ b/ide/plugins/prob-runtime/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF b/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF index 8c27df989f..c7cf64842d 100644 --- a/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF +++ b/ide/plugins/prob-runtime/win32.win32/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Eclipse-BundleShape: dir Bundle-ManifestVersion: 2 Bundle-Name: org.overture.ide.plugins.probruntime Bundle-SymbolicName: org.overture.ide.plugins.probruntime.win32.win32;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Fragment-Host: org.overture.ide.plugins.probruntime.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/ide/plugins/prob-runtime/win32.win32/pom.xml b/ide/plugins/prob-runtime/win32.win32/pom.xml index 3b92b1f10a..70db2768ec 100644 --- a/ide/plugins/prob-runtime/win32.win32/pom.xml +++ b/ide/plugins/prob-runtime/win32.win32/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide.plugins org.overture.ide.plugins.probruntime - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF b/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF index 7e010e1a4b..e8f6d61371 100644 --- a/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF +++ b/ide/plugins/quickinterpreter/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.quickinterpreter diff --git a/ide/plugins/quickinterpreter/pom.xml b/ide/plugins/quickinterpreter/pom.xml index 1883c3161b..38099b5e9a 100644 --- a/ide/plugins/quickinterpreter/pom.xml +++ b/ide/plugins/quickinterpreter/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF b/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF index a3f3ac362c..b95dd2874a 100644 --- a/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF +++ b/ide/plugins/rttraceviewer/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.rttraceviewer diff --git a/ide/plugins/rttraceviewer/pom.xml b/ide/plugins/rttraceviewer/pom.xml index 289b5f9122..2b3d43f302 100644 --- a/ide/plugins/rttraceviewer/pom.xml +++ b/ide/plugins/rttraceviewer/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/uml2.tests/META-INF/MANIFEST.MF b/ide/plugins/uml2.tests/META-INF/MANIFEST.MF index 2cd7880966..cac406c981 100644 --- a/ide/plugins/uml2.tests/META-INF/MANIFEST.MF +++ b/ide/plugins/uml2.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.plugins.uml2.tests diff --git a/ide/plugins/uml2.tests/pom.xml b/ide/plugins/uml2.tests/pom.xml index 29439bed9a..627699af59 100644 --- a/ide/plugins/uml2.tests/pom.xml +++ b/ide/plugins/uml2.tests/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/plugins/uml2/META-INF/MANIFEST.MF b/ide/plugins/uml2/META-INF/MANIFEST.MF index 41cac381eb..ef4d8c1414 100644 --- a/ide/plugins/uml2/META-INF/MANIFEST.MF +++ b/ide/plugins/uml2/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Name: UML2 Translator Bundle-ManifestVersion: 2 diff --git a/ide/plugins/uml2/pom.xml b/ide/plugins/uml2/pom.xml index 5cc3812407..35195c8701 100644 --- a/ide/plugins/uml2/pom.xml +++ b/ide/plugins/uml2/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.plugins - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/pom.xml b/ide/pom.xml index 20657ee880..0cfb839f2f 100644 --- a/ide/pom.xml +++ b/ide/pom.xml @@ -5,11 +5,11 @@ org.overturetool root - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml - pom +pom ide Overture IDE Top-level Super POM for all IDE (Eclipse) artifacts. diff --git a/ide/product/overture.product b/ide/product/overture.product index 4ffbbcf872..7bac60d75f 100644 --- a/ide/product/overture.product +++ b/ide/product/overture.product @@ -1,7 +1,7 @@ - + diff --git a/ide/product/pom.xml b/ide/product/pom.xml index 5f6061ac47..fa3df286db 100644 --- a/ide/product/pom.xml +++ b/ide/product/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/tests/pom.xml b/ide/tests/pom.xml index bc9d245e7b..7409061785 100644 --- a/ide/tests/pom.xml +++ b/ide/tests/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/tests/ui/META-INF/MANIFEST.MF b/ide/tests/ui/META-INF/MANIFEST.MF index db974817fd..a8648cf0ac 100644 --- a/ide/tests/ui/META-INF/MANIFEST.MF +++ b/ide/tests/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.tests.ui diff --git a/ide/tests/ui/pom.xml b/ide/tests/ui/pom.xml index 3cead7ff81..4a27a37c7a 100644 --- a/ide/tests/ui/pom.xml +++ b/ide/tests/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.tests - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/ui/META-INF/MANIFEST.MF b/ide/ui/META-INF/MANIFEST.MF index efd1a88a79..d154a1e394 100644 --- a/ide/ui/META-INF/MANIFEST.MF +++ b/ide/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.ui diff --git a/ide/ui/pom.xml b/ide/ui/pom.xml index 8cc38ed58f..3dde557224 100644 --- a/ide/ui/pom.xml +++ b/ide/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmpp/core/META-INF/MANIFEST.MF b/ide/vdmpp/core/META-INF/MANIFEST.MF index 766bcb5c89..051b1a39e1 100644 --- a/ide/vdmpp/core/META-INF/MANIFEST.MF +++ b/ide/vdmpp/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmpp.core diff --git a/ide/vdmpp/core/pom.xml b/ide/vdmpp/core/pom.xml index b13bad8398..8b57f42923 100644 --- a/ide/vdmpp/core/pom.xml +++ b/ide/vdmpp/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmpp - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmpp/debug/META-INF/MANIFEST.MF b/ide/vdmpp/debug/META-INF/MANIFEST.MF index c5db33a46e..ba09194c80 100644 --- a/ide/vdmpp/debug/META-INF/MANIFEST.MF +++ b/ide/vdmpp/debug/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmpp.debug diff --git a/ide/vdmpp/debug/pom.xml b/ide/vdmpp/debug/pom.xml index eae37812ea..30f2a142b4 100644 --- a/ide/vdmpp/debug/pom.xml +++ b/ide/vdmpp/debug/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmpp - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmpp/pom.xml b/ide/vdmpp/pom.xml index 35796de967..9553e58f09 100644 --- a/ide/vdmpp/pom.xml +++ b/ide/vdmpp/pom.xml @@ -4,7 +4,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmpp/ui/META-INF/MANIFEST.MF b/ide/vdmpp/ui/META-INF/MANIFEST.MF index 85aa346c3d..696332288b 100644 --- a/ide/vdmpp/ui/META-INF/MANIFEST.MF +++ b/ide/vdmpp/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmpp.ui diff --git a/ide/vdmpp/ui/pom.xml b/ide/vdmpp/ui/pom.xml index b7750ab3c2..c3d713876f 100644 --- a/ide/vdmpp/ui/pom.xml +++ b/ide/vdmpp/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmpp - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmrt/core/META-INF/MANIFEST.MF b/ide/vdmrt/core/META-INF/MANIFEST.MF index f5f9e71570..aaf80d16df 100644 --- a/ide/vdmrt/core/META-INF/MANIFEST.MF +++ b/ide/vdmrt/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmrt.core diff --git a/ide/vdmrt/core/pom.xml b/ide/vdmrt/core/pom.xml index 149043f2a7..bcf105d9c8 100644 --- a/ide/vdmrt/core/pom.xml +++ b/ide/vdmrt/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmrt - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmrt/debug/META-INF/MANIFEST.MF b/ide/vdmrt/debug/META-INF/MANIFEST.MF index e2c927a464..5b91408079 100644 --- a/ide/vdmrt/debug/META-INF/MANIFEST.MF +++ b/ide/vdmrt/debug/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmrt.debug diff --git a/ide/vdmrt/debug/pom.xml b/ide/vdmrt/debug/pom.xml index 8bd6397980..5195945841 100644 --- a/ide/vdmrt/debug/pom.xml +++ b/ide/vdmrt/debug/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmrt - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmrt/pom.xml b/ide/vdmrt/pom.xml index 7a1b3cd3ac..257f139117 100644 --- a/ide/vdmrt/pom.xml +++ b/ide/vdmrt/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmrt/ui/META-INF/MANIFEST.MF b/ide/vdmrt/ui/META-INF/MANIFEST.MF index 5d87ba1f7b..9ac4c3e7e7 100644 --- a/ide/vdmrt/ui/META-INF/MANIFEST.MF +++ b/ide/vdmrt/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmrt.ui diff --git a/ide/vdmrt/ui/pom.xml b/ide/vdmrt/ui/pom.xml index 6f08432859..1032205d34 100644 --- a/ide/vdmrt/ui/pom.xml +++ b/ide/vdmrt/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmrt - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmsl/core/META-INF/MANIFEST.MF b/ide/vdmsl/core/META-INF/MANIFEST.MF index ab38a95d1e..f6878bd5ea 100644 --- a/ide/vdmsl/core/META-INF/MANIFEST.MF +++ b/ide/vdmsl/core/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmsl.core diff --git a/ide/vdmsl/core/pom.xml b/ide/vdmsl/core/pom.xml index 4565adb066..be6b30be86 100644 --- a/ide/vdmsl/core/pom.xml +++ b/ide/vdmsl/core/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmsl - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmsl/debug/META-INF/MANIFEST.MF b/ide/vdmsl/debug/META-INF/MANIFEST.MF index 5144a14d52..ef536928c3 100644 --- a/ide/vdmsl/debug/META-INF/MANIFEST.MF +++ b/ide/vdmsl/debug/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmsl.debug diff --git a/ide/vdmsl/debug/pom.xml b/ide/vdmsl/debug/pom.xml index f9d8946941..692669c612 100644 --- a/ide/vdmsl/debug/pom.xml +++ b/ide/vdmsl/debug/pom.xml @@ -4,7 +4,7 @@ org.overturetool.ide org.overture.ide.vdmsl - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmsl/pom.xml b/ide/vdmsl/pom.xml index 93c35f25ed..e440893681 100644 --- a/ide/vdmsl/pom.xml +++ b/ide/vdmsl/pom.xml @@ -5,7 +5,7 @@ org.overturetool ide - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml diff --git a/ide/vdmsl/ui/META-INF/MANIFEST.MF b/ide/vdmsl/ui/META-INF/MANIFEST.MF index b73a496d98..ea3b5ddb8d 100644 --- a/ide/vdmsl/ui/META-INF/MANIFEST.MF +++ b/ide/vdmsl/ui/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-Vendor: Overture Bundle-ActivationPolicy: lazy -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 2.2.2 Eclipse-BuddyPolicy: registered Bundle-Localization: plugin Bundle-Name: org.overture.ide.vdmsl.ui diff --git a/ide/vdmsl/ui/pom.xml b/ide/vdmsl/ui/pom.xml index fb7a905dc6..3c9208fdb3 100644 --- a/ide/vdmsl/ui/pom.xml +++ b/ide/vdmsl/ui/pom.xml @@ -5,7 +5,7 @@ org.overturetool.ide org.overture.ide.vdmsl - 2.2.1-SNAPSHOT + 2.2.2 ../pom.xml