expressir 2.0.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -13
  3. data/.rubocop_todo.yml +78 -1
  4. data/Gemfile +1 -2
  5. data/README.adoc +46 -0
  6. data/exe/{format-test → expressir-format-test} +3 -2
  7. data/expressir.gemspec +3 -4
  8. data/lib/expressir/express/cache.rb +6 -6
  9. data/lib/expressir/express/formatter.rb +754 -741
  10. data/lib/expressir/express/hyperlink_formatter.rb +2 -2
  11. data/lib/expressir/express/model_visitor.rb +1 -1
  12. data/lib/expressir/express/parser.rb +224 -100
  13. data/lib/expressir/express/resolve_references_model_visitor.rb +6 -6
  14. data/lib/expressir/express/schema_head_formatter.rb +3 -3
  15. data/lib/expressir/express/visitor.rb +353 -344
  16. data/lib/expressir/liquid/cache_drop.rb +20 -0
  17. data/lib/expressir/liquid/data_type_drop.rb +8 -0
  18. data/lib/expressir/liquid/data_types/aggregate_drop.rb +21 -0
  19. data/lib/expressir/liquid/data_types/array_drop.rb +34 -0
  20. data/lib/expressir/liquid/data_types/bag_drop.rb +26 -0
  21. data/lib/expressir/liquid/data_types/binary_drop.rb +22 -0
  22. data/lib/expressir/liquid/data_types/boolean_drop.rb +10 -0
  23. data/lib/expressir/liquid/data_types/enumeration_drop.rb +30 -0
  24. data/lib/expressir/liquid/data_types/enumeration_item_drop.rb +17 -0
  25. data/lib/expressir/liquid/data_types/generic_drop.rb +17 -0
  26. data/lib/expressir/liquid/data_types/generic_entity_drop.rb +17 -0
  27. data/lib/expressir/liquid/data_types/integer_drop.rb +10 -0
  28. data/lib/expressir/liquid/data_types/list_drop.rb +30 -0
  29. data/lib/expressir/liquid/data_types/logical_drop.rb +10 -0
  30. data/lib/expressir/liquid/data_types/number_drop.rb +10 -0
  31. data/lib/expressir/liquid/data_types/real_drop.rb +18 -0
  32. data/lib/expressir/liquid/data_types/select_drop.rb +34 -0
  33. data/lib/expressir/liquid/data_types/set_drop.rb +26 -0
  34. data/lib/expressir/liquid/data_types/string_drop.rb +22 -0
  35. data/lib/expressir/liquid/declaration_drop.rb +8 -0
  36. data/lib/expressir/liquid/declarations/attribute_drop.rb +37 -0
  37. data/lib/expressir/liquid/declarations/constant_drop.rb +25 -0
  38. data/lib/expressir/liquid/declarations/entity_drop.rb +65 -0
  39. data/lib/expressir/liquid/declarations/function_drop.rb +93 -0
  40. data/lib/expressir/liquid/declarations/interface_drop.rb +30 -0
  41. data/lib/expressir/liquid/declarations/interface_item_drop.rb +22 -0
  42. data/lib/expressir/liquid/declarations/interfaced_item_drop.rb +34 -0
  43. data/lib/expressir/liquid/declarations/parameter_drop.rb +25 -0
  44. data/lib/expressir/liquid/declarations/procedure_drop.rb +89 -0
  45. data/lib/expressir/liquid/declarations/remark_item_drop.rb +22 -0
  46. data/lib/expressir/liquid/declarations/rule_drop.rb +105 -0
  47. data/lib/expressir/liquid/declarations/schema_drop.rb +91 -0
  48. data/lib/expressir/liquid/declarations/schema_version_drop.rb +26 -0
  49. data/lib/expressir/liquid/declarations/schema_version_item_drop.rb +22 -0
  50. data/lib/expressir/liquid/declarations/subtype_constraint_drop.rb +37 -0
  51. data/lib/expressir/liquid/declarations/type_drop.rb +37 -0
  52. data/lib/expressir/liquid/declarations/unique_rule_drop.rb +21 -0
  53. data/lib/expressir/liquid/declarations/variable_drop.rb +25 -0
  54. data/lib/expressir/liquid/declarations/where_rule_drop.rb +21 -0
  55. data/lib/expressir/liquid/expression_drop.rb +8 -0
  56. data/lib/expressir/liquid/expressions/aggregate_initializer_drop.rb +24 -0
  57. data/lib/expressir/liquid/expressions/aggregate_initializer_item_drop.rb +22 -0
  58. data/lib/expressir/liquid/expressions/binary_expression_drop.rb +26 -0
  59. data/lib/expressir/liquid/expressions/entity_constructor_drop.rb +26 -0
  60. data/lib/expressir/liquid/expressions/function_call_drop.rb +26 -0
  61. data/lib/expressir/liquid/expressions/interval_drop.rb +34 -0
  62. data/lib/expressir/liquid/expressions/query_expression_drop.rb +25 -0
  63. data/lib/expressir/liquid/expressions/unary_expression_drop.rb +22 -0
  64. data/lib/expressir/liquid/identifier_drop.rb +33 -0
  65. data/lib/expressir/liquid/literal_drop.rb +8 -0
  66. data/lib/expressir/liquid/literals/binary_drop.rb +18 -0
  67. data/lib/expressir/liquid/literals/integer_drop.rb +18 -0
  68. data/lib/expressir/liquid/literals/logical_drop.rb +18 -0
  69. data/lib/expressir/liquid/literals/real_drop.rb +18 -0
  70. data/lib/expressir/liquid/literals/string_drop.rb +22 -0
  71. data/lib/expressir/liquid/model_element_drop.rb +33 -0
  72. data/lib/expressir/liquid/reference_drop.rb +8 -0
  73. data/lib/expressir/liquid/references/attribute_reference_drop.rb +22 -0
  74. data/lib/expressir/liquid/references/group_reference_drop.rb +22 -0
  75. data/lib/expressir/liquid/references/index_reference_drop.rb +26 -0
  76. data/lib/expressir/liquid/references/simple_reference_drop.rb +22 -0
  77. data/lib/expressir/liquid/repository_drop.rb +22 -0
  78. data/lib/expressir/liquid/statement_drop.rb +8 -0
  79. data/lib/expressir/liquid/statements/alias_drop.rb +29 -0
  80. data/lib/expressir/liquid/statements/assignment_drop.rb +22 -0
  81. data/lib/expressir/liquid/statements/case_action_drop.rb +26 -0
  82. data/lib/expressir/liquid/statements/case_drop.rb +30 -0
  83. data/lib/expressir/liquid/statements/compound_drop.rb +22 -0
  84. data/lib/expressir/liquid/statements/escape_drop.rb +10 -0
  85. data/lib/expressir/liquid/statements/if_drop.rb +34 -0
  86. data/lib/expressir/liquid/statements/null_drop.rb +10 -0
  87. data/lib/expressir/liquid/statements/procedure_call_drop.rb +26 -0
  88. data/lib/expressir/liquid/statements/repeat_drop.rb +45 -0
  89. data/lib/expressir/liquid/statements/return_drop.rb +18 -0
  90. data/lib/expressir/liquid/statements/skip_drop.rb +10 -0
  91. data/lib/expressir/liquid/supertype_expression_drop.rb +8 -0
  92. data/lib/expressir/liquid/supertype_expressions/binary_supertype_expression_drop.rb +26 -0
  93. data/lib/expressir/liquid/supertype_expressions/oneof_supertype_expression_drop.rb +22 -0
  94. data/lib/expressir/liquid.rb +18 -0
  95. data/lib/expressir/model/cache.rb +3 -3
  96. data/lib/expressir/model/data_type.rb +1 -1
  97. data/lib/expressir/model/data_types/aggregate.rb +3 -3
  98. data/lib/expressir/model/data_types/array.rb +6 -6
  99. data/lib/expressir/model/data_types/bag.rb +4 -4
  100. data/lib/expressir/model/data_types/binary.rb +3 -3
  101. data/lib/expressir/model/data_types/boolean.rb +1 -1
  102. data/lib/expressir/model/data_types/enumeration.rb +4 -4
  103. data/lib/expressir/model/data_types/enumeration_item.rb +2 -2
  104. data/lib/expressir/model/data_types/generic.rb +2 -2
  105. data/lib/expressir/model/data_types/generic_entity.rb +2 -2
  106. data/lib/expressir/model/data_types/integer.rb +1 -1
  107. data/lib/expressir/model/data_types/list.rb +5 -5
  108. data/lib/expressir/model/data_types/logical.rb +1 -1
  109. data/lib/expressir/model/data_types/number.rb +1 -1
  110. data/lib/expressir/model/data_types/real.rb +2 -2
  111. data/lib/expressir/model/data_types/select.rb +5 -5
  112. data/lib/expressir/model/data_types/set.rb +4 -4
  113. data/lib/expressir/model/data_types/string.rb +3 -3
  114. data/lib/expressir/model/declaration.rb +1 -1
  115. data/lib/expressir/model/declarations/attribute.rb +7 -7
  116. data/lib/expressir/model/declarations/constant.rb +4 -4
  117. data/lib/expressir/model/declarations/entity.rb +9 -9
  118. data/lib/expressir/model/declarations/function.rb +13 -13
  119. data/lib/expressir/model/declarations/interface.rb +4 -4
  120. data/lib/expressir/model/declarations/interface_item.rb +3 -3
  121. data/lib/expressir/model/declarations/interfaced_item.rb +6 -6
  122. data/lib/expressir/model/declarations/parameter.rb +4 -4
  123. data/lib/expressir/model/declarations/procedure.rb +12 -12
  124. data/lib/expressir/model/declarations/remark_item.rb +3 -3
  125. data/lib/expressir/model/declarations/rule.rb +14 -14
  126. data/lib/expressir/model/declarations/schema.rb +18 -18
  127. data/lib/expressir/model/declarations/schema_version.rb +3 -3
  128. data/lib/expressir/model/declarations/schema_version_item.rb +3 -3
  129. data/lib/expressir/model/declarations/subtype_constraint.rb +6 -6
  130. data/lib/expressir/model/declarations/type.rb +5 -5
  131. data/lib/expressir/model/declarations/unique_rule.rb +3 -3
  132. data/lib/expressir/model/declarations/variable.rb +4 -4
  133. data/lib/expressir/model/declarations/where_rule.rb +3 -3
  134. data/lib/expressir/model/expression.rb +1 -1
  135. data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
  136. data/lib/expressir/model/expressions/aggregate_initializer_item.rb +3 -3
  137. data/lib/expressir/model/expressions/binary_expression.rb +12 -5
  138. data/lib/expressir/model/expressions/entity_constructor.rb +3 -3
  139. data/lib/expressir/model/expressions/function_call.rb +3 -3
  140. data/lib/expressir/model/expressions/interval.rb +6 -6
  141. data/lib/expressir/model/expressions/query_expression.rb +4 -4
  142. data/lib/expressir/model/expressions/unary_expression.rb +3 -3
  143. data/lib/expressir/model/identifier.rb +5 -5
  144. data/lib/expressir/model/literal.rb +1 -1
  145. data/lib/expressir/model/literals/binary.rb +2 -2
  146. data/lib/expressir/model/literals/integer.rb +2 -2
  147. data/lib/expressir/model/literals/logical.rb +2 -2
  148. data/lib/expressir/model/literals/real.rb +2 -2
  149. data/lib/expressir/model/literals/string.rb +3 -3
  150. data/lib/expressir/model/model_element.rb +39 -38
  151. data/lib/expressir/model/reference.rb +1 -1
  152. data/lib/expressir/model/references/attribute_reference.rb +3 -3
  153. data/lib/expressir/model/references/group_reference.rb +3 -3
  154. data/lib/expressir/model/references/index_reference.rb +4 -4
  155. data/lib/expressir/model/references/simple_reference.rb +3 -3
  156. data/lib/expressir/model/repository.rb +3 -4
  157. data/lib/expressir/model/statement.rb +1 -1
  158. data/lib/expressir/model/statements/alias.rb +4 -4
  159. data/lib/expressir/model/statements/assignment.rb +3 -3
  160. data/lib/expressir/model/statements/case.rb +4 -4
  161. data/lib/expressir/model/statements/case_action.rb +3 -3
  162. data/lib/expressir/model/statements/compound.rb +2 -2
  163. data/lib/expressir/model/statements/escape.rb +1 -1
  164. data/lib/expressir/model/statements/if.rb +4 -4
  165. data/lib/expressir/model/statements/null.rb +1 -1
  166. data/lib/expressir/model/statements/procedure_call.rb +3 -3
  167. data/lib/expressir/model/statements/repeat.rb +8 -8
  168. data/lib/expressir/model/statements/return.rb +2 -2
  169. data/lib/expressir/model/statements/skip.rb +1 -1
  170. data/lib/expressir/model/supertype_expression.rb +1 -1
  171. data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +4 -4
  172. data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +2 -2
  173. data/lib/expressir/version.rb +1 -1
  174. data/lib/expressir.rb +2 -0
  175. metadata +103 -13
  176. /data/exe/{format → expressir-format} +0 -0
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Statements
6
+ class SkipDrop < ::Expressir::Liquid::StatementDrop
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ class SupertypeExpressionDrop < ::Expressir::Liquid::ModelElementDrop
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module SupertypeExpressions
6
+ class BinarySupertypeExpressionDrop < ::Expressir::Liquid::SupertypeExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def operator
13
+ @model.operator
14
+ end
15
+
16
+ def operand1
17
+ drop_klass_by_model(@model.operand1)
18
+ end
19
+
20
+ def operand2
21
+ drop_klass_by_model(@model.operand2)
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 SupertypeExpressions
6
+ class OneofSupertypeExpressionDrop < ::Expressir::Liquid::SupertypeExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def operands
13
+ return [] unless @model.operands
14
+
15
+ @model.operands.map do |item|
16
+ drop_klass_by_model(item)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ require "liquid"
2
+
3
+ require "expressir/liquid/model_element_drop"
4
+
5
+ require "expressir/liquid/cache_drop"
6
+ require "expressir/liquid/data_type_drop"
7
+ require "expressir/liquid/declaration_drop"
8
+ require "expressir/liquid/expression_drop"
9
+ require "expressir/liquid/literal_drop"
10
+ require "expressir/liquid/reference_drop"
11
+ require "expressir/liquid/statement_drop"
12
+ require "expressir/liquid/supertype_expression_drop"
13
+ require "expressir/liquid/identifier_drop"
14
+ require "expressir/liquid/repository_drop"
15
+
16
+ Dir[File.join(__dir__, "liquid", "**", "*.rb")].sort.each do |f|
17
+ require f
18
+ end
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  # Cache content object with Expressir version
4
4
  class Cache < ModelElement
