Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
sarah.grebing
ProofScriptParser
Commits
ef5271b4
Commit
ef5271b4
authored
Feb 05, 2018
by
Sarah Grebing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix interactive mode
parent
6b3f4efe
Pipeline
#17887
failed with stages
in 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/CaseStatement.java
...va/edu/kit/iti/formal/psdbg/parser/ast/CaseStatement.java
+1
-1
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/InteractiveModeController.java
...ormal/psdbg/gui/controller/InteractiveModeController.java
+22
-17
No files found.
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/CaseStatement.java
View file @
ef5271b4
...
...
@@ -39,7 +39,7 @@ import lombok.Setter;
@RequiredArgsConstructor
@AllArgsConstructor
public
abstract
class
CaseStatement
extends
Statement
<
ScriptLanguageParser
.
CasesListContext
>
{
protected
Statements
body
;
protected
Statements
body
=
new
Statements
()
;
/**
* {@inheritDoc}
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/InteractiveModeController.java
View file @
ef5271b4
...
...
@@ -74,6 +74,8 @@ public class InteractiveModeController {
private
boolean
moreThanOneMatch
=
false
;
private
CasesStatement
casesStatement
;
public
void
start
(
Proof
currentProof
,
InspectionModel
model
)
{
Events
.
register
(
this
);
cases
.
clear
();
...
...
@@ -83,7 +85,17 @@ public class InteractiveModeController {
});
this
.
scriptArea
=
scriptController
.
newScript
();
this
.
model
=
model
;
casesStatement
=
new
CasesStatement
();
cases
.
forEach
((
k
,
v
)
->
{
val
gcs
=
new
GuardedCaseStatement
();
val
m
=
new
MatchExpression
();
m
.
setPattern
(
new
StringLiteral
(
format
(
LabelFactory
.
getBranchingLabel
(
k
))
));
gcs
.
setGuard
(
m
);
gcs
.
setBody
(
v
);
casesStatement
.
getCases
().
add
(
gcs
);
});
savepointslist
=
new
ArrayList
<>();
savepointsstatement
=
new
ArrayList
<>();
nodeAtInteractionStart
=
debuggerFramework
.
getStatePointer
();
...
...
@@ -219,20 +231,8 @@ public class InteractiveModeController {
}
public
String
getCasesAsString
()
{
CasesStatement
c
=
new
CasesStatement
();
cases
.
forEach
((
k
,
v
)
->
{
val
gcs
=
new
GuardedCaseStatement
();
val
m
=
new
MatchExpression
();
m
.
setPattern
(
new
StringLiteral
(
format
(
LabelFactory
.
getBranchingLabel
(
k
))
));
gcs
.
setGuard
(
m
);
gcs
.
setBody
(
v
);
c
.
getCases
().
add
(
gcs
);
});
PrettyPrinter
pp
=
new
PrettyPrinter
();
c
.
accept
(
pp
);
c
asesStatement
.
accept
(
pp
);
return
pp
.
toString
();
}
...
...
@@ -290,9 +290,14 @@ public class InteractiveModeController {
for
(
Goal
newGoalNode
:
ngoals
)
{
KeyData
kdn
=
new
KeyData
(
kd
,
newGoalNode
.
node
());
goals
.
add
(
last
=
new
GoalNode
<>(
expandedNode
,
kdn
,
kdn
.
getNode
().
isClosed
()));
cases
.
put
(
last
.
getData
().
getNode
(),
new
Statements
());
val
caseForSubNode
=
new
GuardedCaseStatement
();
val
m
=
new
MatchExpression
();
m
.
setPattern
(
new
StringLiteral
(
format
(
LabelFactory
.
getBranchingLabel
(
newGoalNode
.
node
()))
));
caseForSubNode
.
setGuard
(
m
);
inner
.
getCases
().
add
(
caseForSubNode
);
cases
.
put
(
last
.
getData
().
getNode
(),
caseForSubNode
.
getBody
());
}
}
else
{
KeyData
kdn
=
new
KeyData
(
kd
,
ngoals
.
get
(
0
).
node
());
...
...
Write
Preview
Markdown
is supported
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