Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
a2b1fa2f
Commit
a2b1fa2f
authored
May 01, 2018
by
LULUDBR\Lulu
Browse files
Savepoints ground + adding Info + Warning dialog + expansion of goalmatcher
parent
e141acf7
Pipeline
#21480
passed with stages
in 4 minutes and 15 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/SavepointVisitor.java
0 → 100644
View file @
a2b1fa2f
package
edu.kit.iti.formal.psdbg.parser
;
import
edu.kit.iti.formal.psdbg.parser.ast.*
;
import
javafx.util.Pair
;
public
class
SavepointVisitor
extends
DefaultASTVisitor
{
@Override
public
Parameters
visit
(
CallStatement
call
)
{
if
(
call
.
getCommand
().
toString
().
equals
(
"save"
))
{
Parameters
param
=
call
.
getParameters
().
copy
();
return
param
;
}
else
{
return
null
;
}
}
}
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/funchdl/SaveCommand.java
0 → 100644
View file @
a2b1fa2f
package
edu.kit.iti.formal.psdbg.interpreter.funchdl
;
import
edu.kit.iti.formal.psdbg.interpreter.Interpreter
;
import
edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment
;
import
edu.kit.iti.formal.psdbg.parser.ast.CallStatement
;
import
edu.kit.iti.formal.psdbg.parser.ast.Parameters
;
import
edu.kit.iti.formal.psdbg.parser.ast.Variable
;
import
edu.kit.iti.formal.psdbg.parser.data.Value
;
import
java.io.File
;
import
java.math.BigInteger
;
import
java.nio.file.Path
;
public
class
SaveCommand
extends
BuiltinCommands
.
BuiltinCommand
<
String
>{
public
SaveCommand
()
{
super
(
"save"
);
}
@Override
public
void
evaluate
(
Interpreter
<
String
>
interpreter
,
CallStatement
call
,
VariableAssignment
params
,
String
data
)
{
//TODO: another param entry with id for the savepoint
Value
<
Path
>
val
=
(
Value
<
Path
>)
params
.
getValues
().
getOrDefault
(
new
Variable
(
"filepath"
),
Value
.
from
(
2
));
File
savepoint
=
new
File
(
val
.
toString
());
}
private
class
Parameters
extends
edu
.
kit
.
iti
.
formal
.
psdbg
.
parser
.
ast
.
Parameters
{
}
}
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
View file @
a2b1fa2f
...
...
@@ -74,6 +74,7 @@ import java.io.IOException;
import
java.io.PrintWriter
;
import
java.net.URL
;
import
java.nio.charset.Charset
;
import
java.nio.file.Path
;
import
java.time.Duration
;
import
java.util.*
;
import
java.util.concurrent.*
;
...
...
@@ -133,6 +134,9 @@ public class DebuggerMain implements Initializable {
@FXML
private
Button
interactive_undo
;
@FXML
private
ComboBox
<
Path
>
combo_savepoints
;
private
JavaArea
javaArea
=
new
JavaArea
();
private
DockNode
javaAreaDock
=
new
DockNode
(
javaArea
,
"Java Source"
,
...
...
@@ -356,6 +360,7 @@ public class DebuggerMain implements Initializable {
statusBar
.
interpreterStatusModelProperty
().
bind
(
model
.
interpreterStateProperty
());
renewThreadStateTimer
();
}
/**
...
...
@@ -934,7 +939,7 @@ public class DebuggerMain implements Initializable {
assert
model
.
getDebuggerFramework
()
!=
null
:
"You should have started the prove"
;
model
.
getDebuggerFramework
().
execute
(
new
ContinueCommand
<>());
}
catch
(
DebuggerException
e
)
{
Utils
.
show
Exception
Dialog
(
""
,
""
,
""
,
e
);
Utils
.
show
Warning
Dialog
(
""
,
""
,
""
,
e
);
LOGGER
.
error
(
e
);
}
}
...
...
@@ -1229,6 +1234,12 @@ public class DebuggerMain implements Initializable {
}
}
@FXML
public
void
selectSavepoint
(
ActionEvent
actionEvent
)
{
}
@FXML
public
void
showWelcomeDock
(
ActionEvent
actionEvent
)
{
if
(!
welcomePaneDock
.
isDocked
()
&&
!
welcomePaneDock
.
isFloating
())
{
...
...
@@ -1475,6 +1486,8 @@ public class DebuggerMain implements Initializable {
}
}
//endregion
}
//deprecated
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/InteractiveModeController.java
View file @
a2b1fa2f
...
...
@@ -213,7 +213,7 @@ public class InteractiveModeController {
sb
.
append
(
"\nSequent Formula: formula="
).
append
(
sfTerm
);
sb
.
append
(
"\nOn Sub Term: on="
).
append
(
onTerm
);
Utils
.
show
Exception
Dialog
(
"Proof Command was not applicable"
,
Utils
.
show
Warning
Dialog
(
"Proof Command was not applicable"
,
"Proof Command was not applicable."
,
sb
.
toString
(),
e
);
}
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/SequentOptionsMenu.java
View file @
a2b1fa2f
...
...
@@ -49,7 +49,7 @@ public class SequentOptionsMenu extends ContextMenu {
}
catch
(
Exception
e
)
{
Utils
.
show
Exception
Dialog
(
"Please Select a Goal first."
,
Utils
.
show
Info
Dialog
(
"Please Select a Goal first."
,
"Please Select a Goal node from the list first to open the SequentMatcher Window."
,
"Please Select a Goal node from the list first to open the SequentMatcher Window."
,
e
);
// e.printStackTrace();
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/Utils.java
View file @
a2b1fa2f
...
...
@@ -203,6 +203,48 @@ public class Utils {
alert
.
showAndWait
();
}
public
static
void
showWarningDialog
(
String
title
,
String
headerText
,
String
contentText
,
Throwable
ex
)
{
Alert
alert
=
new
Alert
(
Alert
.
AlertType
.
WARNING
);
alert
.
setTitle
(
title
);
alert
.
setHeaderText
(
headerText
);
alert
.
setContentText
(
contentText
);
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
ex
.
printStackTrace
(
pw
);
String
exceptionText
=
sw
.
toString
();
alert
.
setWidth
(
400
);
alert
.
setHeight
(
400
);
alert
.
setHeight
(
600
);
alert
.
setWidth
(
400
);
alert
.
showAndWait
();
}
public
static
void
showInfoDialog
(
String
title
,
String
headerText
,
String
contentText
,
Throwable
ex
)
{
Alert
alert
=
new
Alert
(
Alert
.
AlertType
.
INFORMATION
);
alert
.
setTitle
(
title
);
alert
.
setHeaderText
(
headerText
);
alert
.
setContentText
(
contentText
);
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
ex
.
printStackTrace
(
pw
);
String
exceptionText
=
sw
.
toString
();
alert
.
setWidth
(
400
);
alert
.
setHeight
(
400
);
alert
.
setHeight
(
600
);
alert
.
setWidth
(
400
);
alert
.
showAndWait
();
}
public
static
void
addDebugListener
(
Property
<?>
property
)
{
property
.
addListener
((
ChangeListener
<
Object
>)
(
observable
,
oldValue
,
newValue
)
->
{
String
simpleName
=
property
.
getBean
()
!=
null
?
property
.
getBean
().
getClass
().
getSimpleName
()
:
"<n/a>"
;
...
...
ui/src/main/resources/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.fxml
View file @
a2b1fa2f
...
...
@@ -323,7 +323,9 @@
<Tooltip
text=
"Undo"
/>
</tooltip>
</Button>
<ComboBox
fx:id=
"combo_savepoints"
disable=
"true"
prefWidth=
"100"
prefHeight=
"30"
>
</ComboBox>
<Pane
HBox.hgrow=
"ALWAYS"
/>
<Label
text=
"Windows:"
/>
...
...
ui/src/main/resources/edu/kit/iti/formal/psdbg/gui/controls/InspectionView.fxml
View file @
a2b1fa2f
...
...
@@ -27,7 +27,7 @@
<Label
labelFor=
"$frames"
text=
"Contexts:"
/>
<ComboBox
fx:id=
"frames"
HBox.hgrow=
"ALWAYS"
/>
</HBox>
<ListView
fx:id=
"goalView"
/>
<ListView
fx:id=
"goalView"
styleClass=
"goal-view"
/>
</VBox>
</center>
</SectionPane>
...
...
ui/src/main/resources/edu/kit/iti/formal/psdbg/gui/controls/SequentMatcher.fxml
View file @
a2b1fa2f
...
...
@@ -31,6 +31,13 @@
<ListView
fx:id=
"goalView"
/>
</VBox>
</center>
<Label
text=
"Matching Pattern for Goals"
></Label>
<TextArea
fx:id=
"matchpattern_goal"
minHeight=
"0.0"
minWidth=
"0.0"
prefHeight=
"159.0"
prefWidth=
"639.0"
/>
<Button
mnemonicParsing=
"false"
text=
"Start Matching"
onMouseClicked=
"#startMatchGoal"
/>
</SectionPane>
<SplitPane
dividerPositions=
"0.4189895470383275"
prefHeight=
"500"
prefWidth=
"800"
>
<SectionPane
title=
"Sequent"
minHeight=
"0.0"
minWidth=
"0.0"
prefHeight=
"633.0"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment