Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
6098d211
Commit
6098d211
authored
Sep 24, 2018
by
Lulu Luong
Browse files
foreach end fix
parent
ee92cd85
Pipeline
#28099
passed with stages
in 2 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptTreeGraph.java
View file @
6098d211
...
...
@@ -162,6 +162,8 @@ public class ScriptTreeGraph {
}
List
<
AbstractTreeNode
>
subchild
=
new
ArrayList
<>();
subchild
.
add
(
atn
);
//TODO: Hack for double foreach-end recognition
if
(
atn
.
getParent
()
==
childlist
.
get
(
0
).
getParent
())
return
;
childlist
.
get
(
0
).
setChildren
(
subchild
);
}
}
...
...
@@ -428,7 +430,7 @@ public class ScriptTreeGraph {
AbstractTreeNode
current
=
mapping
.
get
(
n
);
if
(
current
instanceof
PlaceholderNode
)
{
//TODO : atn.setParent(current.getParent()); -> leads to concurretn exception
current
.
getParent
().
setChildren
(
new
ArrayList
<>(
Arrays
.
asList
(
atn
)));
mapping
.
put
(
n
,
atn
);
iterator
.
remove
();
...
...
@@ -437,11 +439,11 @@ public class ScriptTreeGraph {
while
(!(
current
instanceof
PlaceholderNode
))
{
//TODO: if(current.getChildren().size() > 0) return;
if
(
current
.
getChildren
()
==
null
)
return
;
if
(
current
.
getChildren
().
get
(
0
)
instanceof
PlaceholderNode
)
{
//TODO: insert a variable instead of using atn?
atn
.
setParent
(
current
.
getChildren
().
get
(
0
).
getParent
());
current
.
setChildren
(
new
ArrayList
<>(
Arrays
.
asList
(
atn
)));
iterator
.
remove
();
...
...
@@ -484,6 +486,9 @@ public class ScriptTreeGraph {
}
}
/*
checks if given node is the end of a foreach-statement
*/
private
void
checkIfForeachEnd
(
Node
n
)
{
if
(
foreachNodes
.
containsKey
(
n
))
{
PTreeNode
ptn
=
foreachNodes
.
get
(
n
);
...
...
@@ -492,8 +497,8 @@ public class ScriptTreeGraph {
ptn
,
ptn
.
getStatement
().
getStartPosition
().
getLineNumber
(),
false
);
replacePlaceholder
(
n
extPtreeNode
.
getStateBeforeStmt
().
getSelectedGoalNode
().
getData
().
getNode
()
,
ftn
);
//TODO: replacePlaceholder(nextPtreeNode.getStateBeforeStmt().getSelectedGoalNode().getData().getNode(), ftn);
replacePlaceholder
(
n
,
ftn
);
addPlaceholder
(
ftn
,
n
);
foreachNodes
.
remove
(
n
);
...
...
ui/src/main/resources/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.fxml
View file @
6098d211
...
...
@@ -184,7 +184,7 @@
<MaterialDesignIconView
glyphName=
"TREE"
size=
"24.0"
/>
</graphic>
</CheckMenuItem>
<CheckMenuItem
fx:id=
"miScriptTree"
onAction=
"#showScriptTree"
text=
"Show Script Tree"
>
<CheckMenuItem
fx:id=
"miScriptTree"
onAction=
"#showScriptTree"
text=
"Show Script Tree"
accelerator=
"Ctrl+r"
>
<graphic>
<ImageView>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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