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
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;
...
@@ -13,9 +13,13 @@ import edu.kit.iti.formal.psdbg.interpreter.dbg.PTreeNode;
import
edu.kit.iti.formal.psdbg.parser.ast.ASTNode
;
import
edu.kit.iti.formal.psdbg.parser.ast.ASTNode
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
public
class
ScriptTreeGraph
{
public
class
ScriptTreeGraph
{
private
ScriptTreeNode
rootNode
;
private
ScriptTreeNode
rootNode
;
private
final
MutableGraph
<
AbstractTreeNode
>
graph
=
private
final
MutableGraph
<
AbstractTreeNode
>
graph
=
...
@@ -34,26 +38,24 @@ public class ScriptTreeGraph {
...
@@ -34,26 +38,24 @@ public class ScriptTreeGraph {
//Am Anfang: rootNode
//Am Anfang: rootNode
ScriptTreeNode
currentScriptNode
=
rootNode
;
ScriptTreeNode
currentScriptNode
=
rootNode
;
PTreeNode
<
KeyData
>
currentNode
=
rootNode
.
getScriptState
();
PTreeNode
<
KeyData
>
currentNode
=
rootNode
.
getScriptState
();
while
(
currentNode
.
getStateAfterStmt
()
!=
null
)
{
if
(
currentNode
.
getStateAfterStmt
()
!=
null
)
{
while
(
currentNode
.
getStateAfterStmt
()
!=
null
)
{
if
(
currentNode
.
getStateAfterStmt
().
getGoals
().
size
()
==
1
)
{
List
<
GoalNode
<
KeyData
>>
goalsAfterStmt
=
currentNode
.
getStateAfterStmt
().
getGoals
();
PTreeNode
<
KeyData
>
nextPTreeNode
=
currentNode
.
computeNextPtreeNode
(
currentNode
);
if
(
goalsAfterStmt
.
size
()
==
1
)
{
ScriptTreeNode
newNode
=
new
ScriptTreeNode
(
nextPTreeNode
,
currentNode
.
getStateAfterStmt
().
getGoals
().
get
(
0
).
getData
().
getNode
());
PTreeNode
<
KeyData
>
nextPTreeNode
=
currentNode
.
computeNextPtreeNode
(
currentNode
);
ScriptTreeNode
newNode
=
new
ScriptTreeNode
(
nextPTreeNode
,
goalsAfterStmt
.
get
(
0
).
getData
().
getNode
());
//set parent and children relation
newNode
.
setParent
(
currentScriptNode
);
//set parent and children relation
currentScriptNode
.
setChildren
(
Collections
.
singletonList
(
newNode
));
newNode
.
setParent
(
currentScriptNode
);
currentScriptNode
.
setChildren
(
Collections
.
singletonList
(
newNode
));
//reset Pointer for next round
currentNode
=
nextPTreeNode
;
//reset Pointer for next round
currentScriptNode
=
newNode
;
currentNode
=
nextPTreeNode
;
}
else
{
currentScriptNode
=
newNode
;
if
(
currentNode
.
getStateAfterStmt
().
getGoals
().
size
()
<
1
)
{
}
else
if
(
goalsAfterStmt
.
size
()
>
1
)
{
}
}
}
else
{
}
else
{
break
;
}
}
}
}
}
}
...
...
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