expressir 0.2.9-arm64-darwin → 0.2.14-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/format +20 -0
- data/expressir.gemspec +1 -0
- data/lib/expressir/express_exp/2.4/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/2.5/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/2.6/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/2.7/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/3.0/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/formatter.rb +146 -105
- data/lib/expressir/express_exp/hyperlink_formatter.rb +25 -0
- data/lib/expressir/express_exp/parser.rb +2 -0
- data/lib/expressir/express_exp/schema_head_formatter.rb +14 -0
- data/lib/expressir/express_exp/visitor.rb +132 -82
- data/lib/expressir/model.rb +2 -1
- data/lib/expressir/model/attribute.rb +5 -1
- data/lib/expressir/model/constant.rb +5 -1
- data/lib/expressir/model/entity.rb +13 -22
- data/lib/expressir/model/enumeration_item.rb +5 -1
- data/lib/expressir/model/expressions/aggregate_initializer.rb +4 -2
- data/lib/expressir/model/expressions/aggregate_item.rb +3 -1
- data/lib/expressir/model/expressions/attribute_reference.rb +3 -1
- data/lib/expressir/model/expressions/binary_expression.rb +3 -1
- data/lib/expressir/model/expressions/call.rb +4 -2
- data/lib/expressir/model/expressions/entity_constructor.rb +4 -2
- data/lib/expressir/model/expressions/group_reference.rb +3 -1
- data/lib/expressir/model/expressions/index_reference.rb +3 -1
- data/lib/expressir/model/expressions/interval.rb +3 -1
- data/lib/expressir/model/expressions/query_expression.rb +5 -2
- data/lib/expressir/model/expressions/simple_reference.rb +3 -1
- data/lib/expressir/model/expressions/unary_expression.rb +3 -1
- data/lib/expressir/model/function.rb +28 -39
- data/lib/expressir/model/identifier.rb +1 -3
- data/lib/expressir/model/informal_proposition.rb +5 -1
- data/lib/expressir/model/interface.rb +4 -2
- data/lib/expressir/model/literals/binary.rb +3 -1
- data/lib/expressir/model/literals/integer.rb +3 -1
- data/lib/expressir/model/literals/logical.rb +3 -1
- data/lib/expressir/model/literals/real.rb +3 -1
- data/lib/expressir/model/literals/string.rb +3 -1
- data/lib/expressir/model/model_element.rb +140 -0
- data/lib/expressir/model/parameter.rb +5 -1
- data/lib/expressir/model/procedure.rb +29 -40
- data/lib/expressir/model/renamed_ref.rb +3 -1
- data/lib/expressir/model/repository.rb +5 -5
- data/lib/expressir/model/rule.rb +32 -43
- data/lib/expressir/model/schema.rb +48 -48
- data/lib/expressir/model/statements/alias.rb +6 -3
- data/lib/expressir/model/statements/assignment.rb +3 -1
- data/lib/expressir/model/statements/call.rb +4 -2
- data/lib/expressir/model/statements/case.rb +4 -2
- data/lib/expressir/model/statements/case_action.rb +4 -2
- data/lib/expressir/model/statements/compound.rb +4 -2
- data/lib/expressir/model/statements/escape.rb +1 -1
- data/lib/expressir/model/statements/if.rb +5 -3
- data/lib/expressir/model/statements/null.rb +1 -1
- data/lib/expressir/model/statements/repeat.rb +6 -3
- data/lib/expressir/model/statements/return.rb +3 -1
- data/lib/expressir/model/statements/skip.rb +1 -1
- data/lib/expressir/model/subtype_constraint.rb +5 -2
- data/lib/expressir/model/type.rb +10 -11
- data/lib/expressir/model/types/aggregate.rb +5 -1
- data/lib/expressir/model/types/array.rb +3 -1
- data/lib/expressir/model/types/bag.rb +3 -1
- data/lib/expressir/model/types/binary.rb +3 -1
- data/lib/expressir/model/types/boolean.rb +1 -1
- data/lib/expressir/model/types/enumeration.rb +5 -3
- data/lib/expressir/model/types/generic.rb +5 -1
- data/lib/expressir/model/types/generic_entity.rb +5 -1
- data/lib/expressir/model/types/integer.rb +1 -1
- data/lib/expressir/model/types/list.rb +3 -1
- data/lib/expressir/model/types/logical.rb +1 -1
- data/lib/expressir/model/types/number.rb +1 -1
- data/lib/expressir/model/types/real.rb +3 -1
- data/lib/expressir/model/types/select.rb +5 -3
- data/lib/expressir/model/types/set.rb +3 -1
- data/lib/expressir/model/types/string.rb +3 -1
- data/lib/expressir/model/unique.rb +6 -2
- data/lib/expressir/model/variable.rb +5 -1
- data/lib/expressir/model/where.rb +5 -1
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/hyperlink.exp +8 -0
- data/original/examples/syntax/hyperlink_formatted.exp +19 -0
- data/original/examples/syntax/remark_formatted.exp +0 -5
- data/original/examples/syntax/simple.exp +3 -0
- data/original/examples/syntax/syntax.exp +197 -189
- data/original/examples/syntax/syntax_formatted.exp +362 -800
- data/spec/expressir/express_exp/{format_remark_spec.rb → formatter/remark_spec.rb} +2 -2
- data/spec/expressir/express_exp/{format_syntax_spec.rb → formatter/syntax_spec.rb} +2 -2
- data/spec/expressir/express_exp/hyperlink_formatter_spec.rb +24 -0
- data/spec/expressir/express_exp/{head_source_spec.rb → parser/head_source_spec.rb} +2 -5
- data/spec/expressir/express_exp/{parse_multiple_spec.rb → parser/multiple_spec.rb} +6 -1
- data/spec/expressir/express_exp/{parse_remark_spec.rb → parser/remark_spec.rb} +5 -5
- data/spec/expressir/express_exp/{source_spec.rb → parser/source_spec.rb} +2 -5
- data/spec/expressir/express_exp/{parse_syntax_spec.rb → parser/syntax_spec.rb} +1619 -1582
- data/spec/expressir/express_exp/schema_head_formatter_spec.rb +36 -0
- data/spec/expressir/model/{find_spec.rb → model_element/find_spec.rb} +7 -2
- data/spec/expressir/model/model_element/hash_spec.rb +66 -0
- metadata +34 -12
- data/lib/expressir/model/scope.rb +0 -66
- data/spec/expressir/express_exp/ap233_spec.rb +0 -22
@@ -1,13 +1,15 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class Binary
|
4
|
+
class Binary < ModelElement
|
5
5
|
attr_accessor :width
|
6
6
|
attr_accessor :fixed
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@width = options[:width]
|
10
10
|
@fixed = options[:fixed]
|
11
|
+
|
12
|
+
super
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class Enumeration
|
4
|
+
class Enumeration < ModelElement
|
5
5
|
attr_accessor :extensible
|
6
6
|
attr_accessor :items
|
7
7
|
attr_accessor :extension_type
|
@@ -9,9 +9,11 @@ module Expressir
|
|
9
9
|
|
10
10
|
def initialize(options = {})
|
11
11
|
@extensible = options[:extensible]
|
12
|
-
@items = options
|
12
|
+
@items = options.fetch(:items, [])
|
13
13
|
@extension_type = options[:extension_type]
|
14
|
-
@extension_items = options
|
14
|
+
@extension_items = options.fetch(:extension_items, [])
|
15
|
+
|
16
|
+
super
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -1,11 +1,15 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class Generic
|
4
|
+
class Generic < ModelElement
|
5
5
|
include Identifier
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
8
|
@id = options[:id]
|
9
|
+
@remarks = options.fetch(:remarks, [])
|
10
|
+
@source = options[:source]
|
11
|
+
|
12
|
+
super
|
9
13
|
end
|
10
14
|
end
|
11
15
|
end
|
@@ -1,11 +1,15 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class GenericEntity
|
4
|
+
class GenericEntity < ModelElement
|
5
5
|
include Identifier
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
8
|
@id = options[:id]
|
9
|
+
@remarks = options.fetch(:remarks, [])
|
10
|
+
@source = options[:source]
|
11
|
+
|
12
|
+
super
|
9
13
|
end
|
10
14
|
end
|
11
15
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class List
|
4
|
+
class List < ModelElement
|
5
5
|
attr_accessor :bound1
|
6
6
|
attr_accessor :bound2
|
7
7
|
attr_accessor :unique
|
@@ -12,6 +12,8 @@ module Expressir
|
|
12
12
|
@bound2 = options[:bound2]
|
13
13
|
@unique = options[:unique]
|
14
14
|
@base_type = options[:base_type]
|
15
|
+
|
16
|
+
super
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class Select
|
4
|
+
class Select < ModelElement
|
5
5
|
attr_accessor :extensible
|
6
6
|
attr_accessor :generic_entity
|
7
7
|
attr_accessor :items
|
@@ -11,9 +11,11 @@ module Expressir
|
|
11
11
|
def initialize(options = {})
|
12
12
|
@extensible = options[:extensible]
|
13
13
|
@generic_entity = options[:generic_entity]
|
14
|
-
@items = options
|
14
|
+
@items = options.fetch(:items, [])
|
15
15
|
@extension_type = options[:extension_type]
|
16
|
-
@extension_items = options
|
16
|
+
@extension_items = options.fetch(:extension_items, [])
|
17
|
+
|
18
|
+
super
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class Set
|
4
|
+
class Set < ModelElement
|
5
5
|
attr_accessor :bound1
|
6
6
|
attr_accessor :bound2
|
7
7
|
attr_accessor :base_type
|
@@ -10,6 +10,8 @@ module Expressir
|
|
10
10
|
@bound1 = options[:bound1]
|
11
11
|
@bound2 = options[:bound2]
|
12
12
|
@base_type = options[:base_type]
|
13
|
+
|
14
|
+
super
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Types
|
4
|
-
class String
|
4
|
+
class String < ModelElement
|
5
5
|
attr_accessor :width
|
6
6
|
attr_accessor :fixed
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@width = options[:width]
|
10
10
|
@fixed = options[:fixed]
|
11
|
+
|
12
|
+
super
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -1,14 +1,18 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Unique
|
3
|
+
class Unique < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
attr_accessor :attributes
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@id = options[:id]
|
10
|
+
@remarks = options.fetch(:remarks, [])
|
11
|
+
@source = options[:source]
|
10
12
|
|
11
|
-
@attributes = options
|
13
|
+
@attributes = options.fetch(:attributes, [])
|
14
|
+
|
15
|
+
super
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Variable
|
3
|
+
class Variable < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
attr_accessor :type
|
@@ -8,9 +8,13 @@ module Expressir
|
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
@id = options[:id]
|
11
|
+
@remarks = options.fetch(:remarks, [])
|
12
|
+
@source = options[:source]
|
11
13
|
|
12
14
|
@type = options[:type]
|
13
15
|
@expression = options[:expression]
|
16
|
+
|
17
|
+
super
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -1,14 +1,18 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Where
|
3
|
+
class Where < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
attr_accessor :expression
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@id = options[:id]
|
10
|
+
@remarks = options.fetch(:remarks, [])
|
11
|
+
@source = options[:source]
|
10
12
|
|
11
13
|
@expression = options[:expression]
|
14
|
+
|
15
|
+
super
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
data/lib/expressir/version.rb
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
SCHEMA hyperlink_schema;
|
2
|
+
ENTITY test; END_ENTITY;
|
3
|
+
ENTITY empty_entity; END_ENTITY;
|
4
|
+
ENTITY attribute_entity; test : BOOLEAN; END_ENTITY;
|
5
|
+
ENTITY subtype_empty_entity SUBTYPE OF (empty_entity); END_ENTITY;
|
6
|
+
ENTITY subtype_attribute_entity SUBTYPE OF (attribute_entity); SELF\attribute_entity.test : BOOLEAN; END_ENTITY;
|
7
|
+
ENTITY subtype_missing_entity SUBTYPE OF (missing_entity); END_ENTITY;
|
8
|
+
END_SCHEMA;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
SCHEMA hyperlink_schema;
|
2
|
+
ENTITY test;
|
3
|
+
END_ENTITY;
|
4
|
+
ENTITY empty_entity;
|
5
|
+
END_ENTITY;
|
6
|
+
ENTITY attribute_entity;
|
7
|
+
test : BOOLEAN;
|
8
|
+
END_ENTITY;
|
9
|
+
ENTITY subtype_empty_entity
|
10
|
+
SUBTYPE OF ({{{<<express:hyperlink_schema.empty_entity,empty_entity>>}}});
|
11
|
+
END_ENTITY;
|
12
|
+
ENTITY subtype_attribute_entity
|
13
|
+
SUBTYPE OF ({{{<<express:hyperlink_schema.attribute_entity,attribute_entity>>}}});
|
14
|
+
SELF\{{{<<express:hyperlink_schema.attribute_entity,attribute_entity>>}}}.test : BOOLEAN;
|
15
|
+
END_ENTITY;
|
16
|
+
ENTITY subtype_missing_entity
|
17
|
+
SUBTYPE OF (missing_entity);
|
18
|
+
END_ENTITY;
|
19
|
+
END_SCHEMA;
|
@@ -6,7 +6,6 @@ TYPE remark_type = ENUMERATION OF (remark_enumeration_item);
|
|
6
6
|
WHERE
|
7
7
|
WR1 : TRUE;
|
8
8
|
END_TYPE;
|
9
|
-
|
10
9
|
ENTITY remark_entity;
|
11
10
|
remark_attribute : STRING;
|
12
11
|
DERIVE
|
@@ -18,10 +17,8 @@ ENTITY remark_entity;
|
|
18
17
|
WHERE
|
19
18
|
WR1 : TRUE;
|
20
19
|
END_ENTITY;
|
21
|
-
|
22
20
|
SUBTYPE_CONSTRAINT remark_subtype_constraint FOR remark_entity;
|
23
21
|
END_SUBTYPE_CONSTRAINT;
|
24
|
-
|
25
22
|
FUNCTION remark_function(remark_parameter : STRING) : BOOLEAN;
|
26
23
|
TYPE remark_type = ENUMERATION OF (remark_enumeration_item);
|
27
24
|
END_TYPE;
|
@@ -43,7 +40,6 @@ FUNCTION remark_function(remark_parameter : STRING) : BOOLEAN;
|
|
43
40
|
--"remark_query" function query scope - function query
|
44
41
|
);
|
45
42
|
END_FUNCTION;
|
46
|
-
|
47
43
|
PROCEDURE remark_procedure(remark_parameter : STRING);
|
48
44
|
TYPE remark_type = ENUMERATION OF (remark_enumeration_item);
|
49
45
|
END_TYPE;
|
@@ -65,7 +61,6 @@ PROCEDURE remark_procedure(remark_parameter : STRING);
|
|
65
61
|
--"remark_query" procedure query scope - procedure query
|
66
62
|
);
|
67
63
|
END_PROCEDURE;
|
68
|
-
|
69
64
|
RULE remark_rule FOR (remark_entity);
|
70
65
|
TYPE remark_type = ENUMERATION OF (remark_enumeration_item);
|
71
66
|
END_TYPE;
|
@@ -31,23 +31,23 @@ ENTITY attribute_entity; test : BOOLEAN; END_ENTITY;
|
|
31
31
|
ENTITY attribute_optional_entity; test : OPTIONAL BOOLEAN; END_ENTITY;
|
32
32
|
ENTITY attribute_multiple_entity; test : BOOLEAN; test2 : BOOLEAN; END_ENTITY;
|
33
33
|
ENTITY attribute_multiple_shorthand_entity; test, test2 : BOOLEAN; END_ENTITY;
|
34
|
-
ENTITY attribute_redeclared_entity; SELF\attribute_entity.test : BOOLEAN; END_ENTITY;
|
35
|
-
ENTITY attribute_redeclared_renamed_entity; SELF\attribute_entity.test RENAMED 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
36
|
ENTITY derived_attribute_entity; DERIVE test : BOOLEAN := TRUE; END_ENTITY;
|
37
|
-
ENTITY derived_attribute_redeclared_entity; DERIVE SELF\attribute_entity.test : BOOLEAN := TRUE; END_ENTITY;
|
38
|
-
ENTITY derived_attribute_redeclared_renamed_entity; DERIVE SELF\attribute_entity.test RENAMED test2 : 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
39
|
ENTITY inverse_attribute_entity; INVERSE test : attribute_entity FOR test; END_ENTITY;
|
40
40
|
ENTITY inverse_attribute_entity_entity; INVERSE test : attribute_entity FOR attribute_entity.test; END_ENTITY;
|
41
41
|
ENTITY inverse_attribute_set_entity; INVERSE test : SET OF attribute_entity FOR test; END_ENTITY;
|
42
42
|
ENTITY inverse_attribute_set_bound_entity; INVERSE test : SET [1:9] OF attribute_entity FOR test; END_ENTITY;
|
43
43
|
ENTITY inverse_attribute_bag_entity; INVERSE test : BAG OF attribute_entity FOR test; END_ENTITY;
|
44
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; INVERSE SELF\attribute_entity.test : attribute_entity FOR test; END_ENTITY;
|
46
|
-
ENTITY inverse_attribute_redeclared_renamed_entity; INVERSE SELF\attribute_entity.test RENAMED test2 : 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
47
|
ENTITY unique_entity; test : BOOLEAN; UNIQUE test; END_ENTITY;
|
48
48
|
ENTITY unique_label_entity; test : BOOLEAN; UNIQUE UR1 : test; END_ENTITY;
|
49
|
-
ENTITY
|
50
|
-
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
51
|
ENTITY where_entity; WHERE TRUE; END_ENTITY;
|
52
52
|
ENTITY where_label_entity; WHERE WR1 : TRUE; END_ENTITY;
|
53
53
|
|
@@ -119,197 +119,205 @@ RULE multiple_shorthand_variable_expression_rule FOR (empty_entity); LOCAL test,
|
|
119
119
|
RULE statement_rule FOR (empty_entity); ; WHERE TRUE; END_RULE;
|
120
120
|
RULE where_label_rule FOR (empty_entity); WHERE WR1 : TRUE; END_RULE;
|
121
121
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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;
|
135
161
|
|
136
|
-
|
137
|
-
|
138
|
-
TYPE
|
139
|
-
TYPE
|
140
|
-
TYPE
|
141
|
-
TYPE
|
142
|
-
TYPE
|
143
|
-
TYPE
|
144
|
-
TYPE
|
145
|
-
TYPE
|
146
|
-
TYPE
|
147
|
-
TYPE
|
148
|
-
TYPE
|
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;
|
149
176
|
|
150
|
-
--
|
151
|
-
TYPE
|
152
|
-
TYPE
|
153
|
-
TYPE
|
154
|
-
TYPE
|
155
|
-
TYPE
|
156
|
-
TYPE
|
157
|
-
TYPE
|
158
|
-
TYPE
|
159
|
-
TYPE
|
160
|
-
TYPE
|
161
|
-
TYPE
|
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;
|
162
190
|
|
163
|
-
--
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
FUNCTION case_multiple_shorthand_statement : BOOLEAN; CASE test OF TRUE, TRUE : ; END_CASE; END_FUNCTION;
|
177
|
-
FUNCTION case_otherwise_statement : BOOLEAN; CASE test OF TRUE : ; OTHERWISE : ; END_CASE; END_FUNCTION;
|
178
|
-
FUNCTION compound_statement : BOOLEAN; BEGIN ; END; END_FUNCTION;
|
179
|
-
FUNCTION escape_statement : BOOLEAN; ESCAPE; END_FUNCTION;
|
180
|
-
FUNCTION if_statement : BOOLEAN; IF TRUE THEN ; END_IF; END_FUNCTION;
|
181
|
-
FUNCTION if2_statement : BOOLEAN; IF TRUE THEN ; ; END_IF; END_FUNCTION;
|
182
|
-
FUNCTION if_else_statement : BOOLEAN; IF TRUE THEN ; ELSE ; END_IF; END_FUNCTION;
|
183
|
-
FUNCTION if2_else_statement : BOOLEAN; IF TRUE THEN ; ; ELSE ; END_IF; END_FUNCTION;
|
184
|
-
FUNCTION if_else2_statement : BOOLEAN; IF TRUE THEN ; ELSE ; ; END_IF; END_FUNCTION;
|
185
|
-
FUNCTION if2_else2_statement : BOOLEAN; IF TRUE THEN ; ; ELSE ; ; END_IF; END_FUNCTION;
|
186
|
-
FUNCTION null_statement : BOOLEAN; ; END_FUNCTION;
|
187
|
-
FUNCTION call_statement : BOOLEAN; empty_procedure; END_FUNCTION;
|
188
|
-
FUNCTION call_parameter_statement : BOOLEAN; empty_procedure(TRUE); END_FUNCTION;
|
189
|
-
FUNCTION call_parameter2_statement : BOOLEAN; empty_procedure(TRUE, TRUE); END_FUNCTION;
|
190
|
-
FUNCTION call_insert_statement : BOOLEAN; INSERT(TRUE); END_FUNCTION;
|
191
|
-
FUNCTION call_remove_statement : BOOLEAN; REMOVE(TRUE); END_FUNCTION;
|
192
|
-
FUNCTION repeat_statement : BOOLEAN; REPEAT; ; END_REPEAT; END_FUNCTION;
|
193
|
-
FUNCTION repeat_variable_statement : BOOLEAN; REPEAT test := 1 TO 9; ; END_REPEAT; END_FUNCTION;
|
194
|
-
FUNCTION repeat_variable_increment_statement : BOOLEAN; REPEAT test := 1 TO 9 BY 2; ; END_REPEAT; END_FUNCTION;
|
195
|
-
FUNCTION repeat_while_statement : BOOLEAN; REPEAT WHILE TRUE; ; END_REPEAT; END_FUNCTION;
|
196
|
-
FUNCTION repeat_until_statement : BOOLEAN; REPEAT UNTIL TRUE; ; END_REPEAT; END_FUNCTION;
|
197
|
-
FUNCTION return_statement : BOOLEAN; RETURN; END_FUNCTION;
|
198
|
-
FUNCTION return_expression_statement : BOOLEAN; RETURN (TRUE); END_FUNCTION;
|
199
|
-
FUNCTION skip_statement : BOOLEAN; SKIP; END_FUNCTION;
|
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_list_type = SELECT (empty_type); END_TYPE;
|
196
|
+
TYPE select_extension_type_ref_type = SELECT BASED_ON select_type; END_TYPE;
|
197
|
+
TYPE select_extension_type_ref_list_type = SELECT BASED_ON select_type WITH (empty_type); END_TYPE;
|
198
|
+
TYPE enumeration_type = ENUMERATION; END_TYPE;
|
199
|
+
TYPE enumeration_extensible_type = EXTENSIBLE ENUMERATION; END_TYPE;
|
200
|
+
TYPE enumeration_list_type = ENUMERATION OF (test); END_TYPE;
|
201
|
+
TYPE enumeration_extension_type_ref_type = ENUMERATION BASED_ON enumeration_type; END_TYPE;
|
202
|
+
TYPE enumeration_extension_type_ref_list_type = ENUMERATION BASED_ON enumeration_type WITH (test); END_TYPE;
|
203
|
+
END_PROCEDURE;
|
200
204
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
205
|
+
PROCEDURE expressions;
|
206
|
+
LOCAL
|
207
|
+
-- literal expressions
|
208
|
+
binary_expression : BOOLEAN := %011110000111100001111000;
|
209
|
+
integer_expression : BOOLEAN := 999;
|
210
|
+
true_logical_expression : BOOLEAN := TRUE;
|
211
|
+
false_logical_expression : BOOLEAN := FALSE;
|
212
|
+
unknown_logical_expression : BOOLEAN := UNKNOWN;
|
213
|
+
real_expression : BOOLEAN := 999.999;
|
214
|
+
simple_string_expression : BOOLEAN := 'xxx';
|
215
|
+
utf8_simple_string_expression : BOOLEAN := 'UTF8 test: Příliš žluťoučký kůň úpěl ďábelské ódy.';
|
216
|
+
encoded_string_expression : BOOLEAN := "000000780000007800000078";
|
211
217
|
|
212
|
-
-- constant expressions
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
218
|
+
-- constant expressions
|
219
|
+
const_e_expression : BOOLEAN := CONST_E;
|
220
|
+
indeterminate_expression : BOOLEAN := ?;
|
221
|
+
pi_expression : BOOLEAN := PI;
|
222
|
+
self_expression : BOOLEAN := SELF;
|
217
223
|
|
218
|
-
-- function expressions
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
224
|
+
-- function expressions
|
225
|
+
abs_expression : BOOLEAN := ABS(TRUE);
|
226
|
+
acos_expression : BOOLEAN := ACOS(TRUE);
|
227
|
+
asin_expression : BOOLEAN := ASIN(TRUE);
|
228
|
+
atan_expression : BOOLEAN := ATAN(TRUE);
|
229
|
+
blength_expression : BOOLEAN := BLENGTH(TRUE);
|
230
|
+
cos_expression : BOOLEAN := COS(TRUE);
|
231
|
+
exists_expression : BOOLEAN := EXISTS(TRUE);
|
232
|
+
exp_expression : BOOLEAN := EXP(TRUE);
|
233
|
+
format_expression : BOOLEAN := FORMAT(TRUE);
|
234
|
+
hibound_expression : BOOLEAN := HIBOUND(TRUE);
|
235
|
+
hiindex_expression : BOOLEAN := HIINDEX(TRUE);
|
236
|
+
length_expression : BOOLEAN := LENGTH(TRUE);
|
237
|
+
lobound_expression : BOOLEAN := LOBOUND(TRUE);
|
238
|
+
loindex_expression : BOOLEAN := LOINDEX(TRUE);
|
239
|
+
log_expression : BOOLEAN := LOG(TRUE);
|
240
|
+
log2_expression : BOOLEAN := LOG2(TRUE);
|
241
|
+
log10_expression : BOOLEAN := LOG10(TRUE);
|
242
|
+
nvl_expression : BOOLEAN := NVL(TRUE);
|
243
|
+
odd_expression : BOOLEAN := ODD(TRUE);
|
244
|
+
rolesof_expression : BOOLEAN := ROLESOF(TRUE);
|
245
|
+
sin_expression : BOOLEAN := SIN(TRUE);
|
246
|
+
sizeof_expression : BOOLEAN := SIZEOF(TRUE);
|
247
|
+
sqrt_expression : BOOLEAN := SQRT(TRUE);
|
248
|
+
tan_expression : BOOLEAN := TAN(TRUE);
|
249
|
+
typeof_expression : BOOLEAN := TYPEOF(TRUE);
|
250
|
+
usedin_expression : BOOLEAN := USEDIN(TRUE);
|
251
|
+
value_expression : BOOLEAN := VALUE(TRUE);
|
252
|
+
value_in_expression : BOOLEAN := VALUE_IN(TRUE);
|
253
|
+
value_unique_expression : BOOLEAN := VALUE_UNIQUE(TRUE);
|
248
254
|
|
249
|
-
-- operator expressions
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
255
|
+
-- operator expressions
|
256
|
+
plus_expression : BOOLEAN := +4;
|
257
|
+
plus_addition_expression : BOOLEAN := +(4 + 2);
|
258
|
+
minus_expression : BOOLEAN := -4;
|
259
|
+
minus_addition_expression : BOOLEAN := -(4 + 2);
|
260
|
+
addition_expression : BOOLEAN := 4 + 2;
|
261
|
+
subtraction_expression : BOOLEAN := 4 - 2;
|
262
|
+
multiplication_expression : BOOLEAN := 4 * 2;
|
263
|
+
real_division_expression : BOOLEAN := 4 / 2;
|
264
|
+
integer_division_expression : BOOLEAN := 4 DIV 2;
|
265
|
+
modulo_expression : BOOLEAN := 4 MOD 2;
|
266
|
+
exponentiation_expression : BOOLEAN := 4 ** 2;
|
267
|
+
addition_addition_expression : BOOLEAN := 4 + 2 + 1;
|
268
|
+
subtraction_subtraction_expression : BOOLEAN := 4 - 2 - 1;
|
269
|
+
addition_subtraction_expression : BOOLEAN := 4 + 2 - 1;
|
270
|
+
subtraction_addition_expression : BOOLEAN := 4 - 2 + 1;
|
271
|
+
addition_multiplication_expression : BOOLEAN := 8 + 4 * 2;
|
272
|
+
multiplication_addition_expression : BOOLEAN := 8 * 4 + 2;
|
273
|
+
parenthesis_addition_multiplication_expression : BOOLEAN := (8 + 4) * 2;
|
274
|
+
multiplication_parenthesis_addition_expression : BOOLEAN := 8 * (4 + 2);
|
275
|
+
equal_expression : BOOLEAN := 4 = 2;
|
276
|
+
not_equal_expression : BOOLEAN := 4 <> 2;
|
277
|
+
instance_equal_expression : BOOLEAN := 4 :=: 2;
|
278
|
+
instance_not_equal_expression : BOOLEAN := 4 :<>: 2;
|
279
|
+
lt_expression : BOOLEAN := 4 < 2;
|
280
|
+
gt_expression : BOOLEAN := 4 > 2;
|
281
|
+
lte_expression : BOOLEAN := 4 <= 2;
|
282
|
+
gte_expression : BOOLEAN := 4 >= 2;
|
283
|
+
not_expression : BOOLEAN := NOT TRUE;
|
284
|
+
not_or_expression : BOOLEAN := NOT (TRUE OR FALSE);
|
285
|
+
or_expression : BOOLEAN := TRUE OR FALSE;
|
286
|
+
and_expression : BOOLEAN := TRUE AND FALSE;
|
287
|
+
or_or_expression : BOOLEAN := TRUE OR FALSE OR TRUE;
|
288
|
+
and_and_expression : BOOLEAN := TRUE AND FALSE AND TRUE;
|
289
|
+
or_and_expression : BOOLEAN := TRUE OR FALSE AND TRUE;
|
290
|
+
and_or_expression : BOOLEAN := TRUE AND FALSE OR TRUE;
|
291
|
+
parenthesis_or_and_expression : BOOLEAN := (TRUE OR FALSE) AND TRUE;
|
292
|
+
and_parenthesis_or_expression : BOOLEAN := TRUE AND (FALSE OR TRUE);
|
293
|
+
combine_expression : BOOLEAN := test || test2;
|
294
|
+
in_expression : BOOLEAN := TRUE IN [TRUE];
|
295
|
+
like_expression : BOOLEAN := 'xxx' LIKE 'xxx';
|
290
296
|
|
291
|
-
-- aggregate initializer expressions
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
297
|
+
-- aggregate initializer expressions
|
298
|
+
aggregate_initializer_expression : BOOLEAN := [4];
|
299
|
+
repeated_aggregate_initializer_expression : BOOLEAN := [4:2];
|
300
|
+
complex_aggregate_initializer_expression : BOOLEAN := [4 + 2];
|
301
|
+
complex_repeated_aggregate_initializer_expression : BOOLEAN := [4 + 2:4 + 2];
|
296
302
|
|
297
|
-
-- function call or entity constructor expressions
|
298
|
-
|
303
|
+
-- function call or entity constructor expressions
|
304
|
+
call_expression : BOOLEAN := parameter_function(TRUE);
|
299
305
|
|
300
|
-
-- reference expressions
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
+
-- reference expressions
|
307
|
+
simple_reference_expression : BOOLEAN := test;
|
308
|
+
group_reference_expression : BOOLEAN := test\test2;
|
309
|
+
index_reference_expression : BOOLEAN := test[1];
|
310
|
+
index2_reference_expression : BOOLEAN := test[1:9];
|
311
|
+
attribute_reference_expression : BOOLEAN := test.test2;
|
306
312
|
|
307
|
-
-- interval expressions
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
313
|
+
-- interval expressions
|
314
|
+
lt_lt_interval_expression : BOOLEAN := {1 < 5 < 9};
|
315
|
+
lte_lt_interval_expression : BOOLEAN := {1 <= 5 < 9};
|
316
|
+
lt_lte_interval_expression : BOOLEAN := {1 < 5 <= 9};
|
317
|
+
lte_lte_interval_expression : BOOLEAN := {1 <= 5 <= 9};
|
312
318
|
|
313
|
-
-- query expressions
|
314
|
-
|
319
|
+
-- query expressions
|
320
|
+
query_expression : BOOLEAN := QUERY(test <* test2 | TRUE);
|
321
|
+
END_LOCAL;
|
322
|
+
END_PROCEDURE;
|
315
323
|
END_SCHEMA;
|