expressir 1.2.3-x64-mingw32 → 1.2.6-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.cross_rubies +0 -6
  3. data/.github/workflows/rake.yml +223 -31
  4. data/.gitignore +7 -1
  5. data/.gitmodules +3 -0
  6. data/.rubocop.yml +13 -4
  7. data/README.adoc +8 -0
  8. data/Rakefile +4 -1
  9. data/bin/console +0 -1
  10. data/bin/rspec +3 -3
  11. data/exe/expressir +4 -2
  12. data/exe/format +1 -1
  13. data/exe/format-test +25 -25
  14. data/exe/generate-parser +16 -13
  15. data/expressir.gemspec +11 -9
  16. data/lib/expressir/config.rb +1 -1
  17. data/lib/expressir/express/2.7/express_parser.so +0 -0
  18. data/lib/expressir/express/3.0/express_parser.so +0 -0
  19. data/lib/expressir/express/parser.rb +17 -15
  20. data/lib/expressir/express/visitor.rb +7 -3
  21. data/lib/expressir/model.rb +78 -78
  22. data/lib/expressir/version.rb +1 -1
  23. data/rakelib/antlr4-native.rake +161 -0
  24. data/rakelib/cross-ruby.rake +213 -162
  25. data/spec/acceptance/version_spec.rb +17 -2
  26. data/spec/expressir/express/cache_spec.rb +23 -5
  27. data/spec/expressir/express/formatter_spec.rb +54 -8
  28. data/spec/expressir/express/parser_spec.rb +47 -11
  29. data/spec/expressir/model/model_element_spec.rb +198 -146
  30. data/spec/spec_helper.rb +7 -0
  31. metadata +52 -61
  32. data/demo.rb +0 -18
  33. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +0 -9589
  34. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +0 -36619
  35. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +0 -13294
  36. data/original/examples/employment/eclipse/.project +0 -17
  37. data/original/examples/employment/eclipse/Export/Employment.png +0 -0
  38. data/original/examples/employment/eclipse/Express/employment_schema.exp +0 -33
  39. data/original/examples/employment/eclipse/Express/employment_schema.xmi +0 -77
  40. data/original/examples/employment/eclipse/Express/employment_schema.xml +0 -93
  41. data/original/examples/employment/eclipse/Models/Employment.uml +0 -4
  42. data/original/examples/employment/eclipse/Models/Employment.umldi +0 -240
  43. data/original/examples/employment/eclipse/readme.txt +0 -7
  44. data/original/examples/employment/employment_schema.exp +0 -33
  45. data/original/examples/employment/employment_schema.rb +0 -232
  46. data/original/examples/employment/employment_schema.xml +0 -93
  47. data/original/examples/employment/employment_schema___module.rb +0 -46
  48. data/original/examples/employment/employment_schema___p28attr.rb +0 -126
  49. data/original/examples/employment/employment_schema___p28inst.rb +0 -26
  50. data/original/examples/employment/example_employment_data.xml +0 -1
  51. data/original/examples/employment/example_employment_data_copy.xml +0 -1
  52. data/original/examples/employment/example_employment_reader.rb +0 -30
  53. data/original/examples/employment/example_employment_writer.rb +0 -51
  54. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +0 -3710
  55. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +0 -35880
  56. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +0 -15357
  57. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +0 -9468
  58. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +0 -8404
  59. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +0 -43147
  60. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +0 -18341
  61. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +0 -11632
  62. data/original/exp2ruby.rb +0 -525
  63. data/original/expsm.rb +0 -34
  64. data/original/mapping_owl.rb +0 -1018
  65. data/original/mapping_sysml.rb +0 -2281
  66. data/original/mapping_uml2.rb +0 -599
  67. data/original/mapping_uml2_eclipse.rb +0 -433
  68. data/original/reeper.rb +0 -134
  69. data/spec/expressr_spec.rb +0 -5
@@ -1,4 +1,3 @@
1
-
2
1
  require "yaml"
3
2
  require "spec_helper"
