expressir 2.1.13 → 2.1.14
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/.github/workflows/rake.yml +7 -82
- data/.rubocop_todo.yml +15 -74
- data/Gemfile +4 -5
- data/expressir.gemspec +3 -1
- data/lib/expressir/express/cache.rb +4 -6
- data/lib/expressir/express/formatter.rb +92 -63
- data/lib/expressir/express/model_visitor.rb +10 -9
- data/lib/expressir/express/parser.rb +10 -8
- data/lib/expressir/express/resolve_references_model_visitor.rb +0 -3
- data/lib/expressir/express/visitor.rb +2 -1
- data/lib/expressir/liquid.rb +0 -17
- data/lib/expressir/model/cache.rb +9 -8
- data/lib/expressir/model/data_types/aggregate.rb +6 -11
- data/lib/expressir/model/data_types/array.rb +14 -20
- data/lib/expressir/model/data_types/bag.rb +10 -14
- data/lib/expressir/model/data_types/binary.rb +8 -11
- data/lib/expressir/model/data_types/boolean.rb +6 -1
- data/lib/expressir/model/data_types/enumeration.rb +10 -14
- data/lib/expressir/model/data_types/enumeration_item.rb +3 -5
- data/lib/expressir/model/data_types/generic.rb +4 -6
- data/lib/expressir/model/data_types/generic_entity.rb +4 -6
- data/lib/expressir/model/data_types/integer.rb +6 -1
- data/lib/expressir/model/data_types/list.rb +12 -17
- data/lib/expressir/model/data_types/logical.rb +6 -1
- data/lib/expressir/model/data_types/number.rb +6 -1
- data/lib/expressir/model/data_types/real.rb +6 -8
- data/lib/expressir/model/data_types/select.rb +12 -17
- data/lib/expressir/model/data_types/set.rb +10 -14
- data/lib/expressir/model/data_types/string.rb +8 -11
- data/lib/expressir/model/declarations/attribute.rb +17 -26
- data/lib/expressir/model/declarations/constant.rb +8 -14
- data/lib/expressir/model/declarations/entity.rb +18 -29
- data/lib/expressir/model/declarations/function.rb +25 -39
- data/lib/expressir/model/declarations/interface.rb +12 -16
- data/lib/expressir/model/declarations/interface_item.rb +7 -11
- data/lib/expressir/model/declarations/interfaced_item.rb +11 -18
- data/lib/expressir/model/declarations/parameter.rb +8 -14
- data/lib/expressir/model/declarations/procedure.rb +23 -36
- data/lib/expressir/model/declarations/remark_item.rb +8 -11
- data/lib/expressir/model/declarations/rule.rb +27 -42
- data/lib/expressir/model/declarations/schema.rb +59 -58
- data/lib/expressir/model/declarations/schema_version.rb +7 -10
- data/lib/expressir/model/declarations/schema_version_item.rb +7 -10
- data/lib/expressir/model/declarations/subtype_constraint.rb +12 -20
- data/lib/expressir/model/declarations/type.rb +10 -17
- data/lib/expressir/model/declarations/unique_rule.rb +6 -11
- data/lib/expressir/model/declarations/variable.rb +8 -14
- data/lib/expressir/model/declarations/where_rule.rb +6 -11
- data/lib/expressir/model/expressions/aggregate_initializer.rb +6 -8
- data/lib/expressir/model/expressions/aggregate_initializer_item.rb +8 -11
- data/lib/expressir/model/expressions/binary_expression.rb +40 -42
- data/lib/expressir/model/expressions/entity_constructor.rb +8 -11
- data/lib/expressir/model/expressions/function_call.rb +8 -11
- data/lib/expressir/model/expressions/interval.rb +16 -22
- data/lib/expressir/model/expressions/query_expression.rb +8 -14
- data/lib/expressir/model/expressions/unary_expression.rb +11 -14
- data/lib/expressir/model/identifier.rb +8 -25
- data/lib/expressir/model/literals/binary.rb +6 -8
- data/lib/expressir/model/literals/integer.rb +6 -8
- data/lib/expressir/model/literals/logical.rb +9 -11
- data/lib/expressir/model/literals/real.rb +6 -8
- data/lib/expressir/model/literals/string.rb +8 -11
- data/lib/expressir/model/model_element.rb +164 -131
- data/lib/expressir/model/references/attribute_reference.rb +8 -11
- data/lib/expressir/model/references/group_reference.rb +8 -11
- data/lib/expressir/model/references/index_reference.rb +10 -14
- data/lib/expressir/model/references/simple_reference.rb +10 -13
- data/lib/expressir/model/repository.rb +5 -7
- data/lib/expressir/model/statements/alias.rb +8 -14
- data/lib/expressir/model/statements/assignment.rb +8 -11
- data/lib/expressir/model/statements/case.rb +10 -14
- data/lib/expressir/model/statements/case_action.rb +7 -10
- data/lib/expressir/model/statements/compound.rb +6 -8
- data/lib/expressir/model/statements/escape.rb +6 -1
- data/lib/expressir/model/statements/if.rb +10 -14
- data/lib/expressir/model/statements/null.rb +6 -1
- data/lib/expressir/model/statements/procedure_call.rb +8 -11
- data/lib/expressir/model/statements/repeat.rb +16 -26
- data/lib/expressir/model/statements/return.rb +6 -8
- data/lib/expressir/model/statements/skip.rb +6 -1
- data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +12 -16
- data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +6 -8
- data/lib/expressir/model.rb +1 -8
- data/lib/expressir/version.rb +1 -1
- data/lib/expressir.rb +7 -3
- metadata +32 -89
- data/lib/expressir/liquid/cache_drop.rb +0 -20
- data/lib/expressir/liquid/data_type_drop.rb +0 -8
- data/lib/expressir/liquid/data_types/aggregate_drop.rb +0 -21
- data/lib/expressir/liquid/data_types/array_drop.rb +0 -34
- data/lib/expressir/liquid/data_types/bag_drop.rb +0 -26
- data/lib/expressir/liquid/data_types/binary_drop.rb +0 -22
- data/lib/expressir/liquid/data_types/boolean_drop.rb +0 -10
- data/lib/expressir/liquid/data_types/enumeration_drop.rb +0 -30
- data/lib/expressir/liquid/data_types/enumeration_item_drop.rb +0 -17
- data/lib/expressir/liquid/data_types/generic_drop.rb +0 -17
- data/lib/expressir/liquid/data_types/generic_entity_drop.rb +0 -17
- data/lib/expressir/liquid/data_types/integer_drop.rb +0 -10
- data/lib/expressir/liquid/data_types/list_drop.rb +0 -30
- data/lib/expressir/liquid/data_types/logical_drop.rb +0 -10
- data/lib/expressir/liquid/data_types/number_drop.rb +0 -10
- data/lib/expressir/liquid/data_types/real_drop.rb +0 -18
- data/lib/expressir/liquid/data_types/select_drop.rb +0 -34
- data/lib/expressir/liquid/data_types/set_drop.rb +0 -26
- data/lib/expressir/liquid/data_types/string_drop.rb +0 -22
- data/lib/expressir/liquid/declaration_drop.rb +0 -8
- data/lib/expressir/liquid/declarations/attribute_drop.rb +0 -37
- data/lib/expressir/liquid/declarations/constant_drop.rb +0 -25
- data/lib/expressir/liquid/declarations/entity_drop.rb +0 -65
- data/lib/expressir/liquid/declarations/function_drop.rb +0 -93
- data/lib/expressir/liquid/declarations/interface_drop.rb +0 -30
- data/lib/expressir/liquid/declarations/interface_item_drop.rb +0 -22
- data/lib/expressir/liquid/declarations/interfaced_item_drop.rb +0 -34
- data/lib/expressir/liquid/declarations/parameter_drop.rb +0 -25
- data/lib/expressir/liquid/declarations/procedure_drop.rb +0 -89
- data/lib/expressir/liquid/declarations/remark_item_drop.rb +0 -22
- data/lib/expressir/liquid/declarations/rule_drop.rb +0 -105
- data/lib/expressir/liquid/declarations/schema_drop.rb +0 -131
- data/lib/expressir/liquid/declarations/schema_version_drop.rb +0 -26
- data/lib/expressir/liquid/declarations/schema_version_item_drop.rb +0 -22
- data/lib/expressir/liquid/declarations/subtype_constraint_drop.rb +0 -37
- data/lib/expressir/liquid/declarations/type_drop.rb +0 -37
- data/lib/expressir/liquid/declarations/unique_rule_drop.rb +0 -21
- data/lib/expressir/liquid/declarations/variable_drop.rb +0 -25
- data/lib/expressir/liquid/declarations/where_rule_drop.rb +0 -21
- data/lib/expressir/liquid/expression_drop.rb +0 -8
- data/lib/expressir/liquid/expressions/aggregate_initializer_drop.rb +0 -24
- data/lib/expressir/liquid/expressions/aggregate_initializer_item_drop.rb +0 -22
- data/lib/expressir/liquid/expressions/binary_expression_drop.rb +0 -26
- data/lib/expressir/liquid/expressions/entity_constructor_drop.rb +0 -26
- data/lib/expressir/liquid/expressions/function_call_drop.rb +0 -26
- data/lib/expressir/liquid/expressions/interval_drop.rb +0 -34
- data/lib/expressir/liquid/expressions/query_expression_drop.rb +0 -25
- data/lib/expressir/liquid/expressions/unary_expression_drop.rb +0 -22
- data/lib/expressir/liquid/identifier_drop.rb +0 -33
- data/lib/expressir/liquid/literal_drop.rb +0 -8
- data/lib/expressir/liquid/literals/binary_drop.rb +0 -18
- data/lib/expressir/liquid/literals/integer_drop.rb +0 -18
- data/lib/expressir/liquid/literals/logical_drop.rb +0 -18
- data/lib/expressir/liquid/literals/real_drop.rb +0 -18
- data/lib/expressir/liquid/literals/string_drop.rb +0 -22
- data/lib/expressir/liquid/model_element_drop.rb +0 -33
- data/lib/expressir/liquid/reference_drop.rb +0 -8
- data/lib/expressir/liquid/references/attribute_reference_drop.rb +0 -22
- data/lib/expressir/liquid/references/group_reference_drop.rb +0 -22
- data/lib/expressir/liquid/references/index_reference_drop.rb +0 -26
- data/lib/expressir/liquid/references/simple_reference_drop.rb +0 -22
- data/lib/expressir/liquid/repository_drop.rb +0 -25
- data/lib/expressir/liquid/statement_drop.rb +0 -8
- data/lib/expressir/liquid/statements/alias_drop.rb +0 -29
- data/lib/expressir/liquid/statements/assignment_drop.rb +0 -22
- data/lib/expressir/liquid/statements/case_action_drop.rb +0 -26
- data/lib/expressir/liquid/statements/case_drop.rb +0 -30
- data/lib/expressir/liquid/statements/compound_drop.rb +0 -22
- data/lib/expressir/liquid/statements/escape_drop.rb +0 -10
- data/lib/expressir/liquid/statements/if_drop.rb +0 -34
- data/lib/expressir/liquid/statements/null_drop.rb +0 -10
- data/lib/expressir/liquid/statements/procedure_call_drop.rb +0 -26
- data/lib/expressir/liquid/statements/repeat_drop.rb +0 -45
- data/lib/expressir/liquid/statements/return_drop.rb +0 -18
- data/lib/expressir/liquid/statements/skip_drop.rb +0 -10
- data/lib/expressir/liquid/supertype_expression_drop.rb +0 -8
- data/lib/expressir/liquid/supertype_expressions/binary_supertype_expression_drop.rb +0 -26
- data/lib/expressir/liquid/supertype_expressions/oneof_supertype_expression_drop.rb +0 -22
- data/lib/expressir/model/data_type.rb +0 -9
- data/lib/expressir/model/declaration.rb +0 -9
- data/lib/expressir/model/expression.rb +0 -9
- data/lib/expressir/model/literal.rb +0 -9
- data/lib/expressir/model/reference.rb +0 -9
- data/lib/expressir/model/statement.rb +0 -9
- data/lib/expressir/model/supertype_expression.rb +0 -9
@@ -3,20 +3,15 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.5.3.1 Aggregate data type
|
6
|
-
class Aggregate <
|
6
|
+
class Aggregate < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
9
|
+
attribute :base_type, ModelElement
|
10
|
+
attribute :_class, :string, default: -> { send(:name) }
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def initialize(options = {})
|
15
|
-
initialize_identifier(options)
|
16
|
-
|
17
|
-
@base_type = options[:base_type]
|
18
|
-
|
19
|
-
super
|
12
|
+
key_value do
|
13
|
+
map "_class", to: :_class, render_default: true
|
14
|
+
map "base_type", to: :base_type
|
20
15
|
end
|
21
16
|
|
22
17
|
# @return [Array<Declaration>]
|
@@ -3,27 +3,21 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.2.1 Array data type
|
6
|
-
class Array <
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
class Array < ModelElement
|
7
|
+
attribute :bound1, ModelElement
|
8
|
+
attribute :bound2, ModelElement
|
9
|
+
attribute :optional, :boolean
|
10
|
+
attribute :unique, :boolean
|
11
|
+
attribute :base_type, ModelElement
|
12
|
+
attribute :_class, :string, default: -> { send(:name) }
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@bound1 = options[:bound1]
|
21
|
-
@bound2 = options[:bound2]
|
22
|
-
@optional = options[:optional]
|
23
|
-
@unique = options[:unique]
|
24
|
-
@base_type = options[:base_type]
|
25
|
-
|
26
|
-
super
|
14
|
+
key_value do
|
15
|
+
map "_class", to: :_class, render_default: true
|
16
|
+
map "bound1", to: :bound1
|
17
|
+
map "bound2", to: :bound2
|
18
|
+
map "optional", to: :optional
|
19
|
+
map "unique", to: :unique
|
20
|
+
map "base_type", to: :base_type
|
27
21
|
end
|
28
22
|
end
|
29
23
|
end
|
@@ -3,21 +3,17 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.2.3 Bag data type
|
6
|
-
class Bag <
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
class Bag < ModelElement
|
7
|
+
attribute :bound1, ModelElement
|
8
|
+
attribute :bound2, ModelElement
|
9
|
+
attribute :base_type, ModelElement
|
10
|
+
attribute :_class, :string, default: -> { send(:name) }
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@bound1 = options[:bound1]
|
17
|
-
@bound2 = options[:bound2]
|
18
|
-
@base_type = options[:base_type]
|
19
|
-
|
20
|
-
super
|
12
|
+
key_value do
|
13
|
+
map "_class", to: :_class, render_default: true
|
14
|
+
map "bound1", to: :bound1
|
15
|
+
map "bound2", to: :bound2
|
16
|
+
map "base_type", to: :base_type
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
@@ -3,18 +3,15 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.7 Binary data type
|
6
|
-
class Binary <
|
7
|
-
|
8
|
-
|
6
|
+
class Binary < ModelElement
|
7
|
+
attribute :width, ModelElement
|
8
|
+
attribute :fixed, :boolean
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@width = options[:width]
|
15
|
-
@fixed = options[:fixed]
|
16
|
-
|
17
|
-
super
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
13
|
+
map "width", to: :width
|
14
|
+
map "fixed", to: :fixed
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -3,7 +3,12 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.5 Boolean data type
|
6
|
-
class Boolean <
|
6
|
+
class Boolean < ModelElement
|
7
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
|
+
|
9
|
+
key_value do
|
10
|
+
map "_class", to: :_class, render_default: true
|
11
|
+
end
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
@@ -3,21 +3,17 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.4.1 Enumeration data type
|
6
|
-
class Enumeration <
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
class Enumeration < ModelElement
|
7
|
+
attribute :extensible, :boolean
|
8
|
+
attribute :based_on, ModelElement
|
9
|
+
attribute :items, EnumerationItem, collection: true
|
10
|
+
attribute :_class, :string, default: -> { send(:name) }
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@extensible = options[:extensible]
|
17
|
-
@based_on = options[:based_on]
|
18
|
-
@items = options[:items] || []
|
19
|
-
|
20
|
-
super
|
12
|
+
key_value do
|
13
|
+
map "_class", to: :_class, render_default: true
|
14
|
+
map "extensible", to: :extensible
|
15
|
+
map "based_on", to: :based_on
|
16
|
+
map "items", to: :items
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
@@ -6,12 +6,10 @@ module Expressir
|
|
6
6
|
class EnumerationItem < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
# @option (see Identifier#initialize_identifier)
|
11
|
-
def initialize(options = {})
|
12
|
-
initialize_identifier(options)
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
13
10
|
|
14
|
-
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
15
13
|
end
|
16
14
|
|
17
15
|
# @return [Array<Declaration>]
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.5.3.2 Generic data type
|
6
|
-
class Generic <
|
6
|
+
class Generic < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
# @option (see Identifier#initialize_identifier)
|
11
|
-
def initialize(options = {})
|
12
|
-
initialize_identifier(options)
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
13
10
|
|
14
|
-
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
15
13
|
end
|
16
14
|
|
17
15
|
# @return [Array<Declaration>]
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.5.3.3 Generic entity data type
|
6
|
-
class GenericEntity <
|
6
|
+
class GenericEntity < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
# @option (see Identifier#initialize_identifier)
|
11
|
-
def initialize(options = {})
|
12
|
-
initialize_identifier(options)
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
13
10
|
|
14
|
-
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
15
13
|
end
|
16
14
|
end
|
17
15
|
|
@@ -3,7 +3,12 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.3 Integer data type
|
6
|
-
class Integer <
|
6
|
+
class Integer < ModelElement
|
7
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
|
+
|
9
|
+
key_value do
|
10
|
+
map "_class", to: :_class, render_default: true
|
11
|
+
end
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
@@ -3,24 +3,19 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.2.2 List data type
|
6
|
-
class List <
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
class List < ModelElement
|
7
|
+
attribute :bound1, ModelElement
|
8
|
+
attribute :bound2, ModelElement
|
9
|
+
attribute :unique, :boolean
|
10
|
+
attribute :base_type, ModelElement
|
11
|
+
attribute :_class, :string, default: -> { send(:name) }
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
@bound1 = options[:bound1]
|
19
|
-
@bound2 = options[:bound2]
|
20
|
-
@unique = options[:unique]
|
21
|
-
@base_type = options[:base_type]
|
22
|
-
|
23
|
-
super
|
13
|
+
key_value do
|
14
|
+
map "_class", to: :_class, render_default: true
|
15
|
+
map "bound1", to: :bound1
|
16
|
+
map "bound2", to: :bound2
|
17
|
+
map "unique", to: :unique
|
18
|
+
map "base_type", to: :base_type
|
24
19
|
end
|
25
20
|
end
|
26
21
|
end
|
@@ -3,7 +3,12 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.4 Logical data type
|
6
|
-
class Logical <
|
6
|
+
class Logical < ModelElement
|
7
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
|
+
|
9
|
+
key_value do
|
10
|
+
map "_class", to: :_class, render_default: true
|
11
|
+
end
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
@@ -3,7 +3,12 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.1 Number data type
|
6
|
-
class Number <
|
6
|
+
class Number < ModelElement
|
7
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
|
+
|
9
|
+
key_value do
|
10
|
+
map "_class", to: :_class, render_default: true
|
11
|
+
end
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.2 Real data type
|
6
|
-
class Real <
|
7
|
-
|
6
|
+
class Real < ModelElement
|
7
|
+
attribute :precision, ModelElement
|
8
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@precision = options[:precision]
|
13
|
-
|
14
|
-
super
|
10
|
+
key_value do
|
11
|
+
map "_class", to: :_class, render_default: true
|
12
|
+
map "precision", to: :precision
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -3,24 +3,19 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.4.2 Select data type
|
6
|
-
class Select <
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
class Select < ModelElement
|
7
|
+
attribute :extensible, :boolean
|
8
|
+
attribute :generic_entity, :boolean
|
9
|
+
attribute :based_on, ModelElement
|
10
|
+
attribute :items, ModelElement, collection: true
|
11
|
+
attribute :_class, :string, default: -> { send(:name) }
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
@extensible = options[:extensible]
|
19
|
-
@generic_entity = options[:generic_entity]
|
20
|
-
@based_on = options[:based_on]
|
21
|
-
@items = options[:items] || []
|
22
|
-
|
23
|
-
super
|
13
|
+
key_value do
|
14
|
+
map "_class", to: :_class, render_default: true
|
15
|
+
map "extensible", to: :extensible
|
16
|
+
map "generic_entity", to: :generic_entity
|
17
|
+
map "based_on", to: :based_on
|
18
|
+
map "items", to: :items
|
24
19
|
end
|
25
20
|
end
|
26
21
|
end
|
@@ -3,21 +3,17 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.2.4 Set data type
|
6
|
-
class Set <
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
class Set < ModelElement
|
7
|
+
attribute :bound1, ModelElement
|
8
|
+
attribute :bound2, ModelElement
|
9
|
+
attribute :base_type, ModelElement
|
10
|
+
attribute :_class, :string, default: -> { send(:name) }
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@bound1 = options[:bound1]
|
17
|
-
@bound2 = options[:bound2]
|
18
|
-
@base_type = options[:base_type]
|
19
|
-
|
20
|
-
super
|
12
|
+
key_value do
|
13
|
+
map "_class", to: :_class, render_default: true
|
14
|
+
map "bound1", to: :bound1
|
15
|
+
map "bound2", to: :bound2
|
16
|
+
map "base_type", to: :base_type
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
@@ -3,18 +3,15 @@ module Expressir
|
|
3
3
|
module DataTypes
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 8.1.6 String data type
|
6
|
-
class String <
|
7
|
-
|
8
|
-
|
6
|
+
class String < ModelElement
|
7
|
+
attribute :width, ModelElement
|
8
|
+
attribute :fixed, :boolean
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@width = options[:width]
|
15
|
-
@fixed = options[:fixed]
|
16
|
-
|
17
|
-
super
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
13
|
+
map "width", to: :width
|
14
|
+
map "fixed", to: :fixed
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -3,36 +3,27 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.2.1 Attributes
|
6
|
-
class Attribute <
|
6
|
+
class Attribute < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
EXPLICIT =
|
10
|
-
DERIVED =
|
11
|
-
INVERSE =
|
9
|
+
EXPLICIT = "EXPLICIT".freeze
|
10
|
+
DERIVED = "DERIVED".freeze
|
11
|
+
INVERSE = "INVERSE".freeze
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
attribute :kind, :string, values: %w[EXPLICIT DERIVED INVERSE]
|
14
|
+
attribute :supertype_attribute, ModelElement
|
15
|
+
attribute :optional, :boolean
|
16
|
+
attribute :type, ModelElement
|
17
|
+
attribute :expression, ModelElement
|
18
|
+
attribute :_class, :string, default: -> { send(:name) }
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def initialize(options = {})
|
27
|
-
initialize_identifier(options)
|
28
|
-
|
29
|
-
@kind = options[:kind]
|
30
|
-
@supertype_attribute = options[:supertype_attribute]
|
31
|
-
@optional = options[:optional]
|
32
|
-
@type = options[:type]
|
33
|
-
@expression = options[:expression]
|
34
|
-
|
35
|
-
super
|
20
|
+
key_value do
|
21
|
+
map "_class", to: :_class, render_default: true
|
22
|
+
map "kind", to: :kind
|
23
|
+
map "supertype_attribute", to: :supertype_attribute
|
24
|
+
map "optional", to: :optional
|
25
|
+
map "type", to: :type
|
26
|
+
map "expression", to: :expression
|
36
27
|
end
|
37
28
|
|
38
29
|
# @return [Array<Declaration>]
|
@@ -3,23 +3,17 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.4 Constant
|
6
|
-
class Constant <
|
6
|
+
class Constant < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
attribute :type, ModelElement
|
10
|
+
attribute :expression, ModelElement
|
11
|
+
attribute :_class, :string, default: -> { send(:name) }
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def initialize(options = {})
|
17
|
-
initialize_identifier(options)
|
18
|
-
|
19
|
-
@type = options[:type]
|
20
|
-
@expression = options[:expression]
|
21
|
-
|
22
|
-
super
|
13
|
+
key_value do
|
14
|
+
map "_class", to: :_class, render_default: true
|
15
|
+
map "type", to: :type
|
16
|
+
map "expression", to: :expression
|
23
17
|
end
|
24
18
|
|
25
19
|
# @return [Array<Declaration>]
|
@@ -3,38 +3,27 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.2 Entity declaration
|
6
|
-
class Entity <
|
6
|
+
class Entity < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
attribute :abstract, :boolean
|
10
|
+
attribute :supertype_expression, ModelElement
|
11
|
+
attribute :subtype_of, ModelElement, collection: true
|
12
|
+
attribute :attributes, Attribute, collection: true
|
13
|
+
attribute :unique_rules, UniqueRule, collection: true
|
14
|
+
attribute :where_rules, WhereRule, collection: true
|
15
|
+
attribute :informal_propositions, RemarkItem, collection: true
|
16
|
+
attribute :_class, :string, default: -> { send(:name) }
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def initialize(options = {})
|
27
|
-
initialize_identifier(options)
|
28
|
-
|
29
|
-
@abstract = options[:abstract]
|
30
|
-
@supertype_expression = options[:supertype_expression]
|
31
|
-
@subtype_of = options[:subtype_of] || []
|
32
|
-
@attributes = options[:attributes] || []
|
33
|
-
@unique_rules = options[:unique_rules] || []
|
34
|
-
@where_rules = options[:where_rules] || []
|
35
|
-
@informal_propositions = options[:informal_propositions] || []
|
36
|
-
|
37
|
-
super
|
18
|
+
key_value do
|
19
|
+
map "_class", to: :_class, render_default: true
|
20
|
+
map "abstract", to: :abstract
|
21
|
+
map "supertype_expression", to: :supertype_expression
|
22
|
+
map "subtype_of", to: :subtype_of
|
23
|
+
map "attributes", to: :attributes
|
24
|
+
map "unique_rules", to: :unique_rules
|
25
|
+
map "where_rules", to: :where_rules
|
26
|
+
map "informal_propositions", to: :informal_propositions
|
38
27
|
end
|
39
28
|
|
40
29
|
# @return [Array<Declaration>]
|