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
6732ab31
Commit
6732ab31
authored
6 months ago
by
Jan Gruteser
Browse files
Options
Downloads
Patches
Plain Diff
minor simplifications
parent
8367b55a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tla2bAst/BAstCreator.java
+14
-26
14 additions, 26 deletions
src/main/java/de/tla2bAst/BAstCreator.java
with
14 additions
and
26 deletions
src/main/java/de/tla2bAst/BAstCreator.java
+
14
−
26
View file @
6732ab31
...
...
@@ -403,14 +403,14 @@ public class BAstCreator extends BuiltInOPs implements TranslationGlobals, BBuil
private
List
<
PPredicate
>
evalRecursiveFunctions
()
{
List
<
PPredicate
>
propertiesList
=
new
ArrayList
<>();
for
(
OpDefNode
def
:
specAnalyser
.
getRecursiveFunctions
())
{
AEqualPredicate
equals
=
new
AEqualPredicate
(
createIdentifierNode
(
def
),
visitExprNodeExpression
(
def
.
getBody
()));
propertiesList
.
add
(
equals
);
propertiesList
.
add
(
new
AEqualPredicate
(
createIdentifierNode
(
def
),
visitExprNodeExpression
(
def
.
getBody
())));
}
return
propertiesList
;
}
private
List
<
PPredicate
>
evalRecursiveDefinitions
()
{
// TODO: review this method
List
<
PPredicate
>
propertiesList
=
new
ArrayList
<>();
for
(
RecursiveDefinition
recDef
:
specAnalyser
.
getRecursiveDefinitions
())
{
...
...
@@ -456,23 +456,13 @@ public class BAstCreator extends BuiltInOPs implements TranslationGlobals, BBuil
return
new
AIntegerExpression
(
new
TIntegerLiteral
(
tlcValue
.
toString
()));
case
REALVALUE:
return
new
ARealExpression
(
new
TRealLiteral
(
tlcValue
.
toString
()));
case
SETENUMVALUE:
{
SetEnumValue
s
=
(
SetEnumValue
)
tlcValue
;
ArrayList
<
PExpression
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
s
.
elems
.
size
();
i
++)
{
Value
v
=
s
.
elems
.
elementAt
(
i
);
list
.
add
(
createTLCValue
(
v
));
}
return
new
ASetExtensionExpression
(
list
);
}
case
MODELVALUE:
{
ModelValue
m
=
(
ModelValue
)
tlcValue
;
return
createIdentifierNode
(
m
.
toString
());
}
case
STRINGVALUE:
{
StringValue
stringValue
=
(
StringValue
)
tlcValue
;
return
new
AStringExpression
(
new
TStringLiteral
(
stringValue
.
getVal
().
toString
()));
}
case
SETENUMVALUE:
return
new
ASetExtensionExpression
(
Arrays
.
stream
(((
SetEnumValue
)
tlcValue
).
elems
.
toArray
())
.
map
(
this
::
createTLCValue
).
collect
(
Collectors
.
toList
()));
case
MODELVALUE:
return
createIdentifierNode
(
tlcValue
.
toString
());
case
STRINGVALUE:
return
new
AStringExpression
(
new
TStringLiteral
(((
StringValue
)
tlcValue
).
getVal
().
toString
()));
default
:
throw
new
NotImplementedException
(
"TLC value in configuration file: "
+
tlcValue
.
getClass
());
}
...
...
@@ -516,14 +506,12 @@ public class BAstCreator extends BuiltInOPs implements TranslationGlobals, BBuil
switch
(
exprNode
.
getKind
())
{
case
OpApplKind:
return
visitOpApplNodePredicate
((
OpApplNode
)
exprNode
);
case
LetInKind:
{
LetInNode
letInNode
=
(
LetInNode
)
exprNode
;
return
visitExprNodePredicate
(
letInNode
.
getBody
());
}
case
LetInKind:
return
visitExprNodePredicate
(((
LetInNode
)
exprNode
).
getBody
());
case
NumeralKind:
case
DecimalKind:
{
case
DecimalKind:
// TODO: description
throw
new
RuntimeException
();
}
default
:
throw
new
NotImplementedException
(
exprNode
.
getClass
().
toString
());
}
...
...
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