expressir 2.1.12 → 2.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/liquid_drops.adoc +1547 -0
- data/lib/expressir/version.rb +1 -1
- metadata +3 -2
@@ -0,0 +1,1547 @@
|
|
1
|
+
= Expressir Liquid drop attributes
|
2
|
+
:toc:
|
3
|
+
|
4
|
+
== Introduction
|
5
|
+
|
6
|
+
== Identifier functionality
|
7
|
+
|
8
|
+
Many EXPRESS model elements have an identifier and associated documentation. In Expressir, this is implemented through the `IdentifierDrop` module. When a drop class includes this module and calls `initialize_identifier`, it automatically gets the following attributes:
|
9
|
+
|
10
|
+
`id`:: The identifier name of the element
|
11
|
+
`remarks`:: Array of remarks (comments) associated with the element
|
12
|
+
`remark_items`:: Array of structured remarks as RemarkItemDrop objects
|
13
|
+
`source`:: The original source code representation
|
14
|
+
|
15
|
+
The following drops include Identifier functionality:
|
16
|
+
|
17
|
+
* Schema drops
|
18
|
+
* Type drops
|
19
|
+
* Entity drops
|
20
|
+
* Function drops
|
21
|
+
* Procedure drops
|
22
|
+
* Attribute drops
|
23
|
+
* Constant drops
|
24
|
+
* Variable drops
|
25
|
+
* Parameter drops
|
26
|
+
* Rule drops
|
27
|
+
* Where rule drops
|
28
|
+
* Unique rule drops
|
29
|
+
* Subtype constraint drops
|
30
|
+
* Generic drops
|
31
|
+
* Generic entity drops
|
32
|
+
* Enumeration item drops
|
33
|
+
* Aggregate drops
|
34
|
+
* Query expression drops
|
35
|
+
* Alias statement drops
|
36
|
+
|
37
|
+
Each of these drops will have the above attributes in addition to their specific attributes.
|
38
|
+
|
39
|
+
Example using identifier attributes:
|
40
|
+
|
41
|
+
[source,liquid]
|
42
|
+
----
|
43
|
+
Name: {{ item.id }}
|
44
|
+
|
45
|
+
{% if item.remarks.size > 0 %}
|
46
|
+
Documentation:
|
47
|
+
{% for remark in item.remarks %}
|
48
|
+
* {{ remark }}
|
49
|
+
{% endfor %}
|
50
|
+
{% endif %}
|
51
|
+
|
52
|
+
{% if item.remark_items.size > 0 %}
|
53
|
+
Structured Documentation:
|
54
|
+
{% for ritem in item.remark_items %}
|
55
|
+
* {{ ritem.id }}: {{ ritem.remarks | join: " " }}
|
56
|
+
{% endfor %}
|
57
|
+
{% endif %}
|
58
|
+
|
59
|
+
Source:
|
60
|
+
{{ item.source }}
|
61
|
+
----
|
62
|
+
|
63
|
+
=== Identifier implementation details
|
64
|
+
|
65
|
+
The identifier functionality is implemented in the `IdentifierDrop` module located in `lib/expressir/liquid/identifier_drop.rb`. Classes include this module and call `initialize_identifier` in their initializer to get the standard identifier attributes.
|
66
|
+
|
67
|
+
Example implementation pattern:
|
68
|
+
|
69
|
+
[source,ruby]
|
70
|
+
----
|
71
|
+
class MyDrop < ModelElementDrop
|
72
|
+
include IdentifierDrop
|
73
|
+
|
74
|
+
def initialize(model)
|
75
|
+
super
|
76
|
+
initialize_identifier
|
77
|
+
end
|
78
|
+
end
|
79
|
+
----
|
80
|
+
|
81
|
+
=== Error handling with identifier attributes
|
82
|
+
|
83
|
+
When working with identifier attributes, consider these error handling patterns:
|
84
|
+
|
85
|
+
[source,liquid]
|
86
|
+
----
|
87
|
+
{% if item %}
|
88
|
+
{% if item.id %}{{ item.id }}{% else %}[Unnamed]{% endif %}
|
89
|
+
{% else %}
|
90
|
+
[Invalid Item]
|
91
|
+
{% endif %}
|
92
|
+
|
93
|
+
{% if item and item.remarks %}
|
94
|
+
{% for remark in item.remarks %}
|
95
|
+
- {{ remark }}
|
96
|
+
{% endfor %}
|
97
|
+
{% endif %}
|
98
|
+
|
99
|
+
{% if item and item.source %}{{ item.source }}{% else %}[No Source Available]{% endif %}
|
100
|
+
----
|
101
|
+
|
102
|
+
== Drop categories and attributes
|
103
|
+
|
104
|
+
=== Base drops
|
105
|
+
|
106
|
+
==== ModelElementDrop
|
107
|
+
|
108
|
+
Base class for all drops.
|
109
|
+
|
110
|
+
Attributes:
|
111
|
+
|
112
|
+
`_class`:: Returns the class name of the model
|
113
|
+
`file`:: Returns the file path if the model responds to it
|
114
|
+
`source`:: Returns the source if the model responds to it
|
115
|
+
|
116
|
+
==== DeclarationDrop
|
117
|
+
|
118
|
+
Inherits from ModelElementDrop.
|
119
|
+
|
120
|
+
=== Repository and schema drops
|
121
|
+
|
122
|
+
==== RepositoryDrop
|
123
|
+
|
124
|
+
Represents the root container for schemas.
|
125
|
+
|
126
|
+
Attributes:
|
127
|
+
|
128
|
+
`schemas`:: Array of SchemaDrop objects
|
129
|
+
|
130
|
+
==== SchemaDrop
|
131
|
+
|
132
|
+
Represents an EXPRESS SCHEMA declaration. Includes identifier functionality.
|
133
|
+
|
134
|
+
Attributes:
|
135
|
+
|
136
|
+
`id`:: Schema name
|
137
|
+
`remarks`:: Array of remarks
|
138
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
139
|
+
`source`:: Source code representation
|
140
|
+
`file`:: Schema file path
|
141
|
+
`file_basename`:: Base name of schema file
|
142
|
+
`selected`:: Boolean indicating if schema is selected
|
143
|
+
`relative_path_prefix`:: Relative path prefix for document
|
144
|
+
`version`:: SchemaVersionDrop object
|
145
|
+
`interfaces`:: Array of InterfaceDrop objects
|
146
|
+
`constants`:: Array of ConstantDrop objects
|
147
|
+
`types`:: Array of TypeDrop objects
|
148
|
+
`entities`:: Array of EntityDrop objects
|
149
|
+
`subtype_constraints`:: Array of SubtypeConstraintDrop objects
|
150
|
+
`functions`:: Array of FunctionDrop objects
|
151
|
+
`rules`:: Array of RuleDrop objects
|
152
|
+
`procedures`:: Array of ProcedureDrop objects
|
153
|
+
`formatted`:: Formatted string representation
|
154
|
+
|
155
|
+
==== SchemaVersionDrop
|
156
|
+
|
157
|
+
Represents schema version information.
|
158
|
+
|
159
|
+
Attributes:
|
160
|
+
|
161
|
+
`value`:: Version string value
|
162
|
+
`items`:: Array of SchemaVersionItemDrop objects
|
163
|
+
|
164
|
+
==== SchemaVersionItemDrop
|
165
|
+
|
166
|
+
Represents individual version items.
|
167
|
+
|
168
|
+
Attributes:
|
169
|
+
|
170
|
+
`name`:: Item name
|
171
|
+
`value`:: Item value
|
172
|
+
|
173
|
+
=== Interface drops
|
174
|
+
|
175
|
+
==== InterfaceDrop
|
176
|
+
|
177
|
+
Represents schema interfaces (USE FROM and REFERENCE FROM).
|
178
|
+
|
179
|
+
Attributes:
|
180
|
+
|
181
|
+
`kind`:: Interface kind ('use' or 'reference')
|
182
|
+
`schema`:: Reference to schema being interfaced
|
183
|
+
`items`:: Array of InterfaceItemDrop objects
|
184
|
+
|
185
|
+
==== InterfaceItemDrop
|
186
|
+
|
187
|
+
Represents items in an interface.
|
188
|
+
|
189
|
+
Attributes:
|
190
|
+
|
191
|
+
`ref`:: Reference to the interfaced item
|
192
|
+
`id`:: Identifier name
|
193
|
+
|
194
|
+
==== InterfacedItemDrop
|
195
|
+
|
196
|
+
Represents an item that has been interfaced.
|
197
|
+
|
198
|
+
Attributes:
|
199
|
+
|
200
|
+
`id`:: Identifier name
|
201
|
+
`remarks`:: Array of remarks
|
202
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
203
|
+
`base_item`:: Reference to the original item
|
204
|
+
|
205
|
+
=== Declaration drops
|
206
|
+
|
207
|
+
==== AttributeDrop
|
208
|
+
|
209
|
+
Represents an entity attribute. Includes identifier functionality.
|
210
|
+
|
211
|
+
Attributes:
|
212
|
+
|
213
|
+
`id`:: Attribute name
|
214
|
+
`remarks`:: Array of remarks
|
215
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
216
|
+
`source`:: Source code representation
|
217
|
+
`kind`:: Kind of attribute (explicit, derived, inverse)
|
218
|
+
`supertype_attribute`:: Reference to attribute in supertype if inherited
|
219
|
+
`optional`:: Boolean indicating if attribute is optional
|
220
|
+
`type`:: DataTypeDrop representing attribute type
|
221
|
+
`expression`:: ExpressionDrop for derived attributes
|
222
|
+
|
223
|
+
==== ConstantDrop
|
224
|
+
|
225
|
+
Represents schema-level constants. Includes identifier functionality.
|
226
|
+
|
227
|
+
Attributes:
|
228
|
+
|
229
|
+
`id`:: Constant name
|
230
|
+
`remarks`:: Array of remarks
|
231
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
232
|
+
`source`:: Source code representation
|
233
|
+
`type`:: DataTypeDrop representing constant type
|
234
|
+
`expression`:: ExpressionDrop representing constant value
|
235
|
+
|
236
|
+
==== EntityDrop
|
237
|
+
|
238
|
+
Represents an EXPRESS entity. Includes identifier functionality.
|
239
|
+
|
240
|
+
Attributes:
|
241
|
+
|
242
|
+
`id`:: Entity name
|
243
|
+
`remarks`:: Array of remarks
|
244
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
245
|
+
`source`:: Source code representation
|
246
|
+
`abstract`:: Boolean indicating if entity is abstract
|
247
|
+
`supertype_expression`:: SupertypeExpressionDrop
|
248
|
+
`subtype_of`:: Array of references to supertypes
|
249
|
+
`attributes`:: Array of AttributeDrop objects
|
250
|
+
`unique_rules`:: Array of UniqueRuleDrop objects
|
251
|
+
`where_rules`:: Array of WhereRuleDrop objects
|
252
|
+
`informal_propositions`:: Array of RemarkItemDrop objects
|
253
|
+
|
254
|
+
==== FunctionDrop
|
255
|
+
|
256
|
+
Represents an EXPRESS function. Includes identifier functionality.
|
257
|
+
|
258
|
+
Attributes:
|
259
|
+
|
260
|
+
`id`:: Function name
|
261
|
+
`remarks`:: Array of remarks
|
262
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
263
|
+
`source`:: Source code representation
|
264
|
+
`parameters`:: Array of ParameterDrop objects
|
265
|
+
`return_type`:: DataTypeDrop representing return type
|
266
|
+
`types`:: Array of TypeDrop objects
|
267
|
+
`entities`:: Array of EntityDrop objects
|
268
|
+
`subtype_constraints`:: Array of SubtypeConstraintDrop objects
|
269
|
+
`functions`:: Array of FunctionDrop objects
|
270
|
+
`procedures`:: Array of ProcedureDrop objects
|
271
|
+
`constants`:: Array of ConstantDrop objects
|
272
|
+
`variables`:: Array of VariableDrop objects
|
273
|
+
`statements`:: Array of StatementDrop objects
|
274
|
+
|
275
|
+
==== ParameterDrop
|
276
|
+
|
277
|
+
Represents function/procedure parameters. Includes identifier functionality.
|
278
|
+
|
279
|
+
Attributes:
|
280
|
+
|
281
|
+
`id`:: Parameter name
|
282
|
+
`remarks`:: Array of remarks
|
283
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
284
|
+
`source`:: Source code representation
|
285
|
+
`var`:: Boolean indicating if parameter is VAR (variable)
|
286
|
+
`type`:: DataTypeDrop representing parameter type
|
287
|
+
|
288
|
+
==== ProcedureDrop
|
289
|
+
|
290
|
+
Represents an EXPRESS procedure. Includes identifier functionality.
|
291
|
+
|
292
|
+
Attributes:
|
293
|
+
|
294
|
+
`id`:: Procedure name
|
295
|
+
`remarks`:: Array of remarks
|
296
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
297
|
+
`source`:: Source code representation
|
298
|
+
`parameters`:: Array of ParameterDrop objects
|
299
|
+
`types`:: Array of TypeDrop objects
|
300
|
+
`entities`:: Array of EntityDrop objects
|
301
|
+
`subtype_constraints`:: Array of SubtypeConstraintDrop objects
|
302
|
+
`functions`:: Array of FunctionDrop objects
|
303
|
+
`procedures`:: Array of ProcedureDrop objects
|
304
|
+
`constants`:: Array of ConstantDrop objects
|
305
|
+
`variables`:: Array of VariableDrop objects
|
306
|
+
`statements`:: Array of StatementDrop objects
|
307
|
+
|
308
|
+
==== RemarkItemDrop
|
309
|
+
|
310
|
+
Represents structured remarks.
|
311
|
+
|
312
|
+
Attributes:
|
313
|
+
|
314
|
+
`id`:: Remark identifier
|
315
|
+
`remarks`:: Array of remark content strings
|
316
|
+
|
317
|
+
==== RuleDrop
|
318
|
+
|
319
|
+
Represents EXPRESS global rules. Includes identifier functionality.
|
320
|
+
|
321
|
+
Attributes:
|
322
|
+
|
323
|
+
`id`:: Rule name
|
324
|
+
`remarks`:: Array of remarks
|
325
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
326
|
+
`source`:: Source code representation
|
327
|
+
`applies_to`:: Array of references to entities rule applies to
|
328
|
+
`types`:: Array of TypeDrop objects
|
329
|
+
`entities`:: Array of EntityDrop objects
|
330
|
+
`subtype_constraints`:: Array of SubtypeConstraintDrop objects
|
331
|
+
`functions`:: Array of FunctionDrop objects
|
332
|
+
`procedures`:: Array of ProcedureDrop objects
|
333
|
+
`constants`:: Array of ConstantDrop objects
|
334
|
+
`variables`:: Array of VariableDrop objects
|
335
|
+
`statements`:: Array of StatementDrop objects
|
336
|
+
`where_rules`:: Array of WhereRuleDrop objects
|
337
|
+
`informal_propositions`:: Array of RemarkItemDrop objects
|
338
|
+
|
339
|
+
==== TypeDrop
|
340
|
+
|
341
|
+
Represents EXPRESS type definitions. Includes identifier functionality.
|
342
|
+
|
343
|
+
Attributes:
|
344
|
+
|
345
|
+
`id`:: Type name
|
346
|
+
`remarks`:: Array of remarks
|
347
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
348
|
+
`source`:: Source code representation
|
349
|
+
`underlying_type`:: DataTypeDrop representing base type
|
350
|
+
`where_rules`:: Array of WhereRuleDrop objects
|
351
|
+
`informal_propositions`:: Array of RemarkItemDrop objects
|
352
|
+
|
353
|
+
==== UniqueRuleDrop
|
354
|
+
|
355
|
+
Represents UNIQUE rules in entities. Includes identifier functionality.
|
356
|
+
|
357
|
+
Attributes:
|
358
|
+
|
359
|
+
`id`:: Rule name
|
360
|
+
`remarks`:: Array of remarks
|
361
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
362
|
+
`source`:: Source code representation
|
363
|
+
`attributes`:: Array of references to attributes
|
364
|
+
|
365
|
+
==== VariableDrop
|
366
|
+
|
367
|
+
Represents local variables. Includes identifier functionality.
|
368
|
+
|
369
|
+
Attributes:
|
370
|
+
|
371
|
+
`id`:: Variable name
|
372
|
+
`remarks`:: Array of remarks
|
373
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
374
|
+
`source`:: Source code representation
|
375
|
+
`type`:: DataTypeDrop representing variable type
|
376
|
+
`expression`:: ExpressionDrop representing initial value
|
377
|
+
|
378
|
+
==== WhereRuleDrop
|
379
|
+
|
380
|
+
Represents WHERE rules. Includes identifier functionality.
|
381
|
+
|
382
|
+
Attributes:
|
383
|
+
|
384
|
+
`id`:: Rule name
|
385
|
+
`remarks`:: Array of remarks
|
386
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
387
|
+
`source`:: Source code representation
|
388
|
+
`expression`:: ExpressionDrop representing rule condition
|
389
|
+
|
390
|
+
=== Data type drops
|
391
|
+
|
392
|
+
==== AggregateDrop
|
393
|
+
|
394
|
+
Base class for aggregate types. Includes identifier functionality.
|
395
|
+
|
396
|
+
Attributes:
|
397
|
+
|
398
|
+
`id`:: Type name
|
399
|
+
`remarks`:: Array of remarks
|
400
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
401
|
+
`source`:: Source code representation
|
402
|
+
`base_type`:: DataTypeDrop representing element type
|
403
|
+
|
404
|
+
==== ArrayDrop
|
405
|
+
|
406
|
+
Represents EXPRESS ARRAY type.
|
407
|
+
|
408
|
+
Attributes:
|
409
|
+
|
410
|
+
`bound1`:: Lower bound expression
|
411
|
+
`bound2`:: Upper bound expression
|
412
|
+
`optional`:: Boolean indicating if array is optional
|
413
|
+
`unique`:: Boolean indicating if elements must be unique
|
414
|
+
`base_type`:: DataTypeDrop representing element type
|
415
|
+
|
416
|
+
==== BagDrop
|
417
|
+
|
418
|
+
Represents EXPRESS BAG type.
|
419
|
+
|
420
|
+
Attributes:
|
421
|
+
|
422
|
+
`bound1`:: Lower bound expression
|
423
|
+
`bound2`:: Upper bound expression
|
424
|
+
`base_type`:: DataTypeDrop representing element type
|
425
|
+
|
426
|
+
==== BinaryDrop
|
427
|
+
|
428
|
+
Represents EXPRESS BINARY type.
|
429
|
+
|
430
|
+
Attributes:
|
431
|
+
|
432
|
+
`width`:: Width specification expression
|
433
|
+
`fixed`:: Boolean indicating if width is fixed
|
434
|
+
|
435
|
+
==== BooleanDrop
|
436
|
+
|
437
|
+
Represents EXPRESS BOOLEAN type.
|
438
|
+
|
439
|
+
==== EnumerationDrop
|
440
|
+
|
441
|
+
Represents EXPRESS ENUMERATION type.
|
442
|
+
|
443
|
+
Attributes:
|
444
|
+
|
445
|
+
`extensible`:: Boolean indicating if enumeration is extensible
|
446
|
+
`based_on`:: Reference to base enumeration
|
447
|
+
`items`:: Array of EnumerationItemDrop objects
|
448
|
+
|
449
|
+
==== EnumerationItemDrop
|
450
|
+
|
451
|
+
Represents items in an enumeration. Includes identifier functionality.
|
452
|
+
|
453
|
+
Attributes:
|
454
|
+
|
455
|
+
`id`:: Item name
|
456
|
+
`remarks`:: Array of remarks
|
457
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
458
|
+
`source`:: Source code representation
|
459
|
+
|
460
|
+
==== GenericDrop
|
461
|
+
|
462
|
+
Represents EXPRESS GENERIC type. Includes identifier functionality.
|
463
|
+
|
464
|
+
Attributes:
|
465
|
+
|
466
|
+
`id`:: Type name
|
467
|
+
`remarks`:: Array of remarks
|
468
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
469
|
+
`source`:: Source code representation
|
470
|
+
|
471
|
+
==== GenericEntityDrop
|
472
|
+
|
473
|
+
Represents EXPRESS GENERIC_ENTITY type. Includes identifier functionality.
|
474
|
+
|
475
|
+
Attributes:
|
476
|
+
|
477
|
+
`id`:: Type name
|
478
|
+
`remarks`:: Array of remarks
|
479
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
480
|
+
`source`:: Source code representation
|
481
|
+
|
482
|
+
==== IntegerDrop
|
483
|
+
|
484
|
+
Represents EXPRESS INTEGER type.
|
485
|
+
|
486
|
+
==== ListDrop
|
487
|
+
|
488
|
+
Represents EXPRESS LIST type.
|
489
|
+
|
490
|
+
Attributes:
|
491
|
+
|
492
|
+
`bound1`:: Lower bound expression
|
493
|
+
`bound2`:: Upper bound expression
|
494
|
+
`unique`:: Boolean indicating if elements must be unique
|
495
|
+
`base_type`:: DataTypeDrop representing element type
|
496
|
+
|
497
|
+
==== LogicalDrop
|
498
|
+
|
499
|
+
Represents EXPRESS LOGICAL type.
|
500
|
+
|
501
|
+
==== RealDrop
|
502
|
+
|
503
|
+
Represents EXPRESS REAL type.
|
504
|
+
|
505
|
+
Attributes:
|
506
|
+
|
507
|
+
`precision`:: Precision specification expression
|
508
|
+
|
509
|
+
==== SelectDrop
|
510
|
+
|
511
|
+
Represents EXPRESS SELECT type.
|
512
|
+
|
513
|
+
Attributes:
|
514
|
+
|
515
|
+
`extensible`:: Boolean indicating if select is extensible
|
516
|
+
`generic_entity`:: Boolean indicating if select is generic entity
|
517
|
+
`based_on`:: Reference to base select
|
518
|
+
`items`:: Array of references to select items
|
519
|
+
|
520
|
+
==== SetDrop
|
521
|
+
|
522
|
+
Represents EXPRESS SET type.
|
523
|
+
|
524
|
+
Attributes:
|
525
|
+
|
526
|
+
`bound1`:: Lower bound expression
|
527
|
+
`bound2`:: Upper bound expression
|
528
|
+
`base_type`:: DataTypeDrop representing element type
|
529
|
+
|
530
|
+
==== StringDrop
|
531
|
+
|
532
|
+
Represents EXPRESS STRING type.
|
533
|
+
|
534
|
+
Attributes:
|
535
|
+
|
536
|
+
`width`:: Width specification expression
|
537
|
+
`fixed`:: Boolean indicating if width is fixed
|
538
|
+
|
539
|
+
=== Expression drops
|
540
|
+
|
541
|
+
==== AggregateInitializerDrop
|
542
|
+
|
543
|
+
Represents aggregate initialization expressions.
|
544
|
+
|
545
|
+
Attributes:
|
546
|
+
|
547
|
+
`items`:: Array of AggregateInitializerItemDrop objects
|
548
|
+
|
549
|
+
==== AggregateInitializerItemDrop
|
550
|
+
|
551
|
+
Represents items in an aggregate initializer.
|
552
|
+
|
553
|
+
Attributes:
|
554
|
+
|
555
|
+
`expression`:: ExpressionDrop representing item value
|
556
|
+
`repetition`:: ExpressionDrop representing repetition count
|
557
|
+
|
558
|
+
==== BinaryExpressionDrop
|
559
|
+
|
560
|
+
Represents binary operations.
|
561
|
+
|
562
|
+
Attributes:
|
563
|
+
|
564
|
+
`operator`:: Operator symbol
|
565
|
+
`operand1`:: ExpressionDrop for first operand
|
566
|
+
`operand2`:: ExpressionDrop for second operand
|
567
|
+
|
568
|
+
==== EntityConstructorDrop
|
569
|
+
|
570
|
+
Represents entity constructor expressions.
|
571
|
+
|
572
|
+
Attributes:
|
573
|
+
|
574
|
+
`entity`:: Reference to entity being constructed
|
575
|
+
`items`:: Array of entity constructor items
|
576
|
+
|
577
|
+
==== FunctionCallDrop
|
578
|
+
|
579
|
+
Represents function call expressions.
|
580
|
+
|
581
|
+
Attributes:
|
582
|
+
|
583
|
+
`function`:: Reference to called function
|
584
|
+
`parameters`:: Array of parameter expressions
|
585
|
+
|
586
|
+
==== IntervalDrop
|
587
|
+
|
588
|
+
Represents interval expressions.
|
589
|
+
|
590
|
+
Attributes:
|
591
|
+
|
592
|
+
`operator`:: Interval operator
|
593
|
+
`operand1`:: Lower bound expression
|
594
|
+
`operand2`:: Upper bound expression
|
595
|
+
|
596
|
+
==== QueryExpressionDrop
|
597
|
+
|
598
|
+
Represents QUERY expressions.
|
599
|
+
|
600
|
+
Attributes:
|
601
|
+
|
602
|
+
`id`:: Query variable name
|
603
|
+
`remarks`:: Array of remarks
|
604
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
605
|
+
`source`:: Source code representation
|
606
|
+
`aggregate_source`:: Expression providing source collection
|
607
|
+
`expression`:: Query filter expression
|
608
|
+
|
609
|
+
==== UnaryExpressionDrop
|
610
|
+
|
611
|
+
Represents unary operations.
|
612
|
+
|
613
|
+
Attributes:
|
614
|
+
|
615
|
+
`operator`:: Operator symbol
|
616
|
+
`operand`:: ExpressionDrop for operand
|
617
|
+
|
618
|
+
=== Literal drops
|
619
|
+
|
620
|
+
==== BinaryDrop
|
621
|
+
|
622
|
+
Represents binary literals.
|
623
|
+
|
624
|
+
Attributes:
|
625
|
+
|
626
|
+
`value`:: Binary value
|
627
|
+
|
628
|
+
==== IntegerDrop
|
629
|
+
|
630
|
+
Represents integer literals.
|
631
|
+
|
632
|
+
Attributes:
|
633
|
+
|
634
|
+
`value`:: Integer value
|
635
|
+
|
636
|
+
==== LogicalDrop
|
637
|
+
|
638
|
+
Represents logical literals.
|
639
|
+
|
640
|
+
Attributes:
|
641
|
+
|
642
|
+
`value`:: Logical value (TRUE, FALSE, UNKNOWN)
|
643
|
+
|
644
|
+
==== RealDrop
|
645
|
+
|
646
|
+
Represents real number literals.
|
647
|
+
|
648
|
+
Attributes:
|
649
|
+
|
650
|
+
`value`:: Real number value
|
651
|
+
|
652
|
+
==== StringDrop
|
653
|
+
|
654
|
+
Represents string literals.
|
655
|
+
|
656
|
+
Attributes:
|
657
|
+
|
658
|
+
`value`:: String value
|
659
|
+
`encoded`:: Boolean indicating if string is encoded
|
660
|
+
|
661
|
+
=== Reference drops
|
662
|
+
|
663
|
+
==== AttributeReferenceDrop
|
664
|
+
|
665
|
+
Represents references to attributes.
|
666
|
+
|
667
|
+
Attributes:
|
668
|
+
|
669
|
+
`base`:: Reference to base entity/type
|
670
|
+
`attribute`:: Reference to attribute
|
671
|
+
|
672
|
+
==== GroupReferenceDrop
|
673
|
+
|
674
|
+
Represents references to groups.
|
675
|
+
|
676
|
+
Attributes:
|
677
|
+
|
678
|
+
`base`:: Reference to base entity/type
|
679
|
+
`group`:: Reference to group
|
680
|
+
|
681
|
+
==== IndexReferenceDrop
|
682
|
+
|
683
|
+
Represents array/list index references.
|
684
|
+
|
685
|
+
Attributes:
|
686
|
+
|
687
|
+
`base`:: Reference to aggregate
|
688
|
+
`index1`:: First index expression
|
689
|
+
`index2`:: Second index expression (for ranges)
|
690
|
+
|
691
|
+
==== SimpleReferenceDrop
|
692
|
+
|
693
|
+
Represents simple named references.
|
694
|
+
|
695
|
+
Attributes:
|
696
|
+
|
697
|
+
`id`:: Referenced name
|
698
|
+
|
699
|
+
=== Statement drops
|
700
|
+
|
701
|
+
==== AliasDrop
|
702
|
+
|
703
|
+
Represents ALIAS statements. Includes identifier functionality.
|
704
|
+
|
705
|
+
Attributes:
|
706
|
+
|
707
|
+
`id`:: Alias name
|
708
|
+
`remarks`:: Array of remarks
|
709
|
+
`remark_items`:: Array of RemarkItemDrop objects
|
710
|
+
`source`:: Source code representation
|
711
|
+
`expression`:: Referenced expression
|
712
|
+
`statements`:: Array of statements in alias block
|
713
|
+
|
714
|
+
==== AssignmentDrop
|
715
|
+
|
716
|
+
Represents assignment statements.
|
717
|
+
|
718
|
+
Attributes:
|
719
|
+
|
720
|
+
`expression1`:: Target expression
|
721
|
+
`expression2`:: Value expression
|
722
|
+
|
723
|
+
==== CaseActionDrop
|
724
|
+
|
725
|
+
Represents CASE action clauses.
|
726
|
+
|
727
|
+
Attributes:
|
728
|
+
|
729
|
+
`labels`:: Array of case label expressions
|
730
|
+
`statement`:: Statement to execute
|
731
|
+
|
732
|
+
==== CaseDrop
|
733
|
+
|
734
|
+
Represents CASE statements.
|
735
|
+
|
736
|
+
Attributes:
|
737
|
+
|
738
|
+
`expression`:: Selector expression
|
739
|
+
`actions`:: Array of CaseActionDrop objects
|
740
|
+
`otherwise`:: Otherwise statement
|
741
|
+
|
742
|
+
==== CompoundDrop
|
743
|
+
|
744
|
+
Represents compound statements.
|
745
|
+
|
746
|
+
Attributes:
|
747
|
+
|
748
|
+
`statements`:: Array of statements
|
749
|
+
|
750
|
+
==== EscapeDrop
|
751
|
+
|
752
|
+
Represents ESCAPE statements.
|
753
|
+
|
754
|
+
==== IfDrop
|
755
|
+
|
756
|
+
Represents IF statements.
|
757
|
+
|
758
|
+
Attributes:
|
759
|
+
|
760
|
+
`expression`:: Condition expression
|
761
|
+
`statements`:: Array of statements in then branch
|
762
|
+
`else_statements`:: Array of statements in else branch
|
763
|
+
|
764
|
+
==== NullDrop
|
765
|
+
|
766
|
+
Represents NULL statements.
|
767
|
+
|
768
|
+
==== ProcedureCallDrop
|
769
|
+
|
770
|
+
Represents procedure call statements.
|
771
|
+
|
772
|
+
Attributes:
|
773
|
+
|
774
|
+
`procedure`:: Reference to called procedure
|
775
|
+
`parameters`:: Array of parameter expressions
|
776
|
+
|
777
|
+
==== RepeatDrop
|
778
|
+
|
779
|
+
Represents REPEAT statements.
|
780
|
+
|
781
|
+
Attributes:
|
782
|
+
|
783
|
+
`expression`:: Loop condition expression
|
784
|
+
`statements`:: Array of statements in loop body
|
785
|
+
|
786
|
+
==== ReturnDrop
|
787
|
+
|
788
|
+
Represents RETURN statements.
|
789
|
+
|
790
|
+
Attributes:
|
791
|
+
|
792
|
+
`expression`:: Return value expression
|
793
|
+
|
794
|
+
==== SkipDrop
|
795
|
+
|
796
|
+
Represents SKIP statements.
|
797
|
+
|
798
|
+
=== Constant drop
|
799
|
+
|
800
|
+
Represents EXPRESS CONSTANT declarations at the schema level. Includes identifier functionality through `IdentifierDrop`.
|
801
|
+
|
802
|
+
Attributes:
|
803
|
+
|
804
|
+
* [Added by IdentifierDrop]:
|
805
|
+
|
806
|
+
`id`::: Identifier name (constant name)
|
807
|
+
`remarks`::: Array of remarks associated with the constant
|
808
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
809
|
+
`source`::: Source code representation
|
810
|
+
|
811
|
+
* Constant-specific attributes:
|
812
|
+
|
813
|
+
`type`::: DataTypeDrop representing the constant's type
|
814
|
+
`expression`::: ExpressionDrop representing the constant's value
|
815
|
+
|
816
|
+
Example EXPRESS:
|
817
|
+
|
818
|
+
[source,express]
|
819
|
+
----
|
820
|
+
CONSTANT
|
821
|
+
(* Mathematical constant *)
|
822
|
+
PI : REAL := 3.14159;
|
823
|
+
(* System limits *)
|
824
|
+
MAX_ITEMS : INTEGER := 1000;
|
825
|
+
(* Default text *)
|
826
|
+
DEFAULT_NAME : STRING := 'Untitled';
|
827
|
+
END_CONSTANT;
|
828
|
+
----
|
829
|
+
|
830
|
+
Example usage showing identifier functionality:
|
831
|
+
|
832
|
+
[source,liquid]
|
833
|
+
----
|
834
|
+
Constants:
|
835
|
+
{% for const in schema.constants %}
|
836
|
+
{{ const.id }}:
|
837
|
+
Type: {{ const.type._class }}
|
838
|
+
Value: {{ const.expression.value }}
|
839
|
+
|
840
|
+
Documentation:
|
841
|
+
{% for remark in const.remarks %}
|
842
|
+
- {{ remark }}
|
843
|
+
{% endfor %}
|
844
|
+
|
845
|
+
Source:
|
846
|
+
{{ const.source }}
|
847
|
+
|
848
|
+
{% if const.remark_items %}
|
849
|
+
Structured Documentation:
|
850
|
+
{% for item in const.remark_items %}
|
851
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
852
|
+
{% endfor %}
|
853
|
+
{% endif %}
|
854
|
+
{% endfor %}
|
855
|
+
----
|
856
|
+
|
857
|
+
=== Query expression drop
|
858
|
+
|
859
|
+
Represents an EXPRESS QUERY expression. Includes identifier functionality through `IdentifierDrop` since queries can have variable declarations.
|
860
|
+
|
861
|
+
Attributes:
|
862
|
+
|
863
|
+
* [Added by IdentifierDrop]:
|
864
|
+
|
865
|
+
`id`::: Identifier name (query variable name)
|
866
|
+
`remarks`::: Array of remarks associated with the query
|
867
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
868
|
+
`source`::: Source code representation
|
869
|
+
|
870
|
+
* Query-specific attributes:
|
871
|
+
|
872
|
+
`aggregate_source`::: Expression providing the source collection
|
873
|
+
`expression`::: Query filter expression
|
874
|
+
|
875
|
+
Example EXPRESS:
|
876
|
+
|
877
|
+
[source,express]
|
878
|
+
----
|
879
|
+
RULE find_expensive_items FOR (catalog);
|
880
|
+
WHERE
|
881
|
+
(* Find items above price threshold *)
|
882
|
+
has_expensive : QUERY (
|
883
|
+
(* Iterator for catalog items *)
|
884
|
+
item <* catalog.items |
|
885
|
+
(* Check price threshold *)
|
886
|
+
item.price > 1000.0
|
887
|
+
) > 0;
|
888
|
+
END_RULE;
|
889
|
+
----
|
890
|
+
|
891
|
+
Example usage showing identifier functionality:
|
892
|
+
|
893
|
+
[source,liquid]
|
894
|
+
----
|
895
|
+
Query Variable: {{ query.id }}
|
896
|
+
|
897
|
+
Documentation:
|
898
|
+
{% for remark in query.remarks %}
|
899
|
+
- {{ remark }}
|
900
|
+
{% endfor %}
|
901
|
+
|
902
|
+
Source:
|
903
|
+
{{ query.source }}
|
904
|
+
|
905
|
+
{% if query.remark_items %}
|
906
|
+
Structured Documentation:
|
907
|
+
{% for item in query.remark_items %}
|
908
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
909
|
+
{% endfor %}
|
910
|
+
{% endif %}
|
911
|
+
|
912
|
+
Source Collection: {{ query.aggregate_source }}
|
913
|
+
Filter: {{ query.expression }}
|
914
|
+
----
|
915
|
+
|
916
|
+
=== Generic drop
|
917
|
+
|
918
|
+
Represents an EXPRESS GENERIC type. Includes identifier functionality through `IdentifierDrop`.
|
919
|
+
|
920
|
+
Attributes:
|
921
|
+
|
922
|
+
* [Added by IdentifierDrop]:
|
923
|
+
|
924
|
+
`id`::: Identifier name (generic type name)
|
925
|
+
`remarks`::: Array of remarks associated with the generic type
|
926
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
927
|
+
`source`::: Source code representation
|
928
|
+
|
929
|
+
Example EXPRESS:
|
930
|
+
|
931
|
+
[source,express]
|
932
|
+
----
|
933
|
+
TYPE list_type = LIST OF GENERIC;
|
934
|
+
(* Generic list type *)
|
935
|
+
(* Author: Jane Smith *)
|
936
|
+
END_TYPE;
|
937
|
+
----
|
938
|
+
|
939
|
+
Example usage showing identifier functionality:
|
940
|
+
|
941
|
+
[source,liquid]
|
942
|
+
----
|
943
|
+
Generic Type: {{ type.id }}
|
944
|
+
|
945
|
+
Documentation:
|
946
|
+
{% for remark in type.remarks %}
|
947
|
+
- {{ remark }}
|
948
|
+
{% endfor %}
|
949
|
+
|
950
|
+
Source:
|
951
|
+
{{ type.source }}
|
952
|
+
|
953
|
+
{% if type.remark_items %}
|
954
|
+
Structured Documentation:
|
955
|
+
{% for item in type.remark_items %}
|
956
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
957
|
+
{% endfor %}
|
958
|
+
{% endif %}
|
959
|
+
----
|
960
|
+
|
961
|
+
=== Generic entity drop
|
962
|
+
|
963
|
+
Represents an EXPRESS GENERIC_ENTITY type. Includes identifier functionality through `IdentifierDrop`.
|
964
|
+
|
965
|
+
Attributes:
|
966
|
+
|
967
|
+
* [Added by IdentifierDrop]:
|
968
|
+
|
969
|
+
`id`::: Identifier name (generic entity name)
|
970
|
+
`remarks`::: Array of remarks associated with the generic entity
|
971
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
972
|
+
`source`::: Source code representation
|
973
|
+
|
974
|
+
Example EXPRESS:
|
975
|
+
|
976
|
+
[source,express]
|
977
|
+
----
|
978
|
+
TYPE container = SET OF GENERIC_ENTITY;
|
979
|
+
(* Generic entity container *)
|
980
|
+
(* Supports any entity type *)
|
981
|
+
END_TYPE;
|
982
|
+
----
|
983
|
+
|
984
|
+
Example usage showing identifier functionality:
|
985
|
+
|
986
|
+
[source,liquid]
|
987
|
+
----
|
988
|
+
Generic Entity: {{ type.id }}
|
989
|
+
|
990
|
+
Documentation:
|
991
|
+
{% for remark in type.remarks %}
|
992
|
+
- {{ remark }}
|
993
|
+
{% endfor %}
|
994
|
+
|
995
|
+
Source:
|
996
|
+
{{ type.source }}
|
997
|
+
|
998
|
+
{% if type.remark_items %}
|
999
|
+
Structured Documentation:
|
1000
|
+
{% for item in type.remark_items %}
|
1001
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
1002
|
+
{% endfor %}
|
1003
|
+
{% endif %}
|
1004
|
+
{% endfor %}
|
1005
|
+
----
|
1006
|
+
|
1007
|
+
=== Enumeration item drop
|
1008
|
+
|
1009
|
+
Represents items in an EXPRESS ENUMERATION type. Includes identifier functionality through `IdentifierDrop`.
|
1010
|
+
|
1011
|
+
Attributes:
|
1012
|
+
|
1013
|
+
* [Added by IdentifierDrop]:
|
1014
|
+
|
1015
|
+
`id`::: Identifier name (enumeration value name)
|
1016
|
+
`remarks`::: Array of remarks associated with the enumeration item
|
1017
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
1018
|
+
`source`::: Source code representation
|
1019
|
+
|
1020
|
+
Example EXPRESS:
|
1021
|
+
|
1022
|
+
[source,express]
|
1023
|
+
----
|
1024
|
+
TYPE color = ENUMERATION OF
|
1025
|
+
(* Basic colors *)
|
1026
|
+
red, (* Primary color *)
|
1027
|
+
green, (* Primary color *)
|
1028
|
+
blue, (* Primary color *)
|
1029
|
+
(* Extended colors *)
|
1030
|
+
yellow, (* Secondary color *)
|
1031
|
+
purple (* Secondary color *)
|
1032
|
+
);
|
1033
|
+
END_TYPE;
|
1034
|
+
----
|
1035
|
+
|
1036
|
+
Example usage showing identifier functionality:
|
1037
|
+
|
1038
|
+
[source,liquid]
|
1039
|
+
----
|
1040
|
+
{% for item in type.underlying_type.items %}
|
1041
|
+
Value: {{ item.id }}
|
1042
|
+
|
1043
|
+
Documentation:
|
1044
|
+
{% for remark in item.remarks %}
|
1045
|
+
- {{ remark }}
|
1046
|
+
{% endfor %}
|
1047
|
+
|
1048
|
+
Source:
|
1049
|
+
{{ item.source }}
|
1050
|
+
|
1051
|
+
{% if item.remark_items %}
|
1052
|
+
Structured Documentation:
|
1053
|
+
{% for ritem in item.remark_items %}
|
1054
|
+
- {{ ritem.id }}: {{ ritem.remarks | join: " " }}
|
1055
|
+
{% endfor %}
|
1056
|
+
{% endif %}
|
1057
|
+
{% endfor %}
|
1058
|
+
----
|
1059
|
+
|
1060
|
+
=== Aggregate drop
|
1061
|
+
|
1062
|
+
Represents an EXPRESS aggregate type definition. Includes identifier functionality through `IdentifierDrop`.
|
1063
|
+
|
1064
|
+
Attributes:
|
1065
|
+
|
1066
|
+
* [Added by IdentifierDrop]:
|
1067
|
+
|
1068
|
+
`id`::: Identifier name (aggregate type name)
|
1069
|
+
`remarks`::: Array of remarks associated with the aggregate type
|
1070
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
1071
|
+
`source`::: Source code representation
|
1072
|
+
* Aggregate-specific attributes:
|
1073
|
+
|
1074
|
+
`base_type`::: DataTypeDrop representing the element type
|
1075
|
+
|
1076
|
+
Example EXPRESS:
|
1077
|
+
|
1078
|
+
[source,express]
|
1079
|
+
----
|
1080
|
+
TYPE point_list = LIST OF point;
|
1081
|
+
(* List of geometric points *)
|
1082
|
+
(* Used for polylines *)
|
1083
|
+
END_TYPE;
|
1084
|
+
|
1085
|
+
TYPE color_set = SET OF color;
|
1086
|
+
(* Set of unique colors *)
|
1087
|
+
(* For color palettes *)
|
1088
|
+
END_TYPE;
|
1089
|
+
----
|
1090
|
+
|
1091
|
+
Example usage showing identifier functionality:
|
1092
|
+
|
1093
|
+
[source,liquid]
|
1094
|
+
----
|
1095
|
+
Aggregate Type: {{ type.id }}
|
1096
|
+
Base Type: {{ type.base_type._class }}
|
1097
|
+
|
1098
|
+
Documentation:
|
1099
|
+
{% for remark in type.remarks %}
|
1100
|
+
- {{ remark }}
|
1101
|
+
{% endfor %}
|
1102
|
+
|
1103
|
+
Source:
|
1104
|
+
{{ type.source }}
|
1105
|
+
|
1106
|
+
{% if type.remark_items %}
|
1107
|
+
Structured Documentation:
|
1108
|
+
{% for item in type.remark_items %}
|
1109
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
1110
|
+
{% endfor %}
|
1111
|
+
{% endif %}
|
1112
|
+
----
|
1113
|
+
|
1114
|
+
=== Alias statement drop
|
1115
|
+
|
1116
|
+
Represents an EXPRESS ALIAS statement. Includes identifier functionality through `IdentifierDrop`.
|
1117
|
+
|
1118
|
+
Attributes:
|
1119
|
+
|
1120
|
+
* [Added by IdentifierDrop]:
|
1121
|
+
|
1122
|
+
`id`::: Identifier name (alias name)
|
1123
|
+
`remarks`::: Array of remarks associated with the alias
|
1124
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
1125
|
+
`source`::: Source code representation
|
1126
|
+
* Alias-specific attributes:
|
1127
|
+
|
1128
|
+
`expression`::: The referenced expression
|
1129
|
+
`statements`::: Array of statements in the ALIAS block
|
1130
|
+
|
1131
|
+
Example EXPRESS:
|
1132
|
+
|
1133
|
+
[source,express]
|
1134
|
+
----
|
1135
|
+
FUNCTION process_point(p : point) : REAL;
|
1136
|
+
(* Create alias for readability *)
|
1137
|
+
ALIAS coord := p.coordinates;
|
1138
|
+
(* Compute using aliased value *)
|
1139
|
+
result := coord.x * coord.y;
|
1140
|
+
END_ALIAS;
|
1141
|
+
RETURN result;
|
1142
|
+
END_FUNCTION;
|
1143
|
+
----
|
1144
|
+
|
1145
|
+
Example usage showing identifier functionality:
|
1146
|
+
|
1147
|
+
[source,liquid]
|
1148
|
+
----
|
1149
|
+
{% for statement in function.statements %}
|
1150
|
+
{% if statement._class contains "Alias" %}
|
1151
|
+
Alias: {{ statement.id }}
|
1152
|
+
|
1153
|
+
Documentation:
|
1154
|
+
{% for remark in statement.remarks %}
|
1155
|
+
- {{ remark }}
|
1156
|
+
{% endfor %}
|
1157
|
+
|
1158
|
+
Source:
|
1159
|
+
{{ statement.source }}
|
1160
|
+
|
1161
|
+
{% if statement.remark_items %}
|
1162
|
+
Structured Documentation:
|
1163
|
+
{% for item in statement.remark_items %}
|
1164
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
1165
|
+
{% endfor %}
|
1166
|
+
{% endif %}
|
1167
|
+
|
1168
|
+
Expression: {{ statement.expression }}
|
1169
|
+
{% endif %}
|
1170
|
+
{% endfor %}
|
1171
|
+
----
|
1172
|
+
|
1173
|
+
=== Variable drop
|
1174
|
+
|
1175
|
+
Represents EXPRESS variable declarations in functions and procedures. Includes identifier functionality through `IdentifierDrop`.
|
1176
|
+
|
1177
|
+
Attributes:
|
1178
|
+
|
1179
|
+
* [Added by IdentifierDrop]:
|
1180
|
+
|
1181
|
+
`id`::: Identifier name (variable name)
|
1182
|
+
`remarks`::: Array of remarks associated with the variable
|
1183
|
+
`remark_items`::: Array of RemarkItemDrop objects containing structured remarks
|
1184
|
+
`source`::: Source code representation
|
1185
|
+
* Variable-specific attributes:
|
1186
|
+
|
1187
|
+
`type`::: DataTypeDrop representing the variable's type
|
1188
|
+
`expression`::: ExpressionDrop representing the optional initial value
|
1189
|
+
|
1190
|
+
Example EXPRESS:
|
1191
|
+
|
1192
|
+
[source,express]
|
1193
|
+
----
|
1194
|
+
FUNCTION calculate_area(width, height: REAL) : REAL;
|
1195
|
+
LOCAL
|
1196
|
+
(* Temporary result storage *)
|
1197
|
+
result : REAL := 0.0;
|
1198
|
+
(* Status flag *)
|
1199
|
+
valid : BOOLEAN := TRUE;
|
1200
|
+
END_LOCAL;
|
1201
|
+
|
1202
|
+
result := width * height;
|
1203
|
+
RETURN result;
|
1204
|
+
END_FUNCTION;
|
1205
|
+
----
|
1206
|
+
|
1207
|
+
Example usage showing identifier functionality:
|
1208
|
+
|
1209
|
+
[source,liquid]
|
1210
|
+
----
|
1211
|
+
Local Variables:
|
1212
|
+
{% for var in function.variables %}
|
1213
|
+
{{ var.id }}:
|
1214
|
+
Type: {{ var.type._class }}
|
1215
|
+
{% if var.expression %}
|
1216
|
+
Initial Value: {{ var.expression }}
|
1217
|
+
{% endif %}
|
1218
|
+
|
1219
|
+
Documentation:
|
1220
|
+
{% for remark in var.remarks %}
|
1221
|
+
- {{ remark }}
|
1222
|
+
{% endfor %}
|
1223
|
+
|
1224
|
+
Source:
|
1225
|
+
{{ var.source }}
|
1226
|
+
|
1227
|
+
{% if var.remark_items %}
|
1228
|
+
Structured Documentation:
|
1229
|
+
{% for item in var.remark_items %}
|
1230
|
+
- {{ item.id }}: {{ item.remarks | join: " " }}
|
1231
|
+
{% endfor %}
|
1232
|
+
{% endif %}
|
1233
|
+
{% endfor %}
|
1234
|
+
----
|
1235
|
+
|
1236
|
+
=== Working with remark items
|
1237
|
+
|
1238
|
+
Remark items provide a structured way to handle documentation in EXPRESS schemas. Unlike plain remarks, remark items have both an identifier and content, making them suitable for metadata and categorized documentation.
|
1239
|
+
|
1240
|
+
Example EXPRESS with structured remarks:
|
1241
|
+
|
1242
|
+
[source,express]
|
1243
|
+
----
|
1244
|
+
SCHEMA building_schema;
|
1245
|
+
(* @Author: John Smith *)
|
1246
|
+
(* @Version: 1.0 *)
|
1247
|
+
(* @Date: 2024-01-15 *)
|
1248
|
+
(* @Description: Building information model *)
|
1249
|
+
|
1250
|
+
TYPE length_measure = REAL;
|
1251
|
+
(* @Unit: meters *)
|
1252
|
+
(* @Precision: 0.001 *)
|
1253
|
+
END_TYPE;
|
1254
|
+
|
1255
|
+
ENTITY wall;
|
1256
|
+
(* @Property: structural *)
|
1257
|
+
(* @Material: concrete *)
|
1258
|
+
height : length_measure;
|
1259
|
+
width : length_measure;
|
1260
|
+
END_ENTITY;
|
1261
|
+
END_SCHEMA;
|
1262
|
+
----
|
1263
|
+
|
1264
|
+
Example template for handling remark items:
|
1265
|
+
|
1266
|
+
[source,liquid]
|
1267
|
+
----
|
1268
|
+
{%- comment %}Group remarks by category{% endcomment %}
|
1269
|
+
{% assign metadata = [] %}
|
1270
|
+
{% assign technical = [] %}
|
1271
|
+
{% assign other = [] %}
|
1272
|
+
|
1273
|
+
{% for ritem in item.remark_items %}
|
1274
|
+
{% case ritem.id %}
|
1275
|
+
{% when 'Author', 'Version', 'Date' %}
|
1276
|
+
{% assign metadata = metadata | push: ritem %}
|
1277
|
+
{% when 'Unit', 'Precision', 'Property', 'Material' %}
|
1278
|
+
{% assign technical = technical | push: ritem %}
|
1279
|
+
{% else %}
|
1280
|
+
{% assign other = other | push: ritem %}
|
1281
|
+
{% endcase %}
|
1282
|
+
{% endfor %}
|
1283
|
+
|
1284
|
+
{% if metadata.size > 0 %}
|
1285
|
+
Metadata:
|
1286
|
+
{% for ritem in metadata %}
|
1287
|
+
- {{ ritem.id }}: {{ ritem.remarks | join: " " }}
|
1288
|
+
{% endfor %}
|
1289
|
+
{% endif %}
|
1290
|
+
|
1291
|
+
{% if technical.size > 0 %}
|
1292
|
+
Technical Details:
|
1293
|
+
{% for ritem in technical %}
|
1294
|
+
- {{ ritem.id }}: {{ ritem.remarks | join: " " }}
|
1295
|
+
{% endfor %}
|
1296
|
+
{% endif %}
|
1297
|
+
|
1298
|
+
{% if other.size > 0 %}
|
1299
|
+
Additional Information:
|
1300
|
+
{% for ritem in other %}
|
1301
|
+
- {{ ritem.id }}: {{ ritem.remarks | join: " " }}
|
1302
|
+
{% endfor %}
|
1303
|
+
{% endif %}
|
1304
|
+
----
|
1305
|
+
|
1306
|
+
Using the template:
|
1307
|
+
|
1308
|
+
[source,liquid]
|
1309
|
+
----
|
1310
|
+
Schema Documentation:
|
1311
|
+
{{ process_remark_items schema }}
|
1312
|
+
|
1313
|
+
Types:
|
1314
|
+
{% for type in schema.types %}
|
1315
|
+
{{ type.id }}:
|
1316
|
+
{{ process_remark_items type }}
|
1317
|
+
{% endfor %}
|
1318
|
+
|
1319
|
+
Entities:
|
1320
|
+
{% for entity in schema.entities %}
|
1321
|
+
{{ entity.id }}:
|
1322
|
+
{{ process_remark_items entity }}
|
1323
|
+
|
1324
|
+
Attributes:
|
1325
|
+
{% for attr in entity.attributes %}
|
1326
|
+
{{ attr.id }}:
|
1327
|
+
{{ process_remark_items attr }}
|
1328
|
+
{% endfor %}
|
1329
|
+
{% endfor %}
|
1330
|
+
----
|
1331
|
+
|
1332
|
+
Example output:
|
1333
|
+
|
1334
|
+
[source,text]
|
1335
|
+
----
|
1336
|
+
Schema Documentation:
|
1337
|
+
Metadata:
|
1338
|
+
- Author: John Smith
|
1339
|
+
- Version: 1.0
|
1340
|
+
- Date: 2024-01-15
|
1341
|
+
|
1342
|
+
Additional Information:
|
1343
|
+
- Description: Building information model
|
1344
|
+
|
1345
|
+
Types:
|
1346
|
+
length_measure:
|
1347
|
+
Technical Details:
|
1348
|
+
- Unit: meters
|
1349
|
+
- Precision: 0.001
|
1350
|
+
|
1351
|
+
Entities:
|
1352
|
+
wall:
|
1353
|
+
Technical Details:
|
1354
|
+
- Property: structural
|
1355
|
+
- Material: concrete
|
1356
|
+
----
|
1357
|
+
|
1358
|
+
This structured approach makes it easier to:
|
1359
|
+
- Generate consistent documentation
|
1360
|
+
- Filter and categorize documentation elements
|
1361
|
+
- Support multiple documentation formats
|
1362
|
+
- Maintain metadata separate from general documentation
|
1363
|
+
- Generate different views of the same documentation
|
1364
|
+
|
1365
|
+
=== Common remark item patterns
|
1366
|
+
|
1367
|
+
Here are some common patterns for working with remark items in templates:
|
1368
|
+
|
1369
|
+
==== Filtering by category
|
1370
|
+
|
1371
|
+
[source,liquid]
|
1372
|
+
----
|
1373
|
+
{% assign filtered = [] %}
|
1374
|
+
{% for ritem in item.remark_items %}
|
1375
|
+
{% if ritem.id == category %}
|
1376
|
+
{% assign filtered = filtered | push: ritem %}
|
1377
|
+
{% endif %}
|
1378
|
+
{% endfor %}
|
1379
|
+
{{ filtered | map: "remarks" | join: " " }}
|
1380
|
+
|
1381
|
+
{%- comment %}Usage examples:{% endcomment %}
|
1382
|
+
Author: {{ get_remarks_by_category schema "Author" }}
|
1383
|
+
Version: {{ get_remarks_by_category schema "Version" }}
|
1384
|
+
----
|
1385
|
+
|
1386
|
+
==== Creating documentation tables
|
1387
|
+
|
1388
|
+
[source,liquid]
|
1389
|
+
----
|
1390
|
+
|===
|
1391
|
+
|Category |Value
|
1392
|
+
|
1393
|
+
{% for ritem in item.remark_items %}
|
1394
|
+
|{{ ritem.id }}
|
1395
|
+
|{{ ritem.remarks | join: " " }}
|
1396
|
+
{% endfor %}
|
1397
|
+
|===
|
1398
|
+
----
|
1399
|
+
|
1400
|
+
==== Inheritance-aware documentation
|
1401
|
+
|
1402
|
+
[source,liquid]
|
1403
|
+
----
|
1404
|
+
{%- comment %}Get direct remarks{% endcomment %}
|
1405
|
+
{% assign all_remarks = entity.remark_items %}
|
1406
|
+
|
1407
|
+
{%- comment %}Get inherited remarks{% endcomment %}
|
1408
|
+
{% for super in entity.subtype_of %}
|
1409
|
+
{% for ritem in super.remark_items %}
|
1410
|
+
{% assign all_remarks = all_remarks | push: ritem %}
|
1411
|
+
{% endfor %}
|
1412
|
+
{% endfor %}
|
1413
|
+
|
1414
|
+
{%- comment %}Remove duplicates by ID{% endcomment %}
|
1415
|
+
{% assign unique_remarks = [] %}
|
1416
|
+
{% for ritem in all_remarks %}
|
1417
|
+
{% unless unique_remarks | map: "id" | contains: ritem.id %}
|
1418
|
+
{% assign unique_remarks = unique_remarks | push: ritem %}
|
1419
|
+
{% endunless %}
|
1420
|
+
{% endfor %}
|
1421
|
+
|
1422
|
+
{% for ritem in unique_remarks %}
|
1423
|
+
- {{ ritem.id }}: {{ ritem.remarks | join: " " }}
|
1424
|
+
{% endfor %}
|
1425
|
+
----
|
1426
|
+
|
1427
|
+
These patterns help maintain consistency and structure when working with documentation in EXPRESS schemas.
|
1428
|
+
|
1429
|
+
== Drop inheritance hierarchy
|
1430
|
+
|
1431
|
+
Here's how the drops are organized hierarchically:
|
1432
|
+
|
1433
|
+
* ModelElementDrop
|
1434
|
+
** DeclarationDrop
|
1435
|
+
*** EntityDrop
|
1436
|
+
*** TypeDrop
|
1437
|
+
*** FunctionDrop
|
1438
|
+
*** ProcedureDrop
|
1439
|
+
*** RuleDrop
|
1440
|
+
*** WhereRuleDrop
|
1441
|
+
*** UniqueRuleDrop
|
1442
|
+
*** ConstantDrop
|
1443
|
+
*** VariableDrop
|
1444
|
+
*** ParameterDrop
|
1445
|
+
*** AttributeDrop
|
1446
|
+
** ExpressionDrop
|
1447
|
+
*** BinaryExpressionDrop
|
1448
|
+
*** UnaryExpressionDrop
|
1449
|
+
*** QueryExpressionDrop
|
1450
|
+
*** FunctionCallDrop
|
1451
|
+
*** EntityConstructorDrop
|
1452
|
+
*** AggregateInitializerDrop
|
1453
|
+
*** IntervalDrop
|
1454
|
+
** DataTypeDrop
|
1455
|
+
*** AggregateDrop
|
1456
|
+
**** ArrayDrop
|
1457
|
+
**** BagDrop
|
1458
|
+
**** ListDrop
|
1459
|
+
**** SetDrop
|
1460
|
+
*** BinaryDrop
|
1461
|
+
*** BooleanDrop
|
1462
|
+
*** EnumerationDrop
|
1463
|
+
*** GenericDrop
|
1464
|
+
*** GenericEntityDrop
|
1465
|
+
*** IntegerDrop
|
1466
|
+
*** LogicalDrop
|
1467
|
+
*** RealDrop
|
1468
|
+
*** SelectDrop
|
1469
|
+
*** StringDrop
|
1470
|
+
** ReferenceDrop
|
1471
|
+
*** SimpleReferenceDrop
|
1472
|
+
*** AttributeReferenceDrop
|
1473
|
+
*** GroupReferenceDrop
|
1474
|
+
*** IndexReferenceDrop
|
1475
|
+
** StatementDrop
|
1476
|
+
*** AliasDrop
|
1477
|
+
*** AssignmentDrop
|
1478
|
+
*** CaseDrop
|
1479
|
+
*** CompoundDrop
|
1480
|
+
*** EscapeDrop
|
1481
|
+
*** IfDrop
|
1482
|
+
*** NullDrop
|
1483
|
+
*** ProcedureCallDrop
|
1484
|
+
*** RepeatDrop
|
1485
|
+
*** ReturnDrop
|
1486
|
+
*** SkipDrop
|
1487
|
+
** LiteralDrop
|
1488
|
+
*** BinaryDrop
|
1489
|
+
*** IntegerDrop
|
1490
|
+
*** LogicalDrop
|
1491
|
+
*** RealDrop
|
1492
|
+
*** StringDrop
|
1493
|
+
|
1494
|
+
=== Common inheritance patterns
|
1495
|
+
|
1496
|
+
When working with drops that share a common base class, you can use patterns like:
|
1497
|
+
|
1498
|
+
[source,liquid]
|
1499
|
+
----
|
1500
|
+
{% for item in items %}
|
1501
|
+
{% case item._class %}
|
1502
|
+
{% when 'EntityDrop' %}
|
1503
|
+
// Process entity
|
1504
|
+
{% when 'TypeDrop' %}
|
1505
|
+
// Process type
|
1506
|
+
{% when 'FunctionDrop' %}
|
1507
|
+
// Process function
|
1508
|
+
{% else %}
|
1509
|
+
// Handle other declarations
|
1510
|
+
{% endcase %}
|
1511
|
+
{% endfor %}
|
1512
|
+
|
1513
|
+
{% for expr in exprs %}
|
1514
|
+
{% case expr._class %}
|
1515
|
+
{% when 'BinaryExpressionDrop' %}
|
1516
|
+
{{ expr.operand1 }} {{ expr.operator }} {{ expr.operand2 }}
|
1517
|
+
{% when 'UnaryExpressionDrop' %}
|
1518
|
+
{{ expr.operator }}{{ expr.operand }}
|
1519
|
+
{% when 'QueryExpressionDrop' %}
|
1520
|
+
QUERY({{ expr.id }} <* {{ expr.aggregate_source }} | {{ expr.expression }})
|
1521
|
+
{% else %}
|
1522
|
+
{{ expr }}
|
1523
|
+
{% endcase %}
|
1524
|
+
{% endfor %}
|
1525
|
+
----
|
1526
|
+
|
1527
|
+
=== Common base class attributes
|
1528
|
+
|
1529
|
+
When working with drops, remember these common attributes available through inheritance:
|
1530
|
+
|
1531
|
+
1. From ModelElementDrop:
|
1532
|
+
|
1533
|
+
`_class`:: Type of drop
|
1534
|
+
`file`:: Source file (if applicable)
|
1535
|
+
`source`:: Original source code
|
1536
|
+
|
1537
|
+
2. From DeclarationDrop:
|
1538
|
+
|
1539
|
+
* All ModelElementDrop attributes
|
1540
|
+
* Additional structure for named declarations
|
1541
|
+
|
1542
|
+
3. When IdentifierDrop is included:
|
1543
|
+
|
1544
|
+
`id`:: Identifier name
|
1545
|
+
`remarks`:: Documentation comments
|
1546
|
+
`remark_items`:: Structured documentation
|
1547
|
+
`source`:: Source representation
|