5
- model_attr_accessor :version, 'String'
6
- model_attr_accessor :content, 'ModelElement'
5
+ model_attr_accessor :version, "String"
6
+ model_attr_accessor :content, "ModelElement"
7
7
 
8
8
  # @param [Hash] options
9
9
  # @option options [String] :version
@@ -14,4 +14,4 @@ module Expressir
14
14
  end
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -6,4 +6,4 @@ module Expressir
6
6
  class DataType < ModelElement
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -6,7 +6,7 @@ module Expressir
6
6
  class Aggregate < DataType
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :base_type, 'Type'
9
+ model_attr_accessor :base_type, "Type"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option (see Identifier#initialize_identifier)
@@ -22,10 +22,10 @@ module Expressir
22
22
  # @return [Array<Declaration>]
23
23
  def children
24
24
  [
25
- *remark_items
25
+ *remark_items,
26
26
  ]
27
27
  end
28
28
  end
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -4,11 +4,11 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.2.1 Array data type
6
6
  class Array < DataType
7
- model_attr_accessor :bound1, 'Expression'
8
- model_attr_accessor :bound2, 'Expression'
9
- model_attr_accessor :optional, '::Boolean'
10
- model_attr_accessor :unique, '::Boolean'
11
- model_attr_accessor :base_type, 'DataType'
7
+ model_attr_accessor :bound1, "Expression"
8
+ model_attr_accessor :bound2, "Expression"
9
+ model_attr_accessor :optional, "::Boolean"
10
+ model_attr_accessor :unique, "::Boolean"
11
+ model_attr_accessor :base_type, "DataType"
12
12
 
13
13
  # @param [Hash] options
14
14
  # @option options [Expression] :bound1
@@ -28,4 +28,4 @@ module Expressir
28
28
  end
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -4,9 +4,9 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.2.3 Bag data type
6
6
  class Bag < DataType
7
- model_attr_accessor :bound1, 'Expression'
8
- model_attr_accessor :bound2, 'Expression'
9
- model_attr_accessor :base_type, 'DataType'
7
+ model_attr_accessor :bound1, "Expression"
8
+ model_attr_accessor :bound2, "Expression"
9
+ model_attr_accessor :base_type, "DataType"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option options [Expression] :bound1
@@ -22,4 +22,4 @@ module Expressir
22
22
  end
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.1.7 Binary data type
6
6
  class Binary < DataType
7
- model_attr_accessor :width, 'Expression'
8
- model_attr_accessor :fixed, '::Boolean'
7
+ model_attr_accessor :width, "Expression"
8
+ model_attr_accessor :fixed, "::Boolean"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Expression] :width
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -4,9 +4,9 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.4.1 Enumeration data type
6
6
  class Enumeration < DataType
