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
969b79ad
Commit
969b79ad
authored
Jul 04, 2018
by
Sarah Grebing
Browse files
supporting structures for treegraph interim state
parent
6ceb7b2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptTreeGraph.java
View file @
969b79ad
...
...
@@ -13,9 +13,13 @@ import edu.kit.iti.formal.psdbg.interpreter.dbg.PTreeNode;
import
edu.kit.iti.formal.psdbg.parser.ast.ASTNode
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
public
class
ScriptTreeGraph
{
private
ScriptTreeNode
rootNode
;
private
final
MutableGraph
<
AbstractTreeNode
>
graph
=
...
...
@@ -34,26 +38,24 @@ public class ScriptTreeGraph {
//Am Anfang: rootNode
ScriptTreeNode
currentScriptNode
=
rootNode
;
PTreeNode
<
KeyData
>
currentNode
=
rootNode
.
getScriptState
();
while
(
currentNode
.
getStateAfterStmt
()
!=
null
)
{
if
(
currentNode
.
getStateAfterStmt
()
!=
null
)
{
if
(
currentNode
.
getStateAfterStmt
().
getGoals
().
size
()
==
1
)
{
PTreeNode
<
KeyData
>
nextPTreeNode
=
currentNode
.
computeNextPtreeNode
(
currentNode
);
ScriptTreeNode
newNode
=
new
ScriptTreeNode
(
nextPTreeNode
,
currentNode
.
getStateAfterStmt
().
getGoals
().
get
(
0
).
getData
().
getNode
());
//set parent and children relation
newNode
.
setParent
(
currentScriptNode
);
currentScriptNode
.
setChildren
(
Collections
.
singletonList
(
newNode
));
//reset Pointer for next round
currentNode
=
nextPTreeNode
;
currentScriptNode
=
newNode
;
}
else
{
if
(
currentNode
.
getStateAfterStmt
().
getGoals
().
size
()
<
1
)
{
}
}
while
(
currentNode
.
getStateAfterStmt
()
!=
null
)
{
List
<
GoalNode
<
KeyData
>>
goalsAfterStmt
=
currentNode
.
getStateAfterStmt
().
getGoals
();
if
(
goalsAfterStmt
.
size
()
==
1
)
{
PTreeNode
<
KeyData
>
nextPTreeNode
=
currentNode
.
computeNextPtreeNode
(
currentNode
);
ScriptTreeNode
newNode
=
new
ScriptTreeNode
(
nextPTreeNode
,
goalsAfterStmt
.
get
(
0
).
getData
().
getNode
());
//set parent and children relation
newNode
.
setParent
(
currentScriptNode
);
currentScriptNode
.
setChildren
(
Collections
.
singletonList
(
newNode
));
//reset Pointer for next round
currentNode
=
nextPTreeNode
;
currentScriptNode
=
newNode
;
}
else
if
(
goalsAfterStmt
.
size
()
>
1
)
{
}
else
{
break
;
}
}
}
...
...
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