4
3
  require "expressir/express/parser"
@@ -6,7 +5,8 @@ require "expressir/express/formatter"
6
5
 
7
6
  RSpec.describe Expressir::Model::ModelElement do
8
7
  describe ".to_hash" do
9
- it "exports an object with a formatter (single.exp)" do
8
+ it "exports an object with a formatter (single.exp)" do |example|
9
+ print "\n[#{example.description}] "
10
10
  exp_file = Expressir.root_path.join("spec", "syntax", "single.exp")
11
11
  yaml_file = Expressir.root_path.join("spec", "syntax", "single_formatted.yaml")
12
12
 
@@ -15,252 +15,304 @@ RSpec.describe Expressir::Model::ModelElement do
15
15
  result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, formatter: Expressir::Express::Formatter))
16
16
  # File.write(yaml_file, result)
17
17
  expected_result = File.read(yaml_file)
18
-
18
+
19
19
  expect(result).to eq(expected_result)
20
+
21
+ # Validate Object Space
22
+ GC.start
23
+ GC.verify_compaction_references
24
+ GC.verify_internal_consistency
20
25
  end
21
26
  end
22
27
 
23
28
  describe ".from_hash" do
24
- it "parses an object (single.yaml)" do
29
+ it "parses an object (single.yaml)" do |example|
30
+ print "\n[#{example.description}] "
25
31
  yaml_file = Expressir.root_path.join("spec", "syntax", "single.yaml")
26
32
 
27
- input = YAML.load(File.read(yaml_file))
33
+ input = YAML.safe_load(File.read(yaml_file))
28
34
  repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
29
35
 
30
36
  result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
31
37
  expected_result = File.read(yaml_file)
32
38
 
33
39
  expect(result).to eq(expected_result)
40
+
41
+ # Validate Object Space
42
+ GC.start
43
+ GC.verify_compaction_references
44
+ GC.verify_internal_consistency
34
45
  end
35
46
 
36
- it "parses an object (multiple.yaml)" do
47
+ it "parses an object (multiple.yaml)" do |example|
48
+ print "\n[#{example.description}] "
37
49
  yaml_file = Expressir.root_path.join("spec", "syntax", "multiple.yaml")
38
50
 
39
- input = YAML.load(File.read(yaml_file))
51
+ input = YAML.safe_load(File.read(yaml_file), permitted_classes: [Symbol]) # For UTF8 symbols
40
52
  repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
41
53
 
42
54
  result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
43
55
  expected_result = File.read(yaml_file)
44
56
 
45
57
  expect(result).to eq(expected_result)
58
+
59
+ # Validate Object Space
60
+ GC.start
61
+ GC.verify_compaction_references
62
+ GC.verify_internal_consistency
46
63
  end
47
64
 
48
- it "parses an object (syntax.yaml)" do
65
+ it "parses an object (syntax.yaml)" do |example|
66
+ print "\n[#{example.description}] "
49
67
  yaml_file = Expressir.root_path.join("spec", "syntax", "syntax.yaml")
50
68
 
51
- input = YAML.load(File.read(yaml_file))
69
+ input = YAML.safe_load(File.read(yaml_file), permitted_classes: [Symbol]) # For UTF8 symbols
52
70
  repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
53
71
 
54
72
  result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
55
73
  expected_result = File.read(yaml_file)
56
74
 
57
75
  expect(result).to eq(expected_result)
76
+
77
+ GC.start
78
+ GC.verify_compaction_references
79
+ GC.verify_internal_consistency
58
80
  end
59
81
 
60
- it "parses an object (remark.yaml)" do
82
+ it "parses an object (remark.yaml)" do |example|
83
+ print "\n[#{example.description}] "
61
84
  yaml_file = Expressir.root_path.join("spec", "syntax", "remark.yaml")
62
85
 
63
- input = YAML.load(File.read(yaml_file))
86
+ input = YAML.safe_load(File.read(yaml_file), permitted_classes: [Symbol]) # For UTF8 symbols
64
87
  repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
