expressir 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +15 -1
- data/Gemfile +0 -1
- data/exe/{format-test → expressir-format-test} +1 -1
- data/expressir.gemspec +2 -2
- data/lib/expressir/liquid/cache_drop.rb +20 -0
- data/lib/expressir/liquid/data_type_drop.rb +8 -0
- data/lib/expressir/liquid/data_types/aggregate_drop.rb +21 -0
- data/lib/expressir/liquid/data_types/array_drop.rb +34 -0
- data/lib/expressir/liquid/data_types/bag_drop.rb +26 -0
- data/lib/expressir/liquid/data_types/binary_drop.rb +22 -0
- data/lib/expressir/liquid/data_types/boolean_drop.rb +10 -0
- data/lib/expressir/liquid/data_types/enumeration_drop.rb +30 -0
- data/lib/expressir/liquid/data_types/enumeration_item_drop.rb +17 -0
- data/lib/expressir/liquid/data_types/generic_drop.rb +17 -0
- data/lib/expressir/liquid/data_types/generic_entity_drop.rb +17 -0
- data/lib/expressir/liquid/data_types/integer_drop.rb +10 -0
- data/lib/expressir/liquid/data_types/list_drop.rb +30 -0
- data/lib/expressir/liquid/data_types/logical_drop.rb +10 -0
- data/lib/expressir/liquid/data_types/number_drop.rb +10 -0
- data/lib/expressir/liquid/data_types/real_drop.rb +18 -0
- data/lib/expressir/liquid/data_types/select_drop.rb +34 -0
- data/lib/expressir/liquid/data_types/set_drop.rb +26 -0
- data/lib/expressir/liquid/data_types/string_drop.rb +22 -0
- data/lib/expressir/liquid/declaration_drop.rb +8 -0
- data/lib/expressir/liquid/declarations/attribute_drop.rb +37 -0
- data/lib/expressir/liquid/declarations/constant_drop.rb +25 -0
- data/lib/expressir/liquid/declarations/entity_drop.rb +65 -0
- data/lib/expressir/liquid/declarations/function_drop.rb +93 -0
- data/lib/expressir/liquid/declarations/interface_drop.rb +30 -0
- data/lib/expressir/liquid/declarations/interface_item_drop.rb +22 -0
- data/lib/expressir/liquid/declarations/interfaced_item_drop.rb +34 -0
- data/lib/expressir/liquid/declarations/parameter_drop.rb +25 -0
- data/lib/expressir/liquid/declarations/procedure_drop.rb +89 -0
- data/lib/expressir/liquid/declarations/remark_item_drop.rb +22 -0
- data/lib/expressir/liquid/declarations/rule_drop.rb +105 -0
- data/lib/expressir/liquid/declarations/schema_drop.rb +91 -0
- data/lib/expressir/liquid/declarations/schema_version_drop.rb +26 -0
- data/lib/expressir/liquid/declarations/schema_version_item_drop.rb +22 -0
- data/lib/expressir/liquid/declarations/subtype_constraint_drop.rb +37 -0
- data/lib/expressir/liquid/declarations/type_drop.rb +37 -0
- data/lib/expressir/liquid/declarations/unique_rule_drop.rb +21 -0
- data/lib/expressir/liquid/declarations/variable_drop.rb +25 -0
- data/lib/expressir/liquid/declarations/where_rule_drop.rb +21 -0
- data/lib/expressir/liquid/expression_drop.rb +8 -0
- data/lib/expressir/liquid/expressions/aggregate_initializer_drop.rb +24 -0
- data/lib/expressir/liquid/expressions/aggregate_initializer_item_drop.rb +22 -0
- data/lib/expressir/liquid/expressions/binary_expression_drop.rb +26 -0
- data/lib/expressir/liquid/expressions/entity_constructor_drop.rb +26 -0
- data/lib/expressir/liquid/expressions/function_call_drop.rb +26 -0
- data/lib/expressir/liquid/expressions/interval_drop.rb +34 -0
- data/lib/expressir/liquid/expressions/query_expression_drop.rb +25 -0
- data/lib/expressir/liquid/expressions/unary_expression_drop.rb +22 -0
- data/lib/expressir/liquid/identifier_drop.rb +33 -0
- data/lib/expressir/liquid/literal_drop.rb +8 -0
- data/lib/expressir/liquid/literals/binary_drop.rb +18 -0
- data/lib/expressir/liquid/literals/integer_drop.rb +18 -0
- data/lib/expressir/liquid/literals/logical_drop.rb +18 -0
- data/lib/expressir/liquid/literals/real_drop.rb +18 -0
- data/lib/expressir/liquid/literals/string_drop.rb +22 -0
- data/lib/expressir/liquid/model_element_drop.rb +33 -0
- data/lib/expressir/liquid/reference_drop.rb +8 -0
- data/lib/expressir/liquid/references/attribute_reference_drop.rb +22 -0
- data/lib/expressir/liquid/references/group_reference_drop.rb +22 -0
- data/lib/expressir/liquid/references/index_reference_drop.rb +26 -0
- data/lib/expressir/liquid/references/simple_reference_drop.rb +22 -0
- data/lib/expressir/liquid/repository_drop.rb +22 -0
- data/lib/expressir/liquid/statement_drop.rb +8 -0
- data/lib/expressir/liquid/statements/alias_drop.rb +29 -0
- data/lib/expressir/liquid/statements/assignment_drop.rb +22 -0
- data/lib/expressir/liquid/statements/case_action_drop.rb +26 -0
- data/lib/expressir/liquid/statements/case_drop.rb +30 -0
- data/lib/expressir/liquid/statements/compound_drop.rb +22 -0
- data/lib/expressir/liquid/statements/escape_drop.rb +10 -0
- data/lib/expressir/liquid/statements/if_drop.rb +34 -0
- data/lib/expressir/liquid/statements/null_drop.rb +10 -0
- data/lib/expressir/liquid/statements/procedure_call_drop.rb +26 -0
- data/lib/expressir/liquid/statements/repeat_drop.rb +45 -0
- data/lib/expressir/liquid/statements/return_drop.rb +18 -0
- data/lib/expressir/liquid/statements/skip_drop.rb +10 -0
- data/lib/expressir/liquid/supertype_expression_drop.rb +8 -0
- data/lib/expressir/liquid/supertype_expressions/binary_supertype_expression_drop.rb +26 -0
- data/lib/expressir/liquid/supertype_expressions/oneof_supertype_expression_drop.rb +22 -0
- data/lib/expressir/liquid.rb +18 -0
- data/lib/expressir/model/model_element.rb +7 -0
- data/lib/expressir/version.rb +1 -1
- data/lib/expressir.rb +2 -0
- metadata +98 -8
- /data/exe/{format → expressir-format} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class FunctionDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def parameters
|
|
16
|
+
return [] unless @model.parameters
|
|
17
|
+
|
|
18
|
+
@model.parameters.map do |item|
|
|
19
|
+
::Expressir::Liquid::Declarations::ParameterDrop.new(item)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def return_type
|
|
24
|
+
drop_klass_by_model(@model.return_type)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def types
|
|
28
|
+
return [] unless @model.types
|
|
29
|
+
|
|
30
|
+
@model.types.map do |item|
|
|
31
|
+
::Expressir::Liquid::Declarations::TypeDrop.new(item)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def entities
|
|
36
|
+
return [] unless @model.entities
|
|
37
|
+
|
|
38
|
+
@model.entities.map do |item|
|
|
39
|
+
::Expressir::Liquid::Declarations::EntityDrop.new(item)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def subtype_constraints
|
|
44
|
+
return [] unless @model.subtype_constraints
|
|
45
|
+
|
|
46
|
+
@model.subtype_constraints.map do |item|
|
|
47
|
+
::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def functions
|
|
52
|
+
return [] unless @model.functions
|
|
53
|
+
|
|
54
|
+
@model.functions.map do |item|
|
|
55
|
+
::Expressir::Liquid::Declarations::FunctionDrop.new(item)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def procedures
|
|
60
|
+
return [] unless @model.procedures
|
|
61
|
+
|
|
62
|
+
@model.procedures.map do |item|
|
|
63
|
+
::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def constants
|
|
68
|
+
return [] unless @model.constants
|
|
69
|
+
|
|
70
|
+
@model.constants.map do |item|
|
|
71
|
+
::Expressir::Liquid::Declarations::ConstantDrop.new(item)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def variables
|
|
76
|
+
return [] unless @model.variables
|
|
77
|
+
|
|
78
|
+
@model.variables.map do |item|
|
|
79
|
+
::Expressir::Liquid::Declarations::VariableDrop.new(item)
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def statements
|
|
84
|
+
return [] unless @model.statements
|
|
85
|
+
|
|
86
|
+
@model.statements.map do |item|
|
|
87
|
+
::Expressir::Liquid::StatementDrop.new(item)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class InterfaceDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
def initialize(model)
|
|
8
|
+
@model = model
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def kind
|
|
13
|
+
@model.kind
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def schema
|
|
17
|
+
drop_klass_by_model(@model.schema)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def items
|
|
21
|
+
return [] unless @model.items
|
|
22
|
+
|
|
23
|
+
@model.items.map do |item|
|
|
24
|
+
::Expressir::Liquid::Declarations::InterfaceItemDrop.new(item)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class InterfaceItemDrop < ::Expressir::Liquid::ModelElementDrop
|
|
7
|
+
def initialize(model)
|
|
8
|
+
@model = model
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def ref
|
|
13
|
+
drop_klass_by_model(@model.ref)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def id
|
|
17
|
+
@model.id
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class InterfacedItemDrop < ::Expressir::Liquid::ModelElementDrop
|
|
7
|
+
def initialize(model)
|
|
8
|
+
@model = model
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def id
|
|
13
|
+
@model.id
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def remarks
|
|
17
|
+
@model.remarks || []
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def remark_items
|
|
21
|
+
return [] unless @model.remark_items
|
|
22
|
+
|
|
23
|
+
@model.remark_items.map do |item|
|
|
24
|
+
::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def base_item
|
|
29
|
+
::Expressir::Liquid::ModelElementDrop.new(@model.base_item)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class ParameterDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def var
|
|
16
|
+
@model.var
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def type
|
|
20
|
+
drop_klass_by_model(@model.type)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class ProcedureDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def parameters
|
|
16
|
+
return [] unless @model.parameters
|
|
17
|
+
|
|
18
|
+
@model.parameters.map do |item|
|
|
19
|
+
::Expressir::Liquid::Declarations::ParameterDrop.new(item)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def types
|
|
24
|
+
return [] unless @model.types
|
|
25
|
+
|
|
26
|
+
@model.types.map do |item|
|
|
27
|
+
::Expressir::Liquid::Declarations::TypeDrop.new(item)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def entities
|
|
32
|
+
return [] unless @model.entities
|
|
33
|
+
|
|
34
|
+
@model.entities.map do |item|
|
|
35
|
+
::Expressir::Liquid::Declarations::EntityDrop.new(item)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def subtype_constraints
|
|
40
|
+
return [] unless @model.subtype_constraints
|
|
41
|
+
|
|
42
|
+
@model.subtype_constraints.map do |item|
|
|
43
|
+
::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def functions
|
|
48
|
+
return [] unless @model.functions
|
|
49
|
+
|
|
50
|
+
@model.functions.map do |item|
|
|
51
|
+
::Expressir::Liquid::Declarations::FunctionDrop.new(item)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def procedures
|
|
56
|
+
return [] unless @model.procedures
|
|
57
|
+
|
|
58
|
+
@model.procedures.map do |item|
|
|
59
|
+
::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def constants
|
|
64
|
+
return [] unless @model.constants
|
|
65
|
+
|
|
66
|
+
@model.constants.map do |item|
|
|
67
|
+
::Expressir::Liquid::Declarations::ConstantDrop.new(item)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def variables
|
|
72
|
+
return [] unless @model.variables
|
|
73
|
+
|
|
74
|
+
@model.variables.map do |item|
|
|
75
|
+
::Expressir::Liquid::Declarations::VariableDrop.new(item)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def statements
|
|
80
|
+
return [] unless @model.statements
|
|
81
|
+
|
|
82
|
+
@model.statements.map do |item|
|
|
83
|
+
::Expressir::Liquid::StatementDrop.new(item)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class RemarkItemDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
def initialize(model)
|
|
8
|
+
@model = model
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def id
|
|
13
|
+
@model.id
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def remarks
|
|
17
|
+
@model.remarks || []
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class RuleDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def applies_to
|
|
16
|
+
return [] unless @model.applies_to
|
|
17
|
+
|
|
18
|
+
@model.applies_to.map do |item|
|
|
19
|
+
drop_klass_by_model(item)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def types
|
|
24
|
+
return [] unless @model.types
|
|
25
|
+
|
|
26
|
+
@model.types.map do |item|
|
|
27
|
+
::Expressir::Liquid::Declarations::TypeDrop.new(item)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def entities
|
|
32
|
+
return [] unless @model.entities
|
|
33
|
+
|
|
34
|
+
@model.entities.map do |item|
|
|
35
|
+
::Expressir::Liquid::Declarations::EntityDrop.new(item)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def subtype_constraints
|
|
40
|
+
return [] unless @model.subtype_constraints
|
|
41
|
+
|
|
42
|
+
@model.subtype_constraints.map do |item|
|
|
43
|
+
::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def functions
|
|
48
|
+
return [] unless @model.functions
|
|
49
|
+
|
|
50
|
+
@model.functions.map do |item|
|
|
51
|
+
::Expressir::Liquid::Declarations::FunctionDrop.new(item)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def procedures
|
|
56
|
+
return [] unless @model.procedures
|
|
57
|
+
|
|
58
|
+
@model.procedures.map do |item|
|
|
59
|
+
::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def constants
|
|
64
|
+
return [] unless @model.constants
|
|
65
|
+
|
|
66
|
+
@model.constants.map do |item|
|
|
67
|
+
::Expressir::Liquid::Declarations::ConstantDrop.new(item)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def variables
|
|
72
|
+
return [] unless @model.variables
|
|
73
|
+
|
|
74
|
+
@model.variables.map do |item|
|
|
75
|
+
::Expressir::Liquid::Declarations::VariableDrop.new(item)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def statements
|
|
80
|
+
return [] unless @model.statements
|
|
81
|
+
|
|
82
|
+
@model.statements.map do |item|
|
|
83
|
+
::Expressir::Liquid::StatementDrop.new(item)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def where_rules
|
|
88
|
+
return [] unless @model.where_rules
|
|
89
|
+
|
|
90
|
+
@model.where_rules.map do |item|
|
|
91
|
+
::Expressir::Liquid::Declarations::WhereRuleDrop.new(item)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def informal_propositions
|
|
96
|
+
return [] unless @model.informal_propositions
|
|
97
|
+
|
|
98
|
+
@model.informal_propositions.map do |item|
|
|
99
|
+
::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class SchemaDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def file
|
|
16
|
+
@model.file
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def version
|
|
20
|
+
::Expressir::Liquid::Declarations::SchemaVersionDrop.new(
|
|
21
|
+
@model.version,
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def interfaces
|
|
26
|
+
return [] unless @model.interfaces
|
|
27
|
+
|
|
28
|
+
@model.interfaces.map do |item|
|
|
29
|
+
::Expressir::Liquid::Declarations::InterfaceDrop.new(item)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def constants
|
|
34
|
+
return [] unless @model.constants
|
|
35
|
+
|
|
36
|
+
@model.constants.map do |item|
|
|
37
|
+
::Expressir::Liquid::Declarations::ConstantDrop.new(item)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def types
|
|
42
|
+
return [] unless @model.types
|
|
43
|
+
|
|
44
|
+
@model.types.map do |item|
|
|
45
|
+
::Expressir::Liquid::Declarations::TypeDrop.new(item)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def entities
|
|
50
|
+
return [] unless @model.entities
|
|
51
|
+
|
|
52
|
+
@model.entities.map do |item|
|
|
53
|
+
::Expressir::Liquid::Declarations::EntityDrop.new(item)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def subtype_constraints
|
|
58
|
+
return [] unless @model.subtype_constraints
|
|
59
|
+
|
|
60
|
+
@model.subtype_constraints.map do |item|
|
|
61
|
+
::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def functions
|
|
66
|
+
return [] unless @model.functions
|
|
67
|
+
|
|
68
|
+
@model.functions.map do |item|
|
|
69
|
+
::Expressir::Liquid::Declarations::FunctionDrop.new(item)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def rules
|
|
74
|
+
return [] unless @model.rules
|
|
75
|
+
|
|
76
|
+
@model.rules.map do |item|
|
|
77
|
+
::Expressir::Liquid::Declarations::RuleDrop.new(item)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def procedures
|
|
82
|
+
return [] unless @model.procedures
|
|
83
|
+
|
|
84
|
+
@model.procedures.map do |item|
|
|
85
|
+
::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class SchemaVersionDrop < ::Expressir::Liquid::ModelElementDrop
|
|
7
|
+
def initialize(model)
|
|
8
|
+
@model = model
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def value
|
|
13
|
+
@model.value
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def items
|
|
17
|
+
return [] unless @model.items
|
|
18
|
+
|
|
19
|
+
@model.items.map do |item|
|
|
20
|
+
::Expressir::Liquid::Declarations::SchemaVersionItemDrop.new(item)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class SchemaVersionItemDrop < ::Expressir::Liquid::ModelElementDrop
|
|
7
|
+
def initialize(model)
|
|
8
|
+
@model = model
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def name
|
|
13
|
+
@model.name
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def value
|
|
17
|
+
@model.value
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class SubtypeConstraintDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def applies_to
|
|
16
|
+
drop_klass_by_model(@model.applies_to)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def abstract
|
|
20
|
+
@model.abstract
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def total_over
|
|
24
|
+
return [] unless @model.total_over
|
|
25
|
+
|
|
26
|
+
@model.total_over.map do |item|
|
|
27
|
+
drop_klass_by_model(item)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def supertype_expression
|
|
32
|
+
drop_klass_by_model(@model.supertype_expression)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class TypeDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def underlying_type
|
|
16
|
+
drop_klass_by_model(@model.underlying_type)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def where_rules
|
|
20
|
+
return [] unless @model.where_rules
|
|
21
|
+
|
|
22
|
+
@model.where_rules.map do |item|
|
|
23
|
+
::Expressir::Liquid::Declarations::WhereRuleDrop.new(item)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def informal_propositions
|
|
28
|
+
return [] unless @model.informal_propositions
|
|
29
|
+
|
|
30
|
+
@model.informal_propositions.map do |item|
|
|
31
|
+
::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class UniqueRuleDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def attributes
|
|
16
|
+
drop_klass_by_model(@model.attributes)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Liquid
|
|
5
|
+
module Declarations
|
|
6
|
+
class VariableDrop < ::Expressir::Liquid::DeclarationDrop
|
|
7
|
+
include ::Expressir::Liquid::IdentifierDrop
|
|
8
|
+
|
|
9
|
+
def initialize(model)
|
|
10
|
+
@model = model
|
|
11
|
+
initialize_identifier(@model)
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def type
|
|
16
|
+
drop_klass_by_model(@model.type)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def expression
|
|
20
|
+
drop_klass_by_model(@model.expression)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|