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
708d4ac6
Commit
708d4ac6
authored
7 months ago
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
export comments of variables as description pragmas
Signed-off-by:
Michael Leuschel
<
leuschel@uni-duesseldorf.de
>
parent
68f3cb26
No related branches found
No related tags found
No related merge requests found
Pipeline
#145717
passed
7 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
de.prob.core/src/de/prob/eventb/translator/internal/ModelTranslator.java
+13
-1
13 additions, 1 deletion
...c/de/prob/eventb/translator/internal/ModelTranslator.java
with
13 additions
and
1 deletion
de.prob.core/src/de/prob/eventb/translator/internal/ModelTranslator.java
+
13
−
1
View file @
708d4ac6
...
@@ -37,6 +37,7 @@ import org.eventb.core.ISCVariable;
...
@@ -37,6 +37,7 @@ import org.eventb.core.ISCVariable;
import
org.eventb.core.ISCVariant
;
import
org.eventb.core.ISCVariant
;
import
org.eventb.core.ISCWitness
;
import
org.eventb.core.ISCWitness
;
import
org.eventb.core.ITraceableElement
;
import
org.eventb.core.ITraceableElement
;
import
org.eventb.core.IVariable
;
import
org.eventb.core.IVariant
;
import
org.eventb.core.IVariant
;
import
org.eventb.core.ast.Assignment
;
import
org.eventb.core.ast.Assignment
;
import
org.eventb.core.ast.FormulaFactory
;
import
org.eventb.core.ast.FormulaFactory
;
...
@@ -52,6 +53,7 @@ import org.rodinp.core.RodinDBException;
...
@@ -52,6 +53,7 @@ import org.rodinp.core.RodinDBException;
import
de.be4.classicalb.core.parser.node.AAnticipatedEventstatus
;
import
de.be4.classicalb.core.parser.node.AAnticipatedEventstatus
;
import
de.be4.classicalb.core.parser.node.AConvergentEventstatus
;
import
de.be4.classicalb.core.parser.node.AConvergentEventstatus
;
import
de.be4.classicalb.core.parser.node.ADescriptionEvent
;
import
de.be4.classicalb.core.parser.node.ADescriptionEvent
;
import
de.be4.classicalb.core.parser.node.ADescriptionExpression
;
import
de.be4.classicalb.core.parser.node.ADescriptionPragma
;
import
de.be4.classicalb.core.parser.node.ADescriptionPragma
;
import
de.be4.classicalb.core.parser.node.ADescriptionPredicate
;
import
de.be4.classicalb.core.parser.node.ADescriptionPredicate
;
import
de.be4.classicalb.core.parser.node.AEvent
;
import
de.be4.classicalb.core.parser.node.AEvent
;
...
@@ -452,9 +454,19 @@ public class ModelTranslator extends AbstractComponentTranslator {
...
@@ -452,9 +454,19 @@ public class ModelTranslator extends AbstractComponentTranslator {
variable
.
getIdentifierString
());
variable
.
getIdentifierString
());
final
AIdentifierExpression
id
=
new
AIdentifierExpression
(
final
AIdentifierExpression
id
=
new
AIdentifierExpression
(
Arrays
.
asList
(
new
TIdentifierLiteral
[]
{
literal
}));
Arrays
.
asList
(
new
TIdentifierLiteral
[]
{
literal
}));
final
IVariable
ucv
=
(
IVariable
)
variable
.
getSource
();
// comments only attached in unchecked source
if
(
ucv
.
hasAttribute
(
EventBAttributes
.
COMMENT_ATTRIBUTE
))
{
final
String
commentString
=
ucv
.
getAttributeValue
(
EventBAttributes
.
COMMENT_ATTRIBUTE
);
final
TPragmaFreeText
desc
=
new
TPragmaFreeText
(
commentString
);
ADescriptionPragma
descPragma
=
new
ADescriptionPragma
(
Collections
.
singletonList
(
desc
));
final
ADescriptionExpression
descid
=
new
ADescriptionExpression
(
descPragma
,
id
);
list
.
add
(
descid
);
}
else
{
list
.
add
(
id
);
list
.
add
(
id
);
}
}
}
}
}
variablesModelClause
.
setIdentifiers
(
list
);
variablesModelClause
.
setIdentifiers
(
list
);
return
variablesModelClause
;
return
variablesModelClause
;
}
}
...
...
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