expressir 1.2.5-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.cross_rubies +15 -0
  3. data/.github/workflows/rake.yml +300 -0
  4. data/.github/workflows/release.yml +120 -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 +17 -0
  10. data/.yardopts +11 -0
  11. data/Gemfile +4 -0
  12. data/README.adoc +147 -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/3.1/express_parser.so +0 -0
  27. data/lib/expressir/express/cache.rb +51 -0
  28. data/lib/expressir/express/formatter.rb +1608 -0
  29. data/lib/expressir/express/hyperlink_formatter.rb +36 -0
  30. data/lib/expressir/express/model_visitor.rb +24 -0
  31. data/lib/expressir/express/parser.rb +84 -0
  32. data/lib/expressir/express/resolve_references_model_visitor.rb +31 -0
  33. data/lib/expressir/express/schema_head_formatter.rb +23 -0
  34. data/lib/expressir/express/visitor.rb +2578 -0
  35. data/lib/expressir/model/cache.rb +17 -0
  36. data/lib/expressir/model/data_type.rb +9 -0
  37. data/lib/expressir/model/data_types/aggregate.rb +31 -0
  38. data/lib/expressir/model/data_types/array.rb +31 -0
  39. data/lib/expressir/model/data_types/bag.rb +25 -0
  40. data/lib/expressir/model/data_types/binary.rb +22 -0
  41. data/lib/expressir/model/data_types/boolean.rb +10 -0
  42. data/lib/expressir/model/data_types/enumeration.rb +25 -0
  43. data/lib/expressir/model/data_types/enumeration_item.rb +26 -0
  44. data/lib/expressir/model/data_types/generic.rb +26 -0
  45. data/lib/expressir/model/data_types/generic_entity.rb +26 -0
  46. data/lib/expressir/model/data_types/integer.rb +10 -0
  47. data/lib/expressir/model/data_types/list.rb +28 -0
  48. data/lib/expressir/model/data_types/logical.rb +10 -0
  49. data/lib/expressir/model/data_types/number.rb +10 -0
  50. data/lib/expressir/model/data_types/real.rb +19 -0
  51. data/lib/expressir/model/data_types/select.rb +28 -0
  52. data/lib/expressir/model/data_types/set.rb +25 -0
  53. data/lib/expressir/model/data_types/string.rb +22 -0
  54. data/lib/expressir/model/declaration.rb +9 -0
  55. data/lib/expressir/model/declarations/attribute.rb +47 -0
  56. data/lib/expressir/model/declarations/constant.rb +34 -0
  57. data/lib/expressir/model/declarations/entity.rb +53 -0
  58. data/lib/expressir/model/declarations/function.rb +67 -0
  59. data/lib/expressir/model/declarations/interface.rb +28 -0
  60. data/lib/expressir/model/declarations/interface_item.rb +23 -0
  61. data/lib/expressir/model/declarations/interfaced_item.rb +37 -0
  62. data/lib/expressir/model/declarations/parameter.rb +34 -0
  63. data/lib/expressir/model/declarations/procedure.rb +64 -0
  64. data/lib/expressir/model/declarations/remark_item.rb +21 -0
  65. data/lib/expressir/model/declarations/rule.rb +71 -0
  66. data/lib/expressir/model/declarations/schema.rb +117 -0
  67. data/lib/expressir/model/declarations/schema_version.rb +22 -0
  68. data/lib/expressir/model/declarations/schema_version_item.rb +22 -0
  69. data/lib/expressir/model/declarations/subtype_constraint.rb +40 -0
  70. data/lib/expressir/model/declarations/type.rb +45 -0
  71. data/lib/expressir/model/declarations/unique_rule.rb +31 -0
  72. data/lib/expressir/model/declarations/variable.rb +34 -0
  73. data/lib/expressir/model/declarations/where_rule.rb +31 -0
  74. data/lib/expressir/model/expression.rb +9 -0
  75. data/lib/expressir/model/expressions/aggregate_initializer.rb +19 -0
  76. data/lib/expressir/model/expressions/aggregate_initializer_item.rb +22 -0
  77. data/lib/expressir/model/expressions/binary_expression.rb +53 -0
  78. data/lib/expressir/model/expressions/entity_constructor.rb +22 -0
  79. data/lib/expressir/model/expressions/function_call.rb +22 -0
  80. data/lib/expressir/model/expressions/interval.rb +34 -0
  81. data/lib/expressir/model/expressions/query_expression.rb +35 -0
  82. data/lib/expressir/model/expressions/unary_expression.rb +27 -0
  83. data/lib/expressir/model/identifier.rb +34 -0
  84. data/lib/expressir/model/literal.rb +9 -0
  85. data/lib/expressir/model/literals/binary.rb +19 -0
  86. data/lib/expressir/model/literals/integer.rb +19 -0
  87. data/lib/expressir/model/literals/logical.rb +23 -0
  88. data/lib/expressir/model/literals/real.rb +19 -0
  89. data/lib/expressir/model/literals/string.rb +22 -0
  90. data/lib/expressir/model/model_element.rb +208 -0
  91. data/lib/expressir/model/reference.rb +9 -0
  92. data/lib/expressir/model/references/attribute_reference.rb +22 -0
  93. data/lib/expressir/model/references/group_reference.rb +22 -0
  94. data/lib/expressir/model/references/index_reference.rb +27 -0
  95. data/lib/expressir/model/references/simple_reference.rb +24 -0
  96. data/lib/expressir/model/repository.rb +23 -0
  97. data/lib/expressir/model/statement.rb +9 -0
  98. data/lib/expressir/model/statements/alias.rb +35 -0
  99. data/lib/expressir/model/statements/assignment.rb +22 -0
  100. data/lib/expressir/model/statements/case.rb +25 -0
  101. data/lib/expressir/model/statements/case_action.rb +22 -0
  102. data/lib/expressir/model/statements/compound.rb +19 -0
  103. data/lib/expressir/model/statements/escape.rb +10 -0
  104. data/lib/expressir/model/statements/if.rb +25 -0
  105. data/lib/expressir/model/statements/null.rb +10 -0
  106. data/lib/expressir/model/statements/procedure_call.rb +22 -0
  107. data/lib/expressir/model/statements/repeat.rb +47 -0
  108. data/lib/expressir/model/statements/return.rb +19 -0
  109. data/lib/expressir/model/statements/skip.rb +10 -0
  110. data/lib/expressir/model/supertype_expression.rb +9 -0
  111. data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +29 -0
  112. data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +19 -0
  113. data/lib/expressir/model.rb +79 -0
  114. data/lib/expressir/version.rb +3 -0
  115. data/lib/expressir.rb +20 -0
  116. data/rakelib/antlr4-native.rake +63 -0
  117. data/rakelib/cross-ruby.rake +367 -0
  118. data/spec/acceptance/version_spec.rb +17 -0
  119. data/spec/expressir/express/cache_spec.rb +67 -0
  120. data/spec/expressir/express/formatter_spec.rb +135 -0
  121. data/spec/expressir/express/parser_spec.rb +104 -0
  122. data/spec/expressir/model/model_element_spec.rb +274 -0
  123. data/spec/spec_helper.rb +17 -0
  124. data/spec/support/console_helper.rb +29 -0
  125. data/spec/syntax/multiple.exp +23 -0
  126. data/spec/syntax/multiple.yaml +198 -0
  127. data/spec/syntax/multiple_formatted.exp +71 -0
  128. data/spec/syntax/multiple_hyperlink_formatted.exp +71 -0
  129. data/spec/syntax/multiple_schema_head_hyperlink_formatted.exp +13 -0
  130. data/spec/syntax/remark.exp +191 -0
  131. data/spec/syntax/remark.yaml +466 -0
  132. data/spec/syntax/remark_formatted.exp +227 -0
  133. data/spec/syntax/single.exp +4 -0
  134. data/spec/syntax/single.yaml +18 -0
  135. data/spec/syntax/single_formatted.exp +10 -0
  136. data/spec/syntax/single_formatted.yaml +36 -0
  137. data/spec/syntax/syntax.exp +333 -0
  138. data/spec/syntax/syntax.yaml +3509 -0
  139. data/spec/syntax/syntax_formatted.exp +902 -0
  140. data/spec/syntax/syntax_hyperlink_formatted.exp +902 -0
  141. data/spec/syntax/syntax_schema_head_formatted.exp +18 -0
  142. metadata +387 -0
@@ -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;