expressir 0.2.19-x64-mingw32 → 0.2.27-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +7 -6
  3. data/.github/workflows/release.yml +31 -3
  4. data/README.adoc +3 -3
  5. data/exe/format +2 -49
  6. data/exe/format-test +81 -0
  7. data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
  8. data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
  9. data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
  10. data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
  11. data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
  12. data/lib/expressir/express_exp/cache.rb +48 -0
  13. data/lib/expressir/express_exp/formatter.rb +12 -2
  14. data/lib/expressir/express_exp/hyperlink_formatter.rb +10 -15
  15. data/lib/expressir/express_exp/model_visitor.rb +23 -0
  16. data/lib/expressir/express_exp/parser.rb +14 -3
  17. data/lib/expressir/express_exp/resolve_references_model_visitor.rb +29 -0
  18. data/lib/expressir/express_exp/visitor.rb +46 -19
  19. data/lib/expressir/model.rb +5 -1
  20. data/lib/expressir/model/attribute.rb +13 -6
  21. data/lib/expressir/model/cache.rb +13 -0
  22. data/lib/expressir/model/constant.rb +10 -3
  23. data/lib/expressir/model/entity.rb +16 -14
  24. data/lib/expressir/model/enumeration_item.rb +8 -1
  25. data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
  26. data/lib/expressir/model/expressions/aggregate_item.rb +2 -2
  27. data/lib/expressir/model/expressions/attribute_reference.rb +2 -2
  28. data/lib/expressir/model/expressions/binary_expression.rb +3 -3
  29. data/lib/expressir/model/expressions/call.rb +3 -3
  30. data/lib/expressir/model/expressions/entity_constructor.rb +3 -3
  31. data/lib/expressir/model/expressions/group_reference.rb +2 -2
  32. data/lib/expressir/model/expressions/index_reference.rb +3 -3
  33. data/lib/expressir/model/expressions/interval.rb +5 -5
  34. data/lib/expressir/model/expressions/query_expression.rb +6 -4
  35. data/lib/expressir/model/expressions/simple_reference.rb +5 -1
  36. data/lib/expressir/model/expressions/unary_expression.rb +2 -2
  37. data/lib/expressir/model/function.rb +23 -21
  38. data/lib/expressir/model/identifier.rb +6 -3
  39. data/lib/expressir/model/interface.rb +4 -4
  40. data/lib/expressir/model/interface_item.rb +2 -2
  41. data/lib/expressir/model/interfaced_item.rb +10 -9
  42. data/lib/expressir/model/literals/binary.rb +1 -1
  43. data/lib/expressir/model/literals/integer.rb +1 -1
  44. data/lib/expressir/model/literals/logical.rb +1 -1
  45. data/lib/expressir/model/literals/real.rb +1 -1
  46. data/lib/expressir/model/literals/string.rb +2 -2
  47. data/lib/expressir/model/model_element.rb +38 -26
  48. data/lib/expressir/model/parameter.rb +10 -3
  49. data/lib/expressir/model/procedure.rb +22 -20
  50. data/lib/expressir/model/remark_item.rb +15 -0
  51. data/lib/expressir/model/repository.rb +2 -2
  52. data/lib/expressir/model/rule.rb +26 -24
  53. data/lib/expressir/model/schema.rb +24 -20
  54. data/lib/expressir/model/schema_version.rb +15 -0
  55. data/lib/expressir/model/schema_version_item.rb +15 -0
  56. data/lib/expressir/model/statements/alias.rb +7 -5
  57. data/lib/expressir/model/statements/assignment.rb +2 -2
  58. data/lib/expressir/model/statements/call.rb +3 -3
  59. data/lib/expressir/model/statements/case.rb +4 -4
  60. data/lib/expressir/model/statements/case_action.rb +3 -3
  61. data/lib/expressir/model/statements/compound.rb +2 -2
  62. data/lib/expressir/model/statements/if.rb +5 -5
  63. data/lib/expressir/model/statements/repeat.rb +11 -9
  64. data/lib/expressir/model/statements/return.rb +1 -1
  65. data/lib/expressir/model/subtype_constraint.rb +13 -6
  66. data/lib/expressir/model/type.rb +9 -7
  67. data/lib/expressir/model/types/aggregate.rb +9 -2
  68. data/lib/expressir/model/types/array.rb +5 -5
  69. data/lib/expressir/model/types/bag.rb +3 -3
  70. data/lib/expressir/model/types/binary.rb +2 -2
  71. data/lib/expressir/model/types/enumeration.rb +6 -6
  72. data/lib/expressir/model/types/generic.rb +8 -1
  73. data/lib/expressir/model/types/generic_entity.rb +8 -1
  74. data/lib/expressir/model/types/list.rb +4 -4
  75. data/lib/expressir/model/types/real.rb +1 -1
  76. data/lib/expressir/model/types/select.rb +7 -7
  77. data/lib/expressir/model/types/set.rb +3 -3
  78. data/lib/expressir/model/types/string.rb +2 -2
  79. data/lib/expressir/model/unique.rb +10 -3
  80. data/lib/expressir/model/variable.rb +10 -3
  81. data/lib/expressir/model/where.rb +9 -2
  82. data/lib/expressir/version.rb +1 -1
  83. data/original/examples/syntax/multiple.exp +1 -1
  84. data/original/examples/syntax/multiple.yaml +15 -1
  85. data/original/examples/syntax/multiple_formatted.exp +1 -1
  86. data/original/examples/syntax/multiple_hyperlink_formatted.exp +4 -4
  87. data/original/examples/syntax/multiple_schema_head_hyperlink_formatted.exp +1 -1
  88. data/original/examples/syntax/remark.exp +12 -10
  89. data/original/examples/syntax/remark.yaml +23 -3
  90. data/original/examples/syntax/remark_formatted.exp +3 -1
  91. data/original/examples/syntax/single.exp +2 -1
  92. data/original/examples/syntax/single.yaml +9 -0
  93. data/original/examples/syntax/single_formatted.exp +5 -1
  94. data/original/examples/syntax/single_formatted.yaml +18 -1
  95. data/original/examples/syntax/syntax.exp +1 -1
  96. data/original/examples/syntax/syntax.yaml +99 -2
  97. data/original/examples/syntax/syntax_formatted.exp +1 -1
  98. data/original/examples/syntax/syntax_hyperlink_formatted.exp +902 -0
  99. data/original/examples/syntax/syntax_schema_head_formatted.exp +1 -1
  100. data/spec/expressir/express_exp/cache_spec.rb +64 -0
  101. data/spec/expressir/express_exp/formatter_spec.rb +16 -0
  102. data/spec/expressir/express_exp/parser_spec.rb +1 -1
  103. data/spec/expressir/model/model_element_spec.rb +73 -21
  104. metadata +12 -3
  105. data/lib/expressir/model/informal_proposition.rb +0 -18