7
- model_attr_accessor :extensible, '::Boolean'
8
- model_attr_accessor :based_on, 'Reference'
9
- model_attr_accessor :items, '::Array<EnumerationItem>'
7
+ model_attr_accessor :extensible, "::Boolean"
8
+ model_attr_accessor :based_on, "Reference"
9
+ model_attr_accessor :items, "::Array<EnumerationItem>"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option options [::Boolean] :extensible
@@ -22,4 +22,4 @@ module Expressir
22
22
  end
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -17,10 +17,10 @@ module Expressir
17
17
  # @return [Array<Declaration>]
18
18
  def children
19
19
  [
20
- *remark_items
20
+ *remark_items,
21
21
  ]
22
22
  end
23
23
  end
24
24
  end
25
25
  end
26
- end
26
+ end
@@ -17,10 +17,10 @@ module Expressir
17
17
  # @return [Array<Declaration>]
18
18
  def children
19
19
  [
20
- *remark_items
20
+ *remark_items,
21
21
  ]
22
22
  end
23
23
  end
24
24
  end
25
25
  end
26
- end
26
+ end
@@ -18,9 +18,9 @@ module Expressir
18
18
  # @return [Array<Declaration>]
19
19
  def children
20
20
  [
21
- *remark_items
21
+ *remark_items,
22
22
  ]
