forked from xtuml/models
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new folder to hold model compiler examples. Initial content is
two archetypes to be used in the xtUML Learning Series presentation on customizing a model compiler.
- Loading branch information
keithbrown
committed
Feb 5, 2013
1 parent
c5eb22b
commit 504b69c
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>MC_examples</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.//============================================================================ | ||
.// Custom model compiler extension to export component and port information | ||
.// as XML | ||
.//============================================================================ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
.select any s_sys from instances of S_SYS | ||
.select many c_cs from instances of C_C | ||
.for each c_c in c_cs | ||
<component name="${c_c.Name}"> | ||
.select many c_pos related by c_c->C_PO[R4010] | ||
.for each c_po in c_pos | ||
<port name="${c_po.Name}" /> | ||
.end for | ||
</component> | ||
.end for | ||
.emit to file "${s_sys.Name}.xml" | ||
.//============================================================================ | ||
.// End custom MC extension | ||
.//============================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.//============================================================================ | ||
.// Custom model compiler extension to export component, port, and interface | ||
.// message information as XML | ||
.//============================================================================ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
.select any s_sys from instances of S_SYS | ||
.select many c_cs from instances of C_C | ||
.for each c_c in c_cs | ||
<component name="${c_c.Name}"> | ||
.select many c_pos related by c_c->C_PO[R4010] | ||
.for each c_po in c_pos | ||
<port name="${c_po.Name}"> | ||
.select any c_ir related by c_po->C_IR[R4016] | ||
.if ( not_empty c_ir ) | ||
.select one c_i related by c_ir->C_I[R4012] | ||
.if ( not_empty c_i ) | ||
.select many c_eps related by c_i->C_EP[R4003] | ||
.if ( not_empty c_eps ) | ||
.for each c_ep in c_eps | ||
.select any c_as related by c_ep->C_AS[R4004] | ||
.if ( not_empty c_as ) | ||
<message name="${c_as.Name}" /> | ||
.end if | ||
.select any c_io related by c_ep->C_IO[R4004] | ||
.if ( not_empty c_io ) | ||
<message name="${c_io.Name}" /> | ||
.end if | ||
.end for | ||
.end if | ||
.end if | ||
.end if | ||
</port> | ||
.end for | ||
</component> | ||
.end for | ||
.emit to file "${s_sys.Name}.xml" | ||
.//============================================================================ | ||
.// End custom MC extension | ||
.//============================================================================ |