Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ProB Rodin Plugin
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
Operate
Environments
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
ProB Rodin Plugin
Commits
fa519677
Commit
fa519677
authored
7 months ago
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
export carrier set comments as desription pragmas
Signed-off-by:
Michael Leuschel
<
leuschel@uni-duesseldorf.de
>
parent
d7406930
No related branches found
No related tags found
No related merge requests found
Pipeline
#146160
passed
7 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
de.prob.core/src/de/prob/eventb/translator/ContextTranslator.java
+16
-1
16 additions, 1 deletion
...core/src/de/prob/eventb/translator/ContextTranslator.java
with
16 additions
and
1 deletion
de.prob.core/src/de/prob/eventb/translator/ContextTranslator.java
+
16
−
1
View file @
fa519677
...
...
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.Assert;
import
org.eclipse.core.runtime.CoreException
;
import
org.eventb.core.EventBAttributes
;
import
org.eventb.core.IAxiom
;
import
org.eventb.core.ICarrierSet
;
import
org.eventb.core.IContextRoot
;
import
org.eventb.core.IEventBRoot
;
import
org.eventb.core.IExtendsContext
;
...
...
@@ -52,6 +53,7 @@ import de.be4.classicalb.core.parser.node.ADeferredSetSet;
import
de.be4.classicalb.core.parser.node.ADescriptionExpression
;
import
de.be4.classicalb.core.parser.node.ADescriptionPragma
;
import
de.be4.classicalb.core.parser.node.ADescriptionPredicate
;
import
de.be4.classicalb.core.parser.node.ADescriptionSet
;
import
de.be4.classicalb.core.parser.node.AEventBContextParseUnit
;
import
de.be4.classicalb.core.parser.node.AExtendsContextClause
;
import
de.be4.classicalb.core.parser.node.AIdentifierExpression
;
...
...
@@ -314,10 +316,23 @@ public final class ContextTranslator extends AbstractComponentTranslator {
final
ISCCarrierSet
[]
carrierSets
=
context
.
getSCCarrierSets
();
final
List
<
PSet
>
setList
=
new
ArrayList
<
PSet
>(
carrierSets
.
length
);
for
(
final
ISCCarrierSet
carrierSet
:
carrierSets
)
{
final
ADeferredSetSet
deferredSet
=
new
ADeferredSetSet
(
Arrays
.
asList
(
new
TIdentifierLiteral
[]
{
new
TIdentifierLiteral
(
carrierSet
.
getIdentifierString
())
}));
final
ICarrierSet
ucs
=
(
ICarrierSet
)
carrierSet
.
getSource
();
// comments only attached in unchecked source
if
(
ucs
.
hasAttribute
(
EventBAttributes
.
COMMENT_ATTRIBUTE
))
{
final
String
commentString
=
ucs
.
getAttributeValue
(
EventBAttributes
.
COMMENT_ATTRIBUTE
);
System
.
out
.
println
(
"Carrier set "
+
carrierSet
+
" has comment "
+
commentString
);
final
TPragmaFreeText
desc
=
new
TPragmaFreeText
(
commentString
);
ADescriptionPragma
descPragma
=
new
ADescriptionPragma
(
Collections
.
singletonList
(
desc
));
final
ADescriptionSet
descid
=
new
ADescriptionSet
(
descPragma
,
deferredSet
);
setList
.
add
(
descid
);
}
else
{
setList
.
add
(
deferredSet
);
}
}
return
new
ASetsContextClause
(
setList
);
}
...
...
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