23
23
  end
24
24
  end
25
25
  end
26
- end
26
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -4,10 +4,10 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.2.2 List data type
6
6
  class List < DataType
7
- model_attr_accessor :bound1, 'Expression'
8
- model_attr_accessor :bound2, 'Expression'
9
- model_attr_accessor :unique, '::Boolean'
10
- model_attr_accessor :base_type, 'DataType'
7
+ model_attr_accessor :bound1, "Expression"
8
+ model_attr_accessor :bound2, "Expression"
9
+ model_attr_accessor :unique, "::Boolean"
10
+ model_attr_accessor :base_type, "DataType"
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option options [Expression] :bound1
@@ -25,4 +25,4 @@ module Expressir
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -4,7 +4,7 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.1.2 Real data type
6
6
  class Real < DataType
7
- model_attr_accessor :precision, 'Expression'
7
+ model_attr_accessor :precision, "Expression"
8
8
 
9
9
  # @param [Hash] options
10
10
  # @option options [Expression] :precision
@@ -16,4 +16,4 @@ module Expressir
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -4,10 +4,10 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.4.2 Select data type
6
6
  class Select < DataType
7
- model_attr_accessor :extensible, '::Boolean'
8
- model_attr_accessor :generic_entity, '::Boolean'
9
- model_attr_accessor :based_on, 'Reference'
10
- model_attr_accessor :items, '::Array<Reference>'
7
+ model_attr_accessor :extensible, "::Boolean"
8
+ model_attr_accessor :generic_entity, "::Boolean"
9
+ model_attr_accessor :based_on, "Reference"
10
+ model_attr_accessor :items, "::Array<Reference>"
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option options [::Boolean] :extensible
@@ -25,4 +25,4 @@ module Expressir
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -4,9 +4,9 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.2.4 Set data type
6
6
  class Set < DataType