@@ -4,17 +4,24 @@ module Expressir
4
4
  class Aggregate < ModelElement
5
5
  include Identifier
6
6
 
7
- attr_accessor :base_type
7
+ model_attr_accessor :base_type
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
- @remarks = options.fetch(:remarks, [])
11
+ @remarks = options[:remarks] || []
12
+ @remark_items = options[:remark_items] || []
12
13
  @source = options[:source]
13
14
 
14
15
  @base_type = options[:base_type]
15
16
 
16
17
  super
17
18
  end
19
+
20
+ def children
21
+ [
22
+ *remark_items
23
+ ]
24
+ end
18
25
  end
19
26
  end
20
27
  end
@@ -2,11 +2,11 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Array < ModelElement
5
- attr_accessor :bound1
6
- attr_accessor :bound2
7
- attr_accessor :optional
8
- attr_accessor :unique
9
- attr_accessor :base_type
5
+ model_attr_accessor :bound1
6
+ model_attr_accessor :bound2
7
+ model_attr_accessor :optional
8
+ model_attr_accessor :unique
9
+ model_attr_accessor :base_type
10
10
 
11
11
  def initialize(options = {})
12
12
  @bound1 = options[:bound1]
@@ -2,9 +2,9 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Bag < ModelElement
5
- attr_accessor :bound1
6
- attr_accessor :bound2
7
- attr_accessor :base_type
5
+ model_attr_accessor :bound1
6
+ model_attr_accessor :bound2
7
+ model_attr_accessor :base_type
8
8
 
9
9
  def initialize(options = {})
10
10
  @bound1 = options[:bound1]
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Binary < ModelElement
5
- attr_accessor :width
6
- attr_accessor :fixed
5
+ model_attr_accessor :width
6
+ model_attr_accessor :fixed
7
7
 
8
8
  def initialize(options = {})
9
9
  @width = options[:width]
