Statistics
| Branch: | Revision:

root / doc / ned2 / ned2.dtd @ 01873262

History | View | Annotate | Download (9.53 KB)

1
<!--
2
**
3
** OMNeT++/OMNEST Network Description v2 (NED2)
4
**
5
-->
6

    
7
<!ELEMENT files ((ned-file|msg-file)*)>
8

    
9
<!--
10
  **  NED-2.
11
  -->
12

    
13
<!ELEMENT ned-file (comment*, (package|import|property-decl|property|
14
                    simple-module|compound-module|module-interface|
15
                    channel|channel-interface)*)>
16
<!ATTLIST ned-file
17
     filename           CDATA     #REQUIRED
18
     version            CDATA     "2">
19

    
20
<!-- comments and whitespace; comments include '//' marks. Note that although
21
     nearly all elements may contain comment elements, there are places
22
     (e.g. within expressions) where they are ignored by the implementation.
23
     Default value is a space or a newline, depending on the context.
24
 -->
25
<!ELEMENT comment EMPTY>
26
<!ATTLIST comment
27
     locid              NMTOKEN   #REQUIRED
28
     content            CDATA     #IMPLIED>
29

    
30
<!ELEMENT package (comment*)>
31
<!ATTLIST package
32
     name               CDATA     #REQUIRED>
33

    
34
<!ELEMENT import (comment*)>
35
<!ATTLIST import
36
     import-spec        CDATA     #REQUIRED>
37

    
38
<!ELEMENT property-decl (comment*, property-key*, property*)>
39
<!ATTLIST property-decl
40
     name               NMTOKEN   #REQUIRED
41
     is-array           (true|false) "false">
42

    
43
<!ELEMENT extends (comment*)>
44
<!ATTLIST extends
45
     name               CDATA     #REQUIRED>
46

    
47
<!ELEMENT interface-name (comment*)>
48
<!ATTLIST interface-name
49
     name               CDATA     #REQUIRED>
50

    
51
<!ELEMENT simple-module (comment*, extends?, interface-name*, parameters?, gates?)>
52
<!ATTLIST simple-module
53
     name               NMTOKEN   #REQUIRED>
54

    
55
<!ELEMENT module-interface (comment*, extends*, parameters?, gates?)>
56
<!ATTLIST module-interface
57
     name               NMTOKEN   #REQUIRED>
58

    
59
<!ELEMENT compound-module (comment*, extends?, interface-name*,
60
                           parameters?, gates?, types?, submodules?, connections?)>
61
<!ATTLIST compound-module
62
     name               NMTOKEN   #REQUIRED>
63

    
64
<!ELEMENT channel-interface (comment*, extends*, parameters?)>
65
<!ATTLIST channel-interface
66
     name                NMTOKEN   #REQUIRED>
67

    
68
<!ELEMENT channel (comment*, extends?, interface-name*, parameters?)>
69
<!ATTLIST channel
70
     name                NMTOKEN   #REQUIRED>
71

    
72
<!ELEMENT parameters (comment*, (property|param)*)>
73
<!ATTLIST parameters
74
    is-implicit         (true|false)  "false">
75

    
76
<!ELEMENT param (comment*, expression?, property*)>
77
<!ATTLIST param
78
     type               (double|int|string|bool|xml) #IMPLIED
79
     is-volatile        (true|false)  "false"
80
     name               CDATA     #REQUIRED
81
     value              CDATA     #IMPLIED
82
     is-pattern         (true|false)  "false"
83
     is-default         (true|false)  "false">
84

    
85
<!ELEMENT property (comment*, property-key*)>
86
<!ATTLIST property
87
     is-implicit        (true|false) "false"
88
     name               NMTOKEN   #REQUIRED
89
     index              NMTOKEN   #IMPLIED>
90

    
91
<!ELEMENT property-key (comment*, literal*)>
92
<!ATTLIST property-key
93
     name               CDATA     #IMPLIED>
94

    
95
<!ELEMENT gates (comment*, gate*)>
96

    
97
<!ELEMENT gate (comment*, expression?, property*)>
98
<!ATTLIST gate
99
     name               NMTOKEN   #REQUIRED
100
     type               (input|output|inout) #IMPLIED
101
     is-vector          (true|false) "false"
