expressir 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/demo.rb +16 -0
  4. data/expressir.gemspec +1 -0
  5. data/generate-parser.sh +29 -0
  6. data/lib/expressir/express_exp/generated/ExpressBaseVisitor.rb +779 -0
  7. data/lib/expressir/express_exp/generated/ExpressLexer.rb +841 -0
  8. data/lib/expressir/express_exp/generated/ExpressParser.rb +12136 -0
  9. data/lib/expressir/express_exp/generated/ExpressVisitor.rb +394 -0
  10. data/lib/expressir/express_exp/parser.rb +25 -0
  11. data/lib/expressir/express_exp/visitor.rb +2103 -0
  12. data/lib/expressir/model/constant.rb +15 -0
  13. data/lib/expressir/model/derived.rb +15 -0
  14. data/lib/expressir/model/entity.rb +29 -0
  15. data/lib/expressir/model/explicit.rb +15 -0
  16. data/lib/expressir/model/expressions/aggregate_element.rb +15 -0
  17. data/lib/expressir/model/expressions/attribute_qualifier.rb +13 -0
  18. data/lib/expressir/model/expressions/entity_constructor.rb +15 -0
  19. data/lib/expressir/model/expressions/expression.rb +15 -0
  20. data/lib/expressir/model/expressions/function_call.rb +15 -0
  21. data/lib/expressir/model/expressions/group_qualifier.rb +13 -0
  22. data/lib/expressir/model/expressions/index_qualifier.rb +15 -0
  23. data/lib/expressir/model/expressions/interval.rb +21 -0
  24. data/lib/expressir/model/expressions/qualified_ref.rb +15 -0
  25. data/lib/expressir/model/expressions/query.rb +17 -0
  26. data/lib/expressir/model/expressions/unknown.rb +8 -0
  27. data/lib/expressir/model/function.rb +23 -0
  28. data/lib/expressir/model/inverse.rb +15 -0
  29. data/lib/expressir/model/local.rb +15 -0
  30. data/lib/expressir/model/operators/addition.rb +8 -0
  31. data/lib/expressir/model/operators/and.rb +8 -0
  32. data/lib/expressir/model/operators/andor.rb +8 -0
  33. data/lib/expressir/model/operators/combine.rb +8 -0
  34. data/lib/expressir/model/operators/equal.rb +8 -0
  35. data/lib/expressir/model/operators/exponentiation.rb +8 -0
  36. data/lib/expressir/model/operators/greater_than.rb +8 -0
  37. data/lib/expressir/model/operators/greater_than_or_equal.rb +8 -0
  38. data/lib/expressir/model/operators/in.rb +8 -0
  39. data/lib/expressir/model/operators/instance_equal.rb +8 -0
  40. data/lib/expressir/model/operators/instance_not_equal.rb +8 -0
  41. data/lib/expressir/model/operators/integer_division.rb +8 -0
  42. data/lib/expressir/model/operators/less_than.rb +8 -0
  43. data/lib/expressir/model/operators/less_than_or_equal.rb +8 -0
  44. data/lib/expressir/model/operators/like.rb +8 -0
  45. data/lib/expressir/model/operators/modulo.rb +8 -0
  46. data/lib/expressir/model/operators/multiplication.rb +8 -0
  47. data/lib/expressir/model/operators/not.rb +8 -0
  48. data/lib/expressir/model/operators/not_equal.rb +8 -0
  49. data/lib/expressir/model/operators/oneof.rb +8 -0
  50. data/lib/expressir/model/operators/or.rb +8 -0
  51. data/lib/expressir/model/operators/real_division.rb +8 -0
  52. data/lib/expressir/model/operators/subtraction.rb +8 -0
  53. data/lib/expressir/model/operators/unary_minus.rb +8 -0
  54. data/lib/expressir/model/operators/unary_plus.rb +8 -0
  55. data/lib/expressir/model/operators/xor.rb +8 -0
  56. data/lib/expressir/model/parameter.rb +15 -0
  57. data/lib/expressir/model/procedure.rb +21 -0
  58. data/lib/expressir/model/ref.rb +11 -0
  59. data/lib/expressir/model/reference.rb +13 -0
  60. data/lib/expressir/model/renamed_ref.rb +13 -0
  61. data/lib/expressir/model/repository.rb +11 -0
  62. data/lib/expressir/model/rule.rb +23 -0
  63. data/lib/expressir/model/schema.rb +41 -0
  64. data/lib/expressir/model/statements/alias.rb +17 -0
  65. data/lib/expressir/model/statements/assignment.rb +15 -0
  66. data/lib/expressir/model/statements/case.rb +17 -0
  67. data/lib/expressir/model/statements/case_action.rb +15 -0
  68. data/lib/expressir/model/statements/compound.rb +13 -0
  69. data/lib/expressir/model/statements/escape.rb +8 -0
  70. data/lib/expressir/model/statements/if.rb +17 -0
  71. data/lib/expressir/model/statements/null.rb +8 -0
  72. data/lib/expressir/model/statements/procedure_call.rb +15 -0
  73. data/lib/expressir/model/statements/repeat.rb +25 -0
  74. data/lib/expressir/model/statements/return.rb +13 -0
  75. data/lib/expressir/model/statements/skip.rb +8 -0
  76. data/lib/expressir/model/subtype_constraint.rb +19 -0
  77. data/lib/expressir/model/type.rb +15 -0
  78. data/lib/expressir/model/types/aggregate.rb +15 -0
  79. data/lib/expressir/model/types/array.rb +21 -0
  80. data/lib/expressir/model/types/bag.rb +17 -0
  81. data/lib/expressir/model/types/binary.rb +15 -0
  82. data/lib/expressir/model/types/boolean.rb +8 -0
  83. data/lib/expressir/model/types/enumeration.rb +19 -0
  84. data/lib/expressir/model/types/generic.rb +13 -0
  85. data/lib/expressir/model/types/generic_entity.rb +13 -0
  86. data/lib/expressir/model/types/integer.rb +8 -0
  87. data/lib/expressir/model/types/list.rb +19 -0
  88. data/lib/expressir/model/types/logical.rb +8 -0
  89. data/lib/expressir/model/types/number.rb +8 -0
  90. data/lib/expressir/model/types/real.rb +13 -0
  91. data/lib/expressir/model/types/select.rb +21 -0
  92. data/lib/expressir/model/types/set.rb +17 -0
  93. data/lib/expressir/model/types/string.rb +15 -0
  94. data/lib/expressir/model/unique.rb +13 -0
  95. data/lib/expressir/model/use.rb +13 -0
  96. data/lib/expressir/model/where.rb +13 -0
  97. data/lib/expressir/version.rb +1 -1
  98. data/original/examples/syntax/syntax.exp +295 -0
  99. data/spec/expressir/express_exp/ap233_spec.rb +22 -0
  100. data/spec/expressir/express_exp/syntax_spec.rb +2640 -0
  101. metadata +115 -5
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ module Statements
4
+ class Return
5
+ attr_accessor :expression
6
+
7
+ def initialize(options = {})
8
+ @expression = options[:expression]
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ module Expressir
2
+ module Model
3
+ module Statements
4
+ class Skip
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ module Expressir
2
+ module Model
3
+ class SubtypeConstraint
4
+ attr_accessor :id
5
+ attr_accessor :applies_to
6
+ attr_accessor :abstract_supertype
7
+ attr_accessor :total_over
8
+ attr_accessor :subtype_expression
9
+
10
+ def initialize(options = {})
11
+ @id = options[:id]
12
+ @applies_to = options[:applies_to]
13
+ @abstract_supertype = options[:abstract_supertype]
14
+ @total_over = options[:total_over]
15
+ @subtype_expression = options[:subtype_expression]
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ module Expressir
2
+ module Model
3
+ class Type
4
+ attr_accessor :id
5
+ attr_accessor :type
6
+ attr_accessor :where
7
+
8
+ def initialize(options = {})
9
+ @id = options[:id]
10
+ @type = options[:type]
11
+ @where = options[:where]
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Aggregate
5
+ attr_accessor :label
6
+ attr_accessor :base_type
7
+
8
+ def initialize(options = {})
9
+ @label = options[:label]
10
+ @base_type = options[:base_type]
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Array
5
+ attr_accessor :bound1
6
+ attr_accessor :bound2
7
+ attr_accessor :optional
8
+ attr_accessor :unique
9
+ attr_accessor :base_type
10
+
11
+ def initialize(options = {})
12
+ @bound1 = options[:bound1]
13
+ @bound2 = options[:bound2]
14
+ @optional = options[:optional]
15
+ @unique = options[:unique]
16
+ @base_type = options[:base_type]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Bag
5
+ attr_accessor :bound1
6
+ attr_accessor :bound2
7
+ attr_accessor :base_type
8
+
9
+ def initialize(options = {})
10
+ @bound1 = options[:bound1]
11
+ @bound2 = options[:bound2]
12
+ @base_type = options[:base_type]
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Binary
5
+ attr_accessor :width
6
+ attr_accessor :fixed
7
+
8
+ def initialize(options = {})
9
+ @width = options[:width]
10
+ @fixed = options[:fixed]
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Boolean
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Enumeration
5
+ attr_accessor :extensible
6
+ attr_accessor :list
7
+ attr_accessor :extension_type
8
+ attr_accessor :extension_list
9
+
10
+ def initialize(options = {})
11
+ @extensible = options[:extensible]
12
+ @list = options[:list]
13
+ @extension_type = options[:extension_type]
14
+ @extension_list = options[:extension_list]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Generic
5
+ attr_accessor :label
6
+
7
+ def initialize(options = {})
8
+ @label = options[:label]
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class GenericEntity
5
+ attr_accessor :label
6
+
7
+ def initialize(options = {})
8
+ @label = options[:label]
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Integer
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class List
5
+ attr_accessor :bound1
6
+ attr_accessor :bound2
7
+ attr_accessor :unique
8
+ attr_accessor :base_type
9
+
10
+ def initialize(options = {})
11
+ @bound1 = options[:bound1]
12
+ @bound2 = options[:bound2]
13
+ @unique = options[:unique]
14
+ @base_type = options[:base_type]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Logical
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Number
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Real
5
+ attr_accessor :precision
6
+
7
+ def initialize(options = {})
8
+ @precision = options[:precision]
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Select
5
+ attr_accessor :extensible
6
+ attr_accessor :generic_entity
7
+ attr_accessor :list
8
+ attr_accessor :extension_type
9
+ attr_accessor :extension_list
10
+
11
+ def initialize(options = {})
12
+ @extensible = options[:extensible]
13
+ @generic_entity = options[:generic_entity]
14
+ @list = options[:list]
15
+ @extension_type = options[:extension_type]
16
+ @extension_list = options[:extension_list]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class Set
5
+ attr_accessor :bound1
6
+ attr_accessor :bound2
7
+ attr_accessor :base_type
8
+
9
+ def initialize(options = {})
10
+ @bound1 = options[:bound1]
11
+ @bound2 = options[:bound2]
12
+ @base_type = options[:base_type]
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ module Expressir
2
+ module Model
3
+ module Types
4
+ class String
5
+ attr_accessor :width
6
+ attr_accessor :fixed
7
+
8
+ def initialize(options = {})
9
+ @width = options[:width]
10
+ @fixed = options[:fixed]
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ class Unique
4
+ attr_accessor :id
5
+ attr_accessor :attributes
6
+
7
+ def initialize(options = {})
8
+ @id = options[:id]
9
+ @attributes = options[:attributes]
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ class Use
4
+ attr_accessor :schema
5
+ attr_accessor :items
6
+
7
+ def initialize(options = {})
8
+ @schema = options[:schema]
9
+ @items = options[:items]
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Expressir
2
+ module Model
3
+ class Where
4
+ attr_accessor :id
5
+ attr_accessor :expression
6
+
7
+ def initialize(options = {})
8
+ @id = options[:id]
9
+ @expression = options[:expression]
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
@@ -0,0 +1,295 @@
1
+ SCHEMA syntaxSchema 'version';
2
+
3
+ -- interfaces
4
+ USE FROM useInterface;
5
+ USE FROM useItemInterface (test);
6
+ USE FROM useItemRenameInterface (test AS test2);
7
+ REFERENCE FROM referenceInterface;
8
+ REFERENCE FROM referenceItemInterface (test);
9
+ REFERENCE FROM referenceItemRenameInterface (test AS test2);
10
+
11
+ CONSTANT
12
+ -- literals
13
+ binaryExpression : STRING := %011110000111100001111000;
14
+ integerExpression : STRING := 999;
15
+ logicalTrueExpression : STRING := TRUE;
16
+ logicalFalseExpression : STRING := FALSE;
17
+ logicalUnknownExpression : STRING := UNKNOWN;
18
+ realExpression : STRING := 999.999;
19
+ stringSimpleExpression : STRING := 'xxx';
20
+ stringEncodedExpression : STRING := "000000780000007800000078";
21
+
22
+ -- constants
23
+ constEExpression : STRING := CONST_E;
24
+ indeterminateExpression : STRING := ?;
25
+ piExpression : STRING := PI;
26
+ selfExpression : STRING := SELF;
27
+
28
+ -- functions
29
+ absExpression : STRING := ABS(TRUE);
30
+ acosExpression : STRING := ACOS(TRUE);
31
+ asinExpression : STRING := ASIN(TRUE);
32
+ atanExpression : STRING := ATAN(TRUE);
33
+ blengthExpression : STRING := BLENGTH(TRUE);
34
+ cosExpression : STRING := COS(TRUE);
35
+ existsExpression : STRING := EXISTS(TRUE);
36
+ expExpression : STRING := EXP(TRUE);
37
+ formatExpression : STRING := FORMAT(TRUE);
38
+ hiboundExpression : STRING := HIBOUND(TRUE);
39
+ hiindexExpression : STRING := HIINDEX(TRUE);
40
+ lengthExpression : STRING := LENGTH(TRUE);
41
+ loboundExpression : STRING := LOBOUND(TRUE);
42
+ loindexExpression : STRING := LOINDEX(TRUE);
43
+ logExpression : STRING := LOG(TRUE);
44
+ log2Expression : STRING := LOG2(TRUE);
45
+ log10Expression : STRING := LOG10(TRUE);
46
+ nvlExpression : STRING := NVL(TRUE);
47
+ oddExpression : STRING := ODD(TRUE);
48
+ rolesofExpression : STRING := ROLESOF(TRUE);
49
+ sinExpression : STRING := SIN(TRUE);
50
+ sizeofExpression : STRING := SIZEOF(TRUE);
51
+ sqrtExpression : STRING := SQRT(TRUE);
52
+ tanExpression : STRING := TAN(TRUE);
53
+ typeofExpression : STRING := TYPEOF(TRUE);
54
+ usedinExpression : STRING := USEDIN(TRUE);
55
+ valueExpression : STRING := VALUE(TRUE);
56
+ valueInExpression : STRING := VALUE_IN(TRUE);
57
+ valueUniqueExpression : STRING := VALUE_UNIQUE(TRUE);
58
+
59
+ -- operations
60
+ unaryPlusExpression : STRING := +4;
61
+ unaryMinusExpression : STRING := -4;
62
+ additionExpression : STRING := 4 + 2;
63
+ subtractionExpression : STRING := 4 - 2;
64
+ multiplicationExpression : STRING := 4 * 2;
65
+ realDivisionExpression : STRING := 4 / 2;
66
+ integerDivisionExpression : STRING := 4 DIV 2;
67
+ moduloExpression : STRING := 4 MOD 2;
68
+ exponentiationExpression : STRING := 4 ** 2;
69
+ additionAdditionExpression : STRING := 4 + 2 + 1;
70
+ subtractionSubtractionExpression : STRING := 4 - 2 - 1;
71
+ additionSubtractionExpression : STRING := 4 + 2 - 1;
72
+ subtractionAdditionExpression : STRING := 4 - 2 + 1;
73
+ additionMultiplicationExpression : STRING := 8 + 4 * 2;
74
+ multiplicationAdditionExpression : STRING := 8 * 4 + 2;
75
+ parenthesisAdditionMultiplicationExpression : STRING := (8 + 4) * 2;
76
+ multiplicationParenthesisAdditionExpression : STRING := 8 * (4 + 2);
77
+ equalExpression : STRING := 4 = 2;
78
+ notEqualExpression : STRING := 4 <> 2;
79
+ ltExpression : STRING := 4 < 2;
80
+ gtExpression : STRING := 4 > 2;
81
+ lteExpression : STRING := 4 <= 2;
82
+ gteExpression : STRING := 4 >= 2;
83
+ orExpression : STRING := TRUE OR FALSE;
84
+ andExpression : STRING := TRUE AND FALSE;
85
+ orOrExpression : STRING := TRUE OR FALSE OR TRUE;
86
+ andAndExpression : STRING := TRUE AND FALSE AND TRUE;
87
+ orAndExpression : STRING := TRUE OR FALSE AND TRUE;
88
+ andOrExpression : STRING := TRUE AND FALSE OR TRUE;
89
+ parenthesisOrAndExpression : STRING := (TRUE OR FALSE) AND TRUE;
90
+ andParenthesisOrExpression : STRING := TRUE AND (FALSE OR TRUE);
91
+ combineExpression : STRING := test || test;
92
+ inExpression : STRING := TRUE IN [TRUE];
93
+ likeExpression : STRING := 'xxx' LIKE 'xxx';
94
+
95
+ -- aggregate initializers
96
+ aggregateExpression : STRING := ['xxx'];
97
+ aggregateRepeatedExpression : STRING := ['xxx' : 2];
98
+ aggregateComplexExpression : STRING := [4 + 2];
99
+ aggregateComplexRepeatedExpression : STRING := [4 + 2 : 4 + 2];
100
+
101
+ -- entity constructors
102
+ entityConstructorExpression : STRING := explicitAttributeEntity(TRUE);
103
+
104
+ -- enumeration references
105
+ enumerationReferenceExpression : STRING := test;
106
+ attributeEnumerationReferenceExpression : STRING := test.test;
107
+
108
+ -- intervals
109
+ ltLtIntervalExpression : STRING := {1 < 5 < 9};
110
+ lteLtIntervalExpression : STRING := {1 <= 5 < 9};
111
+ ltLteIntervalExpression : STRING := {1 < 5 <= 9};
112
+ lteLteIntervalExpression : STRING := {1 <= 5 <= 9};
113
+
114
+ -- queries
115
+ queryExpression : STRING := QUERY(test <* test2 | TRUE);
116
+ END_CONSTANT;
117
+
118
+ -- types
119
+ TYPE integerType = INTEGER; END_TYPE;
120
+ TYPE integerWhereType = INTEGER; WHERE TRUE; END_TYPE;
121
+ TYPE integerWhereLabelType = INTEGER; WHERE WR1: TRUE; END_TYPE;
122
+
123
+ -- simple types
124
+ TYPE binaryType = BINARY; END_TYPE;
125
+ TYPE binaryWidthType = BINARY (3); END_TYPE;
126
+ TYPE binaryWidthFixedType = BINARY (3) FIXED; END_TYPE;
127
+ TYPE booleanType = BOOLEAN; END_TYPE;
128
+ TYPE integerType = INTEGER; END_TYPE;
129
+ TYPE integerWhereType = INTEGER; WHERE TRUE; END_TYPE;
130
+ TYPE integerWhereLabelType = INTEGER; WHERE WR1: TRUE; END_TYPE;
131
+ TYPE logicalType = LOGICAL; END_TYPE;
132
+ TYPE numberType = NUMBER; END_TYPE;
133
+ TYPE realType = REAL; END_TYPE;
134
+ TYPE realPrecisionType = REAL (3); END_TYPE;
135
+ TYPE stringType = STRING; END_TYPE;
136
+ TYPE stringWidthType = STRING (3); END_TYPE;
137
+ TYPE stringWidthFixedType = STRING (3) FIXED; END_TYPE;
138
+
139
+ -- aggregation types
140
+ TYPE arrayType = ARRAY [1:9] OF STRING; END_TYPE;
141
+ TYPE arrayOptionalType = ARRAY [1:9] OF OPTIONAL STRING; END_TYPE;
142
+ TYPE arrayUniqueType = ARRAY [1:9] OF UNIQUE STRING; END_TYPE;
143
+ TYPE arrayOptionalUniqueType = ARRAY [1:9] OF OPTIONAL UNIQUE STRING; END_TYPE;
144
+ TYPE bagType = BAG OF STRING; END_TYPE;
145
+ TYPE bagBoundType = BAG [1:9] OF STRING; END_TYPE;
146
+ TYPE listType = LIST OF STRING; END_TYPE;
147
+ TYPE listBoundType = LIST [1:9] OF STRING; END_TYPE;
148
+ TYPE listUniqueType = LIST OF UNIQUE STRING; END_TYPE;
149
+ TYPE listBoundUniqueType = LIST [1:9] OF UNIQUE STRING; END_TYPE;
150
+ TYPE setType = SET OF STRING; END_TYPE;
151
+ TYPE setBoundType = SET [1:9] OF STRING; END_TYPE;
152
+
153
+ -- constructed types
154
+ TYPE selectType = SELECT; END_TYPE;
155
+ TYPE selectExtensibleType = EXTENSIBLE SELECT; END_TYPE;
156
+ TYPE selectExtensibleGenericEntityType = EXTENSIBLE GENERIC_ENTITY SELECT; END_TYPE;
157
+ TYPE selectListType = SELECT (test); END_TYPE;
158
+ TYPE selectExtensionTypeRefType = SELECT BASED_ON selectType; END_TYPE;
159
+ TYPE selectExtensionTypeRefListType = SELECT BASED_ON selectType WITH (test); END_TYPE;
160
+ TYPE enumerationType = ENUMERATION; END_TYPE;
161
+ TYPE enumerationExtensibleType = EXTENSIBLE ENUMERATION; END_TYPE;
162
+ TYPE enumerationListType = ENUMERATION OF (test); END_TYPE;
163
+ TYPE enumerationExtensionTypeRefType = ENUMERATION BASED_ON enumerationType; END_TYPE;
164
+ TYPE enumerationExtensionTypeRefListType = ENUMERATION BASED_ON enumerationType WITH (test); END_TYPE;
165
+
166
+ -- entities
167
+ ENTITY emptyEntity; END_ENTITY;
168
+ ENTITY abstractEntity ABSTRACT; END_ENTITY;
169
+ ENTITY abstractSupertypeEntity ABSTRACT SUPERTYPE; END_ENTITY;
170
+ ENTITY abstractSupertypeConstraintEntity ABSTRACT SUPERTYPE OF (emptyEntity); END_ENTITY;
171
+ ENTITY supertypeConstraintEntity SUPERTYPE OF (emptyEntity); END_ENTITY;
172
+ ENTITY subtypeEntity SUBTYPE OF (emptyEntity); END_ENTITY;
173
+ ENTITY supertypeConstraintSubtypeEntity SUPERTYPE OF (emptyEntity) SUBTYPE OF (emptyEntity); END_ENTITY;
174
+ ENTITY explicitAttributeEntity; test : BOOLEAN; END_ENTITY;
175
+ ENTITY explicitAttributeOptionalEntity; test : OPTIONAL BOOLEAN; END_ENTITY;
176
+ ENTITY explicitAttributeMultipleEntity; test : BOOLEAN; test2 : BOOLEAN; END_ENTITY;
177
+ ENTITY explicitAttributeMultipleShorthandEntity; test, test2 : BOOLEAN; END_ENTITY;
178
+ ENTITY explicitAttributeRenamedEntity; SELF\explicitAttributeEntity.test RENAMED test2: BOOLEAN; END_ENTITY;
179
+ ENTITY derivedAttributeEntity; DERIVE test : BOOLEAN := TRUE; END_ENTITY;
180
+ ENTITY inverseAttributeEntity; INVERSE test : explicitAttributeEntity FOR test; END_ENTITY;
181
+ ENTITY inverseAttributeEntityEntity; INVERSE test : explicitAttributeEntity FOR explicitAttributeEntity.test; END_ENTITY;
182
+ ENTITY inverseAttributeSetEntity; INVERSE test : SET OF explicitAttributeEntity FOR test; END_ENTITY;
183
+ ENTITY inverseAttributeSetBoundEntity; INVERSE test : SET [1:9] OF explicitAttributeEntity FOR test; END_ENTITY;
184
+ ENTITY inverseAttributeBagEntity; INVERSE test : BAG OF explicitAttributeEntity FOR test; END_ENTITY;
185
+ ENTITY inverseAttributeBagBoundEntity; INVERSE test : BAG [1:9] OF explicitAttributeEntity FOR test; END_ENTITY;
186
+ ENTITY uniqueEntity; UNIQUE test; END_ENTITY;
187
+ ENTITY uniqueLabelEntity; UNIQUE UR1: test; END_ENTITY;
188
+ ENTITY uniqueQualifiedEntity; UNIQUE SELF\explicitAttributeEntity.test; END_ENTITY;
189
+ ENTITY uniqueLabelQualifiedEntity; UNIQUE UR1: SELF\explicitAttributeEntity.test; END_ENTITY;
190
+ ENTITY whereEntity; WHERE TRUE; END_ENTITY;
191
+ ENTITY whereLabelEntity; WHERE WR1: TRUE; END_ENTITY;
192
+
193
+ -- subtype constraints
194
+ SUBTYPE_CONSTRAINT emptySubtypeConstraint FOR emptyEntity; END_SUBTYPE_CONSTRAINT;
195
+ SUBTYPE_CONSTRAINT abstractSupertypeSubtypeConstraint FOR emptyEntity; ABSTRACT SUPERTYPE; END_SUBTYPE_CONSTRAINT;
196
+ SUBTYPE_CONSTRAINT totalOverSubtypeConstraint FOR emptyEntity; TOTAL_OVER (a); END_SUBTYPE_CONSTRAINT;
197
+ SUBTYPE_CONSTRAINT supertypeExpressionSubtypeConstraint FOR emptyEntity; a; END_SUBTYPE_CONSTRAINT;
198
+ SUBTYPE_CONSTRAINT supertypeExpressionAndorSubtypeConstraint FOR emptyEntity; a ANDOR b; END_SUBTYPE_CONSTRAINT;
199
+ SUBTYPE_CONSTRAINT supertypeExpressionAndSubtypeConstraint FOR emptyEntity; a AND b; END_SUBTYPE_CONSTRAINT;
200
+ SUBTYPE_CONSTRAINT supertypeExpressionAndorAndSubtypeConstraint FOR emptyEntity; a ANDOR b AND c; END_SUBTYPE_CONSTRAINT;
201
+ SUBTYPE_CONSTRAINT supertypeExpressionAndAndorSubtypeConstraint FOR emptyEntity; a AND b ANDOR c; END_SUBTYPE_CONSTRAINT;
202
+ SUBTYPE_CONSTRAINT supertypeExpressionParenthesisAndorAndSubtypeConstraint FOR emptyEntity; (a ANDOR b) AND c; END_SUBTYPE_CONSTRAINT;
203
+ SUBTYPE_CONSTRAINT supertypeExpressionAndParenthesisAndorSubtypeConstraint FOR emptyEntity; a AND (b ANDOR c); END_SUBTYPE_CONSTRAINT;
204
+ SUBTYPE_CONSTRAINT supertypeExpressionOneofSubtypeConstraint FOR emptyEntity; ONEOF(a, b); END_SUBTYPE_CONSTRAINT;
205
+ SUBTYPE_CONSTRAINT supertypeExpressionAndOneofSubtypeConstraint FOR emptyEntity; a AND ONEOF(b, c); END_SUBTYPE_CONSTRAINT;
206
+ SUBTYPE_CONSTRAINT supertypeExpressionAndorOneofSubtypeConstraint FOR emptyEntity; a ANDOR ONEOF(b, c); END_SUBTYPE_CONSTRAINT;
207
+ SUBTYPE_CONSTRAINT supertypeExpressionOneofAndSubtypeConstraint FOR emptyEntity; ONEOF(a, b) AND c; END_SUBTYPE_CONSTRAINT;
208
+ SUBTYPE_CONSTRAINT supertypeExpressionOneofAndorSubtypeConstraint FOR emptyEntity; ONEOF(a, b) ANDOR c; END_SUBTYPE_CONSTRAINT;
209
+ SUBTYPE_CONSTRAINT supertypeExpressionOneofAndOneofSubtypeConstraint FOR emptyEntity; ONEOF(a, b) AND ONEOF(c, d); END_SUBTYPE_CONSTRAINT;
210
+ SUBTYPE_CONSTRAINT supertypeExpressionOneofAndorOneofSubtypeConstraint FOR emptyEntity; ONEOF(a, b) ANDOR ONEOF(c, d); END_SUBTYPE_CONSTRAINT;
211
+
212
+ -- functions
213
+ FUNCTION emptyFunction : BOOLEAN; ; END_FUNCTION;
214
+ FUNCTION parameterFunction (test : BOOLEAN) : BOOLEAN; ; END_FUNCTION;
215
+ FUNCTION multipleParameterFunction (test : BOOLEAN; test2 : BOOLEAN) : BOOLEAN; ; END_FUNCTION;
216
+ FUNCTION multipleShorthandParameterFunction (test, test2 : BOOLEAN) : BOOLEAN; ; END_FUNCTION;
217
+ FUNCTION typeFunction : BOOLEAN; TYPE integerType = INTEGER; END_TYPE; ; END_FUNCTION;
218
+ FUNCTION constantFunction : BOOLEAN; CONSTANT test : STRING := 'xxx'; END_CONSTANT; ; END_FUNCTION;
219
+ FUNCTION multipleConstantFunction : BOOLEAN; CONSTANT test : STRING := 'xxx'; test2 : STRING := 'xxx'; END_CONSTANT; ; END_FUNCTION;
220
+ FUNCTION localFunction : BOOLEAN; LOCAL test : STRING; END_LOCAL; ; END_FUNCTION;
221
+ FUNCTION multipleLocalFunction : BOOLEAN; LOCAL test : STRING; test2 : STRING; END_LOCAL; ; END_FUNCTION;
222
+ FUNCTION multipleShorthandLocalFunction : BOOLEAN; LOCAL test, test2 : STRING; END_LOCAL; ; END_FUNCTION;
223
+ FUNCTION localExpressionFunction : BOOLEAN; LOCAL test : STRING := 'xxx'; END_LOCAL; ; END_FUNCTION;
224
+ FUNCTION multipleLocalExpressionFunction : BOOLEAN; LOCAL test : STRING := 'xxx'; test2 : STRING := 'xxx'; END_LOCAL; ; END_FUNCTION;
225
+ FUNCTION multipleShorthandLocalExpressionFunction : BOOLEAN; LOCAL test, test2 : STRING := 'xxx'; END_LOCAL; ; END_FUNCTION;
226
+
227
+ -- procedures
228
+ PROCEDURE emptyProcedure; END_PROCEDURE;
229
+ PROCEDURE parameterProcedure (test : BOOLEAN); END_PROCEDURE;
230
+ PROCEDURE multipleParameterProcedure (test : BOOLEAN; test2 : BOOLEAN); END_PROCEDURE;
231
+ PROCEDURE multipleShorthandParameterProcedure (test, test2 : BOOLEAN); END_PROCEDURE;
232
+ PROCEDURE variableParameterProcedure (VAR test : BOOLEAN); END_PROCEDURE;
233
+ PROCEDURE multipleVariableParameterProcedure (VAR test : BOOLEAN; test2 : BOOLEAN); END_PROCEDURE;
234
+ PROCEDURE multipleVariableParameter2Procedure (test : BOOLEAN; VAR test2 : BOOLEAN); END_PROCEDURE;
235
+ PROCEDURE multipleShorthandVariableParameterProcedure (VAR test, test2 : BOOLEAN); END_PROCEDURE;
236
+ PROCEDURE typeProcedure; TYPE integerType = INTEGER; END_TYPE; END_PROCEDURE;
237
+ PROCEDURE constantProcedure; CONSTANT test : STRING := 'xxx'; END_CONSTANT; END_PROCEDURE;
238
+ PROCEDURE multipleConstantProcedure; CONSTANT test : STRING := 'xxx'; test2 : STRING := 'xxx'; END_CONSTANT; END_PROCEDURE;
239
+ PROCEDURE localProcedure; LOCAL test : STRING; END_LOCAL; END_PROCEDURE;
240
+ PROCEDURE multipleLocalProcedure; LOCAL test : STRING; test2 : STRING; END_LOCAL; END_PROCEDURE;
241
+ PROCEDURE multipleShorthandLocalProcedure; LOCAL test, test2 : STRING; END_LOCAL; END_PROCEDURE;
242
+ PROCEDURE localExpressionProcedure; LOCAL test : STRING := 'xxx'; END_LOCAL; END_PROCEDURE;
243
+ PROCEDURE multipleLocalExpressionProcedure; LOCAL test : STRING := 'xxx'; test2 : STRING := 'xxx'; END_LOCAL; END_PROCEDURE;
244
+ PROCEDURE multipleShorthandLocalExpressionProcedure; LOCAL test, test2 : STRING := 'xxx'; END_LOCAL; END_PROCEDURE;
245
+
246
+ -- rules
247
+ RULE emptyRule FOR (emptyEntity); WHERE TRUE; END_RULE;
248
+ RULE typeRule FOR (emptyEntity); TYPE integerType = INTEGER; END_TYPE; WHERE TRUE; END_RULE;
249
+ RULE constantRule FOR (emptyEntity); CONSTANT test : STRING := 'xxx'; END_CONSTANT; WHERE TRUE; END_RULE;
250
+ RULE multipleConstantRule FOR (emptyEntity); CONSTANT test : STRING := 'xxx'; test2 : STRING := 'xxx'; END_CONSTANT; WHERE TRUE; END_RULE;
251
+ RULE localRule FOR (emptyEntity); LOCAL test : STRING; END_LOCAL; WHERE TRUE; END_RULE;
252
+ RULE multipleLocalRule FOR (emptyEntity); LOCAL test : STRING; test2 : STRING; END_LOCAL; WHERE TRUE; END_RULE;
253
+ RULE multipleShorthandLocalRule FOR (emptyEntity); LOCAL test, test2 : STRING; END_LOCAL; WHERE TRUE; END_RULE;
254
+ RULE localExpressionRule FOR (emptyEntity); LOCAL test : STRING := 'xxx'; END_LOCAL; WHERE TRUE; END_RULE;
255
+ RULE multipleLocalExpressionRule FOR (emptyEntity); LOCAL test : STRING := 'xxx'; test2 : STRING := 'xxx'; END_LOCAL; WHERE TRUE; END_RULE;
256
+ RULE multipleShorthandLocalExpressionRule FOR (emptyEntity); LOCAL test, test2 : STRING := 'xxx'; END_LOCAL; WHERE TRUE; END_RULE;
257
+
258
+ -- statements
259
+ FUNCTION aliasStatement : BOOLEAN; ALIAS test FOR test; ; END_ALIAS; END_FUNCTION;
260
+ FUNCTION aliasAttributeStatement : BOOLEAN; ALIAS test FOR test.test; ; END_ALIAS; END_FUNCTION;
261
+ FUNCTION aliasGroupStatement : BOOLEAN; ALIAS test FOR test\test; ; END_ALIAS; END_FUNCTION;
262
+ FUNCTION aliasIndexStatement : BOOLEAN; ALIAS test FOR test[1]; ; END_ALIAS; END_FUNCTION;
263
+ FUNCTION aliasIndex2Statement : BOOLEAN; ALIAS test FOR test[1:9]; ; END_ALIAS; END_FUNCTION;
264
+ FUNCTION assignmentStatement : BOOLEAN; test := TRUE; END_FUNCTION;
265
+ FUNCTION assignmentAttributeStatement : BOOLEAN; test.test := TRUE; END_FUNCTION;
266
+ FUNCTION assignmentGroupStatement : BOOLEAN; test\test := TRUE; END_FUNCTION;
267
+ FUNCTION assignmentIndexStatement : BOOLEAN; test[1] := TRUE; END_FUNCTION;
268
+ FUNCTION assignmentIndex2Statement : BOOLEAN; test[1:9] := TRUE; END_FUNCTION;
269
+ FUNCTION caseStatement : BOOLEAN; CASE test OF TRUE : ; END_CASE; END_FUNCTION;
270
+ FUNCTION caseMultipleStatement : BOOLEAN; CASE test OF TRUE : ; TRUE : ; END_CASE; END_FUNCTION;
271
+ FUNCTION caseMultipleShorthandStatement : BOOLEAN; CASE test OF TRUE, TRUE : ; END_CASE; END_FUNCTION;
272
+ FUNCTION caseOtherwiseStatement : BOOLEAN; CASE test OF TRUE : ; OTHERWISE : ; END_CASE; END_FUNCTION;
273
+ FUNCTION compoundStatement : BOOLEAN; BEGIN ; END; END_FUNCTION;
274
+ FUNCTION escapeStatement : BOOLEAN; ESCAPE; END_FUNCTION;
275
+ FUNCTION ifStatement : BOOLEAN; IF TRUE THEN ; END_IF; END_FUNCTION;
276
+ FUNCTION if2Statement : BOOLEAN; IF TRUE THEN ; ; END_IF; END_FUNCTION;
277
+ FUNCTION ifElseStatement : BOOLEAN; IF TRUE THEN ; ELSE ; END_IF; END_FUNCTION;
278
+ FUNCTION if2ElseStatement : BOOLEAN; IF TRUE THEN ; ; ELSE ; END_IF; END_FUNCTION;
279
+ FUNCTION ifElse2Statement : BOOLEAN; IF TRUE THEN ; ELSE ; ; END_IF; END_FUNCTION;
280
+ FUNCTION if2Else2Statement : BOOLEAN; IF TRUE THEN ; ; ELSE ; ; END_IF; END_FUNCTION;
281
+ FUNCTION nullStatement : BOOLEAN; ; END_FUNCTION;
282
+ FUNCTION procedureCallStatement : BOOLEAN; emptyProcedure; END_FUNCTION;
283
+ FUNCTION procedureCallParameterStatement : BOOLEAN; emptyProcedure(true); END_FUNCTION;
284
+ FUNCTION procedureCallParameter2Statement : BOOLEAN; emptyProcedure(true, true); END_FUNCTION;
285
+ FUNCTION procedureCallInsertStatement : BOOLEAN; INSERT; END_FUNCTION;
286
+ FUNCTION procedureCallRemoveStatement : BOOLEAN; REMOVE; END_FUNCTION;
287
+ FUNCTION repeatStatement : BOOLEAN; REPEAT; ; END_REPEAT; END_FUNCTION;
288
+ FUNCTION repeatVariableStatement : BOOLEAN; REPEAT test := 1 TO 9; ; END_REPEAT; END_FUNCTION;
289
+ FUNCTION repeatVariableIncrementStatement : BOOLEAN; REPEAT test := 1 TO 9 BY 2; ; END_REPEAT; END_FUNCTION;
290
+ FUNCTION repeatWhileStatement : BOOLEAN; REPEAT WHILE TRUE; ; END_REPEAT; END_FUNCTION;
291
+ FUNCTION repeatUntilStatement : BOOLEAN; REPEAT UNTIL TRUE; ; END_REPEAT; END_FUNCTION;
292
+ FUNCTION returnStatement : BOOLEAN; RETURN (TRUE); END_FUNCTION;
293
+ FUNCTION skipStatement : BOOLEAN; SKIP; END_FUNCTION;
294
+
295
+ END_SCHEMA;