Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
mbe-tools
TTool
Commits
64d9e3f3
Commit
64d9e3f3
authored
10 years ago
by
Andrea Enrici
Browse files
Options
Downloads
Patches
Plain Diff
corrected bug in text generation
parent
f20efb82
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
src/tmltranslator/TMLCPTextSpecification.java
+12
-7
12 additions, 7 deletions
src/tmltranslator/TMLCPTextSpecification.java
with
12 additions
and
7 deletions
src/tmltranslator/TMLCPTextSpecification.java
+
12
−
7
View file @
64d9e3f3
...
...
@@ -298,6 +298,10 @@ public class TMLCPTextSpecification {
}
}
TMLCPActivityDiagram
mainCP
=
tmlcp
.
getMainCP
();
sb
.
append
(
CR
+
"ACTIVITY "
+
mainCP
.
getName
()
+
CR2
+
TAB
+
"MAIN"
);
sb
.
append
(
makeSingleActivityDiagram
(
mainCP
)
+
CR
+
TAB
+
"END"
+
CR
);
sb
.
append
(
CR
+
"END "
+
mainCP
.
getName
()
+
CR
);
for
(
TMLCPActivityDiagram
ad:
activityDiagList
)
{
sb
.
append
(
CR
+
"ACTIVITY "
+
ad
.
getName
()
+
CR2
+
TAB
+
"MAIN"
);
sb
.
append
(
makeSingleActivityDiagram
(
ad
)
+
CR
+
TAB
+
"END"
+
CR
);
...
...
@@ -393,7 +397,7 @@ public class TMLCPTextSpecification {
currentElement
=
currentElement
.
getNextElements
().
get
(
0
);
}
return
sb
.
toString
();
return
sb
.
toString
()
+
"><"
;
}
private
String
parseSequence
(
TMLCPElement
element
)
{
...
...
@@ -430,13 +434,13 @@ public class TMLCPTextSpecification {
sbFork
.
append
(
"}"
+
SP
+
PARALLELISM_OP
);
}
sbFork
=
removeTrailingSymbol
(
sbFork
);
sbFork
.
append
(
"}"
);
sbFork
.
append
(
"}"
+
SEQUENCE_OP
);
return
nextElement
;
}
private
String
makeSingleJunctionDiagram
(
TMLCPActivityDiagram
ad
)
{
StringBuffer
sb
=
new
StringBuffer
();
StringBuffer
sb
=
new
StringBuffer
(
ad
.
getName
()
+
":"
+
SP
);
TMLCPElement
currentElement
,
nextElement
;
ArrayList
<
TMLCPElement
>
nextElements
;
...
...
@@ -465,6 +469,7 @@ public class TMLCPTextSpecification {
private
String
parseChoice
(
TMLCPElement
currentElement
,
TMLCPActivityDiagram
ad
)
{
StringBuffer
sb
=
new
StringBuffer
(
CR
+
TAB
+
"LOOP"
+
SP
+
ad
.
getName
()
);
//this LOOP is the keywork that is used to look for the junction diagram name, removing it, causing the generation not to work
ArrayList
<
TMLCPElement
>
nextElements
;
int
index
=
0
;
ArrayList
<
TMLCPElement
>
branches
=
currentElement
.
getNextElements
();
...
...
@@ -485,10 +490,10 @@ public class TMLCPTextSpecification {
String
s
=
(
(
TMLCPRefAD
)
element
).
getName
();
sb
=
removeTrailingSymbol
(
sb
);
if
(
s
.
equals
(
ad
.
getName
()
)
)
{
sb
.
append
(
SP
+
"GOTO
LOOP
"
+
SP
+
s
);
sb
.
append
(
SP
+
"GOTO"
+
SP
+
s
);
// it is a reference to the same junction-choice block
}
else
{
sb
.
append
(
SP
+
"GOTO
LOOP
"
+
SP
+
"JUNCTION"
+
s
);
sb
.
append
(
SP
+
"GOTO"
+
SP
+
"JUNCTION"
+
s
);
//it is a reference to another junction-choice block
}
break
;
}
...
...
@@ -498,13 +503,13 @@ public class TMLCPTextSpecification {
element
=
element
.
getNextElements
().
get
(
0
);
if
(
element
instanceof
TMLCPStop
)
{
sb
=
removeTrailingSymbol
(
sb
);
sb
.
append
(
SP
+
"GOTO END
_LOOP
"
+
SP
+
ad
.
getName
()
);
sb
.
append
(
SP
+
"GOTO END"
+
SP
+
ad
.
getName
()
);
}
}
}
// end of while
index
++;
}
// end of for
sb
.
append
(
CR
+
TAB
+
"END
_LOOP
"
+
SP
+
ad
.
getName
()
+
CR
);
sb
.
append
(
CR
+
TAB
+
"END"
+
SP
+
ad
.
getName
()
+
CR
);
return
sb
.
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