102
     vector-size        CDATA     #IMPLIED>
103

    
104
<!ELEMENT types (comment*, (channel|channel-interface|simple-module|
105
                               compound-module|module-interface)*)>
106

    
107
<!ELEMENT submodules (comment*, submodule*)>
108

    
109
<!ELEMENT submodule (comment*, expression*, parameters?, gates?)>
110
<!ATTLIST submodule
111
     name               NMTOKEN   #REQUIRED
112
     type               CDATA     #IMPLIED
113
     like-type          CDATA     #IMPLIED
114
     like-param         CDATA     #IMPLIED
115
     vector-size        CDATA     #IMPLIED>
116

    
117
<!ELEMENT connections (comment*, (connection|connection-group)*)>
118
<!ATTLIST connections
119
     allow-unconnected (true|false) "false">
120

    
121
<!ELEMENT connection (comment*, expression*, channel-spec?, (loop|condition)*)>
122
<!ATTLIST connection
123
     src-module          NMTOKEN   #IMPLIED
124
     src-module-index    CDATA     #IMPLIED
125
     src-gate            NMTOKEN   #REQUIRED
126
     src-gate-plusplus  (true|false) "false"
127
     src-gate-index      CDATA     #IMPLIED
128
     src-gate-subg       (i|o)     #IMPLIED
129
     dest-module         NMTOKEN   #IMPLIED
130
     dest-module-index   CDATA     #IMPLIED
131
     dest-gate           NMTOKEN   #REQUIRED
132
     dest-gate-plusplus (true|false) "false"
133
     dest-gate-index     CDATA     #IMPLIED
134
     dest-gate-subg      (i|o)     #IMPLIED
135
     arrow-direction    (l2r|r2l|bidir) #REQUIRED>
136

    
137
<!ELEMENT channel-spec (comment*, expression*, parameters?)>
138
<!ATTLIST channel-spec
139
     type               CDATA     #IMPLIED
140
     like-type          CDATA     #IMPLIED
141
     like-param         CDATA     #IMPLIED>
142

    
143
<!ELEMENT connection-group (comment*, (loop|condition)*, connection*)>
144

    
145
<!ELEMENT loop (comment*, expression*)>
146
<!ATTLIST loop
147
     param-name          NMTOKEN   #REQUIRED
148
     from-value          CDATA     #IMPLIED
149
     to-value            CDATA     #IMPLIED>
150

    
151
<!ELEMENT condition (comment*, expression?)>
152
<!ATTLIST condition
153
     condition           CDATA     #IMPLIED>
154

    
155
<!--
156
  **  Expressions
157
  -->
158

    
159
<!ELEMENT expression (comment*, (operator|function|ident|literal))>
160
<!ATTLIST expression
161
     target              CDATA     #IMPLIED>
162

    
163
<!ELEMENT operator (comment*, (operator|function|ident|literal)+)>
164
<!ATTLIST operator
165
     name                CDATA     #REQUIRED>
166

    
167
<!-- functions, "index", "const" and "sizeof" -->
168
<!ELEMENT function (comment*, (operator|function|ident|literal)*)>
169
<!ATTLIST function
170
     name                NMTOKEN   #REQUIRED>
171

    
172
<!-- Ident is either a parameter reference or an argument for the "sizeof" 
173
     operator; its NED source form is one of the following: "name", "module.name",
174
     "module[n].name". If there is a child, it represents the module index n. 
175
     A reserved module name (with special meaning) is "this".
176
-->
177
<!ELEMENT ident (comment*, (operator|function|ident|literal)?)>
178
<!ATTLIST ident
179
     module              CDATA     #IMPLIED
180
     name                NMTOKEN   #REQUIRED>
181

    
182

    
183
<!ELEMENT literal (comment*)>
184
<!-- Note: value is in fact REQUIRED, but empty attr value should
185
     also be accepted because that represents the "" string literal;
186
     "spec" is for properties, to store the null value and "-",
187
     the antivalue. Unit can only be present with "double".
188
 -->
189
<!ATTLIST literal
190
     type  (double|int|string|bool|spec)  #REQUIRED
191
     unit                CDATA     #IMPLIED
192
     text                CDATA     #IMPLIED
193
     value               CDATA     #IMPLIED>
