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
7b0417c6
Commit
7b0417c6
authored
Sep 24, 2018
by
Sarah Grebing
Browse files
scriptcommand
parent
d91bd463
Pipeline
#28107
passed with stages
in 3 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/InteractiveModeController.java
View file @
7b0417c6
package
edu.kit.iti.formal.psdbg.gui.controller
;
import
com.google.common.eventbus.Subscribe
;
import
de.uka.ilkd.key.api.KeYApi
;
import
de.uka.ilkd.key.control.AbstractUserInterfaceControl
;
import
de.uka.ilkd.key.control.DefaultUserInterfaceControl
;
import
de.uka.ilkd.key.java.Services
;
...
...
@@ -27,6 +28,7 @@ import edu.kit.iti.formal.psdbg.interpreter.dbg.DebuggerFramework;
import
edu.kit.iti.formal.psdbg.interpreter.dbg.PTreeNode
;
import
edu.kit.iti.formal.psdbg.interpreter.exceptions.ScriptCommandNotApplicableException
;
import
edu.kit.iti.formal.psdbg.interpreter.funchdl.MacroCommandHandler
;
import
edu.kit.iti.formal.psdbg.interpreter.funchdl.ProofScriptCommandBuilder
;
import
edu.kit.iti.formal.psdbg.parser.PrettyPrinter
;
import
edu.kit.iti.formal.psdbg.parser.ast.*
;
import
edu.kit.iti.formal.psdbg.parser.data.Value
;
...
...
@@ -43,6 +45,7 @@ import org.key_project.util.collection.ImmutableList;
import
recoder.util.Debug
;
import
javax.annotation.Nullable
;
import
java.lang.reflect.Method
;
import
java.math.BigInteger
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -340,10 +343,11 @@ public class InteractiveModeController {
postStateHandler
(
call
,
g
,
goals
,
expandedNode
,
kd
);
break
;
case
SCRIPT_COMMAND:
ScriptCommand
.
Parameters
ccS
=
new
ScriptCommand
.
Parameters
();
ScriptCommand
cS
=
new
ScriptCommand
();
ccS
=
valueInjector
.
inject
(
cS
,
ccS
,
map
);
cS
.
execute
(
uiControl
,
ccS
,
estate
);
ProofScriptCommandBuilder
psb
=
new
ProofScriptCommandBuilder
(
KeYApi
.
getScriptCommandApi
().
getScriptCommands
());
ProofScriptCommand
ps
=
psb
.
getCommands
().
get
(
call
.
getCommand
());
Object
temp
=
valueInjector
.
inject
(
ps
,
getParameterInstance
(
ps
),
map
);
ps
.
execute
(
uiControl
,
temp
,
estate
);
postStateHandler
(
call
,
g
,
goals
,
expandedNode
,
kd
);
break
;
default
:
...
...
@@ -363,6 +367,12 @@ public class InteractiveModeController {
}
private
<
T
>
T
getParameterInstance
(
ProofScriptCommand
c
)
throws
NoSuchMethodException
,
IllegalAccessException
,
InstantiationException
{
Method
method
=
c
.
getClass
().
getMethod
(
"evaluateArguments"
,
EngineState
.
class
,
Map
.
class
);
Class
rtclazz
=
method
.
getReturnType
();
return
(
T
)
rtclazz
.
newInstance
();
}
private
void
postStateHandler
(
CallStatement
call
,
Goal
g
,
ObservableList
<
GoalNode
<
KeyData
>>
goals
,
GoalNode
<
KeyData
>
expandedNode
,
KeyData
kd
)
{
ImmutableList
<
Goal
>
ngoals
=
g
.
proof
().
getSubtreeGoals
(
expandedNode
.
getData
().
getNode
());
...
...
sarah.grebing
@xt9634
mentioned in issue
#54 (closed)
·
Sep 24, 2018
mentioned in issue
#54 (closed)
mentioned in issue #54
Toggle commit list
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