@@ -2,16 +2,16 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Enumeration < ModelElement
5
- attr_accessor :extensible
6
- attr_accessor :items
7
- attr_accessor :extension_type
8
- attr_accessor :extension_items
5
+ model_attr_accessor :extensible
6
+ model_attr_accessor :items
7
+ model_attr_accessor :extension_type
8
+ model_attr_accessor :extension_items
9
9
 
10
10
  def initialize(options = {})
11
11
  @extensible = options[:extensible]
12
- @items = options.fetch(:items, [])
12
+ @items = options[:items] || []
13
13
  @extension_type = options[:extension_type]
14
- @extension_items = options.fetch(:extension_items, [])
14
+ @extension_items = options[:extension_items] || []
15
15
 
16
16
  super
17
17
  end
@@ -6,11 +6,18 @@ module Expressir
6
6
 
7
7
  def initialize(options = {})
8
8
  @id = options[:id]
9
- @remarks = options.fetch(:remarks, [])
9
+ @remarks = options[:remarks] || []
10
+ @remark_items = options[:remark_items] || []
10
11
  @source = options[:source]
11
12
 
12
13
  super
13
14
  end
15
+
16
+ def children
17
+ [
18
+ *remark_items
19
+ ]
20
+ end
14
21
  end
15
22
  end
16
23
  end
@@ -6,12 +6,19 @@ module Expressir
6
6
 
7
7
  def initialize(options = {})
8
8
  @id = options[:id]
9
- @remarks = options.fetch(:remarks, [])
9
+ @remarks = options[:remarks] || []
10
+ @remark_items = options[:remark_items] || []
10
11
  @source = options[:source]
11
12
 
12
13
  super
13
14
  end
14
15
  end
16
+
17
+ def children
18
+ [
19
+ *remark_items
20
+ ]
21
+ end
15
22
  end
16
23
  end
17
24
  end
@@ -2,10 +2,10 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class List < ModelElement
5
- attr_accessor :bound1
6
- attr_accessor :bound2
7
- attr_accessor :unique
8
- attr_accessor :base_type
5
+ model_attr_accessor :bound1
6
+ model_attr_accessor :bound2
7
+ model_attr_accessor :unique
8
+ model_attr_accessor :base_type
9
9
 
10
10
  def initialize(options = {})
11
11
  @bound1 = options[:bound1]
@@ -2,7 +2,7 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Real < ModelElement
5
- attr_accessor :precision
5
+ model_attr_accessor :precision
6
6
 
7
7
  def initialize(options = {})
8
8
  @precision = options[:precision]
@@ -2,18 +2,18 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Select < ModelElement
5
- attr_accessor :extensible
6
- attr_accessor :generic_entity
7
- attr_accessor :items
8
- attr_accessor :extension_type
9
- attr_accessor :extension_items
5
+ model_attr_accessor :extensible
6
+ model_attr_accessor :generic_entity
7
+ model_attr_accessor :items
8
+ model_attr_accessor :extension_type
9
+ model_attr_accessor :extension_items
10
10
 
11
11
  def initialize(options = {})
12
12
  @extensible = options[:extensible]
13
13
  @generic_entity = options[:generic_entity]
14
- @items = options.fetch(:items, [])
14
+ @items = options[:items] || []
15
15
  @extension_type = options[:extension_type]
16
- @extension_items = options.fetch(:extension_items, [])
16
+ @extension_items = options[:extension_items] || []
17
17
 
18
18
  super
19
19
  end
@@ -2,9 +2,9 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class Set < ModelElement
5
- attr_accessor :bound1
6
- attr_accessor :bound2
7
- attr_accessor :base_type
5
+ model_attr_accessor :bound1
6
+ model_attr_accessor :bound2
7
+ model_attr_accessor :base_type
8
8
 
9
9
  def initialize(options = {})
10
10
  @bound1 = options[:bound1]
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Types
4
4
  class String < ModelElement
5
- attr_accessor :width
6
- attr_accessor :fixed
5
+ model_attr_accessor :width
6
+ model_attr_accessor :fixed
7
7
 
8
8
  def initialize(options = {})
9
9
  @width = options[:width]
@@ -3,17 +3,24 @@ module Expressir
3
3
  class Unique < ModelElement
4
4
  include Identifier
5
5
 
6
- attr_accessor :attributes
6
+ model_attr_accessor :attributes
7
7
 
8
8
  def initialize(options = {})
9
9
  @id = options[:id]
10
- @remarks = options.fetch(:remarks, [])
10
+ @remarks = options[:remarks] || []
11
+ @remark_items = options[:remark_items] || []
11
12
  @source = options[:source]
