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