7
- model_attr_accessor :bound1, 'Expression'
8
- model_attr_accessor :bound2, 'Expression'
9
- model_attr_accessor :base_type, 'DataType'
7
+ model_attr_accessor :bound1, "Expression"
8
+ model_attr_accessor :bound2, "Expression"
9
+ model_attr_accessor :base_type, "DataType"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option options [Expression] :bound1
@@ -22,4 +22,4 @@ module Expressir
22
22
  end
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 8.1.6 String data type
6
6
  class String < DataType
7
- model_attr_accessor :width, 'Expression'
8
- model_attr_accessor :fixed, '::Boolean'
7
+ model_attr_accessor :width, "Expression"
8
+ model_attr_accessor :fixed, "::Boolean"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Expression] :width
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -6,4 +6,4 @@ module Expressir
6
6
  class Declaration < ModelElement
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -10,11 +10,11 @@ module Expressir
10
10
  DERIVED = :DERIVED
11
11
  INVERSE = :INVERSE
12
12
 
13
- model_attr_accessor :kind, ':EXPLICIT, :DERIVED, :INVERSE'
14
- model_attr_accessor :supertype_attribute, 'Reference'
15
- model_attr_accessor :optional, 'Boolean'
16
- model_attr_accessor :type, 'DataType'
17
- model_attr_accessor :expression, 'Expression'
13
+ model_attr_accessor :kind, ":EXPLICIT, :DERIVED, :INVERSE"
14
+ model_attr_accessor :supertype_attribute, "Reference"
15
+ model_attr_accessor :optional, "Boolean"
16
+ model_attr_accessor :type, "DataType"
17
+ model_attr_accessor :expression, "Expression"
18
18
 