12
13
 
13
- @attributes = options.fetch(:attributes, [])
14
+ @attributes = options[:attributes] || []
14
15
 
15
16
  super
16
17
  end
18
+
19
+ def children
20
+ [
21
+ *remark_items
22
+ ]
23
+ end
17
24
  end
18
25
  end
19
26
  end
@@ -3,12 +3,13 @@ module Expressir
3
3
  class Variable < ModelElement
4
4
  include Identifier
5
5
 
6
- attr_accessor :type
7
- attr_accessor :expression
6
+ model_attr_accessor :type
7
+ model_attr_accessor :expression
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
- @remarks = options.fetch(:remarks, [])
11
+ @remarks = options[:remarks] || []
12
+ @remark_items = options[:remark_items] || []
12
13
  @source = options[:source]
13
14
 
14
15
  @type = options[:type]
@@ -16,6 +17,12 @@ module Expressir
16
17
 
17
18
  super
18
19
  end
20
+
21
+ def children
22
+ [
23
+ *remark_items
24
+ ]
25
+ end
19
26
  end
20
27
  end
21
28
  end
@@ -3,17 +3,24 @@ module Expressir
3
3
  class Where < ModelElement
4
4
  include Identifier
5
5
 
6
- attr_accessor :expression
6
+ model_attr_accessor :expression
7
7
 
8
8
  def initialize(options = {})
9
9
  @id = options[:id]
10
- @remarks = options.fetch(:remarks, [])
10
+ @remarks = options[:remarks] || []
11
+ @remark_items = options[:remark_items] || []
11
12
  @source = options[:source]
12
13
 
13
14
  @expression = options[:expression]
14
15
 
15
16
  super
16
17
  end
18
+
19
+ def children
20
+ [
21
+ *remark_items
22
+ ]
23
+ end
17
24
  end
18
25
  end
19
26
  end
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "0.2.19".freeze
2
+ VERSION = "0.2.27".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- SCHEMA multiple_schema1;
1
+ SCHEMA multiple_schema;
2
2
  REFERENCE FROM multiple_schema2;
3
3
  REFERENCE FROM multiple_schema3 (attribute_entity3);
4
4
  REFERENCE FROM multiple_schema4 (attribute_entity AS attribute_entity4);
@@ -3,33 +3,38 @@ _class: Expressir::Model::Repository
3
3
  schemas:
4
4
  - _class: Expressir::Model::Schema
5
5
  file: original/examples/syntax/multiple.exp
6
- id: multiple_schema1
6
+ id: multiple_schema
7
7
  interfaces:
8
8
  - _class: Expressir::Model::Interface
9
9
  kind: :REFERENCE
10
10
  schema:
11
11
  _class: Expressir::Model::Expressions::SimpleReference
12
12
  id: multiple_schema2
13
+ base_path: multiple_schema2
13
14
  - _class: Expressir::Model::Interface
14
15
  kind: :REFERENCE
15
16
  schema:
16
17
  _class: Expressir::Model::Expressions::SimpleReference
17
18
  id: multiple_schema3
19
+ base_path: multiple_schema3
18
20
  items:
19
21
  - _class: Expressir::Model::InterfaceItem
20
22
  ref:
21
23
  _class: Expressir::Model::Expressions::SimpleReference
22
24
  id: attribute_entity3
25
+ base_path: multiple_schema3.attribute_entity3
23
26
  - _class: Expressir::Model::Interface
24
27
  kind: :REFERENCE
25
28
  schema:
26
29
  _class: Expressir::Model::Expressions::SimpleReference
27
30
  id: multiple_schema4
31
+ base_path: multiple_schema4
28
32
  items:
29
33
  - _class: Expressir::Model::InterfaceItem
30
34
  ref:
31
35
  _class: Expressir::Model::Expressions::SimpleReference
32
36
  id: attribute_entity
37
+ base_path: multiple_schema4.attribute_entity
33
38
  id: attribute_entity4
34
39
  entities:
35
40
  - _class: Expressir::Model::Entity
@@ -49,11 +54,13 @@ schemas:
49
54
  subtype_of:
50
55
  - _class: Expressir::Model::Expressions::SimpleReference
51
56
  id: empty_entity
57
+ base_path: multiple_schema.empty_entity
52
58
  - _class: Expressir::Model::Entity
53
59
  id: subtype_attribute_entity
54
60
  subtype_of:
55
61
  - _class: Expressir::Model::Expressions::SimpleReference
56
62
  id: attribute_entity
