1(defun insert-uml-class-begin (name)
2  (insert "<UML:Class xmi.id=\"" name "\" name=\"" name "\">\n"))
3
4(defun insert-uml-class-end ()
5  (insert "</UML:Class>\n"))
6
7(defun insert-uml-stereotype (stereotype)
8  (insert "<UML:ModelElement.stereotype>\n")
9  (insert "  <UML:Stereotype xmi.idref=\"" stereotype "\"/>\n")
10  (insert "</UML:ModelElement.stereotype>\n"))
11
12
13(defun insert-uml-taggedvalue (value type)
14  (insert "    <UML:ModelElement.taggedValue>\n")
15  (insert "      <UML:TaggedValue>\n")
16  (insert "        <UML:TaggedValue.dataValue>" value "</UML:TaggedValue.dataValue>\n")
17  (insert "        <UML:TaggedValue.type>\n")
18  (insert "          <UML:TagDefinition xmi.idref=\"" type "\"/>\n")
19  (insert "        </UML:TaggedValue.type>\n")
20  (insert "      </UML:TaggedValue>\n")
21  (insert "    </UML:ModelElement.taggedValue>\n"))
22
23(defun insert-uml-attribute (type name offset bits mask shift comment attrid)
24  (insert "<UML:Classifier.feature>\n")
25  (insert "  <UML:Attribute name=\"" name "\">\n")
26  (insert-uml-taggedvalue comment "comment")
27  (insert-uml-taggedvalue offset "offset")
28  (insert-uml-taggedvalue bits "bits")
29  (insert-uml-taggedvalue mask "mask")
30  (insert-uml-taggedvalue shift "shift")
31  (insert-uml-taggedvalue attrid "attrid")
32  (insert "    <UML:StructuralFeature.type>\n")
33  (insert "      <UML:DataType xmi.idref=\"" type "\"/>\n")
34  (insert "    </UML:StructuralFeature.type>\n")
35  (insert "    <UML:ModelElement.stereotype>\n")
36  (insert "      <UML:Stereotype xmi.idref=\"attribute\"/>\n")
37  (insert "    </UML:ModelElement.stereotype>\n")
38  (insert "  </UML:Attribute>\n")
39  (insert "</UML:Classifier.feature>\n"))
40
41(defun insert-uml-attribute-array (type arraycount name offset bits mask shift comment attrid)
42  (insert "<UML:Classifier.feature>\n")
43  (insert "  <UML:Attribute name=\"" name "\">\n")
44  (insert-uml-taggedvalue comment "comment")
45  (insert-uml-taggedvalue offset "offset")
46  (insert-uml-taggedvalue bits "bits")
47  (insert-uml-taggedvalue mask "mask")
48  (insert-uml-taggedvalue shift "shift")
49  (insert-uml-taggedvalue attrid "attrid")
50  (insert-uml-taggedvalue arraycount "arraycount")
51  (insert "    <UML:StructuralFeature.type>\n")
52  (insert "      <UML:DataType xmi.idref=\"" type "\"/>\n")
53  (insert "    </UML:StructuralFeature.type>\n")
54  (insert "    <UML:ModelElement.stereotype>\n")
55  (insert "      <UML:Stereotype xmi.idref=\"array\"/>\n")
56  (insert "    </UML:ModelElement.stereotype>\n")
57  (insert "  </UML:Attribute>\n")
58  (insert "</UML:Classifier.feature>\n"))
59
60(defun insert-uml-operation (type name comment opid)
61  (insert "<UML:Classifier.feature>\n")
62  (insert "  <UML:Operation name=\"" name "\" >\n")
63  (insert-uml-taggedvalue opid "opid")
64  (insert "    <UML:BehavioralFeature.parameter>\n")
65  (insert "      <UML:Parameter kind=\"return\" name=\"return\">\n")
66  (insert "        <UML:Parameter.type>\n")
67  (insert "          <UML:Class xmi.idref=\"" type "\" />\n")
68  (insert "        </UML:Parameter.type>\n")
69  (insert "      </UML:Parameter>\n")
70  (insert "    </UML:BehavioralFeature.parameter>\n")
71  (insert "    <UML:ModelElement.stereotype>\n")
72  (insert "      <UML:Stereotype xmi.idref=\"attribute\" />\n")
73  (insert "    </UML:ModelElement.stereotype>\n")
74  (insert "  </UML:Operation>\n")
75  (insert "</UML:Classifier.feature>\n"))
76
77(defun insert-uml-binary (name comment opid)
78  (insert "<UML:Classifier.feature>\n")
79  (insert "  <UML:Operation name=\"" name "\" >\n")
80  (insert-uml-taggedvalue opid "opid")
81  (insert "    <UML:BehavioralFeature.parameter>\n")
82  (insert "      <UML:Parameter kind=\"return\" name=\"return\">\n")
83  (insert "        <UML:Parameter.type>\n")
84  (insert "          <UML:Class xmi.idref=\"Binary\" />\n")
85  (insert "        </UML:Parameter.type>\n")
86  (insert "      </UML:Parameter>\n")
87  (insert "    </UML:BehavioralFeature.parameter>\n")
88  (insert "    <UML:ModelElement.stereotype>\n")
89  (insert "      <UML:Stereotype xmi.idref=\"binary\" />\n")
90  (insert "    </UML:ModelElement.stereotype>\n")
91  (insert "  </UML:Operation>\n")
92  (insert "</UML:Classifier.feature>\n"))
93
94(defun insert-uml-operation-array (type name comment opid)
95  (insert "<UML:Classifier.feature>\n")
96  (insert "  <UML:Operation name=\"" name "\" >\n")
97  (insert-uml-taggedvalue opid "opid")
98  (insert "    <UML:BehavioralFeature.parameter>\n")
99  (insert "      <UML:Parameter kind=\"return\" name=\"return\">\n")
100  (insert "        <UML:Parameter.type>\n")
101  (insert "          <UML:Class xmi.idref=\"" type "\" />\n")
102  (insert "        </UML:Parameter.type>\n")
103  (insert "      </UML:Parameter>\n")
104  (insert "    </UML:BehavioralFeature.parameter>\n")
105  (insert "    <UML:ModelElement.stereotype>\n")
106  (insert "      <UML:Stereotype xmi.idref=\"array\" />\n")
107  (insert "    </UML:ModelElement.stereotype>\n")
108  (insert "  </UML:Operation>\n")
109  (insert "</UML:Classifier.feature>\n"))
110
111(defun insert-uml-generalization (parent child)
112  (insert "<UML:Generalization isSpecification=\"false\" xmi.id=\"" child "-" parent "\" >\n")
113  (insert "  <UML:Generalization.child>\n")
114  (insert "    <UML:Class xmi.idref=\"" child "\" />\n")
115  (insert "  </UML:Generalization.child>\n")
116  (insert "  <UML:Generalization.parent>\n")
117  (insert "    <UML:Class xmi.idref=\"" parent "\" />\n")
118  (insert "  </UML:Generalization.parent>\n")
119  (insert "</UML:Generalization>\n"))
120
121(defun insert-uml-sprm (name sprmcode kind)
122  (insert-uml-class-begin name)
123  (insert-uml-stereotype "ww8sprm")
124  (insert-uml-taggedvalue sprmcode "sprmcode")
125  (insert-uml-taggedvalue (concat "rtf:" name) "sprmid")
126  (insert-uml-taggedvalue kind "kind"))