Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tla2bAST
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tla2bAST
Commits
31aa961d
Commit
31aa961d
authored
7 years ago
by
dohan
Browse files
Options
Downloads
Patches
Plain Diff
fix detection of used definitions
parent
c21bc40c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tla2b/translation/BDefinitionsFinder.java
+10
-6
10 additions, 6 deletions
src/main/java/de/tla2b/translation/BDefinitionsFinder.java
with
10 additions
and
6 deletions
src/main/java/de/tla2b/translation/BDefinitionsFinder.java
+
10
−
6
View file @
31aa961d
...
...
@@ -2,6 +2,7 @@ package de.tla2b.translation;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.Set
;
import
tla2sany.semantic.ASTConstants
;
import
tla2sany.semantic.AssumeNode
;
...
...
@@ -49,11 +50,6 @@ public class BDefinitionsFinder extends AbstractASTVisitor implements ASTConstan
bDefinitionsSet
.
add
(
def
);
}
HashSet
<
OpDefNode
>
temp
=
new
HashSet
<>(
bDefinitionsSet
);
for
(
OpDefNode
opDefNode
:
temp
)
{
visitExprNode
(
opDefNode
.
getBody
());
}
for
(
OpDefNode
opDef
:
specAnalyser
.
getModuleNode
().
getOpDefs
())
{
String
defName
=
opDef
.
getName
().
toString
();
// GOAL, ANIMATION_FUNCTION, ANIMATION_IMGxx, SET_PREF_xxx,
...
...
@@ -62,11 +58,19 @@ public class BDefinitionsFinder extends AbstractASTVisitor implements ASTConstan
bDefinitionsSet
.
add
(
opDef
);
}
}
HashSet
<
OpDefNode
>
temp
=
new
HashSet
<>(
bDefinitionsSet
);
for
(
OpDefNode
opDefNode
:
temp
)
{
visitExprNode
(
opDefNode
.
getBody
());
}
}
@Override
public
void
visitUserDefinedNode
(
OpApplNode
n
)
{
OpDefNode
def
=
(
OpDefNode
)
n
.
getOperator
();
if
(
bDefinitionsSet
.
add
(
def
))
{
// visit body only once
visitExprNode
(
def
.
getBody
());
}
for
(
ExprOrOpArgNode
exprOrOpArgNode
:
n
.
getArgs
())
{
...
...
@@ -74,7 +78,7 @@ public class BDefinitionsFinder extends AbstractASTVisitor implements ASTConstan
}
}
public
Hash
Set
<
OpDefNode
>
getBDefinitionsSet
()
{
public
Set
<
OpDefNode
>
getBDefinitionsSet
()
{
return
bDefinitionsSet
;
}
...
...
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