19
19
  # @param [Hash] options
20
20
  # @option (see Identifier#initialize_identifier)
@@ -38,10 +38,10 @@ module Expressir
38
38
  # @return [Array<Declaration>]
39
39
  def children
40
40
  [
41
- *remark_items
41
+ *remark_items,
42
42
  ]
43
43
  end
44
44
  end
45
45
  end
46
46
  end
47
- end
47
+ end
@@ -6,8 +6,8 @@ module Expressir
6
6
  class Constant < Declaration
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :type, 'DataType'
10
- model_attr_accessor :expression, 'Expression'
9
+ model_attr_accessor :type, "DataType"
10
+ model_attr_accessor :expression, "Expression"
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option (see Identifier#initialize_identifier)
@@ -25,10 +25,10 @@ module Expressir
25
25
  # @return [Array<Declaration>]
26
26
  def children
27
27
  [
28
- *remark_items
28
+ *remark_items,
29
29
  ]
30
30
  end
31
31
  end
32
32
  end
33
33
  end
34
- end
34
+ end
@@ -6,13 +6,13 @@ module Expressir
6
6
  class Entity < Declaration
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :abstract, 'Boolean'
10
- model_attr_accessor :supertype_expression, 'SupertypeExpression'
11
- model_attr_accessor :subtype_of, 'Array<Reference>'
12
- model_attr_accessor :attributes, 'Array<Attribute>'
13
- model_attr_accessor :unique_rules, 'Array<UniqueRule>'
14
- model_attr_accessor :where_rules, 'Array<WhereRule>'
15
- model_attr_accessor :informal_propositions, 'Array<RemarkItem>'
9
+ model_attr_accessor :abstract, "Boolean"
10
+ model_attr_accessor :supertype_expression, "SupertypeExpression"
11
+ model_attr_accessor :subtype_of, "Array<Reference>"
12
+ model_attr_accessor :attributes, "Array<Attribute>"
13
+ model_attr_accessor :unique_rules, "Array<UniqueRule>"
14
+ model_attr_accessor :where_rules, "Array<WhereRule>"
15
+ model_attr_accessor :informal_propositions, "Array<RemarkItem>"
16
16
 
17
17
  # @param [Hash] options
18
18
  # @option (see Identifier#initialize_identifier)
@@ -44,10 +44,10 @@ module Expressir
44
44
  *unique_rules,
45
45
  *where_rules,
46
46
  *informal_propositions,
47
- *remark_items
47
+ *remark_items,
48
48
  ]
49
49
  end
50
50
  end
51
51
  end
52
52
  end