63
+ base_path: multiple_schema.attribute_entity
57
64
  attributes:
58
65
  - _class: Expressir::Model::Attribute
59
66
  kind: :EXPLICIT
@@ -67,6 +74,7 @@ schemas:
67
74
  entity:
68
75
  _class: Expressir::Model::Expressions::SimpleReference
69
76
  id: attribute_entity
77
+ base_path: multiple_schema.attribute_entity
70
78
  attribute:
71
79
  _class: Expressir::Model::Expressions::SimpleReference
72
80
  id: test
@@ -77,6 +85,7 @@ schemas:
77
85
  subtype_of:
78
86
  - _class: Expressir::Model::Expressions::SimpleReference
79
87
  id: attribute_entity2
88
+ base_path: multiple_schema2.attribute_entity2
80
89
  attributes:
81
90
  - _class: Expressir::Model::Attribute
82
91
  kind: :EXPLICIT
@@ -90,6 +99,7 @@ schemas:
90
99
  entity:
91
100
  _class: Expressir::Model::Expressions::SimpleReference
92
101
  id: attribute_entity2
102
+ base_path: multiple_schema2.attribute_entity2
93
103
  attribute:
94
104
  _class: Expressir::Model::Expressions::SimpleReference
95
105
  id: test
@@ -100,6 +110,7 @@ schemas:
100
110
  subtype_of:
101
111
  - _class: Expressir::Model::Expressions::SimpleReference
102
112
  id: attribute_entity3
113
+ base_path: multiple_schema3.attribute_entity3
103
114
  attributes:
104
115
  - _class: Expressir::Model::Attribute
105
116
  kind: :EXPLICIT
@@ -113,6 +124,7 @@ schemas:
113
124
  entity:
114
125
  _class: Expressir::Model::Expressions::SimpleReference
115
126
  id: attribute_entity3
127
+ base_path: multiple_schema3.attribute_entity3
116
128
  attribute:
117
129
  _class: Expressir::Model::Expressions::SimpleReference
118
130
  id: test
@@ -123,6 +135,7 @@ schemas:
123
135
  subtype_of:
124
136
  - _class: Expressir::Model::Expressions::SimpleReference
125
137
  id: attribute_entity4
138
+ base_path: multiple_schema4.attribute_entity
126
139
  attributes:
127
140
  - _class: Expressir::Model::Attribute
128
141
  kind: :EXPLICIT
@@ -136,6 +149,7 @@ schemas:
136
149
  entity:
137
150
  _class: Expressir::Model::Expressions::SimpleReference
138
151
  id: attribute_entity4
152
+ base_path: multiple_schema4.attribute_entity
139
153
  attribute:
140
154
  _class: Expressir::Model::Expressions::SimpleReference
141
155
  id: test
@@ -1,4 +1,4 @@
1
- SCHEMA multiple_schema1;
1
+ SCHEMA multiple_schema;
2
2
 
3
3
  REFERENCE FROM multiple_schema2;
4
4
  REFERENCE FROM multiple_schema3
@@ -1,4 +1,4 @@
1
- SCHEMA multiple_schema1;
1
+ SCHEMA multiple_schema;
2
2
 
3
3
  REFERENCE FROM {{{<<express:multiple_schema2,multiple_schema2>>}}};
4
4
  REFERENCE FROM {{{<<express:multiple_schema3,multiple_schema3>>}}}
@@ -17,12 +17,12 @@ ENTITY attribute_entity;
17
17
  END_ENTITY;
18
18
 
19
19
  ENTITY subtype_empty_entity
20
- SUBTYPE OF ({{{<<express:multiple_schema1.empty_entity,empty_entity>>}}});
20
+ SUBTYPE OF ({{{<<express:multiple_schema.empty_entity,empty_entity>>}}});
21
21
  END_ENTITY;
22
22
 
23
23
  ENTITY subtype_attribute_entity
24
- SUBTYPE OF ({{{<<express:multiple_schema1.attribute_entity,attribute_entity>>}}});
25
- SELF\{{{<<express:multiple_schema1.attribute_entity,attribute_entity>>}}}.test : BOOLEAN;
24
+ SUBTYPE OF ({{{<<express:multiple_schema.attribute_entity,attribute_entity>>}}});
25
+ SELF\{{{<<express:multiple_schema.attribute_entity,attribute_entity>>}}}.test : BOOLEAN;
26
26
  END_ENTITY;
27
27
 
28
28
  ENTITY subtype_attribute_entity2