65
88
 
66
89
  result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
67
90
  expected_result = File.read(yaml_file)
68
91
 
69
92
  expect(result).to eq(expected_result)
93
+
94
+ # Validate Object Space
95
+ GC.start
96
+ GC.verify_compaction_references
97
+ GC.verify_internal_consistency
70
98
  end
71
99
  end
72
100
 
73
101
  describe ".find" do
74
- it "finds an object (single.exp)" do
102
+ it "finds an object (single.exp)" do |example|
103
+ print "\n[#{example.description}] "
75
104
  exp_file = Expressir.root_path.join("spec", "syntax", "single.exp")
76
105
 
77
106
  repo = Expressir::Express::Parser.from_file(exp_file)
78
107
 
79
108
  # universal scope
80
- expect(repo.find('single_schema')).to be_instance_of(Expressir::Model::Declarations::Schema)
81
- expect(repo.find('single_schema.empty_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
109
+ expect(repo.find("single_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
110
+ expect(repo.find("single_schema.empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
82
111
 
83
112
  # schema scope
84
113
  schema = repo.schemas.first
85
- expect(schema.find('empty_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
114
+ expect(schema.find("empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
115
+
116
+ # Validate Object Space
117
+ GC.start
118
+ GC.verify_compaction_references
119
+ GC.verify_internal_consistency
86
120
  end
87
121
 
88
- it "finds an object (multiple.exp)" do
122
+ it "finds an object (multiple.exp)" do |example|
123
+ print "\n[#{example.description}] "
89
124
  exp_file = Expressir.root_path.join("spec", "syntax", "multiple.exp")
90
125
 
91
126
  repo = Expressir::Express::Parser.from_file(exp_file)
92
127
 
93
128
  # universal scope
94
- expect(repo.find('multiple_schema')).to be_instance_of(Expressir::Model::Declarations::Schema)
95
- expect(repo.find('multiple_schema.empty_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
96
- expect(repo.find('multiple_schema.attribute_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
97
- expect(repo.find('multiple_schema.attribute_entity2')).to be_instance_of(Expressir::Model::Declarations::Entity)
98
- expect(repo.find('multiple_schema.attribute_entity3')).to be_instance_of(Expressir::Model::Declarations::Entity)
99
- expect(repo.find('multiple_schema.attribute_entity4')).to be_instance_of(Expressir::Model::Declarations::Entity)
129
+ expect(repo.find("multiple_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
130
+ expect(repo.find("multiple_schema.empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
131
+ expect(repo.find("multiple_schema.attribute_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
132
+ expect(repo.find("multiple_schema.attribute_entity2")).to be_instance_of(Expressir::Model::Declarations::Entity)
133
+ expect(repo.find("multiple_schema.attribute_entity3")).to be_instance_of(Expressir::Model::Declarations::Entity)
134
+ expect(repo.find("multiple_schema.attribute_entity4")).to be_instance_of(Expressir::Model::Declarations::Entity)
100
135
 
101
136
  # schema scope
102
137
  schema = repo.schemas.first
103
- expect(schema.find('empty_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
104
- expect(schema.find('attribute_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
105
- expect(schema.find('attribute_entity2')).to be_instance_of(Expressir::Model::Declarations::Entity)
106
- expect(schema.find('attribute_entity3')).to be_instance_of(Expressir::Model::Declarations::Entity)
107
- expect(schema.find('attribute_entity4')).to be_instance_of(Expressir::Model::Declarations::Entity)
138
+ expect(schema.find("empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
139
+ expect(schema.find("attribute_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
140
+ expect(schema.find("attribute_entity2")).to be_instance_of(Expressir::Model::Declarations::Entity)
141
+ expect(schema.find("attribute_entity3")).to be_instance_of(Expressir::Model::Declarations::Entity)
142
+ expect(schema.find("attribute_entity4")).to be_instance_of(Expressir::Model::Declarations::Entity)
143
+
144
+ # Validate Object Space
145
+ GC.start
146
+ GC.verify_compaction_references
147
+ GC.verify_internal_consistency
108
148
  end
109
149
 
110
- it "finds an object (syntax.exp)" do
150
+ it "finds an object (syntax.exp)" do |example|
151
+ print "\n[#{example.description}] "
111
152
  exp_file = Expressir.root_path.join("spec", "syntax", "syntax.exp")
112
153
 
113
154
  repo = Expressir::Express::Parser.from_file(exp_file)
114
155
 
115
156
  # universal scope
116
- expect(repo.find('syntax_schema')).to be_instance_of(Expressir::Model::Declarations::Schema)
117
- expect(repo.find('syntax_schema.empty_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
157
+ expect(repo.find("syntax_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
158
+ expect(repo.find("syntax_schema.empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
118
159
 
119
160
  # schema scope
120
161
  schema = repo.schemas.first
121
- expect(schema.find('empty_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
162
+ expect(schema.find("empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
163
+
164
+ # Validate Object Space
165
+ GC.start
166
+ GC.verify_compaction_references
167
+ GC.verify_internal_consistency
122
168
  end
123
169
 
124
- it "finds an object (remark.exp)" do
170
+ it "finds an object (remark.exp)" do |example|
171
+ print "\n[#{example.description}] "
125
172
  exp_file = Expressir.root_path.join("spec", "syntax", "remark.exp")
126
173
 
127
174
  repo = Expressir::Express::Parser.from_file(exp_file)
128
175
 
129
176
  # universal scope
130
- expect(repo.find('remark_schema')).to be_instance_of(Expressir::Model::Declarations::Schema)
131
- expect(repo.find('remark_schema.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
132
- expect(repo.find('remark_schema.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
133
- expect(repo.find('remark_schema.remark_type.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
134
- expect(repo.find('remark_schema.remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
135
- expect(repo.find('remark_schema.remark_type.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
136
- expect(repo.find('remark_schema.remark_type.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
137
- expect(repo.find('remark_schema.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
138
- expect(repo.find('remark_schema.remark_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
139
- expect(repo.find('remark_schema.remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
140
- expect(repo.find('remark_schema.remark_entity.remark_derived_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
141
- expect(repo.find('remark_schema.remark_entity.remark_inverse_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
142
- expect(repo.find('remark_schema.remark_entity.UR1')).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
143
- expect(repo.find('remark_schema.remark_entity.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
144
- expect(repo.find('remark_schema.remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
145
- expect(repo.find('remark_schema.remark_entity.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
146
- expect(repo.find('remark_schema.remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
147
- expect(repo.find('remark_schema.remark_subtype_constraint')).to be_instance_of(Expressir::Model::Declarations::SubtypeConstraint)
148
- expect(repo.find('remark_schema.remark_function')).to be_instance_of(Expressir::Model::Declarations::Function)
149
- expect(repo.find('remark_schema.remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Declarations::Parameter)
150
- expect(repo.find('remark_schema.remark_function.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
151
- expect(repo.find('remark_schema.remark_function.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
152
- expect(repo.find('remark_schema.remark_function.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
153
- expect(repo.find('remark_schema.remark_function.remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
154
- expect(repo.find('remark_schema.remark_procedure')).to be_instance_of(Expressir::Model::Declarations::Procedure)
155
- expect(repo.find('remark_schema.remark_procedure.remark_parameter')).to be_instance_of(Expressir::Model::Declarations::Parameter)
156
- expect(repo.find('remark_schema.remark_procedure.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
157
- expect(repo.find('remark_schema.remark_procedure.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
158
- expect(repo.find('remark_schema.remark_procedure.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
159
- expect(repo.find('remark_schema.remark_procedure.remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
160
- expect(repo.find('remark_schema.remark_rule')).to be_instance_of(Expressir::Model::Declarations::Rule)
161
- expect(repo.find('remark_schema.remark_rule.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
162
- expect(repo.find('remark_schema.remark_rule.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
163
- expect(repo.find('remark_schema.remark_rule.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
164
- expect(repo.find('remark_schema.remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
165
- expect(repo.find('remark_schema.remark_rule.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
166
- expect(repo.find('remark_schema.remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
167
- expect(repo.find('remark_schema.remark_rule.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
168
- expect(repo.find('remark_schema.remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
169
- expect(repo.find('remark_schema.remark_item')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
177
+ expect(repo.find("remark_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
178
+ expect(repo.find("remark_schema.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
179
+ expect(repo.find("remark_schema.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
180
+ expect(repo.find("remark_schema.remark_type.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
181
+ expect(repo.find("remark_schema.remark_type.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
182
+ expect(repo.find("remark_schema.remark_type.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
183
+ expect(repo.find("remark_schema.remark_type.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
184
+ expect(repo.find("remark_schema.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
185
+ expect(repo.find("remark_schema.remark_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
186
+ expect(repo.find("remark_schema.remark_entity.remark_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
187
+ expect(repo.find("remark_schema.remark_entity.remark_derived_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
188
+ expect(repo.find("remark_schema.remark_entity.remark_inverse_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
189
+ expect(repo.find("remark_schema.remark_entity.UR1")).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
190
+ expect(repo.find("remark_schema.remark_entity.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
191
+ expect(repo.find("remark_schema.remark_entity.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
192
+ expect(repo.find("remark_schema.remark_entity.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
193
+ expect(repo.find("remark_schema.remark_entity.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
194
+ expect(repo.find("remark_schema.remark_subtype_constraint")).to be_instance_of(Expressir::Model::Declarations::SubtypeConstraint)
195
+ expect(repo.find("remark_schema.remark_function")).to be_instance_of(Expressir::Model::Declarations::Function)
196
+ expect(repo.find("remark_schema.remark_function.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
197
+ expect(repo.find("remark_schema.remark_function.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
198
+ expect(repo.find("remark_schema.remark_function.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
199
+ expect(repo.find("remark_schema.remark_function.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
200
+ expect(repo.find("remark_schema.remark_function.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
201
+ expect(repo.find("remark_schema.remark_procedure")).to be_instance_of(Expressir::Model::Declarations::Procedure)
202
+ expect(repo.find("remark_schema.remark_procedure.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
203
+ expect(repo.find("remark_schema.remark_procedure.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
204
+ expect(repo.find("remark_schema.remark_procedure.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
205
+ expect(repo.find("remark_schema.remark_procedure.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
206
+ expect(repo.find("remark_schema.remark_procedure.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
207
+ expect(repo.find("remark_schema.remark_rule")).to be_instance_of(Expressir::Model::Declarations::Rule)
208
+ expect(repo.find("remark_schema.remark_rule.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
209
+ expect(repo.find("remark_schema.remark_rule.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
210
+ expect(repo.find("remark_schema.remark_rule.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
211
+ expect(repo.find("remark_schema.remark_rule.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
212
+ expect(repo.find("remark_schema.remark_rule.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
213
+ expect(repo.find("remark_schema.remark_rule.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
214
+ expect(repo.find("remark_schema.remark_rule.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
215
+ expect(repo.find("remark_schema.remark_rule.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
216
+ expect(repo.find("remark_schema.remark_item")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
170
217
 
171
218
  # schema scope
172
219
  schema = repo.schemas.first
173
- expect(schema.find('remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
174
- expect(schema.find('remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
175
- expect(schema.find('remark_type.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
176
- expect(schema.find('remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
177
- expect(schema.find('remark_type.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
178
- expect(schema.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
179
- expect(schema.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
180
- expect(schema.find('remark_entity')).to be_instance_of(Expressir::Model::Declarations::Entity)
181
- expect(schema.find('remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
182
- expect(schema.find('remark_entity.remark_derived_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
183
- expect(schema.find('remark_entity.remark_inverse_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
184
- expect(schema.find('remark_entity.UR1')).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
185
- expect(schema.find('remark_entity.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
186
- expect(schema.find('remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
187
- expect(schema.find('remark_entity.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
188
- expect(schema.find('remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
189
- expect(schema.find('remark_subtype_constraint')).to be_instance_of(Expressir::Model::Declarations::SubtypeConstraint)
190
- expect(schema.find('remark_function')).to be_instance_of(Expressir::Model::Declarations::Function)
191
- expect(schema.find('remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Declarations::Parameter)
192
- expect(schema.find('remark_function.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
193
- expect(schema.find('remark_function.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
194
- expect(schema.find('remark_function.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
195
- expect(schema.find('remark_function.remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
196
- expect(schema.find('remark_procedure')).to be_instance_of(Expressir::Model::Declarations::Procedure)
197
- expect(schema.find('remark_procedure.remark_parameter')).to be_instance_of(Expressir::Model::Declarations::Parameter)
198
- expect(schema.find('remark_procedure.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
199
- expect(schema.find('remark_procedure.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
200
- expect(schema.find('remark_procedure.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
201
- expect(schema.find('remark_procedure.remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
202
- expect(schema.find('remark_rule')).to be_instance_of(Expressir::Model::Declarations::Rule)
203
- expect(schema.find('remark_rule.remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
204
- expect(schema.find('remark_rule.remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
205
- expect(schema.find('remark_rule.remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
206
- expect(schema.find('remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
207
- expect(schema.find('remark_rule.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
208
- expect(schema.find('remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
209
- expect(schema.find('remark_rule.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
210
- expect(schema.find('remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
211
- expect(schema.find('remark_item')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
220
+ expect(schema.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
221
+ expect(schema.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
222
+ expect(schema.find("remark_type.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
223
+ expect(schema.find("remark_type.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
224
+ expect(schema.find("remark_type.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
225
+ expect(schema.find("remark_type.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
226
+ expect(schema.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
227
+ expect(schema.find("remark_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
228
+ expect(schema.find("remark_entity.remark_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
229
+ expect(schema.find("remark_entity.remark_derived_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
230
+ expect(schema.find("remark_entity.remark_inverse_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
231
+ expect(schema.find("remark_entity.UR1")).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
232
+ expect(schema.find("remark_entity.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
233
+ expect(schema.find("remark_entity.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
234
+ expect(schema.find("remark_entity.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
235
+ expect(schema.find("remark_entity.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
236
+ expect(schema.find("remark_subtype_constraint")).to be_instance_of(Expressir::Model::Declarations::SubtypeConstraint)
237
+ expect(schema.find("remark_function")).to be_instance_of(Expressir::Model::Declarations::Function)
238
+ expect(schema.find("remark_function.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
239
+ expect(schema.find("remark_function.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
240
+ expect(schema.find("remark_function.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
241
+ expect(schema.find("remark_function.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
242
+ expect(schema.find("remark_function.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
243
+ expect(schema.find("remark_procedure")).to be_instance_of(Expressir::Model::Declarations::Procedure)
244
+ expect(schema.find("remark_procedure.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
245
+ expect(schema.find("remark_procedure.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
246
+ expect(schema.find("remark_procedure.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
247
+ expect(schema.find("remark_procedure.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
248
+ expect(schema.find("remark_procedure.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
249
+ expect(schema.find("remark_rule")).to be_instance_of(Expressir::Model::Declarations::Rule)
250
+ expect(schema.find("remark_rule.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
251
+ expect(schema.find("remark_rule.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
252
+ expect(schema.find("remark_rule.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
253
+ expect(schema.find("remark_rule.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
254
+ expect(schema.find("remark_rule.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
255
+ expect(schema.find("remark_rule.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
256
+ expect(schema.find("remark_rule.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
257
+ expect(schema.find("remark_rule.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
258
+ expect(schema.find("remark_item")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
212
259
 
213
260
  # type scope
214
261
  type = schema.types.first
215
- expect(type.find('WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
216
- expect(type.find('wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
217
- expect(type.find('IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
218
- expect(type.find('ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
262
+ expect(type.find("WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
263
+ expect(type.find("wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
264
+ expect(type.find("IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
265
+ expect(type.find("ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
219
266
 
220
267
  # entity scope
221
268
  entity = schema.entities.first
222
- expect(entity.find('remark_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
223
- expect(entity.find('remark_derived_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
224
- expect(entity.find('remark_inverse_attribute')).to be_instance_of(Expressir::Model::Declarations::Attribute)
225
- expect(entity.find('UR1')).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
226
- expect(entity.find('WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
227
- expect(entity.find('wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
228
- expect(entity.find('IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
229
- expect(entity.find('ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
269
+ expect(entity.find("remark_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
270
+ expect(entity.find("remark_derived_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
271
+ expect(entity.find("remark_inverse_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
272
+ expect(entity.find("UR1")).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
273
+ expect(entity.find("WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
274
+ expect(entity.find("wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
275
+ expect(entity.find("IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
276
+ expect(entity.find("ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
230
277
 
231
278
  # function scope
232
279
  function = schema.functions.first
233
- expect(function.find('remark_parameter')).to be_instance_of(Expressir::Model::Declarations::Parameter)
234
- expect(function.find('remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
235
- expect(function.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
236
- expect(function.find('remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
237
- expect(function.find('remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
280
+ expect(function.find("remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
281
+ expect(function.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
282
+ expect(function.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
283
+ expect(function.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
284
+ expect(function.find("remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
238
285
 
239
286
  # procedure scope
240
287
  procedure = schema.procedures.first
241
- expect(procedure.find('remark_parameter')).to be_instance_of(Expressir::Model::Declarations::Parameter)
242
- expect(procedure.find('remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
243
- expect(procedure.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
244
- expect(procedure.find('remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
245
- expect(procedure.find('remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
288
+ expect(procedure.find("remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
289
+ expect(procedure.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
290
+ expect(procedure.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
291
+ expect(procedure.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
292
+ expect(procedure.find("remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
246
293
 
247
294
  # rule scope
248
295
  rule = schema.rules.first
249
- expect(rule.find('remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
250
- expect(rule.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
251
- expect(rule.find('remark_constant')).to be_instance_of(Expressir::Model::Declarations::Constant)
252
- expect(rule.find('remark_variable')).to be_instance_of(Expressir::Model::Declarations::Variable)
253
- expect(rule.find('WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
254
- expect(rule.find('wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
255
- expect(rule.find('IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
256
- expect(rule.find('ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
296
+ expect(rule.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
297
+ expect(rule.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
298
+ expect(rule.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
299
+ expect(rule.find("remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
300
+ expect(rule.find("WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
301
+ expect(rule.find("wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
302
+ expect(rule.find("IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
303
+ expect(rule.find("ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
257
304
 
258
305
  # retry search in parent scope
259
- expect(entity.find('remark_type')).to be_instance_of(Expressir::Model::Declarations::Type)
260
- expect(entity.find('remark_type.WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
261
- expect(entity.find('remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Declarations::WhereRule)
262
- expect(entity.find('remark_type.IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
263
- expect(entity.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
306
+ expect(entity.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
307
+ expect(entity.find("remark_type.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
308
+ expect(entity.find("remark_type.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
309
+ expect(entity.find("remark_type.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
310
+ expect(entity.find("remark_type.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
311
+
312
+ # Validate Object Space
313
+ GC.start
314
+ GC.verify_compaction_references
315
+ GC.verify_internal_consistency
264
316
  end
265
317
  end
266
318
  end
data/spec/spec_helper.rb CHANGED
@@ -14,4 +14,11 @@ RSpec.configure do |config|
14
14
  config.expect_with :rspec do |c|
15
15
  c.syntax = :expect
16
16
  end
17
+
18
+ config.around(:example) do |ex|
19
+ ex.run
20
+ rescue SystemExit => e
21
+ puts "Got SystemExit: #{e.inspect}."
22
+ raise
23
+ end
17
24
  end