Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
ProofScriptParser
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sarah.grebing
ProofScriptParser
Commits
445f6a6d
Commit
445f6a6d
authored
Jan 22, 2018
by
Sarah Grebing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
5 changed files
with
38 additions
and
23 deletions
+38
-23
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/CallStatement.java
...va/edu/kit/iti/formal/psdbg/parser/ast/CallStatement.java
+1
-2
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/Interpreter.java
...ava/edu/kit/iti/formal/psdbg/interpreter/Interpreter.java
+25
-19
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/data/State.java
...java/edu/kit/iti/formal/psdbg/interpreter/data/State.java
+8
-0
rt/src/main/java/edu/kit/iti/formal/psdbg/interpreter/dbg/DebuggerFramework.java
...t/iti/formal/psdbg/interpreter/dbg/DebuggerFramework.java
+3
-1
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/java/quicksort/script.kps
...u/kit/iti/formal/psdbg/examples/java/quicksort/script.kps
+1
-1
No files found.
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
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