194

    
195
<!--**********************************************************************-->
196

    
197
<!--
198
**
199
** OMNeT++/OMNEST Message Definitions (MSG)
200
**
201
-->
202

    
203
<!ELEMENT msg-file (comment*, (namespace|property-decl|property|cplusplus|
204
                    struct-decl|class-decl|message-decl|packet-decl|enum-decl|
205
                    struct|class|message|packet|enum)*)>
206

    
207
<!ATTLIST msg-file
208
     filename            CDATA     #IMPLIED
209
     version             CDATA     "2">
210

    
211
<!ELEMENT namespace (comment*)>
212
<!ATTLIST namespace
213
     name                CDATA     #REQUIRED>  <!-- note: not NMTOKEN because it may contain "::" -->
214

    
215
<!ELEMENT cplusplus (comment*)>
216
<!ATTLIST cplusplus
217
     body                CDATA     #REQUIRED>
218

    
219
<!-- C++ type announcements -->
220

    
221
<!ELEMENT struct-decl (comment*)>
222
<!ATTLIST struct-decl
223
     name                CDATA     #REQUIRED>
224

    
225
<!ELEMENT class-decl (comment*)>
226
<!ATTLIST class-decl
227
     name                CDATA     #REQUIRED
228
     is-cobject      (true|false)  "false"
229
     extends-name        CDATA     #IMPLIED>
230

    
231
<!ELEMENT message-decl (comment*)>
232
<!ATTLIST message-decl
233
     name                CDATA     #REQUIRED>
234

    
235
<!ELEMENT packet-decl (comment*)>
236
<!ATTLIST packet-decl
237
     name                CDATA     #REQUIRED>
238

    
239
<!ELEMENT enum-decl (comment*)>
240
<!ATTLIST enum-decl
241
     name                CDATA     #REQUIRED>
242

    
243
<!-- Enums -->
244

    
245
<!ELEMENT enum (comment*, enum-fields?)>
246
<!ATTLIST enum
247
     name                NMTOKEN   #REQUIRED
248
     extends-name        CDATA     #IMPLIED
249
     source-code         CDATA     #IMPLIED>
250

    
251
<!ELEMENT enum-fields (comment*, enum-field*)>
252

    
253
<!ELEMENT enum-field (comment*)>
254
<!ATTLIST enum-field
255
     name                NMTOKEN   #REQUIRED
256
     value               CDATA     #IMPLIED>
257

    
258
<!-- Message, class, struct -->
259

    
260
<!ELEMENT message (comment*, (property|field)*)>
261
<!ATTLIST message
262
     name                NMTOKEN   #REQUIRED
263
     extends-name        CDATA     #IMPLIED
264
     source-code         CDATA     #IMPLIED>
265

    
266
<!ELEMENT packet (comment*, (property|field)*)>
267
<!ATTLIST packet
268
     name                NMTOKEN   #REQUIRED
269
     extends-name        CDATA     #IMPLIED
270
     source-code         CDATA     #IMPLIED>
271

    
272
<!ELEMENT class (comment*, (property|field)*)>
273
<!ATTLIST class
274
     name                NMTOKEN   #REQUIRED
275
     extends-name        CDATA     #IMPLIED
276
     source-code         CDATA     #IMPLIED>
277

    
278
<!ELEMENT struct (comment*, (property|field)*)>
279
<!ATTLIST struct
280
     name                NMTOKEN   #REQUIRED
281
     extends-name        CDATA     #IMPLIED
282
     source-code         CDATA     #IMPLIED>
283

    
284
<!ELEMENT field (comment*, property*)>
285
<!ATTLIST field
286
     name                NMTOKEN   #REQUIRED
287
     data-type           CDATA     #IMPLIED
288
     is-abstract     (true|false)  "false"
289
     is-readonly     (true|false)  "false"
290
     is-vector       (true|false)  "false"
291
     vector-size         CDATA     #IMPLIED
292
     default-value       CDATA     #IMPLIED>
293

    
294
<!--
295
  **  'unknown' is used internally to represent elements not in this NED DTD
296
  -->
297
<!ELEMENT unknown        ANY>
298
<!ATTLIST unknown
299
     element             CDATA     #REQUIRED>
300

    
301