53
- end
53
+ end
@@ -6,16 +6,16 @@ module Expressir
6
6
  class Function < Declaration
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :parameters, 'Array<Parameter>'
10
- model_attr_accessor :return_type, 'DataType'
11
- model_attr_accessor :types, 'Array<Type>'
12
- model_attr_accessor :entities, 'Array<Entity>'
13
- model_attr_accessor :subtype_constraints, 'Array<SubtypeConstraint>'
14
- model_attr_accessor :functions, 'Array<Function>'
15
- model_attr_accessor :procedures, 'Array<Procedure>'
16
- model_attr_accessor :constants, 'Array<Constant>'
17
- model_attr_accessor :variables, 'Array<Variable>'
18
- model_attr_accessor :statements, 'Array<Statement>'
9
+ model_attr_accessor :parameters, "Array<Parameter>"
10
+ model_attr_accessor :return_type, "DataType"
11
+ model_attr_accessor :types, "Array<Type>"
12
+ model_attr_accessor :entities, "Array<Entity>"
13
+ model_attr_accessor :subtype_constraints, "Array<SubtypeConstraint>"
14
+ model_attr_accessor :functions, "Array<Function>"
15
+ model_attr_accessor :procedures, "Array<Procedure>"
16
+ model_attr_accessor :constants, "Array<Constant>"
17
+ model_attr_accessor :variables, "Array<Variable>"
18
+ model_attr_accessor :statements, "Array<Statement>"
19
19
 
20
20
  # @param [Hash] options
21
21
  # @option (see Identifier#initialize_identifier)
@@ -51,17 +51,17 @@ module Expressir
51
51
  [
52
52
  *parameters,
53
53
  *types,
54
- *types.flat_map{|x| x.enumeration_items},
54
+ *types.flat_map(&:enumeration_items),
55
55
  *entities,
56
56
  *subtype_constraints,
57
57
  *functions,
58
58
  *procedures,
59
59
  *constants,
60
60
  *variables,
61
- *remark_items
61
+ *remark_items,
62
62
  ]
63
63
  end
64
64
  end
65
65
  end
66
66
  end
67
- end
67
+ end
@@ -7,9 +7,9 @@ module Expressir
7
7
  USE = :USE
8
8
  REFERENCE = :REFERENCE
9
9
 
10
- model_attr_accessor :kind, ':USE, :REFERENCE'
11
- model_attr_accessor :schema, 'Reference'
12
- model_attr_accessor :items, 'Array<InterfaceItem>'
10
+ model_attr_accessor :kind, ":USE, :REFERENCE"
11
+ model_attr_accessor :schema, "Reference"
12
+ model_attr_accessor :items, "Array<InterfaceItem>"
13
13
 
14
14
  # @param [Hash] options
15
15
  # @option options [:USE, :REFERENCE] :kind
@@ -25,4 +25,4 @@ module Expressir
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 11 Interface specification
6
6
  class InterfaceItem < ModelElement
7
- model_attr_accessor :ref, 'Reference'
8
- model_attr_accessor :id, 'String'
7
+ model_attr_accessor :ref, "Reference"
8
+ model_attr_accessor :id, "String"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option (see Identifier#initialize_identifier)
@@ -20,4 +20,4 @@ module Expressir
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -4,11 +4,11 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 11 Interface specification
6
6
  class InterfacedItem < ModelElement
7
- model_attr_accessor :id, 'String'
8
- model_attr_accessor :remarks, 'Array<String>'
9
- model_attr_accessor :remark_items, 'Array<RemarkItem>'
7
+ model_attr_accessor :id, "String"
8
+ model_attr_accessor :remarks, "Array<String>"
9
+ model_attr_accessor :remark_items, "Array<RemarkItem>"
10
10
 
11
- model_attr_accessor :base_item, 'ModelElement'
11
+ model_attr_accessor :base_item, "ModelElement"
12
12
 
13
13
  # @param [Hash] options
14
14
  # @option options [String] :id
@@ -28,10 +28,10 @@ module Expressir
28
28
  # @return [Array<Declaration>]
29
29
  def children
30
30
  [
31
- *remark_items
31
+ *remark_items,
32
32
  ]
33
33
  end
34
34
  end
35
35
  end
36
36
  end
37
- end
37
+ end
@@ -6,8 +6,8 @@ module Expressir
6
6
  class Parameter < Declaration
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :var, 'Boolean'
10
- model_attr_accessor :type, 'DataType'
9
+ model_attr_accessor :var, "Boolean"
10
+ model_attr_accessor :type, "DataType"
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option (see Identifier#initialize_identifier)
@@ -25,10 +25,10 @@ module Expressir
25
25
  # @return [Array<Declaration>]
26
26
  def children
27
27
  [
28
- *remark_items
28
+ *remark_items,
29
29
  ]
30
30
  end
31
31
  end
32
32
  end
33
33
  end
34
- end
34
+ end