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
650ef727
Commit
650ef727
authored
Jul 24, 2017
by
Sarah Grebing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow up BugBugfix and enhancements labels and documentation
parent
f9585785
Pipeline
#12256
failed with stage
in 1 minute and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
5 deletions
+40
-5
src/main/java/edu/kit/formal/interpreter/data/KeyData.java
src/main/java/edu/kit/formal/interpreter/data/KeyData.java
+40
-5
No files found.
src/main/java/edu/kit/formal/interpreter/data/KeyData.java
View file @
650ef727
...
...
@@ -10,7 +10,8 @@ import java.util.function.Function;
/**
* @author Alexander Weigl
* @version 1 (28.05.17)
* @author S. Grebing
* @version 2 (24.07.17)
*/
@Data
@AllArgsConstructor
...
...
@@ -54,6 +55,11 @@ public class KeyData {
this
(
node
,
kd
.
getEnv
(),
kd
.
getProof
());
}
/**
* Return rule name of rule applied to this node
*
* @return String representation of applied rule name
*/
public
String
getRuleLabel
()
{
if
(
ruleLabel
==
null
)
{
ruleLabel
=
constructLabel
((
Node
n
)
->
n
.
getAppliedRuleApp
().
rule
().
name
().
toString
());
...
...
@@ -61,15 +67,30 @@ public class KeyData {
return
ruleLabel
;
}
/**
* Create Label for goalview according to function that is passed.
* The following fucntions can be given:
* <ul>
* <li>@see #Method getRuleLabel()</li>
* <li>@see #Method getBranchingLabel()</li>
* <li>@see #Method getNameLabel()</li>
* <li>@see #Method getProgramLinesLabel()</li>
* <li>@see #Method getProgramStatementsLabel()</li>
* </ul>
* @param projection function determining which kind of label to construct
* @return Label from this node to parent
*/
private
String
constructLabel
(
Function
<
Node
,
String
>
projection
)
{
StringBuilder
sb
=
new
StringBuilder
();
Node
cur
=
getNode
();
do
{
try
{
String
section
=
projection
.
apply
(
cur
);
if
(
section
!=
null
)
{
//filter null elements and -1 elements
if
(
section
!=
null
&&
!(
section
.
equals
(
Integer
.
toString
(-
1
))))
{
sb
.
append
(
section
);
sb
.
append
(
SEPARATOR
);
}
}
catch
(
Exception
e
)
{
}
...
...
@@ -79,6 +100,10 @@ public class KeyData {
return
sb
.
toString
();
}
/**
* Get branching label of node from KeY
* @return label of this node determining the branching labels in KeY
*/
public
String
getBranchingLabel
()
{
if
(
branchingLabel
==
null
)
{
branchingLabel
=
constructLabel
(
n
->
n
.
getNodeInfo
().
getBranchLabel
());
...
...
@@ -86,6 +111,10 @@ public class KeyData {
return
branchingLabel
;
}
/**
* Get label with node name from KeY (often applied rulename)
* @return name of this node
*/
public
String
getNameLabel
()
{
if
(
nameLabel
==
null
)
{
nameLabel
=
constructLabel
(
Node:
:
name
);
...
...
@@ -93,20 +122,26 @@ public class KeyData {
return
nameLabel
;
}
/**
* Get lines of active statement
* @return line of active satetment in orginal file (-1 if rewritten by KeY or not applicable)
*/
public
String
getProgramLinesLabel
()
{
if
(
programLinesLabel
==
null
)
{
programLinesLabel
=
constructLabel
(
n
->
Integer
.
toString
(
n
.
getNodeInfo
().
get
ExecStatemen
tPosition
().
getLine
())
Integer
.
toString
(
n
.
getNodeInfo
().
get
ActiveStatement
().
getPositionInfo
().
getStar
tPosition
().
getLine
())
);
}
return
programLinesLabel
;
}
/**
* Get first activestatement for node
* @return
*/
public
String
getProgramStatementsLabel
()
{
if
(
programStatementsLabel
==
null
)
{
programStatementsLabel
=
constructLabel
(
n
->
// n.getNodeInfo().getActiveStatement().toString());
n
.
getNodeInfo
().
getFirstStatementString
());
}
...
...
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