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
445f6a6d
Commit
445f6a6d
authored
Jan 22, 2018
by
Sarah Grebing
Browse files
Bugfixes from friday: Leere Liste der offenen Ziele
parent
1e0289cf
Pipeline
#17140
passed with stages
in 9 minutes and 8 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/CallStatement.java
View file @
445f6a6d
...
...
@@ -37,14 +37,13 @@ import lombok.*;
@Getter
@Setter
@NoArgsConstructor
@RequiredArgsConstructor
@AllArgsConstructor
public
class
CallStatement
extends
Statement
<
ScriptLanguageParser
.
ScriptCommandContext
>
{
/**
* The name of the command.
*/
@NonNull
private
String
command
;
private
String
command
=
""
;
/**
* The list of parameters.
...
...
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/Interpreter.java
View file @
445f6a6d
...
...
@@ -254,6 +254,9 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
newStateAfterCases
=
new
State
<
T
>(
openGoalListAfterCases
,
null
);
}
stateStack
.
push
(
newStateAfterCases
);
}
else
{
stateStack
.
push
(
new
State
<>());
}
//stateStack.peek().getGoals().removeAll(beforeCases.getGoals());
...
...
@@ -532,26 +535,29 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
@Override
public
Object
visit
(
CallStatement
call
)
{
enterScope
(
call
);
// System.out.println(stateStack.peek().hashCode());
//neuer VarScope
//enter new variable scope
VariableAssignment
params
=
evaluateParameters
(
call
.
getParameters
());
GoalNode
<
T
>
g
=
getSelectedNode
();
g
.
enterScope
();
try
{
functionLookup
.
callCommand
(
this
,
call
,
params
);
}
catch
(
RuntimeException
e
)
{
System
.
err
.
println
(
"Call command not applicable"
);
throw
e
;
//TODO handling of error state for each visit
//State<T> newErrorState = newState(null, null);
//newErrorState.setErrorState(true);
//pushState(newErrorState);
}
finally
{
g
.
exitScope
();
// System.out.println(stateStack.peek().hashCode());
exitScope
(
call
);
if
(!
call
.
getCommand
().
isEmpty
())
//real call, can handle pseudo calls!
{
// System.out.println(stateStack.peek().hashCode());
//neuer VarScope
//enter new variable scope
VariableAssignment
params
=
evaluateParameters
(
call
.
getParameters
());
GoalNode
<
T
>
g
=
getSelectedNode
();
g
.
enterScope
();
try
{
functionLookup
.
callCommand
(
this
,
call
,
params
);
}
catch
(
RuntimeException
e
)
{
System
.
err
.
println
(
"Call command not applicable"
);
throw
e
;
//TODO handling of error state for each visit
//State<T> newErrorState = newState(null, null);
//newErrorState.setErrorState(true);
//pushState(newErrorState);
}
finally
{
g
.
exitScope
();
// System.out.println(stateStack.peek().hashCode());
}
}
exitScope
(
call
);
return
null
;
}
...
...
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/data/State.java
View file @
445f6a6d
...
...
@@ -49,6 +49,14 @@ public class State<T> {
setSelectedGoalNode
(
goal
);
}
/**
* creates a state with no goals.
*/
public
State
()
{
goals
=
new
ArrayList
<>();
setSelectedGoalNode
(
null
);
}
public
List
<
GoalNode
<
T
>>
getGoals
()
{
return
goals
;
...
...
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/dbg/DebuggerFramework.java
View file @
445f6a6d
...
...
@@ -4,6 +4,7 @@ import com.google.common.graph.MutableValueGraph;
import
edu.kit.iti.formal.psdbg.interpreter.Interpreter
;
import
edu.kit.iti.formal.psdbg.interpreter.graphs.ControlFlowNode
;
import
edu.kit.iti.formal.psdbg.interpreter.graphs.ControlFlowTypes
;
import
edu.kit.iti.formal.psdbg.parser.ast.CallStatement
;
import
edu.kit.iti.formal.psdbg.parser.ast.ProofScript
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -134,7 +135,8 @@ public class DebuggerFramework<T> {
private
void
run
()
{
try
{
interpreter
.
interpret
(
mainScript
);
ptreeManager
.
fireStatePointerChanged
();
interpreter
.
visit
(
new
CallStatement
());
// ptreeManager.fireStatePointerChanged();
succeedListener
.
accept
(
this
);
}
catch
(
Exception
e
)
{
error
=
e
;
...
...
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/java/quicksort/script.kps
View file @
445f6a6d
...
...
@@ -13,7 +13,7 @@ script split_from_quicksort() {
cases{
case match `==> seqDef(_,_,_) = seqDef(_, _, _)`:
auto;
case match `==> (\exists ?X (\exists ?Y _))`:
//this should match
case match `==> (\exists ?X (\exists ?Y _))`:
instantiate var=`?X`[?X \ X] with=`i_0`;
instantiate var=`?Y`[?Y \ Y] with=`j_0`;
auto;
...
...
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