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,29 +3,21 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.7 Subtype constraints
|
6
|
-
class SubtypeConstraint <
|
6
|
+
class SubtypeConstraint < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
attribute :applies_to, ModelElement
|
10
|
+
attribute :abstract, :boolean
|
11
|
+
attribute :total_over, ModelElement, collection: true
|
12
|
+
attribute :supertype_expression, ModelElement
|
13
|
+
attribute :_class, :string, default: -> { send(:name) }
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
def initialize(options = {})
|
21
|
-
initialize_identifier(options)
|
22
|
-
|
23
|
-
@applies_to = options[:applies_to]
|
24
|
-
@abstract = options[:abstract]
|
25
|
-
@total_over = options[:total_over] || []
|
26
|
-
@supertype_expression = options[:supertype_expression]
|
27
|
-
|
28
|
-
super
|
15
|
+
key_value do
|
16
|
+
map "_class", to: :_class, render_default: true
|
17
|
+
map "applies_to", to: :applies_to
|
18
|
+
map "abstract", to: :abstract
|
19
|
+
map "total_over", to: :total_over
|
20
|
+
map "supertype_expression", to: :supertype_expression
|
29
21
|
end
|
30
22
|
|
31
23
|
# @return [Array<Declaration>]
|
@@ -3,26 +3,19 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.1 Type declaration
|
6
|
-
class Type <
|
6
|
+
class Type < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
attribute :underlying_type, ModelElement
|
10
|
+
attribute :where_rules, WhereRule, collection: true
|
11
|
+
attribute :informal_propositions, RemarkItem, collection: true
|
12
|
+
attribute :_class, :string, default: -> { send(:name) }
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def initialize(options = {})
|
19
|
-
initialize_identifier(options)
|
20
|
-
|
21
|
-
@underlying_type = options[:underlying_type]
|
22
|
-
@where_rules = options[:where_rules] || []
|
23
|
-
@informal_propositions = options[:informal_propositions] || []
|
24
|
-
|
25
|
-
super
|
14
|
+
key_value do
|
15
|
+
map "_class", to: :_class, render_default: true
|
16
|
+
map "underlying_type", to: :underlying_type
|
17
|
+
map "where_rules", to: :where_rules
|
18
|
+
map "informal_propositions", to: :informal_propositions
|
26
19
|
end
|
27
20
|
|
28
21
|
# @return [Array<DataTypes::EnumerationItem>]
|
@@ -3,20 +3,15 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.2.2.1 Uniqueness rule
|
6
|
-
class UniqueRule <
|
6
|
+
class UniqueRule < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
9
|
+
attribute :attributes, ModelElement, collection: true
|
10
|
+
attribute :_class, :string, default: -> { send(:name) }
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def initialize(options = {})
|
15
|
-
initialize_identifier(options)
|
16
|
-
|
17
|
-
@attributes = options[:attributes] || []
|
18
|
-
|
19
|
-
super
|
12
|
+
key_value do
|
13
|
+
map "_class", to: :_class, render_default: true
|
14
|
+
map "attributes", to: :attributes
|
20
15
|
end
|
21
16
|
|
22
17
|
# @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.5.4 Local variables
|
6
|
-
class Variable <
|
6
|
+
class Variable < 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,20 +3,15 @@ module Expressir
|
|
3
3
|
module Declarations
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.2.2.2 Domain rules (WHERE clause)
|
6
|
-
class WhereRule <
|
6
|
+
class WhereRule < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
9
|
+
attribute :expression, ModelElement
|
10
|
+
attribute :_class, :string, default: -> { send(:name) }
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def initialize(options = {})
|
15
|
-
initialize_identifier(options)
|
16
|
-
|
17
|
-
@expression = options[:expression]
|
18
|
-
|
19
|
-
super
|
12
|
+
key_value do
|
13
|
+
map "_class", to: :_class, render_default: true
|
14
|
+
map "expression", to: :expression
|
20
15
|
end
|
21
16
|
|
22
17
|
# @return [Array<Declaration>]
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module Expressions
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 12.9 Aggregate initializer
|
6
|
-
class AggregateInitializer <
|
7
|
-
|
6
|
+
class AggregateInitializer < ModelElement
|
7
|
+
attribute :items, ModelElement, collection: true
|
8
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@items = options[:items] || []
|
13
|
-
|
14
|
-
super
|
10
|
+
key_value do
|
11
|
+
map "_class", to: :_class, render_default: true
|
12
|
+
map "items", to: :items
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -3,18 +3,15 @@ module Expressir
|
|
3
3
|
module Expressions
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 12.9 Aggregate initializer
|
6
|
-
class AggregateInitializerItem <
|
7
|
-
|
8
|
-
|
6
|
+
class AggregateInitializerItem < ModelElement
|
7
|
+
attribute :expression, ModelElement
|
8
|
+
attribute :repetition, ModelElement
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@expression = options[:expression]
|
15
|
-
@repetition = options[:repetition]
|
16
|
-
|
17
|
-
super
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
13
|
+
map "expression", to: :expression
|
14
|
+
map "repetition", to: :repetition
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -9,50 +9,48 @@ module Expressir
|
|
9
9
|
# - section 12.5 String operators
|
10
10
|
# - section 12.6 Aggregate operators
|
11
11
|
# - section 12.10 Complex entity instance construction operator
|
12
|
-
class BinaryExpression <
|
13
|
-
ADDITION =
|
14
|
-
AND =
|
15
|
-
COMBINE =
|
16
|
-
EQUAL =
|
17
|
-
EXPONENTIATION =
|
18
|
-
GREATER_THAN =
|
19
|
-
GREATER_THAN_OR_EQUAL =
|
20
|
-
IN =
|
21
|
-
INSTANCE_EQUAL =
|
22
|
-
INSTANCE_NOT_EQUAL =
|
23
|
-
INTEGER_DIVISION =
|
24
|
-
LESS_THAN =
|
25
|
-
LESS_THAN_OR_EQUAL =
|
26
|
-
LIKE =
|
27
|
-
MODULO =
|
28
|
-
MULTIPLICATION =
|
29
|
-
NOT_EQUAL =
|
30
|
-
OR =
|
31
|
-
REAL_DIVISION =
|
32
|
-
SUBTRACTION =
|
33
|
-
XOR =
|
12
|
+
class BinaryExpression < ModelElement
|
13
|
+
ADDITION = "ADDITION".freeze
|
14
|
+
AND = "AND".freeze
|
15
|
+
COMBINE = "COMBINE".freeze
|
16
|
+
EQUAL = "EQUAL".freeze
|
17
|
+
EXPONENTIATION = "EXPONENTIATION".freeze
|
18
|
+
GREATER_THAN = "GREATER_THAN".freeze
|
19
|
+
GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL".freeze
|
20
|
+
IN = "IN".freeze
|
21
|
+
INSTANCE_EQUAL = "INSTANCE_EQUAL".freeze
|
22
|
+
INSTANCE_NOT_EQUAL = "INSTANCE_NOT_EQUAL".freeze
|
23
|
+
INTEGER_DIVISION = "INTEGER_DIVISION".freeze
|
24
|
+
LESS_THAN = "LESS_THAN".freeze
|
25
|
+
LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL".freeze
|
26
|
+
LIKE = "LIKE".freeze
|
27
|
+
MODULO = "MODULO".freeze
|
28
|
+
MULTIPLICATION = "MULTIPLICATION".freeze
|
29
|
+
NOT_EQUAL = "NOT_EQUAL".freeze
|
30
|
+
OR = "OR".freeze
|
31
|
+
REAL_DIVISION = "REAL_DIVISION".freeze
|
32
|
+
SUBTRACTION = "SUBTRACTION".freeze
|
33
|
+
XOR = "XOR".freeze
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
attribute :operator, :string,
|
36
|
+
values: %w[
|
37
|
+
ADDITION AND COMBINE EQUAL EXPONENTIATION
|
38
|
+
GREATER_THAN
|
39
|
+
GREATER_THAN_OR_EQUAL IN INSTANCE_EQUAL
|
40
|
+
INSTANCE_NOT_EQUAL
|
41
|
+
INTEGER_DIVISION LESS_THAN LESS_THAN_OR_EQUAL LIKE
|
42
|
+
MODULO MULTIPLICATION NOT_EQUAL OR REAL_DIVISION
|
43
|
+
SUBTRACTION XOR
|
44
|
+
]
|
45
|
+
attribute :operand1, ModelElement
|
46
|
+
attribute :operand2, ModelElement
|
47
|
+
attribute :_class, :string, default: -> { send(:name) }
|
42
48
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
# @option options [Expression] :operand1
|
49
|
-
# @option options [Expression] :operand2
|
50
|
-
def initialize(options = {})
|
51
|
-
@operator = options[:operator]
|
52
|
-
@operand1 = options[:operand1]
|
53
|
-
@operand2 = options[:operand2]
|
54
|
-
|
55
|
-
super
|
49
|
+
key_value do
|
50
|
+
map "_class", to: :_class, render_default: true
|
51
|
+
map "operator", to: :operator
|
52
|
+
map "operand1", to: :operand1
|
53
|
+
map "operand2", to: :operand2
|
56
54
|
end
|
57
55
|
end
|
58
56
|
end
|
@@ -3,18 +3,15 @@ module Expressir
|
|
3
3
|
module Expressions
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 9.2.6 Implicit declarations
|
6
|
-
class EntityConstructor <
|
7
|
-
|
8
|
-
|
6
|
+
class EntityConstructor < ModelElement
|
7
|
+
attribute :entity, ModelElement
|
8
|
+
attribute :parameters, ModelElement, collection: true
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@entity = options[:entity]
|
15
|
-
@parameters = options[:parameters] || []
|
16
|
-
|
17
|
-
super
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
13
|
+
map "entity", to: :entity
|
14
|
+
map "parameters", to: :parameters
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -3,18 +3,15 @@ module Expressir
|
|
3
3
|
module Expressions
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 12.8 Function call
|
6
|
-
class FunctionCall <
|
7
|
-
|
8
|
-
|
6
|
+
class FunctionCall < ModelElement
|
7
|
+
attribute :function, ModelElement
|
8
|
+
attribute :parameters, ModelElement, collection: true
|
9
|
+
attribute :_class, :string, default: -> { send(:name) }
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@function = options[:function]
|
15
|
-
@parameters = options[:parameters]
|
16
|
-
|
17
|
-
super
|
11
|
+
key_value do
|
12
|
+
map "_class", to: :_class, render_default: true
|
13
|
+
map "function", to: :function
|
14
|
+
map "parameters", to: :parameters
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -3,30 +3,24 @@ module Expressir
|
|
3
3
|
module Expressions
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 12.2.4 Interval expressions
|
6
|
-
class Interval <
|
7
|
-
LESS_THAN =
|
8
|
-
LESS_THAN_OR_EQUAL =
|
6
|
+
class Interval < ModelElement
|
7
|
+
LESS_THAN = "LESS_THAN".freeze
|
8
|
+
LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL".freeze
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
attribute :low, ModelElement
|
11
|
+
attribute :operator1, :string, values: %w[LESS_THAN LESS_THAN_OR_EQUAL]
|
12
|
+
attribute :item, ModelElement
|
13
|
+
attribute :operator2, :string, values: %w[LESS_THAN LESS_THAN_OR_EQUAL]
|
14
|
+
attribute :high, ModelElement
|
15
|
+
attribute :_class, :string, default: -> { send(:name) }
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@low = options[:low]
|
24
|
-
@operator1 = options[:operator1]
|
25
|
-
@item = options[:item]
|
26
|
-
@operator2 = options[:operator2]
|
27
|
-
@high = options[:high]
|
28
|
-
|
29
|
-
super
|
17
|
+
key_value do
|
18
|
+
map "_class", to: :_class, render_default: true
|
19
|
+
map "low", to: :low
|
20
|
+
map "operator1", to: :operator1
|
21
|
+
map "item", to: :item
|
22
|
+
map "operator2", to: :operator2
|
23
|
+
map "high", to: :high
|
30
24
|
end
|
31
25
|
end
|
32
26
|
end
|
@@ -3,23 +3,17 @@ module Expressir
|
|
3
3
|
module Expressions
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 12.6.7 Query expression
|
6
|
-
class QueryExpression <
|
6
|
+
class QueryExpression < ModelElement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
attribute :aggregate_source, 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
|
-
@aggregate_source = options[:aggregate_source]
|
20
|
-
@expression = options[:expression]
|
21
|
-
|
22
|
-
super
|
13
|
+
key_value do
|
14
|
+
map "_class", to: :_class, render_default: true
|
15
|
+
map "aggregate_source", to: :aggregate_source
|
16
|
+
map "expression", to: :expression
|
23
17
|
end
|
24
18
|
|
25
19
|
# @return [Array<Declaration>]
|
@@ -4,22 +4,19 @@ module Expressir
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 12.1 Arithmetic operators
|
6
6
|
# - section 12.4.1 NOT operator
|
7
|
-
class UnaryExpression <
|
8
|
-
MINUS =
|
9
|
-
NOT =
|
10
|
-
PLUS =
|
7
|
+
class UnaryExpression < ModelElement
|
8
|
+
MINUS = "MINUS".freeze
|
9
|
+
NOT = "NOT".freeze
|
10
|
+
PLUS = "PLUS".freeze
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
attribute :operator, :string, values: %w[MINUS NOT PLUS]
|
13
|
+
attribute :operand, ModelElement
|
14
|
+
attribute :_class, :string, default: -> { send(:name) }
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@operator = options[:operator]
|
20
|
-
@operand = options[:operand]
|
21
|
-
|
22
|
-
super
|
16
|
+
key_value do
|
17
|
+
map "_class", to: :_class, render_default: true
|
18
|
+
map "operator", to: :operator
|
19
|
+
map "operand", to: :operand
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
@@ -1,33 +1,16 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Identifier
|
4
|
-
# @!attribute id
|
5
|
-
# @return [::String]
|
6
|
-
# @!attribute remarks
|
7
|
-
# @return [::Array<::String>]
|
8
|
-
# @!attribute remark_items
|
9
|
-
# @return [::Array<RemarkItem>]
|
10
|
-
# @!attribute source
|
11
|
-
# @return [::String]
|
12
|
-
# @!visibility private
|
13
4
|
def self.included(mod)
|
14
|
-
mod.
|
15
|
-
mod.
|
16
|
-
mod.
|
17
|
-
mod.model_attr_accessor :source, "::String"
|
18
|
-
end
|
5
|
+
mod.attribute :id, :string
|
6
|
+
mod.attribute :remarks, :string, collection: true
|
7
|
+
mod.attribute :remark_items, ::Expressir::Model::Declarations::RemarkItem, collection: true
|
19
8
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
# @!visibility private
|
26
|
-
def initialize_identifier(options = {})
|
27
|
-
@id = options[:id]
|
28
|
-
@remarks = options[:remarks] || []
|
29
|
-
@remark_items = options[:remark_items] || []
|
30
|
-
@source = options[:source]
|
9
|
+
mod.key_value do
|
10
|
+
map "id", to: :id
|
11
|
+
map "remarks", to: :remarks
|
12
|
+
map "remark_items", to: :remark_items
|
13
|
+
end
|
31
14
|
end
|
32
15
|
end
|
33
16
|
end
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module Literals
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 7.5.1 Binary literal
|
6
|
-
class Binary <
|
7
|
-
|
6
|
+
class Binary < ModelElement
|
7
|
+
attribute :value, :string
|
8
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@value = options[:value]
|
13
|
-
|
14
|
-
super
|
10
|
+
key_value do
|
11
|
+
map "_class", to: :_class, render_default: true
|
12
|
+
map "value", to: :value
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module Literals
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 7.5.2 Integer literal
|
6
|
-
class Integer <
|
7
|
-
|
6
|
+
class Integer < ModelElement
|
7
|
+
attribute :value, :string
|
8
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@value = options[:value]
|
13
|
-
|
14
|
-
super
|
10
|
+
key_value do
|
11
|
+
map "_class", to: :_class, render_default: true
|
12
|
+
map "value", to: :value
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -3,19 +3,17 @@ module Expressir
|
|
3
3
|
module Literals
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 7.5.5 Logical literal
|
6
|
-
class Logical <
|
7
|
-
TRUE =
|
8
|
-
FALSE =
|
9
|
-
UNKNOWN =
|
6
|
+
class Logical < ModelElement
|
7
|
+
TRUE = "TRUE".freeze
|
8
|
+
FALSE = "FALSE".freeze
|
9
|
+
UNKNOWN = "UNKNOWN".freeze
|
10
10
|
|
11
|
-
|
11
|
+
attribute :value, :string, values: %w[TRUE FALSE UNKNOWN]
|
12
|
+
attribute :_class, :string, default: -> { send(:name) }
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@value = options[:value]
|
17
|
-
|
18
|
-
super
|
14
|
+
key_value do
|
15
|
+
map "_class", to: :_class, render_default: true
|
16
|
+
map "value", to: :value
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
@@ -3,15 +3,13 @@ module Expressir
|
|
3
3
|
module Literals
|
4
4
|
# Specified in ISO 10303-11:2004
|
5
5
|
# - section 7.5.3 Real literal
|
6
|
-
class Real <
|
7
|
-
|
6
|
+
class Real < ModelElement
|
7
|
+
attribute :value, :string
|
8
|
+
attribute :_class, :string, default: -> { send(:name) }
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@value = options[:value]
|
13
|
-
|
14
|
-
super
|
10
|
+
key_value do
|
11
|
+
map "_class", to: :_class, render_default: true
|
12
|
+
map "value", to: :value
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|