expressir 1.3.0.pre.1-x86_64-linux-gnu

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/.cross_rubies +20 -0
  3. data/.github/workflows/rake.yml +312 -0
  4. data/.github/workflows/release.yml +124 -0
  5. data/.gitignore +23 -0
  6. data/.gitmodules +6 -0
  7. data/.hound.yml +3 -0
  8. data/.rspec +2 -0
  9. data/.rubocop.yml +18 -0
  10. data/.yardopts +11 -0
  11. data/Gemfile +4 -0
  12. data/README.adoc +155 -0
  13. data/Rakefile +17 -0
  14. data/bin/console +11 -0
  15. data/bin/rspec +29 -0
  16. data/bin/setup +8 -0
  17. data/docs/development.md +90 -0
  18. data/exe/expressir +22 -0
  19. data/exe/format +18 -0
  20. data/exe/format-test +81 -0
  21. data/exe/generate-parser +51 -0
  22. data/expressir.gemspec +48 -0
  23. data/lib/expressir/cli/ui.rb +36 -0
  24. data/lib/expressir/cli.rb +21 -0
  25. data/lib/expressir/config.rb +23 -0
  26. data/lib/expressir/express/2.7/express_parser.so +0 -0
  27. data/lib/expressir/express/3.0/express_parser.so +0 -0
  28. data/lib/expressir/express/3.1/express_parser.so +0 -0
  29. data/lib/expressir/express/3.2/express_parser.so +0 -0
  30. data/lib/expressir/express/cache.rb +51 -0
  31. data/lib/expressir/express/extension.rb +30 -0
  32. data/lib/expressir/express/formatter.rb +1608 -0
  33. data/lib/expressir/express/hyperlink_formatter.rb +36 -0
  34. data/lib/expressir/express/model_visitor.rb +24 -0
  35. data/lib/expressir/express/parser.rb +79 -0
  36. data/lib/expressir/express/resolve_references_model_visitor.rb +31 -0
  37. data/lib/expressir/express/schema_head_formatter.rb +23 -0
  38. data/lib/expressir/express/visitor.rb +2581 -0
  39. data/lib/expressir/model/cache.rb +17 -0
  40. data/lib/expressir/model/data_type.rb +9 -0
  41. data/lib/expressir/model/data_types/aggregate.rb +31 -0
  42. data/lib/expressir/model/data_types/array.rb +31 -0
  43. data/lib/expressir/model/data_types/bag.rb +25 -0
  44. data/lib/expressir/model/data_types/binary.rb +22 -0
  45. data/lib/expressir/model/data_types/boolean.rb +10 -0
  46. data/lib/expressir/model/data_types/enumeration.rb +25 -0
  47. data/lib/expressir/model/data_types/enumeration_item.rb +26 -0
  48. data/lib/expressir/model/data_types/generic.rb +26 -0
  49. data/lib/expressir/model/data_types/generic_entity.rb +26 -0
  50. data/lib/expressir/model/data_types/integer.rb +10 -0
  51. data/lib/expressir/model/data_types/list.rb +28 -0
  52. data/lib/expressir/model/data_types/logical.rb +10 -0
  53. data/lib/expressir/model/data_types/number.rb +10 -0
  54. data/lib/expressir/model/data_types/real.rb +19 -0
  55. data/lib/expressir/model/data_types/select.rb +28 -0
  56. data/lib/expressir/model/data_types/set.rb +25 -0
  57. data/lib/expressir/model/data_types/string.rb +22 -0
  58. data/lib/expressir/model/declaration.rb +9 -0
  59. data/lib/expressir/model/declarations/attribute.rb +47 -0
  60. data/lib/expressir/model/declarations/constant.rb +34 -0
  61. data/lib/expressir/model/declarations/entity.rb +53 -0
  62. data/lib/expressir/model/declarations/function.rb +67 -0
  63. data/lib/expressir/model/declarations/interface.rb +28 -0
  64. data/lib/expressir/model/declarations/interface_item.rb +23 -0
  65. data/lib/expressir/model/declarations/interfaced_item.rb +37 -0
  66. data/lib/expressir/model/declarations/parameter.rb +34 -0
  67. data/lib/expressir/model/declarations/procedure.rb +64 -0
  68. data/lib/expressir/model/declarations/remark_item.rb +21 -0
  69. data/lib/expressir/model/declarations/rule.rb +71 -0
  70. data/lib/expressir/model/declarations/schema.rb +117 -0
  71. data/lib/expressir/model/declarations/schema_version.rb +22 -0
  72. data/lib/expressir/model/declarations/schema_version_item.rb +22 -0
  73. data/lib/expressir/model/declarations/subtype_constraint.rb +40 -0
  74. data/lib/expressir/model/declarations/type.rb +45 -0
  75. data/lib/expressir/model/declarations/unique_rule.rb +31 -0
  76. data/lib/expressir/model/declarations/variable.rb +34 -0
  77. data/lib/expressir/model/declarations/where_rule.rb +31 -0
  78. data/lib/expressir/model/expression.rb +9 -0
  79. data/lib/expressir/model/expressions/aggregate_initializer.rb +19 -0
  80. data/lib/expressir/model/expressions/aggregate_initializer_item.rb +22 -0
  81. data/lib/expressir/model/expressions/binary_expression.rb +53 -0
  82. data/lib/expressir/model/expressions/entity_constructor.rb +22 -0
  83. data/lib/expressir/model/expressions/function_call.rb +22 -0
  84. data/lib/expressir/model/expressions/interval.rb +34 -0
  85. data/lib/expressir/model/expressions/query_expression.rb +35 -0
  86. data/lib/expressir/model/expressions/unary_expression.rb +27 -0
  87. data/lib/expressir/model/identifier.rb +34 -0
  88. data/lib/expressir/model/literal.rb +9 -0
  89. data/lib/expressir/model/literals/binary.rb +19 -0
  90. data/lib/expressir/model/literals/integer.rb +19 -0
  91. data/lib/expressir/model/literals/logical.rb +23 -0
  92. data/lib/expressir/model/literals/real.rb +19 -0
  93. data/lib/expressir/model/literals/string.rb +22 -0
  94. data/lib/expressir/model/model_element.rb +208 -0
  95. data/lib/expressir/model/reference.rb +9 -0
  96. data/lib/expressir/model/references/attribute_reference.rb +22 -0
  97. data/lib/expressir/model/references/group_reference.rb +22 -0
  98. data/lib/expressir/model/references/index_reference.rb +27 -0
  99. data/lib/expressir/model/references/simple_reference.rb +24 -0
  100. data/lib/expressir/model/repository.rb +23 -0
  101. data/lib/expressir/model/statement.rb +9 -0
  102. data/lib/expressir/model/statements/alias.rb +35 -0
  103. data/lib/expressir/model/statements/assignment.rb +22 -0
  104. data/lib/expressir/model/statements/case.rb +25 -0
  105. data/lib/expressir/model/statements/case_action.rb +22 -0
  106. data/lib/expressir/model/statements/compound.rb +19 -0
  107. data/lib/expressir/model/statements/escape.rb +10 -0
  108. data/lib/expressir/model/statements/if.rb +25 -0
  109. data/lib/expressir/model/statements/null.rb +10 -0
  110. data/lib/expressir/model/statements/procedure_call.rb +22 -0
  111. data/lib/expressir/model/statements/repeat.rb +47 -0
  112. data/lib/expressir/model/statements/return.rb +19 -0
  113. data/lib/expressir/model/statements/skip.rb +10 -0
  114. data/lib/expressir/model/supertype_expression.rb +9 -0
  115. data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +29 -0
  116. data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +19 -0
  117. data/lib/expressir/model.rb +79 -0
  118. data/lib/expressir/version.rb +3 -0
  119. data/lib/expressir.rb +24 -0
  120. data/rakelib/antlr4-native.rake +161 -0
  121. data/rakelib/cross-ruby.rake +383 -0
  122. data/spec/acceptance/version_spec.rb +27 -0
  123. data/spec/expressir/express/cache_spec.rb +89 -0
  124. data/spec/expressir/express/formatter_spec.rb +173 -0
  125. data/spec/expressir/express/parser_spec.rb +141 -0
  126. data/spec/expressir/model/model_element_spec.rb +318 -0
  127. data/spec/spec_helper.rb +24 -0
  128. data/spec/support/console_helper.rb +29 -0
  129. data/spec/syntax/multiple.exp +23 -0
  130. data/spec/syntax/multiple.yaml +198 -0
  131. data/spec/syntax/multiple_formatted.exp +71 -0
  132. data/spec/syntax/multiple_hyperlink_formatted.exp +71 -0
  133. data/spec/syntax/multiple_schema_head_hyperlink_formatted.exp +13 -0
  134. data/spec/syntax/remark.exp +193 -0
  135. data/spec/syntax/remark.yaml +471 -0
  136. data/spec/syntax/remark_formatted.exp +228 -0
  137. data/spec/syntax/single.exp +4 -0
  138. data/spec/syntax/single.yaml +18 -0
  139. data/spec/syntax/single_formatted.exp +10 -0
  140. data/spec/syntax/single_formatted.yaml +36 -0
  141. data/spec/syntax/syntax.exp +333 -0
  142. data/spec/syntax/syntax.yaml +3509 -0
  143. data/spec/syntax/syntax_formatted.exp +902 -0
  144. data/spec/syntax/syntax_hyperlink_formatted.exp +902 -0
  145. data/spec/syntax/syntax_schema_head_formatted.exp +18 -0
  146. metadata +391 -0
