Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e-Knife for Erlang with Constrained Edges
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Program Slicing
e-Knife for Erlang with Constrained Edges
Commits
f187fcc6
Commit
f187fcc6
authored
2 years ago
by
Carlos Galindo
Browse files
Options
Downloads
Patches
Plain Diff
add a cli flag to ignore constraints
parent
c82bd528
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
e-Knife/src/main/java/eknife/EKnife.java
+15
-2
15 additions, 2 deletions
e-Knife/src/main/java/eknife/EKnife.java
with
15 additions
and
2 deletions
e-Knife/src/main/java/eknife/EKnife.java
+
15
−
2
View file @
f187fcc6
...
...
@@ -35,6 +35,7 @@ import java.io.File;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Set
;
import
java.lang.reflect.InvocationTargetException
;
public
class
EKnife
{
public
enum
Language
{
Java
,
Erlang
,
Php
}
...
...
@@ -157,6 +158,9 @@ public class EKnife {
case
"--print-graph"
:
kArgs
.
setGraphFile
(
new
File
(
args
[
argIndex
+
1
]));
break
;
case
"--ignore-constraints"
:
kArgs
.
algClass
=
AdaptedStandardAlgorithm
.
class
;
break
;
}
}
...
...
@@ -176,6 +180,7 @@ public class EKnife {
help
+=
" -n,--occurrence <num> The occurrence of the slicing criterion in that line\n"
;
help
+=
" -G,--print-graph <file.dot> Exports the graph as a dot file\n"
;
help
+=
" -G,--print-graph <file.pdf> Exports the graph as a PDF file\n"
;
help
+=
" --ignore-constraints Generates constraints but ignores when slicing\n"
;
help
+=
" --help Show this message.\n"
;
System
.
out
.
print
(
help
);
...
...
@@ -192,8 +197,7 @@ public class EKnife {
System
.
exit
(
1
);
}
// final SlicingAlgorithm slicingAlgorithm = new AdaptedStandardAlgorithm(edg);
final
SlicingAlgorithm
slicingAlgorithm
=
new
OnePassConstrainedAlgorithm
(
edg
);
final
SlicingAlgorithm
slicingAlgorithm
=
a
.
getAlgorithm
(
edg
);
final
Set
<
Node
>
slice
=
slicingAlgorithm
.
slice
(
SC
);
if
(
slice
.
isEmpty
())
{
System
.
out
.
println
(
"Warning: no files will be written, as the slice is empty."
);
...
...
@@ -599,6 +603,7 @@ public class EKnife {
int
occurrence
=
1
;
File
graphFile
;
GraphFormat
graphFormat
;
Class
<?
extends
SlicingAlgorithm
>
algClass
=
OnePassConstrainedAlgorithm
.
class
;
void
setGraphFile
(
File
graphFile
)
{
...
...
@@ -640,6 +645,14 @@ public class EKnife {
System
.
out
.
println
(
error
);
return
errors
.
isEmpty
();
}
SlicingAlgorithm
getAlgorithm
(
EDG
edg
)
{
try
{
return
algClass
.
getConstructor
(
EDG
.
class
).
newInstance
(
edg
);
}
catch
(
NoSuchMethodException
|
InvocationTargetException
|
InstantiationException
|
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
public
static
class
SlicingCriterionState
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment