-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add expression and bind checks to exception checking, see #14
- Loading branch information
1 parent
759f6ff
commit 62ab12e
Showing
57 changed files
with
1,106 additions
and
575 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...mples/src/test/resources/external/cgip/sltest/CORE/expr/recmodify/recmodify-11.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: recmodify-11.vdm at 11:3 Body of trap statement does not throw exceptions"] | ||
["recmodify-11.vdmparses and type checks"] |
2 changes: 1 addition & 1 deletion
2
...les/src/test/resources/external/cgip/sltest/CORE/expr/recordexpr/recordexpr-10.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: recordexpr-10.vdm at 15:1 Body of trap statement does not throw exceptions"] | ||
["recordexpr-10.vdmparses and type checks"] |
2 changes: 1 addition & 1 deletion
2
...g/samples/src/test/resources/external/cgip/sltest/CORE/expr/setcomp/setcomp-09.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: setcomp-09.vdm at 14:1 Body of trap statement does not throw exceptions"] | ||
["setcomp-09.vdmparses and type checks"] |
2 changes: 1 addition & 1 deletion
2
...c/test/resources/external/cgip/sltest/CORE/expr/typejudgement/typejudgement-03.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: typejudgement-03.vdm at 16:4 Body of trap statement does not throw exceptions"] | ||
["typejudgement-03.vdmparses and type checks"] |
2 changes: 1 addition & 1 deletion
2
...mples/src/test/resources/external/cgip/sltest/CORE/stmt/exception/exception-08.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: exception-08.vdm at 16:3 Body of trap statement does not throw exceptions"] | ||
["exception-08.vdmparses and type checks"] |
2 changes: 1 addition & 1 deletion
2
...mples/src/test/resources/external/cgip/sltest/CORE/stmt/exception/exception-09.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: exception-09.vdm at 16:3 Body of trap statement does not throw exceptions","Error 3327: exception-09.vdm at 40:8 Value is not of the right type","Error 3027: exception-09.vdm at 35:1 Operation returns unexpected type"] | ||
["Error 3327: exception-09.vdm at 40:8 Value is not of the right type","Error 3027: exception-09.vdm at 35:1 Operation returns unexpected type"] |
2 changes: 1 addition & 1 deletion
2
...rc/test/resources/external/cgip/sltest/CORE/stmt/simple-blockstmt/blockstmt-07.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: blockstmt-07.vdm at 10:1 Body of trap statement does not throw exceptions"] | ||
["blockstmt-07.vdmparses and type checks"] |
2 changes: 1 addition & 1 deletion
2
...les/src/test/resources/external/tc/pptest/fulltest/PP/stmtpp/trapstmt/trapstmt.vpp.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: trapstmt.vpp at 15:3 Body of trap statement does not throw exceptions","Error 3328: trapstmt.vpp at 33:5 Statement may return void value","Error 3241: trapstmt.vpp at 26:3 Body of trap statement does not throw exceptions","Error 3327: trapstmt.vpp at 27:33 Value is not of the right type","Error 3129: trapstmt.vpp at 27:26 Constructor field 2 is of wrong type","Error 3313: trapstmt.vpp at 24:3 Operation returns void value"] | ||
["Error 3328: trapstmt.vpp at 33:5 Statement may return void value","Error 3241: trapstmt.vpp at 26:3 Body of trap statement does not throw exceptions","Error 3327: trapstmt.vpp at 27:33 Value is not of the right type","Error 3129: trapstmt.vpp at 27:26 Constructor field 2 is of wrong type","Error 3313: trapstmt.vpp at 24:3 Operation returns void value"] |
2 changes: 1 addition & 1 deletion
2
...rc/test/resources/external/tc/sltest/fulltest/CORE/stmt/casesstmt/casesstmt-17.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3327: casesstmt-17.vdm at 15:17 Value is not of the right type","Error 3327: casesstmt-17.vdm at 19:17 Value is not of the right type","Error 3241: casesstmt-17.vdm at 18:15 Body of trap statement does not throw exceptions","Error 3213: casesstmt-17.vdm at 18:29 Operation ErrorAction is not in scope"] | ||
["Error 3327: casesstmt-17.vdm at 15:17 Value is not of the right type","Error 3327: casesstmt-17.vdm at 19:17 Value is not of the right type","Error 3213: casesstmt-17.vdm at 18:29 Operation ErrorAction is not in scope"] |
2 changes: 1 addition & 1 deletion
2
.../samples/src/test/resources/external/tc/sltest/fulltest/CORE/stmt/ifstmt/if-18.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3327: if-18.vdm at 15:17 Value is not of the right type","Error 3327: if-18.vdm at 18:17 Value is not of the right type","Error 3241: if-18.vdm at 17:10 Body of trap statement does not throw exceptions","Error 3213: if-18.vdm at 17:24 Operation ErrorAction is not in scope"] | ||
["Error 3327: if-18.vdm at 15:17 Value is not of the right type","Error 3327: if-18.vdm at 18:17 Value is not of the right type","Error 3213: if-18.vdm at 17:24 Operation ErrorAction is not in scope"] |
2 changes: 1 addition & 1 deletion
2
...les/src/test/resources/external/tc/sltest/fulltest/SL/stmtsl/trapstmt/trapstmt.vdm.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Error 3241: trapstmt.vdm at 18:3 Body of trap statement does not throw exceptions","Error 3328: trapstmt.vdm at 36:5 Statement may return void value","Error 3241: trapstmt.vdm at 29:3 Body of trap statement does not throw exceptions","Error 3327: trapstmt.vdm at 30:33 Value is not of the right type","Error 3129: trapstmt.vdm at 30:26 Constructor field 2 is of wrong type","Error 3313: trapstmt.vdm at 27:3 Operation returns void value"] | ||
["Error 3328: trapstmt.vdm at 36:5 Statement may return void value","Error 3241: trapstmt.vdm at 29:3 Body of trap statement does not throw exceptions","Error 3327: trapstmt.vdm at 30:33 Value is not of the right type","Error 3129: trapstmt.vdm at 30:26 Constructor field 2 is of wrong type","Error 3313: trapstmt.vdm at 27:3 Operation returns void value"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...echecker/src/main/java/org/overture/typechecker/assistant/expression/PExpAssistantTC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* | ||
*/ | ||
package org.overture.typechecker.assistant.expression; | ||
|
||
import java.util.List; | ||
|
||
import org.overture.ast.analysis.AnalysisException; | ||
import org.overture.ast.analysis.intf.IQuestionAnswer; | ||
import org.overture.ast.assistant.IAstAssistant; | ||
import org.overture.ast.expressions.PExp; | ||
import org.overture.ast.patterns.PMultipleBind; | ||
import org.overture.ast.util.PTypeSet; | ||
import org.overture.typechecker.Environment; | ||
import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory; | ||
|
||
public class PExpAssistantTC implements IAstAssistant | ||
{ | ||
protected final ITypeCheckerAssistantFactory af; | ||
|
||
public PExpAssistantTC(ITypeCheckerAssistantFactory af) | ||
{ | ||
this.af = af; | ||
} | ||
|
||
public PTypeSet exitCheck(List<PExp> args, Environment env) throws AnalysisException | ||
{ | ||
PTypeSet result = new PTypeSet(af); | ||
IQuestionAnswer<Environment, PTypeSet> checker = af.getExitTypeCollector(); | ||
|
||
for (PExp exp: args) | ||
{ | ||
result.addAll(exp.apply(checker, env)); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
public PTypeSet exitCheckMultipleBindList(List<PMultipleBind> bindList, Environment env) throws AnalysisException | ||
{ | ||
PTypeSet result = new PTypeSet(af); | ||
IQuestionAnswer<Environment, PTypeSet> checker = af.getExitTypeCollector(); | ||
|
||
for (PMultipleBind mbind: bindList) | ||
{ | ||
result.addAll(mbind.apply(checker, env)); | ||
} | ||
|
||
return result; | ||
} | ||
} |
Oops, something went wrong.