@@ -0,0 +1,228 @@
1
+ SCHEMA remark_schema;
2
+
3
+ CONSTANT
4
+ remark_constant : STRING := 'xxx';
5
+ END_CONSTANT;
6
+
7
+ TYPE remark_type = ENUMERATION OF
8
+ (remark_enumeration_item);
9
+ WHERE
10
+ WR1: TRUE;
11
+ END_TYPE;
12
+
13
+ ENTITY remark_entity;
14
+ remark_attribute : STRING;
15
+ DERIVE
16
+ remark_derived_attribute : STRING := 'xxx';
17
+ INVERSE
18
+ remark_inverse_attribute : remark_entity FOR remark_attribute;
19
+ UNIQUE
20
+ UR1: remark_attribute;
21
+ WHERE
22
+ WR1: TRUE;
23
+ END_ENTITY;
24
+
25
+ SUBTYPE_CONSTRAINT remark_subtype_constraint FOR remark_entity;
26
+ END_SUBTYPE_CONSTRAINT;
27
+
28
+ FUNCTION remark_function(remark_parameter : STRING) : BOOLEAN;
29
+ TYPE remark_type = ENUMERATION OF
30
+ (remark_enumeration_item);
31
+ END_TYPE;
32
+ CONSTANT
33
+ remark_constant : STRING := 'xxx';
34
+ END_CONSTANT;
35
+ LOCAL
36
+ remark_variable : STRING;
37
+ END_LOCAL;
38
+ ALIAS remark_alias FOR remark_variable;
39
+ ;
40
+ --"remark_alias" function alias scope - function alias
41
+ END_ALIAS;
42
+ REPEAT remark_repeat := 1 TO 9;
43
+ ;
44
+ --"remark_repeat" function repeat scope - function repeat
45
+ END_REPEAT;
46
+ remark_variable := QUERY(remark_query <* remark_variable | TRUE
47
+ --"remark_query" function query scope - function query
48
+ );
49
+ END_FUNCTION;
50
+
51
+ RULE remark_rule FOR (remark_entity);
52
+ TYPE remark_type = ENUMERATION OF
53
+ (remark_enumeration_item);
54
+ END_TYPE;
55
+ CONSTANT
56
+ remark_constant : STRING := 'xxx';
57
+ END_CONSTANT;
58
+ LOCAL
59
+ remark_variable : STRING;
60
+ END_LOCAL;
61
+ ALIAS remark_alias FOR remark_variable;
62
+ ;
63
+ --"remark_alias" rule alias scope - rule alias
64
+ END_ALIAS;
65
+ REPEAT remark_repeat := 1 TO 9;
66
+ ;
67
+ --"remark_repeat" rule repeat scope - rule repeat
68
+ END_REPEAT;
69
+ remark_variable := QUERY(remark_query <* remark_variable | TRUE
70
+ --"remark_query" rule query scope - rule query
71
+ );
72
+ WHERE
73
+ WR1: TRUE;
74
+ END_RULE;
75
+
76
+ PROCEDURE remark_procedure(remark_parameter : STRING);
77
+ TYPE remark_type = ENUMERATION OF
78
+ (remark_enumeration_item);
79
+ END_TYPE;
80
+ CONSTANT
81
+ remark_constant : STRING := 'xxx';
82
+ END_CONSTANT;
83
+ LOCAL
84
+ remark_variable : STRING;
85
+ END_LOCAL;
86
+ ALIAS remark_alias FOR remark_variable;
87
+ ;
88
+ --"remark_alias" procedure alias scope - procedure alias
89
+ END_ALIAS;
90
+ REPEAT remark_repeat := 1 TO 9;
91
+ ;
92
+ --"remark_repeat" procedure repeat scope - procedure repeat
93
+ END_REPEAT;
94
+ remark_variable := QUERY(remark_query <* remark_variable | TRUE
95
+ --"remark_query" procedure query scope - procedure query
96
+ );
97
+ END_PROCEDURE;
98
+
99
+ END_SCHEMA;
100
+ (*"remark_schema"
101
+ Any character within the EXPRESS character set may occur between the start and end of
102
+ an embedded remark including the newline character; therefore, embedded remarks can span
103
+ several physical lines.
104
+ *)
105
+ --"remark_schema" The tail remark is written at the end of a physical line.
106
+ --"remark_schema" UTF8 test: Příliš žluťoučký kůň úpěl ďábelské ódy.
107
+ --"remark_schema" universal scope - schema before
108
+ --"remark_schema" universal scope - schema
109
+ --"remark_schema.remark_constant" schema scope - constant
110
+ --"remark_schema.remark_constant" universal scope - constant
111
+ --"remark_schema.remark_type" schema scope - type
112
+ --"remark_schema.remark_type" universal scope - type
113
+ --"remark_schema.remark_type.remark_enumeration_item" schema scope - enumeration item
114
+ --"remark_schema.remark_type.remark_enumeration_item" schema scope - enumeration item, on the same level as the type
115
+ --"remark_schema.remark_type.remark_enumeration_item" universal scope - enumeration item
116
+ --"remark_schema.remark_type.remark_enumeration_item" universal scope - enumeration item, on the same level as the type
117
+ --"remark_schema.remark_type.WR1" type scope - type where
118
+ --"remark_schema.remark_type.WR1" type scope - type where, with prefix
119
+ --"remark_schema.remark_type.WR1" schema scope - type where
120
+ --"remark_schema.remark_type.WR1" schema scope - type where, with prefix
121
+ --"remark_schema.remark_type.WR1" universal scope - type where
122
+ --"remark_schema.remark_type.WR1" universal scope - type where, with prefix
123
+ --"remark_schema.remark_type.IP1" type scope - type informal proposition
124
+ --"remark_schema.remark_type.IP1" type scope - type informal proposition, with prefix
125
+ --"remark_schema.remark_type.IP1" schema scope - type informal proposition
126
+ --"remark_schema.remark_type.IP1" schema scope - type informal proposition, with prefix
127
+ --"remark_schema.remark_type.IP1" universal scope - type informal proposition
128
+ --"remark_schema.remark_type.IP1" universal scope - type informal proposition, with prefix
129
+ --"remark_schema.remark_entity" schema scope - entity
130
+ --"remark_schema.remark_entity" universal scope - entity
131
+ --"remark_schema.remark_entity.remark_attribute" entity scope - entity attribute
132
+ --"remark_schema.remark_entity.remark_attribute" schema scope - entity attribute
133
+ --"remark_schema.remark_entity.remark_attribute" universal scope - entity attribute
134
+ --"remark_schema.remark_entity.remark_derived_attribute" entity scope - entity derived attribute
135
+ --"remark_schema.remark_entity.remark_derived_attribute" schema scope - entity derived attribute
136
+ --"remark_schema.remark_entity.remark_derived_attribute" universal scope - entity derived attribute
137
+ --"remark_schema.remark_entity.remark_inverse_attribute" entity scope - entity inverse attribute
138
+ --"remark_schema.remark_entity.remark_inverse_attribute" schema scope - entity inverse attribute
139
+ --"remark_schema.remark_entity.remark_inverse_attribute" universal scope - entity inverse attribute
140
+ --"remark_schema.remark_entity.UR1" entity scope - entity unique
141
+ --"remark_schema.remark_entity.UR1" schema scope - entity unique
142
+ --"remark_schema.remark_entity.UR1" universal scope - entity unique
143
+ --"remark_schema.remark_entity.WR1" entity scope - entity where
144
+ --"remark_schema.remark_entity.WR1" entity scope - entity where, with prefix
145
+ --"remark_schema.remark_entity.WR1" schema scope - entity where
146
+ --"remark_schema.remark_entity.WR1" schema scope - entity where, with prefix
147
+ --"remark_schema.remark_entity.WR1" universal scope - entity where
148
+ --"remark_schema.remark_entity.WR1" universal scope - entity where, with prefix
149
+ --"remark_schema.remark_entity.WR1.unusual_placement" placed inside WHERE clauses (or other enumerable context)
150
+ --"remark_schema.remark_entity.IP1" entity scope - entity informal proposition
151
+ --"remark_schema.remark_entity.IP1" entity scope - entity informal proposition, with prefix
152
+ --"remark_schema.remark_entity.IP1" schema scope - entity informal proposition
153
+ --"remark_schema.remark_entity.IP1" schema scope - entity informal proposition, with prefix
154
+ --"remark_schema.remark_entity.IP1" universal scope - entity informal proposition
155
+ --"remark_schema.remark_entity.IP1" universal scope - entity informal proposition, with prefix
156
+ --"remark_schema.remark_subtype_constraint" schema scope - subtype constraint
157
+ --"remark_schema.remark_subtype_constraint" universal scope - subtype constraint
158
+ --"remark_schema.remark_function" schema scope - function
159
+ --"remark_schema.remark_function" universal scope - function
160
+ --"remark_schema.remark_function.remark_parameter" function scope - function parameter
161
+ --"remark_schema.remark_function.remark_parameter" schema scope - function parameter
162
+ --"remark_schema.remark_function.remark_parameter" universal scope - function parameter
163
+ --"remark_schema.remark_function.remark_type" function scope - function type
164
+ --"remark_schema.remark_function.remark_type" schema scope - function type
165
+ --"remark_schema.remark_function.remark_type" universal scope - function type
166
+ --"remark_schema.remark_function.remark_type.remark_enumeration_item" function scope - function enumeration item
167
+ --"remark_schema.remark_function.remark_type.remark_enumeration_item" function scope - function enumeration item, on the same level as the type
168
+ --"remark_schema.remark_function.remark_type.remark_enumeration_item" schema scope - function enumeration item
169
+ --"remark_schema.remark_function.remark_type.remark_enumeration_item" schema scope - function enumeration item, on the same level as the type
170
+ --"remark_schema.remark_function.remark_type.remark_enumeration_item" universal scope - function enumeration item
171
+ --"remark_schema.remark_function.remark_type.remark_enumeration_item" universal scope - function enumeration item, on the same level as the type
172
+ --"remark_schema.remark_function.remark_constant" function scope - function constant
173
+ --"remark_schema.remark_function.remark_constant" schema scope - function constant
174
+ --"remark_schema.remark_function.remark_constant" universal scope - function constant
175
+ --"remark_schema.remark_function.remark_variable" function scope - function variable
176
+ --"remark_schema.remark_function.remark_variable" schema scope - function variable
177
+ --"remark_schema.remark_function.remark_variable" universal scope - function variable
178
+ --"remark_schema.remark_rule" schema scope - rule
179
+ --"remark_schema.remark_rule" universal scope - rule
180
+ --"remark_schema.remark_rule.remark_type" rule scope - rule type
181
+ --"remark_schema.remark_rule.remark_type" schema scope - rule type
182
+ --"remark_schema.remark_rule.remark_type" universal scope - rule type
183
+ --"remark_schema.remark_rule.remark_type.remark_enumeration_item" rule scope - rule enumeration item
184
+ --"remark_schema.remark_rule.remark_type.remark_enumeration_item" rule scope - rule enumeration item, on the same level as the type
185
+ --"remark_schema.remark_rule.remark_type.remark_enumeration_item" schema scope - rule enumeration item
186
+ --"remark_schema.remark_rule.remark_type.remark_enumeration_item" schema scope - rule enumeration item, on the same level as the type
187
+ --"remark_schema.remark_rule.remark_type.remark_enumeration_item" universal scope - rule enumeration item
188
+ --"remark_schema.remark_rule.remark_type.remark_enumeration_item" universal scope - rule enumeration item, on the same level as the type
189
+ --"remark_schema.remark_rule.remark_constant" rule scope - rule constant
190
+ --"remark_schema.remark_rule.remark_constant" schema scope - rule constant
191
+ --"remark_schema.remark_rule.remark_constant" universal scope - rule constant
192
+ --"remark_schema.remark_rule.remark_variable" rule scope - rule variable
193
+ --"remark_schema.remark_rule.remark_variable" schema scope - rule variable
194
+ --"remark_schema.remark_rule.remark_variable" universal scope - rule variable
195
+ --"remark_schema.remark_rule.WR1" rule scope - rule where
196
+ --"remark_schema.remark_rule.WR1" rule scope - rule where, with prefix
197
+ --"remark_schema.remark_rule.WR1" schema scope - rule where
198
+ --"remark_schema.remark_rule.WR1" schema scope - rule where, with prefix
199
+ --"remark_schema.remark_rule.WR1" universal scope - rule where
200
+ --"remark_schema.remark_rule.WR1" universal scope - rule where, with prefix
201
+ --"remark_schema.remark_rule.IP1" rule scope - rule informal proposition
202
+ --"remark_schema.remark_rule.IP1" rule scope - rule informal proposition, with prefix
203
+ --"remark_schema.remark_rule.IP1" schema scope - rule informal proposition
204
+ --"remark_schema.remark_rule.IP1" schema scope - rule informal proposition, with prefix
205
+ --"remark_schema.remark_rule.IP1" universal scope - rule informal proposition
206
+ --"remark_schema.remark_rule.IP1" universal scope - rule informal proposition, with prefix
207
+ --"remark_schema.remark_procedure" schema scope - procedure
208
+ --"remark_schema.remark_procedure" universal scope - procedure
209
+ --"remark_schema.remark_procedure.remark_parameter" procedure scope - procedure parameter
210
+ --"remark_schema.remark_procedure.remark_parameter" schema scope - procedure parameter
211
+ --"remark_schema.remark_procedure.remark_parameter" universal scope - procedure parameter
212
+ --"remark_schema.remark_procedure.remark_type" procedure scope - procedure type
213
+ --"remark_schema.remark_procedure.remark_type" schema scope - procedure type
214
+ --"remark_schema.remark_procedure.remark_type" universal scope - procedure type
215
+ --"remark_schema.remark_procedure.remark_type.remark_enumeration_item" procedure scope - procedure enumeration item
216
+ --"remark_schema.remark_procedure.remark_type.remark_enumeration_item" procedure scope - procedure enumeration item, on the same level as the type
217
+ --"remark_schema.remark_procedure.remark_type.remark_enumeration_item" schema scope - procedure enumeration item
218
+ --"remark_schema.remark_procedure.remark_type.remark_enumeration_item" schema scope - procedure enumeration item, on the same level as the type
219
+ --"remark_schema.remark_procedure.remark_type.remark_enumeration_item" universal scope - procedure enumeration item
220
+ --"remark_schema.remark_procedure.remark_type.remark_enumeration_item" universal scope - procedure enumeration item, on the same level as the type
221
+ --"remark_schema.remark_procedure.remark_constant" procedure scope - procedure constant
222
+ --"remark_schema.remark_procedure.remark_constant" schema scope - procedure constant
223
+ --"remark_schema.remark_procedure.remark_constant" universal scope - procedure constant
224
+ --"remark_schema.remark_procedure.remark_variable" procedure scope - procedure variable
225
+ --"remark_schema.remark_procedure.remark_variable" schema scope - procedure variable
226
+ --"remark_schema.remark_procedure.remark_variable" universal scope - procedure variable
227
+ --"remark_schema.remark_item" schema scope - schema remark item
228
+ --"remark_schema.remark_item" universal scope - schema remark item
@@ -0,0 +1,4 @@
1
+ SCHEMA single_schema 'version';
2
+ ENTITY empty_entity; END_ENTITY;
3
+ ENTITY subtype_empty_entity SUBTYPE OF (empty_entity); END_ENTITY;
4
+ END_SCHEMA;
@@ -0,0 +1,18 @@
1
+ ---
2
+ _class: Expressir::Model::Repository
3
+ schemas:
4
+ - _class: Expressir::Model::Declarations::Schema
5
+ file: spec/syntax/single.exp
6
+ id: single_schema
7
+ version:
8
+ _class: Expressir::Model::Declarations::SchemaVersion
9
+ value: version
10
+ entities:
11
+ - _class: Expressir::Model::Declarations::Entity
12
+ id: empty_entity
13
+ - _class: Expressir::Model::Declarations::Entity
14
+ id: subtype_empty_entity
15
+ subtype_of:
16
+ - _class: Expressir::Model::References::SimpleReference
17
+ id: empty_entity
18
+ base_path: single_schema.empty_entity
@@ -0,0 +1,10 @@
1
+ SCHEMA single_schema 'version';
2
+
3
+ ENTITY empty_entity;
4
+ END_ENTITY;
5
+
6
+ ENTITY subtype_empty_entity
7
+ SUBTYPE OF (empty_entity);
8
+ END_ENTITY;
9
+
10
+ END_SCHEMA;
@@ -0,0 +1,36 @@
1
+ ---
2
+ _class: Expressir::Model::Repository
3
+ schemas:
4
+ - _class: Expressir::Model::Declarations::Schema
5
+ file: spec/syntax/single.exp
6
+ id: single_schema
7
+ version:
8
+ _class: Expressir::Model::Declarations::SchemaVersion
9
+ value: version
10
+ entities:
11
+ - _class: Expressir::Model::Declarations::Entity
12
+ id: empty_entity
13
+ source: |-
14
+ ENTITY empty_entity;
15
+ END_ENTITY;
16
+ - _class: Expressir::Model::Declarations::Entity
17
+ id: subtype_empty_entity
18
+ subtype_of:
19
+ - _class: Expressir::Model::References::SimpleReference
20
+ id: empty_entity
21
+ base_path: single_schema.empty_entity
22
+ source: |-
23
+ ENTITY subtype_empty_entity
24
+ SUBTYPE OF (empty_entity);
25
+ END_ENTITY;
26
+ source: |-
27
+ SCHEMA single_schema 'version';
28
+
29
+ ENTITY empty_entity;
30
+ END_ENTITY;
31
+
32
+ ENTITY subtype_empty_entity
33
+ SUBTYPE OF (empty_entity);
34
+ END_ENTITY;
35
+
36
+ END_SCHEMA;
@@ -0,0 +1,333 @@
1
+ -- schema
2
+ SCHEMA syntax_schema '{ISO standard 10303 part(41) object(1) version(8)}';
3
+
4
+ -- interfaces
5
+ USE FROM contract_schema;
6
+ USE FROM contract_schema (contract);
7
+ USE FROM contract_schema (contract, contract2);
8
+ USE FROM contract_schema (contract AS contract2);
9
+ REFERENCE FROM contract_schema;
10
+ REFERENCE FROM contract_schema (contract);
11
+ REFERENCE FROM contract_schema (contract, contract2);
12
+ REFERENCE FROM contract_schema (contract AS contract2);
13
+
14
+ -- constants
15
+ CONSTANT empty_constant : BOOLEAN := TRUE; END_CONSTANT;
16
+
17
+ -- types
18
+ TYPE empty_type = BOOLEAN; END_TYPE;
19
+ TYPE where_type = BOOLEAN; WHERE TRUE; END_TYPE;
20
+ TYPE where_label_type = BOOLEAN; WHERE WR1: TRUE; END_TYPE;
21
+
22
+ -- entities
23
+ ENTITY empty_entity; END_ENTITY;
24
+ ENTITY abstract_entity ABSTRACT; END_ENTITY;
25
+ ENTITY abstract_supertype_entity ABSTRACT SUPERTYPE; END_ENTITY;
26
+ ENTITY abstract_supertype_constraint_entity ABSTRACT SUPERTYPE OF (empty_entity); END_ENTITY;
27
+ ENTITY supertype_constraint_entity SUPERTYPE OF (empty_entity); END_ENTITY;
28
+ ENTITY subtype_entity SUBTYPE OF (empty_entity); END_ENTITY;
29
+ ENTITY supertype_constraint_subtype_entity SUPERTYPE OF (empty_entity) SUBTYPE OF (empty_entity); END_ENTITY;
30
+ ENTITY attribute_entity; test : BOOLEAN; END_ENTITY;
31
+ ENTITY attribute_optional_entity; test : OPTIONAL BOOLEAN; END_ENTITY;
32
+ ENTITY attribute_multiple_entity; test : BOOLEAN; test2 : BOOLEAN; END_ENTITY;
33
+ ENTITY attribute_multiple_shorthand_entity; test, test2 : BOOLEAN; END_ENTITY;
34
+ ENTITY attribute_redeclared_entity SUBTYPE OF (attribute_entity); SELF\attribute_entity.test : BOOLEAN; END_ENTITY;
35
+ ENTITY attribute_redeclared_renamed_entity SUBTYPE OF (attribute_entity); SELF\attribute_entity.test RENAMED test2 : BOOLEAN; END_ENTITY;
36
+ ENTITY derived_attribute_entity; DERIVE test : BOOLEAN := TRUE; END_ENTITY;
37
+ ENTITY derived_attribute_redeclared_entity SUBTYPE OF (attribute_entity); DERIVE SELF\attribute_entity.test : BOOLEAN := TRUE; END_ENTITY;
38
+ ENTITY derived_attribute_redeclared_renamed_entity SUBTYPE OF (attribute_entity); DERIVE SELF\attribute_entity.test RENAMED test2 : BOOLEAN := TRUE; END_ENTITY;
39
+ ENTITY inverse_attribute_entity; INVERSE test : attribute_entity FOR test; END_ENTITY;
40
+ ENTITY inverse_attribute_entity_entity; INVERSE test : attribute_entity FOR attribute_entity.test; END_ENTITY;
41
+ ENTITY inverse_attribute_set_entity; INVERSE test : SET OF attribute_entity FOR test; END_ENTITY;
42
+ ENTITY inverse_attribute_set_bound_entity; INVERSE test : SET [1:9] OF attribute_entity FOR test; END_ENTITY;
43
+ ENTITY inverse_attribute_bag_entity; INVERSE test : BAG OF attribute_entity FOR test; END_ENTITY;
44
+ ENTITY inverse_attribute_bag_bound_entity; INVERSE test : BAG [1:9] OF attribute_entity FOR test; END_ENTITY;
45
+ ENTITY inverse_attribute_redeclared_entity SUBTYPE OF (attribute_entity); INVERSE SELF\attribute_entity.test : attribute_entity FOR test; END_ENTITY;
46
+ ENTITY inverse_attribute_redeclared_renamed_entity SUBTYPE OF (attribute_entity); INVERSE SELF\attribute_entity.test RENAMED test2 : attribute_entity FOR test; END_ENTITY;
47
+ ENTITY unique_entity; test : BOOLEAN; UNIQUE test; END_ENTITY;
48
+ ENTITY unique_label_entity; test : BOOLEAN; UNIQUE UR1: test; END_ENTITY;
49
+ ENTITY unique_redeclared_entity SUBTYPE OF (attribute_entity); UNIQUE SELF\attribute_entity.test; END_ENTITY;
50
+ ENTITY unique_label_redeclared_entity SUBTYPE OF (attribute_entity); UNIQUE UR1: SELF\attribute_entity.test; END_ENTITY;
51
+ ENTITY where_entity; WHERE TRUE; END_ENTITY;
52
+ ENTITY where_label_entity; WHERE WR1: TRUE; END_ENTITY;
53
+
54
+ -- subtype constraints
55
+ SUBTYPE_CONSTRAINT empty_subtype_constraint FOR empty_entity; END_SUBTYPE_CONSTRAINT;
56
+ SUBTYPE_CONSTRAINT abstract_supertype_subtype_constraint FOR empty_entity; ABSTRACT SUPERTYPE; END_SUBTYPE_CONSTRAINT;
57
+ SUBTYPE_CONSTRAINT total_over_subtype_constraint FOR empty_entity; TOTAL_OVER(a); END_SUBTYPE_CONSTRAINT;
58
+ SUBTYPE_CONSTRAINT supertype_expression_subtype_constraint FOR empty_entity; a; END_SUBTYPE_CONSTRAINT;
59
+ SUBTYPE_CONSTRAINT supertype_expression_andor_subtype_constraint FOR empty_entity; a ANDOR b; END_SUBTYPE_CONSTRAINT;
60
+ SUBTYPE_CONSTRAINT supertype_expression_and_subtype_constraint FOR empty_entity; a AND b; END_SUBTYPE_CONSTRAINT;
61
+ SUBTYPE_CONSTRAINT supertype_expression_andor_and_subtype_constraint FOR empty_entity; a ANDOR b AND c; END_SUBTYPE_CONSTRAINT;
62
+ SUBTYPE_CONSTRAINT supertype_expression_and_andor_subtype_constraint FOR empty_entity; a AND b ANDOR c; END_SUBTYPE_CONSTRAINT;
63
+ SUBTYPE_CONSTRAINT supertype_expression_parenthesis_andor_and_subtype_constraint FOR empty_entity; (a ANDOR b) AND c; END_SUBTYPE_CONSTRAINT;
64
+ SUBTYPE_CONSTRAINT supertype_expression_and_parenthesis_andor_subtype_constraint FOR empty_entity; a AND (b ANDOR c); END_SUBTYPE_CONSTRAINT;
65
+ SUBTYPE_CONSTRAINT supertype_expression_oneof_subtype_constraint FOR empty_entity; ONEOF(a, b); END_SUBTYPE_CONSTRAINT;
66
+ SUBTYPE_CONSTRAINT supertype_expression_and_oneof_subtype_constraint FOR empty_entity; a AND ONEOF(b, c); END_SUBTYPE_CONSTRAINT;
67
+ SUBTYPE_CONSTRAINT supertype_expression_andor_oneof_subtype_constraint FOR empty_entity; a ANDOR ONEOF(b, c); END_SUBTYPE_CONSTRAINT;
68
+ SUBTYPE_CONSTRAINT supertype_expression_oneof_and_subtype_constraint FOR empty_entity; ONEOF(a, b) AND c; END_SUBTYPE_CONSTRAINT;
69
+ SUBTYPE_CONSTRAINT supertype_expression_oneof_andor_subtype_constraint FOR empty_entity; ONEOF(a, b) ANDOR c; END_SUBTYPE_CONSTRAINT;
70
+ SUBTYPE_CONSTRAINT supertype_expression_oneof_and_oneof_subtype_constraint FOR empty_entity; ONEOF(a, b) AND ONEOF(c, d); END_SUBTYPE_CONSTRAINT;
71
+ SUBTYPE_CONSTRAINT supertype_expression_oneof_andor_oneof_subtype_constraint FOR empty_entity; ONEOF(a, b) ANDOR ONEOF(c, d); END_SUBTYPE_CONSTRAINT;
72
+
73
+ -- functions
74
+ FUNCTION empty_function : BOOLEAN; ; END_FUNCTION;
75
+ FUNCTION parameter_function(test : BOOLEAN) : BOOLEAN; ; END_FUNCTION;
76
+ FUNCTION multiple_parameter_function(test : BOOLEAN; test2 : BOOLEAN) : BOOLEAN; ; END_FUNCTION;
77
+ FUNCTION multiple_shorthand_parameter_function(test, test2 : BOOLEAN) : BOOLEAN; ; END_FUNCTION;
78
+ FUNCTION type_function : BOOLEAN; TYPE test = BOOLEAN; END_TYPE; ; END_FUNCTION;
79
+ FUNCTION constant_function : BOOLEAN; CONSTANT test : BOOLEAN := TRUE; END_CONSTANT; ; END_FUNCTION;
80
+ FUNCTION multiple_constant_function : BOOLEAN; CONSTANT test : BOOLEAN := TRUE; test2 : BOOLEAN := TRUE; END_CONSTANT; ; END_FUNCTION;
81
+ FUNCTION variable_function : BOOLEAN; LOCAL test : BOOLEAN; END_LOCAL; ; END_FUNCTION;
82
+ FUNCTION multiple_variable_function : BOOLEAN; LOCAL test : BOOLEAN; test2 : BOOLEAN; END_LOCAL; ; END_FUNCTION;
83
+ FUNCTION multiple_shorthand_variable_function : BOOLEAN; LOCAL test, test2 : BOOLEAN; END_LOCAL; ; END_FUNCTION;
84
+ FUNCTION variable_expression_function : BOOLEAN; LOCAL test : BOOLEAN := TRUE; END_LOCAL; ; END_FUNCTION;
85
+ FUNCTION multiple_variable_expression_function : BOOLEAN; LOCAL test : BOOLEAN := TRUE; test2 : BOOLEAN := TRUE; END_LOCAL; ; END_FUNCTION;
86
+ FUNCTION multiple_shorthand_variable_expression_function : BOOLEAN; LOCAL test, test2 : BOOLEAN := TRUE; END_LOCAL; ; END_FUNCTION;
87
+
88
+ -- rules
89
+ RULE empty_rule FOR (empty_entity); WHERE TRUE; END_RULE;
90
+ RULE type_rule FOR (empty_entity); TYPE test = BOOLEAN; END_TYPE; WHERE TRUE; END_RULE;
91
+ RULE constant_rule FOR (empty_entity); CONSTANT test : BOOLEAN := TRUE; END_CONSTANT; WHERE TRUE; END_RULE;
92
+ RULE multiple_constant_rule FOR (empty_entity); CONSTANT test : BOOLEAN := TRUE; test2 : BOOLEAN := TRUE; END_CONSTANT; WHERE TRUE; END_RULE;
93
+ RULE variable_rule FOR (empty_entity); LOCAL test : BOOLEAN; END_LOCAL; WHERE TRUE; END_RULE;
94
+ RULE multiple_variable_rule FOR (empty_entity); LOCAL test : BOOLEAN; test2 : BOOLEAN; END_LOCAL; WHERE TRUE; END_RULE;
95
+ RULE multiple_shorthand_variable_rule FOR (empty_entity); LOCAL test, test2 : BOOLEAN; END_LOCAL; WHERE TRUE; END_RULE;
96
+ RULE variable_expression_rule FOR (empty_entity); LOCAL test : BOOLEAN := TRUE; END_LOCAL; WHERE TRUE; END_RULE;
97
+ RULE multiple_variable_expression_rule FOR (empty_entity); LOCAL test : BOOLEAN := TRUE; test2 : BOOLEAN := TRUE; END_LOCAL; WHERE TRUE; END_RULE;
98
+ RULE multiple_shorthand_variable_expression_rule FOR (empty_entity); LOCAL test, test2 : BOOLEAN := TRUE; END_LOCAL; WHERE TRUE; END_RULE;
99
+ RULE statement_rule FOR (empty_entity); ; WHERE TRUE; END_RULE;
100
+ RULE where_label_rule FOR (empty_entity); WHERE WR1: TRUE; END_RULE;
101
+
102
+ -- procedures
103
+ PROCEDURE empty_procedure; END_PROCEDURE;
104
+ PROCEDURE parameter_procedure(test : BOOLEAN); END_PROCEDURE;
105
+ PROCEDURE multiple_parameter_procedure(test : BOOLEAN; test2 : BOOLEAN); END_PROCEDURE;
106
+ PROCEDURE multiple_shorthand_parameter_procedure(test, test2 : BOOLEAN); END_PROCEDURE;
107
+ PROCEDURE variable_parameter_procedure(VAR test : BOOLEAN); END_PROCEDURE;
108
+ PROCEDURE multiple_variable_parameter_procedure(VAR test : BOOLEAN; test2 : BOOLEAN); END_PROCEDURE;
109
+ PROCEDURE multiple_variable_parameter2_procedure(test : BOOLEAN; VAR test2 : BOOLEAN); END_PROCEDURE;
110
+ PROCEDURE multiple_shorthand_variable_parameter_procedure(VAR test, test2 : BOOLEAN); END_PROCEDURE;
111
+ PROCEDURE type_procedure; TYPE test = BOOLEAN; END_TYPE; END_PROCEDURE;
112
+ PROCEDURE constant_procedure; CONSTANT test : BOOLEAN := TRUE; END_CONSTANT; END_PROCEDURE;
113
+ PROCEDURE multiple_constant_procedure; CONSTANT test : BOOLEAN := TRUE; test2 : BOOLEAN := TRUE; END_CONSTANT; END_PROCEDURE;
114
+ PROCEDURE variable_procedure; LOCAL test : BOOLEAN; END_LOCAL; END_PROCEDURE;
115
+ PROCEDURE multiple_variable_procedure; LOCAL test : BOOLEAN; test2 : BOOLEAN; END_LOCAL; END_PROCEDURE;
116
+ PROCEDURE multiple_shorthand_variable_procedure; LOCAL test, test2 : BOOLEAN; END_LOCAL; END_PROCEDURE;
117
+ PROCEDURE variable_expression_procedure; LOCAL test : BOOLEAN := TRUE; END_LOCAL; END_PROCEDURE;
118
+ PROCEDURE multiple_variable_expression_procedure; LOCAL test : BOOLEAN := TRUE; test2 : BOOLEAN := TRUE; END_LOCAL; END_PROCEDURE;
119
+ PROCEDURE multiple_shorthand_variable_expression_procedure; LOCAL test, test2 : BOOLEAN := TRUE; END_LOCAL; END_PROCEDURE;
120
+ PROCEDURE statement_procedure; ; END_PROCEDURE;
121
+
122
+ PROCEDURE statements;
123
+ -- statements
124
+ PROCEDURE alias_simple_reference_statement; ALIAS test FOR test; ; END_ALIAS; END_PROCEDURE;
125
+ PROCEDURE alias_group_reference_statement; ALIAS test FOR test\test2; ; END_ALIAS; END_PROCEDURE;
126
+ PROCEDURE alias_index_reference_statement; ALIAS test FOR test[1]; ; END_ALIAS; END_PROCEDURE;
127
+ PROCEDURE alias_index2_reference_statement; ALIAS test FOR test[1:9]; ; END_ALIAS; END_PROCEDURE;
128
+ PROCEDURE alias_attribute_reference_statement; ALIAS test FOR test.test2; ; END_ALIAS; END_PROCEDURE;
129
+ PROCEDURE assignment_simple_reference_statement; test := TRUE; END_PROCEDURE;
130
+ PROCEDURE assignment_group_reference_statement; test\test2 := TRUE; END_PROCEDURE;
131
+ PROCEDURE assignment_index_reference_statement; test[1] := TRUE; END_PROCEDURE;
132
+ PROCEDURE assignment_index2_reference_statement; test[1:9] := TRUE; END_PROCEDURE;
133
+ PROCEDURE assignment_attribute_reference_statement; test.test2 := TRUE; END_PROCEDURE;
134
+ PROCEDURE case_statement; CASE test OF TRUE : ; END_CASE; END_PROCEDURE;
135
+ PROCEDURE case_multiple_statement; CASE test OF TRUE : ; TRUE : ; END_CASE; END_PROCEDURE;
136
+ PROCEDURE case_multiple_shorthand_statement; CASE test OF TRUE, TRUE : ; END_CASE; END_PROCEDURE;
137
+ PROCEDURE case_otherwise_statement; CASE test OF TRUE : ; OTHERWISE : ; END_CASE; END_PROCEDURE;
138
+ PROCEDURE compound_statement; BEGIN ; END; END_PROCEDURE;
139
+ PROCEDURE escape_statement; ESCAPE; END_PROCEDURE;
140
+ PROCEDURE if_statement; IF TRUE THEN ; END_IF; END_PROCEDURE;
141
+ PROCEDURE if2_statement; IF TRUE THEN ; ; END_IF; END_PROCEDURE;
142
+ PROCEDURE if_else_statement; IF TRUE THEN ; ELSE ; END_IF; END_PROCEDURE;
143
+ PROCEDURE if2_else_statement; IF TRUE THEN ; ; ELSE ; END_IF; END_PROCEDURE;
144
+ PROCEDURE if_else2_statement; IF TRUE THEN ; ELSE ; ; END_IF; END_PROCEDURE;
145
+ PROCEDURE if2_else2_statement; IF TRUE THEN ; ; ELSE ; ; END_IF; END_PROCEDURE;
146
+ PROCEDURE null_statement; ; END_PROCEDURE;
147
+ PROCEDURE call_statement; empty_procedure; END_PROCEDURE;
148
+ PROCEDURE call_parameter_statement; empty_procedure(TRUE); END_PROCEDURE;
149
+ PROCEDURE call_parameter2_statement; empty_procedure(TRUE, TRUE); END_PROCEDURE;
150
+ PROCEDURE call_insert_statement; INSERT(TRUE); END_PROCEDURE;
151
+ PROCEDURE call_remove_statement; REMOVE(TRUE); END_PROCEDURE;
152
+ PROCEDURE repeat_statement; REPEAT; ; END_REPEAT; END_PROCEDURE;
153
+ PROCEDURE repeat_variable_statement; REPEAT test := 1 TO 9; ; END_REPEAT; END_PROCEDURE;
154
+ PROCEDURE repeat_variable_increment_statement; REPEAT test := 1 TO 9 BY 2; ; END_REPEAT; END_PROCEDURE;
155
+ PROCEDURE repeat_while_statement; REPEAT WHILE TRUE; ; END_REPEAT; END_PROCEDURE;
156
+ PROCEDURE repeat_until_statement; REPEAT UNTIL TRUE; ; END_REPEAT; END_PROCEDURE;
157
+ PROCEDURE return_statement; RETURN; END_PROCEDURE;
158
+ PROCEDURE return_expression_statement; RETURN (TRUE); END_PROCEDURE;
159
+ PROCEDURE skip_statement; SKIP; END_PROCEDURE;
160
+ END_PROCEDURE;
161
+
162
+ PROCEDURE types;
163
+ -- simple types
164
+ TYPE binary_type = BINARY; END_TYPE;
165
+ TYPE binary_width_type = BINARY (3); END_TYPE;
166
+ TYPE binary_width_fixed_type = BINARY (3) FIXED; END_TYPE;
167
+ TYPE boolean_type = BOOLEAN; END_TYPE;
168
+ TYPE integer_type = INTEGER; END_TYPE;
169
+ TYPE logical_type = LOGICAL; END_TYPE;
170
+ TYPE number_type = NUMBER; END_TYPE;
171
+ TYPE real_type = REAL; END_TYPE;
172
+ TYPE real_precision_type = REAL (3); END_TYPE;
173
+ TYPE string_type = STRING; END_TYPE;
174
+ TYPE string_width_type = STRING (3); END_TYPE;
175
+ TYPE string_width_fixed_type = STRING (3) FIXED; END_TYPE;
176
+
177
+ -- aggregation types
178
+ TYPE array_type = ARRAY [1:9] OF STRING; END_TYPE;
179
+ TYPE array_optional_type = ARRAY [1:9] OF OPTIONAL STRING; END_TYPE;
180
+ TYPE array_unique_type = ARRAY [1:9] OF UNIQUE STRING; END_TYPE;
181
+ TYPE array_optional_unique_type = ARRAY [1:9] OF OPTIONAL UNIQUE STRING; END_TYPE;
182
+ TYPE bag_type = BAG OF STRING; END_TYPE;
183
+ TYPE bag_bound_type = BAG [1:9] OF STRING; END_TYPE;
184
+ TYPE list_type = LIST OF STRING; END_TYPE;
185
+ TYPE list_bound_type = LIST [1:9] OF STRING; END_TYPE;
186
+ TYPE list_unique_type = LIST OF UNIQUE STRING; END_TYPE;
187
+ TYPE list_bound_unique_type = LIST [1:9] OF UNIQUE STRING; END_TYPE;
188
+ TYPE set_type = SET OF STRING; END_TYPE;
189
+ TYPE set_bound_type = SET [1:9] OF STRING; END_TYPE;
190
+
191
+ -- constructed types
192
+ TYPE select_type = SELECT; END_TYPE;
193
+ TYPE select_extensible_type = EXTENSIBLE SELECT; END_TYPE;
194
+ TYPE select_extensible_generic_entity_type = EXTENSIBLE GENERIC_ENTITY SELECT; END_TYPE;
195
+ TYPE select_item_type = SELECT (empty_type); END_TYPE;
196
+ TYPE select_multiple_item_type = SELECT (empty_type, empty_type); END_TYPE;
197
+ TYPE select_based_on_type = SELECT BASED_ON select_type; END_TYPE;
198
+ TYPE select_based_on_item_type = SELECT BASED_ON select_type WITH (empty_type); END_TYPE;
199
+ TYPE select_based_on_multiple_item_type = SELECT BASED_ON select_type WITH (empty_type, empty_type); END_TYPE;
200
+ TYPE enumeration_type = ENUMERATION; END_TYPE;
201
+ TYPE enumeration_extensible_type = EXTENSIBLE ENUMERATION; END_TYPE;
202
+ TYPE enumeration_item_type = ENUMERATION OF (test); END_TYPE;
203
+ TYPE enumeration_multiple_item_type = ENUMERATION OF (test, test2); END_TYPE;
204
+ TYPE enumeration_based_on_type = ENUMERATION BASED_ON enumeration_type; END_TYPE;
205
+ TYPE enumeration_based_on_item_type = ENUMERATION BASED_ON enumeration_type WITH (test); END_TYPE;
206
+ TYPE enumeration_based_on_multiple_item_type = ENUMERATION BASED_ON enumeration_type WITH (test, test2); END_TYPE;
207
+
208
+ -- generic types
209
+ FUNCTION generic_type : GENERIC; ; END_FUNCTION;
210
+ FUNCTION generic_label_type : GENERIC:label; ; END_FUNCTION;
211
+ FUNCTION generic_entity_type : GENERIC_ENTITY; ; END_FUNCTION;
212
+ FUNCTION generic_entity_label_type : GENERIC_ENTITY:label; ; END_FUNCTION;
213
+ END_PROCEDURE;
214
+
215
+ PROCEDURE expressions;
216
+ LOCAL
217
+ -- literal expressions
218
+ binary_expression : BOOLEAN := %011110000111100001111000;
219
+ integer_expression : BOOLEAN := 999;
220
+ true_logical_expression : BOOLEAN := TRUE;
221
+ false_logical_expression : BOOLEAN := FALSE;
222
+ unknown_logical_expression : BOOLEAN := UNKNOWN;
223
+ real_expression : BOOLEAN := 999.999;
224
+ simple_string_expression : BOOLEAN := 'xxx';
225
+ utf8_simple_string_expression : BOOLEAN := 'UTF8 test: Příliš žluťoučký kůň úpěl ďábelské ódy.';
226
+ encoded_string_expression : BOOLEAN := "000000780000007800000078";
227
+
228
+ -- constant expressions
229
+ const_e_expression : BOOLEAN := CONST_E;
230
+ indeterminate_expression : BOOLEAN := ?;
231
+ pi_expression : BOOLEAN := PI;
232
+ self_expression : BOOLEAN := SELF;
233
+
234
+ -- function expressions
235
+ abs_expression : BOOLEAN := ABS(TRUE);
236
+ acos_expression : BOOLEAN := ACOS(TRUE);
237
+ asin_expression : BOOLEAN := ASIN(TRUE);
238
+ atan_expression : BOOLEAN := ATAN(TRUE);
239
+ blength_expression : BOOLEAN := BLENGTH(TRUE);
240
+ cos_expression : BOOLEAN := COS(TRUE);
241
+ exists_expression : BOOLEAN := EXISTS(TRUE);
242
+ exp_expression : BOOLEAN := EXP(TRUE);
243
+ format_expression : BOOLEAN := FORMAT(TRUE);
244
+ hibound_expression : BOOLEAN := HIBOUND(TRUE);
245
+ hiindex_expression : BOOLEAN := HIINDEX(TRUE);
246
+ length_expression : BOOLEAN := LENGTH(TRUE);
247
+ lobound_expression : BOOLEAN := LOBOUND(TRUE);
248
+ loindex_expression : BOOLEAN := LOINDEX(TRUE);
249
+ log_expression : BOOLEAN := LOG(TRUE);
250
+ log2_expression : BOOLEAN := LOG2(TRUE);
251
+ log10_expression : BOOLEAN := LOG10(TRUE);
252
+ nvl_expression : BOOLEAN := NVL(TRUE);
253
+ odd_expression : BOOLEAN := ODD(TRUE);
254
+ rolesof_expression : BOOLEAN := ROLESOF(TRUE);
255
+ sin_expression : BOOLEAN := SIN(TRUE);
256
+ sizeof_expression : BOOLEAN := SIZEOF(TRUE);
257
+ sqrt_expression : BOOLEAN := SQRT(TRUE);
258
+ tan_expression : BOOLEAN := TAN(TRUE);
259
+ typeof_expression : BOOLEAN := TYPEOF(TRUE);
260
+ usedin_expression : BOOLEAN := USEDIN(TRUE);
261
+ value_expression : BOOLEAN := VALUE(TRUE);
262
+ value_in_expression : BOOLEAN := VALUE_IN(TRUE);
263
+ value_unique_expression : BOOLEAN := VALUE_UNIQUE(TRUE);
264
+
265
+ -- operator expressions
266
+ plus_expression : BOOLEAN := +4;
267
+ plus_addition_expression : BOOLEAN := +(4 + 2);
268
+ minus_expression : BOOLEAN := -4;
269
+ minus_addition_expression : BOOLEAN := -(4 + 2);
270
+ addition_expression : BOOLEAN := 4 + 2;
271
+ subtraction_expression : BOOLEAN := 4 - 2;
272
+ multiplication_expression : BOOLEAN := 4 * 2;
273
+ real_division_expression : BOOLEAN := 4 / 2;
274
+ integer_division_expression : BOOLEAN := 4 DIV 2;
275
+ modulo_expression : BOOLEAN := 4 MOD 2;
276
+ exponentiation_expression : BOOLEAN := 4 ** 2;
277
+ addition_addition_expression : BOOLEAN := 4 + 2 + 1;
278
+ subtraction_subtraction_expression : BOOLEAN := 4 - 2 - 1;
279
+ addition_subtraction_expression : BOOLEAN := 4 + 2 - 1;
280
+ subtraction_addition_expression : BOOLEAN := 4 - 2 + 1;
281
+ addition_multiplication_expression : BOOLEAN := 8 + 4 * 2;
282
+ multiplication_addition_expression : BOOLEAN := 8 * 4 + 2;
283
+ parenthesis_addition_multiplication_expression : BOOLEAN := (8 + 4) * 2;
284
+ multiplication_parenthesis_addition_expression : BOOLEAN := 8 * (4 + 2);
285
+ equal_expression : BOOLEAN := 4 = 2;
286
+ not_equal_expression : BOOLEAN := 4 <> 2;
287
+ instance_equal_expression : BOOLEAN := 4 :=: 2;
288
+ instance_not_equal_expression : BOOLEAN := 4 :<>: 2;
289
+ lt_expression : BOOLEAN := 4 < 2;
290
+ gt_expression : BOOLEAN := 4 > 2;
291
+ lte_expression : BOOLEAN := 4 <= 2;
292
+ gte_expression : BOOLEAN := 4 >= 2;
293
+ not_expression : BOOLEAN := NOT TRUE;
294
+ not_or_expression : BOOLEAN := NOT (TRUE OR FALSE);
295
+ or_expression : BOOLEAN := TRUE OR FALSE;
296
+ and_expression : BOOLEAN := TRUE AND FALSE;
297
+ or_or_expression : BOOLEAN := TRUE OR FALSE OR TRUE;
298
+ and_and_expression : BOOLEAN := TRUE AND FALSE AND TRUE;
299
+ or_and_expression : BOOLEAN := TRUE OR FALSE AND TRUE;
300
+ and_or_expression : BOOLEAN := TRUE AND FALSE OR TRUE;
301
+ parenthesis_or_and_expression : BOOLEAN := (TRUE OR FALSE) AND TRUE;
302
+ and_parenthesis_or_expression : BOOLEAN := TRUE AND (FALSE OR TRUE);
303
+ combine_expression : BOOLEAN := test || test2;
304
+ in_expression : BOOLEAN := TRUE IN [TRUE];
305
+ like_expression : BOOLEAN := 'xxx' LIKE 'xxx';
306
+
307
+ -- aggregate initializer expressions
308
+ aggregate_initializer_expression : BOOLEAN := [4];
309
+ repeated_aggregate_initializer_expression : BOOLEAN := [4:2];
310
+ complex_aggregate_initializer_expression : BOOLEAN := [4 + 2];
311
+ complex_repeated_aggregate_initializer_expression : BOOLEAN := [4 + 2:4 + 2];
312
+
313
+ -- function call or entity constructor expressions
314
+ call_expression : BOOLEAN := parameter_function(TRUE);
315
+
316
+ -- reference expressions
317
+ simple_reference_expression : BOOLEAN := test;
318
+ group_reference_expression : BOOLEAN := test\test2;
319
+ index_reference_expression : BOOLEAN := test[1];
320
+ index2_reference_expression : BOOLEAN := test[1:9];
321
+ attribute_reference_expression : BOOLEAN := test.test2;
322
+
323
+ -- interval expressions
324
+ lt_lt_interval_expression : BOOLEAN := {1 < 5 < 9};
325
+ lte_lt_interval_expression : BOOLEAN := {1 <= 5 < 9};
326
+ lt_lte_interval_expression : BOOLEAN := {1 < 5 <= 9};
327
+ lte_lte_interval_expression : BOOLEAN := {1 <= 5 <= 9};
328
+
329
+ -- query expressions
330
+ query_expression : BOOLEAN := QUERY(test <* test2 | TRUE);
331
+ END_LOCAL;
332
+ END_PROCEDURE;
333
+ END_SCHEMA;