Commit 880c6ea1 authored by Sarah Grebing's avatar Sarah Grebing

changes to paths

parent 165768de
Pipeline #13224 failed with stage
in 13 seconds
...@@ -107,18 +107,18 @@ repeatStmt ...@@ -107,18 +107,18 @@ repeatStmt
casesStmt casesStmt
: CASES INDENT : CASES INDENT
casesList* casesList*
(DEFAULT COLON? INDENT (DEFAULT COLON? INDENT?
defList=stmtList defList=stmtList
DEDENT)? DEDENT?)?
DEDENT DEDENT
; ;
casesList casesList
: CASE (TRY | expression | closesExpression) COLON? INDENT stmtList DEDENT : (TRY | CASE (expression | closesExpression)) COLON? INDENT? stmtList DEDENT?
; ;
closesExpression closesExpression
: CLOSES closesScript= scriptCommand : CLOSES INDENT closesScript=stmtList DEDENT
; ;
forEachStmt forEachStmt
......
...@@ -328,7 +328,7 @@ public class TransformAst implements ScriptLanguageVisitor<Object> { ...@@ -328,7 +328,7 @@ public class TransformAst implements ScriptLanguageVisitor<Object> {
ClosesCase closesCase = new ClosesCase(); ClosesCase closesCase = new ClosesCase();
closesCase.setClosedStmt(true); closesCase.setClosedStmt(true);
closesCase.setRuleContext(ctx); closesCase.setRuleContext(ctx);
closesCase.setClosesScript((CallStatement) ctx.closesExpression().closesScript.accept(this)); closesCase.setClosesScript((Statements) ctx.closesExpression().closesScript.accept(this));
closesCase.setBody((Statements) ctx.stmtList().accept(this)); closesCase.setBody((Statements) ctx.stmtList().accept(this));
return closesCase; return closesCase;
......
...@@ -16,7 +16,7 @@ public class ClosesCase extends CaseStatement { ...@@ -16,7 +16,7 @@ public class ClosesCase extends CaseStatement {
/** /**
* Script that should be executed and shown whether case can be closed * Script that should be executed and shown whether case can be closed
*/ */
private CallStatement closesScript; private Statements closesScript;
/** /**
* A close subscript() {bodyscript} expression * A close subscript() {bodyscript} expression
...@@ -24,7 +24,7 @@ public class ClosesCase extends CaseStatement { ...@@ -24,7 +24,7 @@ public class ClosesCase extends CaseStatement {
* @param closesScript the script that is exectued in order to determine whether goal would clos. This proof is pruned afterwards * @param closesScript the script that is exectued in order to determine whether goal would clos. This proof is pruned afterwards
* @param body the actual script that is then executed when closesscript was successful and pruned * @param body the actual script that is then executed when closesscript was successful and pruned
*/ */
public ClosesCase(CallStatement closesScript, Statements body) { public ClosesCase(Statements closesScript, Statements body) {
this.body = body; this.body = body;
this.closesScript = closesScript; this.closesScript = closesScript;
} }
...@@ -41,8 +41,8 @@ public class ClosesCase extends CaseStatement { ...@@ -41,8 +41,8 @@ public class ClosesCase extends CaseStatement {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public tryCase copy() { public ClosesCase copy() {
return new tryCase(body.copy()); return new ClosesCase(closesScript.copy(), body.copy());
} }
} }
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<module>rt</module> <module>rt</module>
<module>rt-key</module> <module>rt-key</module>
<module>ui</module> <module>ui</module>
<module>DockFX</module> <module>lib/DockFX</module>
<module>lint</module> <module>lint</module>
<module>keydeps</module> <module>keydeps</module>
<module>matcher</module> <module>matcher</module>
......
...@@ -39,8 +39,11 @@ public class ProofScriptDebugger extends Application { ...@@ -39,8 +39,11 @@ public class ProofScriptDebugger extends Application {
Locale.setDefault(Locale.ENGLISH); Locale.setDefault(Locale.ENGLISH);
try { try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(
"controller/DebuggerMain.fxml")); // FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(
// "controller/DebuggerMain.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.fxml"));
//"/edu/kit/formal/psdb/gui/controller/DebuggerMain.fxml"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();
//DebuggerMain controller = fxmlLoader.<DebuggerMain>getController(); //DebuggerMain controller = fxmlLoader.<DebuggerMain>getController();
Scene scene = new Scene(root); Scene scene = new Scene(root);
......
package edu.kit.iti.formal.psdbg.gui.controls; package edu.kit.iti.formal.psdbg.gui.controls;
import edu.kit.iti.formal.psdbg.examples.Examples;
import edu.kit.iti.formal.psdbg.gui.controller.DebuggerMain; import edu.kit.iti.formal.psdbg.gui.controller.DebuggerMain;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
...@@ -21,13 +22,19 @@ public class WelcomePane extends AnchorPane { ...@@ -21,13 +22,19 @@ public class WelcomePane extends AnchorPane {
public void loadContraPosition(ActionEvent event) { public void loadContraPosition(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close(); proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null); proofScriptDebugger.showActiveInspector(null);
proofScriptDebugger.openScript(
new File("src/test/resources/edu/kit/formal/psdb/interpreter/contraposition/w_branching.kps") Examples.loadExamples().forEach(example -> {
if (example.getName().equals("Contraposition"))
example.open(proofScriptDebugger);
});
/* proofScriptDebugger.openScript(
new File("")
); );
proofScriptDebugger.openKeyFile( proofScriptDebugger.openKeyFile(
new File("src/test/resources/edu/kit/formal/psdb/interpreter/contraposition/contraposition.key")); new File("src/test/resources/edu/kit/formal/psdb/interpreter/contraposition/contraposition.key"));
*/
} }
public void loadJavaTest(ActionEvent event) { public void loadJavaTest(ActionEvent event) {
......
<html> <html>
<body> <body>
<h1>Contraposition</h1> <h1>Contraposition</h1>
<p>To load a script it needs to be called in the main script.
For example to load the script cpwob() type <i>cpwob;</i> in the body of the script <i> main()</i></p>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -16,4 +16,36 @@ script cpwob () { ...@@ -16,4 +16,36 @@ script cpwob () {
replace_known_left occ='2'; replace_known_left occ='2';
concrete_impl_1; concrete_impl_1;
close; close;
}
script cpwb () {
impRight;
impLeft;
cases{
case match `==> p`:{
auto;
}
default:{
auto;
}
}
}
script cpClosable(){
impRight;
impRight;
cases{
case try:{
notLeft;
notRight;
replace_known_left occ='2';
concrete_impl_1;
close;
}
default:{
auto;
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment