expressir 0.2.9-arm64-darwin → 0.2.14-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/format +20 -0
- data/expressir.gemspec +1 -0
- data/lib/expressir/express_exp/2.4/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/2.5/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/2.6/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/2.7/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/3.0/express_parser.bundle +0 -0
- data/lib/expressir/express_exp/formatter.rb +146 -105
- data/lib/expressir/express_exp/hyperlink_formatter.rb +25 -0
- data/lib/expressir/express_exp/parser.rb +2 -0
- data/lib/expressir/express_exp/schema_head_formatter.rb +14 -0
- data/lib/expressir/express_exp/visitor.rb +132 -82
- data/lib/expressir/model.rb +2 -1
- data/lib/expressir/model/attribute.rb +5 -1
- data/lib/expressir/model/constant.rb +5 -1
- data/lib/expressir/model/entity.rb +13 -22
- data/lib/expressir/model/enumeration_item.rb +5 -1
- data/lib/expressir/model/expressions/aggregate_initializer.rb +4 -2
- data/lib/expressir/model/expressions/aggregate_item.rb +3 -1
- data/lib/expressir/model/expressions/attribute_reference.rb +3 -1
- data/lib/expressir/model/expressions/binary_expression.rb +3 -1
- data/lib/expressir/model/expressions/call.rb +4 -2
- data/lib/expressir/model/expressions/entity_constructor.rb +4 -2
- data/lib/expressir/model/expressions/group_reference.rb +3 -1
- data/lib/expressir/model/expressions/index_reference.rb +3 -1
- data/lib/expressir/model/expressions/interval.rb +3 -1
- data/lib/expressir/model/expressions/query_expression.rb +5 -2
- data/lib/expressir/model/expressions/simple_reference.rb +3 -1
- data/lib/expressir/model/expressions/unary_expression.rb +3 -1
- data/lib/expressir/model/function.rb +28 -39
- data/lib/expressir/model/identifier.rb +1 -3
- data/lib/expressir/model/informal_proposition.rb +5 -1
- data/lib/expressir/model/interface.rb +4 -2
- data/lib/expressir/model/literals/binary.rb +3 -1
- data/lib/expressir/model/literals/integer.rb +3 -1
- data/lib/expressir/model/literals/logical.rb +3 -1
- data/lib/expressir/model/literals/real.rb +3 -1
- data/lib/expressir/model/literals/string.rb +3 -1
- data/lib/expressir/model/model_element.rb +140 -0
- data/lib/expressir/model/parameter.rb +5 -1
- data/lib/expressir/model/procedure.rb +29 -40
- data/lib/expressir/model/renamed_ref.rb +3 -1
- data/lib/expressir/model/repository.rb +5 -5
- data/lib/expressir/model/rule.rb +32 -43
- data/lib/expressir/model/schema.rb +48 -48
- data/lib/expressir/model/statements/alias.rb +6 -3
- data/lib/expressir/model/statements/assignment.rb +3 -1
- data/lib/expressir/model/statements/call.rb +4 -2
- data/lib/expressir/model/statements/case.rb +4 -2
- data/lib/expressir/model/statements/case_action.rb +4 -2
- data/lib/expressir/model/statements/compound.rb +4 -2
- data/lib/expressir/model/statements/escape.rb +1 -1
- data/lib/expressir/model/statements/if.rb +5 -3
- data/lib/expressir/model/statements/null.rb +1 -1
- data/lib/expressir/model/statements/repeat.rb +6 -3
- data/lib/expressir/model/statements/return.rb +3 -1
- data/lib/expressir/model/statements/skip.rb +1 -1
- data/lib/expressir/model/subtype_constraint.rb +5 -2
- data/lib/expressir/model/type.rb +10 -11
- data/lib/expressir/model/types/aggregate.rb +5 -1
- data/lib/expressir/model/types/array.rb +3 -1
- data/lib/expressir/model/types/bag.rb +3 -1
- data/lib/expressir/model/types/binary.rb +3 -1
- data/lib/expressir/model/types/boolean.rb +1 -1
- data/lib/expressir/model/types/enumeration.rb +5 -3
- data/lib/expressir/model/types/generic.rb +5 -1
- data/lib/expressir/model/types/generic_entity.rb +5 -1
- data/lib/expressir/model/types/integer.rb +1 -1
- data/lib/expressir/model/types/list.rb +3 -1
- data/lib/expressir/model/types/logical.rb +1 -1
- data/lib/expressir/model/types/number.rb +1 -1
- data/lib/expressir/model/types/real.rb +3 -1
- data/lib/expressir/model/types/select.rb +5 -3
- data/lib/expressir/model/types/set.rb +3 -1
- data/lib/expressir/model/types/string.rb +3 -1
- data/lib/expressir/model/unique.rb +6 -2
- data/lib/expressir/model/variable.rb +5 -1
- data/lib/expressir/model/where.rb +5 -1
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/hyperlink.exp +8 -0
- data/original/examples/syntax/hyperlink_formatted.exp +19 -0
- data/original/examples/syntax/remark_formatted.exp +0 -5
- data/original/examples/syntax/simple.exp +3 -0
- data/original/examples/syntax/syntax.exp +197 -189
- data/original/examples/syntax/syntax_formatted.exp +362 -800
- data/spec/expressir/express_exp/{format_remark_spec.rb → formatter/remark_spec.rb} +2 -2
- data/spec/expressir/express_exp/{format_syntax_spec.rb → formatter/syntax_spec.rb} +2 -2
- data/spec/expressir/express_exp/hyperlink_formatter_spec.rb +24 -0
- data/spec/expressir/express_exp/{head_source_spec.rb → parser/head_source_spec.rb} +2 -5
- data/spec/expressir/express_exp/{parse_multiple_spec.rb → parser/multiple_spec.rb} +6 -1
- data/spec/expressir/express_exp/{parse_remark_spec.rb → parser/remark_spec.rb} +5 -5
- data/spec/expressir/express_exp/{source_spec.rb → parser/source_spec.rb} +2 -5
- data/spec/expressir/express_exp/{parse_syntax_spec.rb → parser/syntax_spec.rb} +1619 -1582
- data/spec/expressir/express_exp/schema_head_formatter_spec.rb +36 -0
- data/spec/expressir/model/{find_spec.rb → model_element/find_spec.rb} +7 -2
- data/spec/expressir/model/model_element/hash_spec.rb +66 -0
- metadata +34 -12
- data/lib/expressir/model/scope.rb +0 -66
- data/spec/expressir/express_exp/ap233_spec.rb +0 -22
@@ -4,8 +4,8 @@ require "expressir/express_exp/formatter"
|
|
4
4
|
|
5
5
|
RSpec.describe Expressir::ExpressExp::Formatter do
|
6
6
|
describe ".format" do
|
7
|
-
it "formats
|
8
|
-
repo = Expressir::ExpressExp::Parser.
|
7
|
+
it "formats remark" do
|
8
|
+
repo = Expressir::ExpressExp::Parser.from_file(input_file)
|
9
9
|
|
10
10
|
result = Expressir::ExpressExp::Formatter.format(repo)
|
11
11
|
expected_result = File.read(output_file)
|
@@ -4,8 +4,8 @@ require "expressir/express_exp/formatter"
|
|
4
4
|
|
5
5
|
RSpec.describe Expressir::ExpressExp::Formatter do
|
6
6
|
describe ".format" do
|
7
|
-
it "formats
|
8
|
-
repo = Expressir::ExpressExp::Parser.
|
7
|
+
it "formats syntax" do
|
8
|
+
repo = Expressir::ExpressExp::Parser.from_file(input_file)
|
9
9
|
|
10
10
|
result = Expressir::ExpressExp::Formatter.format(repo)
|
11
11
|
expected_result = File.read(output_file)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "expressir/express_exp/parser"
|
3
|
+
require "expressir/express_exp/hyperlink_formatter"
|
4
|
+
|
5
|
+
RSpec.describe Expressir::ExpressExp::HyperlinkFormatter do
|
6
|
+
describe ".format" do
|
7
|
+
it "formats hyperlink" do
|
8
|
+
repo = Expressir::ExpressExp::Parser.from_file(input_file)
|
9
|
+
|
10
|
+
result = Expressir::ExpressExp::HyperlinkFormatter.format(repo)
|
11
|
+
expected_result = File.read(output_file)
|
12
|
+
|
13
|
+
expect(result).to eq(expected_result)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def input_file
|
18
|
+
@input_file ||= Expressir.root_path.join("original", "examples", "syntax", "hyperlink.exp")
|
19
|
+
end
|
20
|
+
|
21
|
+
def output_file
|
22
|
+
@output_file ||= Expressir.root_path.join("original", "examples", "syntax", "hyperlink_formatted.exp")
|
23
|
+
end
|
24
|
+
end
|
@@ -1,14 +1,11 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "expressir/express_exp/parser"
|
3
3
|
|
4
|
-
RSpec.describe Expressir::
|
4
|
+
RSpec.describe Expressir::ExpressExp::Parser do
|
5
5
|
describe ".head_source" do
|
6
6
|
it "contains original head source" do
|
7
7
|
input = File.read(sample_file)
|
8
|
-
repo = Expressir::ExpressExp::Parser.
|
9
|
-
|
10
|
-
expected_result = input
|
11
|
-
expect(repo.source).to eq(expected_result)
|
8
|
+
repo = Expressir::ExpressExp::Parser.from_file(sample_file)
|
12
9
|
|
13
10
|
repo.schemas[0].tap do |x|
|
14
11
|
start_index = x.source.index("SCHEMA")
|
@@ -3,15 +3,20 @@ require "expressir/express_exp/parser"
|
|
3
3
|
|
4
4
|
RSpec.describe Expressir::ExpressExp::Parser do
|
5
5
|
describe ".from_files" do
|
6
|
-
it "
|
6
|
+
it "parses multiple files" do
|
7
7
|
repo = Expressir::ExpressExp::Parser.from_files(sample_files)
|
8
8
|
|
9
9
|
schemas = repo.schemas
|
10
10
|
expect(schemas.count).to eq(5)
|
11
|
+
expect(schemas[0].file).to eq(sample_files[0])
|
11
12
|
expect(schemas[0].id).to eq("syntax_schema")
|
13
|
+
expect(schemas[1].file).to eq(sample_files[1])
|
12
14
|
expect(schemas[1].id).to eq("remark_schema")
|
15
|
+
expect(schemas[2].file).to eq(sample_files[2])
|
13
16
|
expect(schemas[2].id).to eq("entity_schema")
|
17
|
+
expect(schemas[3].file).to eq(sample_files[2])
|
14
18
|
expect(schemas[3].id).to eq("version_entity_schema")
|
19
|
+
expect(schemas[4].file).to eq(sample_files[2])
|
15
20
|
expect(schemas[4].id).to eq("version_interface_entity_schema")
|
16
21
|
end
|
17
22
|
end
|
@@ -3,8 +3,8 @@ require "expressir/express_exp/parser"
|
|
3
3
|
|
4
4
|
RSpec.describe Expressir::ExpressExp::Parser do
|
5
5
|
describe ".from_file" do
|
6
|
-
it "
|
7
|
-
repo = Expressir::ExpressExp::Parser.
|
6
|
+
it "parses remark" do
|
7
|
+
repo = Expressir::ExpressExp::Parser.from_file(sample_file)
|
8
8
|
|
9
9
|
schema = repo.schemas.first
|
10
10
|
|
@@ -78,7 +78,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
78
78
|
expect(x.remarks[1]).to eq("universal scope - entity")
|
79
79
|
end
|
80
80
|
|
81
|
-
schema.entities.first.
|
81
|
+
schema.entities.first.attributes.find{|x| x.kind == Expressir::Model::Attribute::EXPLICIT}.tap do |x|
|
82
82
|
expect(x).to be_instance_of(Expressir::Model::Attribute)
|
83
83
|
expect(x.kind).to eq(Expressir::Model::Attribute::EXPLICIT)
|
84
84
|
expect(x.remarks).to be_instance_of(Array)
|
@@ -88,7 +88,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
88
88
|
expect(x.remarks[2]).to eq("universal scope - entity attribute")
|
89
89
|
end
|
90
90
|
|
91
|
-
schema.entities.first.
|
91
|
+
schema.entities.first.attributes.find{|x| x.kind == Expressir::Model::Attribute::DERIVED}.tap do |x|
|
92
92
|
expect(x).to be_instance_of(Expressir::Model::Attribute)
|
93
93
|
expect(x.kind).to eq(Expressir::Model::Attribute::DERIVED)
|
94
94
|
expect(x.remarks).to be_instance_of(Array)
|
@@ -98,7 +98,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
98
98
|
expect(x.remarks[2]).to eq("universal scope - entity derived attribute")
|
99
99
|
end
|
100
100
|
|
101
|
-
schema.entities.first.
|
101
|
+
schema.entities.first.attributes.find{|x| x.kind == Expressir::Model::Attribute::INVERSE}.tap do |x|
|
102
102
|
expect(x).to be_instance_of(Expressir::Model::Attribute)
|
103
103
|
expect(x.kind).to eq(Expressir::Model::Attribute::INVERSE)
|
104
104
|
expect(x.remarks).to be_instance_of(Array)
|
@@ -1,14 +1,11 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "expressir/express_exp/parser"
|
3
3
|
|
4
|
-
RSpec.describe Expressir::
|
4
|
+
RSpec.describe Expressir::ExpressExp::Parser do
|
5
5
|
describe ".source" do
|
6
6
|
it "contains original source" do
|
7
7
|
input = File.read(sample_file)
|
8
|
-
repo = Expressir::ExpressExp::Parser.
|
9
|
-
|
10
|
-
expected_result = input
|
11
|
-
expect(repo.source).to eq(expected_result)
|
8
|
+
repo = Expressir::ExpressExp::Parser.from_file(sample_file)
|
12
9
|
|
13
10
|
schema = repo.schemas.first
|
14
11
|
start_index = input.index("SCHEMA")
|
@@ -3,8 +3,8 @@ require "expressir/express_exp/parser"
|
|
3
3
|
|
4
4
|
RSpec.describe Expressir::ExpressExp::Parser do
|
5
5
|
describe ".from_file" do
|
6
|
-
it "
|
7
|
-
repo = Expressir::ExpressExp::Parser.
|
6
|
+
it "parses syntax" do
|
7
|
+
repo = Expressir::ExpressExp::Parser.from_file(sample_file)
|
8
8
|
|
9
9
|
schemas = repo.schemas
|
10
10
|
|
@@ -12,8 +12,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
12
12
|
expect(schema.version).to be_instance_of(Expressir::Model::Literals::String)
|
13
13
|
expect(schema.version.value).to eq("version")
|
14
14
|
|
15
|
-
|
16
|
-
reference_interfaces = schema.reference_interfaces
|
15
|
+
interfaces = schema.interfaces
|
17
16
|
constants = schema.constants
|
18
17
|
types = schema.types
|
19
18
|
entities = schema.entities
|
@@ -23,14 +22,14 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
23
22
|
rules = schema.rules
|
24
23
|
|
25
24
|
# intefaces
|
26
|
-
|
25
|
+
interfaces[0].tap do |x|
|
27
26
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
28
27
|
expect(x.kind).to eq(Expressir::Model::Interface::USE)
|
29
28
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
30
29
|
expect(x.schema.id).to eq("contract_schema")
|
31
30
|
end
|
32
31
|
|
33
|
-
|
32
|
+
interfaces[1].tap do |x|
|
34
33
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
35
34
|
expect(x.kind).to eq(Expressir::Model::Interface::USE)
|
36
35
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
@@ -41,7 +40,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
41
40
|
expect(x.items[0].id).to eq("contract")
|
42
41
|
end
|
43
42
|
|
44
|
-
|
43
|
+
interfaces[2].tap do |x|
|
45
44
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
46
45
|
expect(x.kind).to eq(Expressir::Model::Interface::USE)
|
47
46
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
@@ -54,7 +53,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
54
53
|
expect(x.items[1].id).to eq("contract2")
|
55
54
|
end
|
56
55
|
|
57
|
-
|
56
|
+
interfaces[3].tap do |x|
|
58
57
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
59
58
|
expect(x.kind).to eq(Expressir::Model::Interface::USE)
|
60
59
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
@@ -67,14 +66,14 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
67
66
|
expect(x.items[0].id).to eq("contract2")
|
68
67
|
end
|
69
68
|
|
70
|
-
|
69
|
+
interfaces[4].tap do |x|
|
71
70
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
72
71
|
expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
|
73
72
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
74
73
|
expect(x.schema.id).to eq("contract_schema")
|
75
74
|
end
|
76
75
|
|
77
|
-
|
76
|
+
interfaces[5].tap do |x|
|
78
77
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
79
78
|
expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
|
80
79
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
@@ -85,7 +84,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
85
84
|
expect(x.items[0].id).to eq("contract")
|
86
85
|
end
|
87
86
|
|
88
|
-
|
87
|
+
interfaces[6].tap do |x|
|
89
88
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
90
89
|
expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
|
91
90
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
@@ -98,7 +97,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
98
97
|
expect(x.items[1].id).to eq("contract2")
|
99
98
|
end
|
100
99
|
|
101
|
-
|
100
|
+
interfaces[7].tap do |x|
|
102
101
|
expect(x).to be_instance_of(Expressir::Model::Interface)
|
103
102
|
expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
|
104
103
|
expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
@@ -243,6 +242,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
243
242
|
|
244
243
|
entities.find{|x| x.id == "attribute_redeclared_entity"}.tap do |x|
|
245
244
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
245
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
246
|
+
expect(x.subtype_of.count).to eq(1)
|
247
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
248
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
246
249
|
expect(x.attributes).to be_instance_of(Array)
|
247
250
|
expect(x.attributes.count).to eq(1)
|
248
251
|
expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
|
@@ -260,6 +263,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
260
263
|
|
261
264
|
entities.find{|x| x.id == "attribute_redeclared_renamed_entity"}.tap do |x|
|
262
265
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
266
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
267
|
+
expect(x.subtype_of.count).to eq(1)
|
268
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
269
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
263
270
|
expect(x.attributes).to be_instance_of(Array)
|
264
271
|
expect(x.attributes.count).to eq(1)
|
265
272
|
expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
|
@@ -290,6 +297,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
290
297
|
|
291
298
|
entities.find{|x| x.id == "derived_attribute_redeclared_entity"}.tap do |x|
|
292
299
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
300
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
301
|
+
expect(x.subtype_of.count).to eq(1)
|
302
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
303
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
293
304
|
expect(x.attributes).to be_instance_of(Array)
|
294
305
|
expect(x.attributes.count).to eq(1)
|
295
306
|
expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
|
@@ -309,6 +320,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
309
320
|
|
310
321
|
entities.find{|x| x.id == "derived_attribute_redeclared_renamed_entity"}.tap do |x|
|
311
322
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
323
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
324
|
+
expect(x.subtype_of.count).to eq(1)
|
325
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
326
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
312
327
|
expect(x.attributes).to be_instance_of(Array)
|
313
328
|
expect(x.attributes.count).to eq(1)
|
314
329
|
expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
|
@@ -422,6 +437,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
422
437
|
|
423
438
|
entities.find{|x| x.id == "inverse_attribute_redeclared_entity"}.tap do |x|
|
424
439
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
440
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
441
|
+
expect(x.subtype_of.count).to eq(1)
|
442
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
443
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
425
444
|
expect(x.attributes).to be_instance_of(Array)
|
426
445
|
expect(x.attributes.count).to eq(1)
|
427
446
|
expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
|
@@ -442,6 +461,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
442
461
|
|
443
462
|
entities.find{|x| x.id == "inverse_attribute_redeclared_renamed_entity"}.tap do |x|
|
444
463
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
464
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
465
|
+
expect(x.subtype_of.count).to eq(1)
|
466
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
467
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
445
468
|
expect(x.attributes).to be_instance_of(Array)
|
446
469
|
expect(x.attributes.count).to eq(1)
|
447
470
|
expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
|
@@ -496,8 +519,12 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
496
519
|
expect(x.unique[0].attributes[0].id).to eq("test")
|
497
520
|
end
|
498
521
|
|
499
|
-
entities.find{|x| x.id == "
|
522
|
+
entities.find{|x| x.id == "unique_redeclared_entity"}.tap do |x|
|
500
523
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
524
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
525
|
+
expect(x.subtype_of.count).to eq(1)
|
526
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
527
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
501
528
|
expect(x.unique).to be_instance_of(Array)
|
502
529
|
expect(x.unique.count).to eq(1)
|
503
530
|
expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
|
@@ -525,8 +552,12 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
525
552
|
expect(x.unique[0].attributes[0].id).to eq("test")
|
526
553
|
end
|
527
554
|
|
528
|
-
entities.find{|x| x.id == "
|
555
|
+
entities.find{|x| x.id == "unique_label_redeclared_entity"}.tap do |x|
|
529
556
|
expect(x).to be_instance_of(Expressir::Model::Entity)
|
557
|
+
expect(x.subtype_of).to be_instance_of(Array)
|
558
|
+
expect(x.subtype_of.count).to eq(1)
|
559
|
+
expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
560
|
+
expect(x.subtype_of[0].id).to eq("attribute_entity")
|
530
561
|
expect(x.unique).to be_instance_of(Array)
|
531
562
|
expect(x.unique.count).to eq(1)
|
532
563
|
expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
|
@@ -882,11 +913,11 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
882
913
|
functions.find{|x| x.id == "type_function"}.tap do |x|
|
883
914
|
expect(x).to be_instance_of(Expressir::Model::Function)
|
884
915
|
expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
|
885
|
-
expect(x.
|
886
|
-
expect(x.
|
887
|
-
expect(x.
|
888
|
-
expect(x.
|
889
|
-
expect(x.
|
916
|
+
expect(x.types).to be_instance_of(Array)
|
917
|
+
expect(x.types.count).to eq(1)
|
918
|
+
expect(x.types[0]).to be_instance_of(Expressir::Model::Type)
|
919
|
+
expect(x.types[0].id).to eq("test")
|
920
|
+
expect(x.types[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
|
890
921
|
expect(x.statements).to be_instance_of(Array)
|
891
922
|
expect(x.statements.count).to eq(1)
|
892
923
|
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
@@ -1124,11 +1155,11 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
1124
1155
|
|
1125
1156
|
procedures.find{|x| x.id == "type_procedure"}.tap do |x|
|
1126
1157
|
expect(x).to be_instance_of(Expressir::Model::Procedure)
|
1127
|
-
expect(x.
|
1128
|
-
expect(x.
|
1129
|
-
expect(x.
|
1130
|
-
expect(x.
|
1131
|
-
expect(x.
|
1158
|
+
expect(x.types).to be_instance_of(Array)
|
1159
|
+
expect(x.types.count).to eq(1)
|
1160
|
+
expect(x.types[0]).to be_instance_of(Expressir::Model::Type)
|
1161
|
+
expect(x.types[0].id).to eq("test")
|
1162
|
+
expect(x.types[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
|
1132
1163
|
end
|
1133
1164
|
|
1134
1165
|
procedures.find{|x| x.id == "constant_procedure"}.tap do |x|
|
@@ -1261,11 +1292,11 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
1261
1292
|
expect(x.applies_to.count).to eq(1)
|
1262
1293
|
expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1263
1294
|
expect(x.applies_to[0].id).to eq("empty_entity")
|
1264
|
-
expect(x.
|
1265
|
-
expect(x.
|
1266
|
-
expect(x.
|
1267
|
-
expect(x.
|
1268
|
-
expect(x.
|
1295
|
+
expect(x.types).to be_instance_of(Array)
|
1296
|
+
expect(x.types.count).to eq(1)
|
1297
|
+
expect(x.types[0]).to be_instance_of(Expressir::Model::Type)
|
1298
|
+
expect(x.types[0].id).to eq("test")
|
1299
|
+
expect(x.types[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
|
1269
1300
|
expect(x.where).to be_instance_of(Array)
|
1270
1301
|
expect(x.where.count).to eq(1)
|
1271
1302
|
expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
|
@@ -1478,1559 +1509,1565 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
1478
1509
|
expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1479
1510
|
end
|
1480
1511
|
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
end
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
|
2166
|
-
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
2188
|
-
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2192
|
-
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2207
|
-
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2248
|
-
|
2249
|
-
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2307
|
-
|
2308
|
-
|
2309
|
-
|
2310
|
-
|
2311
|
-
|
2312
|
-
|
2313
|
-
|
2314
|
-
|
2315
|
-
|
2316
|
-
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
2332
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2345
|
-
|
2346
|
-
|
2347
|
-
|
2348
|
-
|
2349
|
-
|
2350
|
-
|
2351
|
-
|
2352
|
-
|
2353
|
-
|
2354
|
-
|
2355
|
-
|
2356
|
-
|
2357
|
-
|
2358
|
-
|
2359
|
-
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2370
|
-
|
2371
|
-
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2375
|
-
|
2376
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2385
|
-
|
2386
|
-
|
2387
|
-
|
2388
|
-
|
2389
|
-
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2451
|
-
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2456
|
-
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
2464
|
-
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2468
|
-
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2476
|
-
|
2477
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2485
|
-
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2501
|
-
|
2502
|
-
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2523
|
-
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
2578
|
-
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
2590
|
-
|
2591
|
-
|
2592
|
-
|
2593
|
-
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
|
2598
|
-
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2603
|
-
|
2604
|
-
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
|
2628
|
-
|
2629
|
-
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2660
|
-
|
2661
|
-
|
2662
|
-
|
2663
|
-
|
2664
|
-
|
2665
|
-
|
2666
|
-
|
2667
|
-
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2676
|
-
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2697
|
-
|
2698
|
-
|
2699
|
-
|
2700
|
-
|
2701
|
-
|
2702
|
-
|
2703
|
-
|
2704
|
-
|
2705
|
-
|
2706
|
-
|
2707
|
-
|
2708
|
-
|
2709
|
-
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
2718
|
-
|
2719
|
-
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2730
|
-
|
2731
|
-
|
2732
|
-
|
2733
|
-
|
2734
|
-
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
2741
|
-
|
2742
|
-
|
2743
|
-
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2761
|
-
|
2762
|
-
|
2763
|
-
|
2764
|
-
|
2765
|
-
|
2766
|
-
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
|
-
|
2771
|
-
|
2772
|
-
|
2773
|
-
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
2791
|
-
|
2792
|
-
|
2793
|
-
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2859
|
-
|
2860
|
-
|
2861
|
-
|
2862
|
-
|
2863
|
-
|
2864
|
-
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
|
2869
|
-
|
2870
|
-
|
2871
|
-
|
2872
|
-
|
2873
|
-
|
2874
|
-
|
2875
|
-
|
2876
|
-
|
2877
|
-
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2882
|
-
|
2883
|
-
|
2884
|
-
|
2885
|
-
|
2886
|
-
|
2887
|
-
|
2888
|
-
|
2889
|
-
|
2890
|
-
|
2891
|
-
|
2892
|
-
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2897
|
-
|
2898
|
-
|
2899
|
-
|
2900
|
-
|
2901
|
-
|
2902
|
-
|
2903
|
-
|
2904
|
-
|
2905
|
-
|
2906
|
-
|
2907
|
-
|
2908
|
-
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
2912
|
-
|
2913
|
-
|
2914
|
-
|
2915
|
-
|
2916
|
-
|
2917
|
-
|
2918
|
-
|
2919
|
-
|
2920
|
-
|
2921
|
-
|
2922
|
-
|
2923
|
-
|
2924
|
-
|
2925
|
-
|
2926
|
-
|
2927
|
-
|
2928
|
-
|
2929
|
-
|
2930
|
-
|
2931
|
-
|
2932
|
-
|
2933
|
-
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
2939
|
-
|
2940
|
-
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
2945
|
-
|
2946
|
-
|
2947
|
-
|
2948
|
-
|
2949
|
-
|
2950
|
-
|
2951
|
-
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2957
|
-
|
2958
|
-
|
2959
|
-
|
2960
|
-
|
2961
|
-
|
2962
|
-
|
2963
|
-
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2967
|
-
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
2976
|
-
|
2977
|
-
|
2978
|
-
|
2979
|
-
|
2980
|
-
|
2981
|
-
|
2982
|
-
|
2983
|
-
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2997
|
-
|
2998
|
-
|
2999
|
-
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
1512
|
+
procedures.find{|x| x.id == "statements"}.tap do |x|
|
1513
|
+
# statements
|
1514
|
+
x.procedures.find{|x| x.id == "alias_simple_reference_statement"}.statements[0].tap do |x|
|
1515
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
|
1516
|
+
expect(x.id).to eq("test")
|
1517
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1518
|
+
expect(x.expression.id).to eq("test")
|
1519
|
+
expect(x.statements).to be_instance_of(Array)
|
1520
|
+
expect(x.statements.count).to eq(1)
|
1521
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1522
|
+
end
|
1523
|
+
|
1524
|
+
x.procedures.find{|x| x.id == "alias_group_reference_statement"}.statements[0].tap do |x|
|
1525
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
|
1526
|
+
expect(x.id).to eq("test")
|
1527
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::GroupReference)
|
1528
|
+
expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1529
|
+
expect(x.expression.ref.id).to eq("test")
|
1530
|
+
expect(x.expression.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1531
|
+
expect(x.expression.entity.id).to eq("test2")
|
1532
|
+
expect(x.statements).to be_instance_of(Array)
|
1533
|
+
expect(x.statements.count).to eq(1)
|
1534
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1535
|
+
end
|
1536
|
+
|
1537
|
+
x.procedures.find{|x| x.id == "alias_index_reference_statement"}.statements[0].tap do |x|
|
1538
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
|
1539
|
+
expect(x.id).to eq("test")
|
1540
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::IndexReference)
|
1541
|
+
expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1542
|
+
expect(x.expression.ref.id).to eq("test")
|
1543
|
+
expect(x.expression.index1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1544
|
+
expect(x.expression.index1.value).to eq("1")
|
1545
|
+
expect(x.statements).to be_instance_of(Array)
|
1546
|
+
expect(x.statements.count).to eq(1)
|
1547
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1548
|
+
end
|
1549
|
+
|
1550
|
+
x.procedures.find{|x| x.id == "alias_index2_reference_statement"}.statements[0].tap do |x|
|
1551
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
|
1552
|
+
expect(x.id).to eq("test")
|
1553
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::IndexReference)
|
1554
|
+
expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1555
|
+
expect(x.expression.ref.id).to eq("test")
|
1556
|
+
expect(x.expression.index1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1557
|
+
expect(x.expression.index1.value).to eq("1")
|
1558
|
+
expect(x.expression.index2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1559
|
+
expect(x.expression.index2.value).to eq("9")
|
1560
|
+
expect(x.statements).to be_instance_of(Array)
|
1561
|
+
expect(x.statements.count).to eq(1)
|
1562
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1563
|
+
end
|
1564
|
+
|
1565
|
+
x.procedures.find{|x| x.id == "alias_attribute_reference_statement"}.statements[0].tap do |x|
|
1566
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
|
1567
|
+
expect(x.id).to eq("test")
|
1568
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
|
1569
|
+
expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1570
|
+
expect(x.expression.ref.id).to eq("test")
|
1571
|
+
expect(x.expression.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1572
|
+
expect(x.expression.attribute.id).to eq("test2")
|
1573
|
+
expect(x.statements).to be_instance_of(Array)
|
1574
|
+
expect(x.statements.count).to eq(1)
|
1575
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1576
|
+
end
|
1577
|
+
|
1578
|
+
x.procedures.find{|x| x.id == "assignment_simple_reference_statement"}.statements[0].tap do |x|
|
1579
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
|
1580
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1581
|
+
expect(x.ref.id).to eq("test")
|
1582
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1583
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1584
|
+
end
|
1585
|
+
|
1586
|
+
x.procedures.find{|x| x.id == "assignment_group_reference_statement"}.statements[0].tap do |x|
|
1587
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
|
1588
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
|
1589
|
+
expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1590
|
+
expect(x.ref.ref.id).to eq("test")
|
1591
|
+
expect(x.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1592
|
+
expect(x.ref.entity.id).to eq("test2")
|
1593
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1594
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1595
|
+
end
|
1596
|
+
|
1597
|
+
x.procedures.find{|x| x.id == "assignment_index_reference_statement"}.statements[0].tap do |x|
|
1598
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
|
1599
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::IndexReference)
|
1600
|
+
expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1601
|
+
expect(x.ref.ref.id).to eq("test")
|
1602
|
+
expect(x.ref.index1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1603
|
+
expect(x.ref.index1.value).to eq("1")
|
1604
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1605
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1606
|
+
end
|
1607
|
+
|
1608
|
+
x.procedures.find{|x| x.id == "assignment_index2_reference_statement"}.statements[0].tap do |x|
|
1609
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
|
1610
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::IndexReference)
|
1611
|
+
expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1612
|
+
expect(x.ref.ref.id).to eq("test")
|
1613
|
+
expect(x.ref.index1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1614
|
+
expect(x.ref.index1.value).to eq("1")
|
1615
|
+
expect(x.ref.index2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1616
|
+
expect(x.ref.index2.value).to eq("9")
|
1617
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1618
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1619
|
+
end
|
1620
|
+
|
1621
|
+
x.procedures.find{|x| x.id == "assignment_attribute_reference_statement"}.statements[0].tap do |x|
|
1622
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
|
1623
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
|
1624
|
+
expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1625
|
+
expect(x.ref.ref.id).to eq("test")
|
1626
|
+
expect(x.ref.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1627
|
+
expect(x.ref.attribute.id).to eq("test2")
|
1628
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1629
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1630
|
+
end
|
1631
|
+
|
1632
|
+
x.procedures.find{|x| x.id == "case_statement"}.statements[0].tap do |x|
|
1633
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Case)
|
1634
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1635
|
+
expect(x.expression.id).to eq("test")
|
1636
|
+
expect(x.actions).to be_instance_of(Array)
|
1637
|
+
expect(x.actions.count).to eq(1)
|
1638
|
+
expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
|
1639
|
+
expect(x.actions[0].labels).to be_instance_of(Array)
|
1640
|
+
expect(x.actions[0].labels.count).to eq(1)
|
1641
|
+
expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1642
|
+
expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1643
|
+
expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
|
1644
|
+
end
|
1645
|
+
|
1646
|
+
x.procedures.find{|x| x.id == "case_multiple_statement"}.statements[0].tap do |x|
|
1647
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Case)
|
1648
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1649
|
+
expect(x.expression.id).to eq("test")
|
1650
|
+
expect(x.actions).to be_instance_of(Array)
|
1651
|
+
expect(x.actions.count).to eq(2)
|
1652
|
+
expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
|
1653
|
+
expect(x.actions[0].labels).to be_instance_of(Array)
|
1654
|
+
expect(x.actions[0].labels.count).to eq(1)
|
1655
|
+
expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1656
|
+
expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1657
|
+
expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
|
1658
|
+
expect(x.actions[1]).to be_instance_of(Expressir::Model::Statements::CaseAction)
|
1659
|
+
expect(x.actions[1].labels).to be_instance_of(Array)
|
1660
|
+
expect(x.actions[1].labels.count).to eq(1)
|
1661
|
+
expect(x.actions[1].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1662
|
+
expect(x.actions[1].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1663
|
+
expect(x.actions[1].statement).to be_instance_of(Expressir::Model::Statements::Null)
|
1664
|
+
end
|
1665
|
+
|
1666
|
+
x.procedures.find{|x| x.id == "case_multiple_shorthand_statement"}.statements[0].tap do |x|
|
1667
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Case)
|
1668
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1669
|
+
expect(x.expression.id).to eq("test")
|
1670
|
+
expect(x.actions).to be_instance_of(Array)
|
1671
|
+
expect(x.actions.count).to eq(1)
|
1672
|
+
expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
|
1673
|
+
expect(x.actions[0].labels).to be_instance_of(Array)
|
1674
|
+
expect(x.actions[0].labels.count).to eq(2)
|
1675
|
+
expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1676
|
+
expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1677
|
+
expect(x.actions[0].labels[1]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1678
|
+
expect(x.actions[0].labels[1].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1679
|
+
expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
|
1680
|
+
end
|
1681
|
+
|
1682
|
+
x.procedures.find{|x| x.id == "case_otherwise_statement"}.statements[0].tap do |x|
|
1683
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Case)
|
1684
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1685
|
+
expect(x.expression.id).to eq("test")
|
1686
|
+
expect(x.actions).to be_instance_of(Array)
|
1687
|
+
expect(x.actions.count).to eq(1)
|
1688
|
+
expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
|
1689
|
+
expect(x.actions[0].labels).to be_instance_of(Array)
|
1690
|
+
expect(x.actions[0].labels.count).to eq(1)
|
1691
|
+
expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1692
|
+
expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1693
|
+
expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
|
1694
|
+
expect(x.otherwise_statement).to be_instance_of(Expressir::Model::Statements::Null)
|
1695
|
+
end
|
1696
|
+
|
1697
|
+
x.procedures.find{|x| x.id == "compound_statement"}.statements[0].tap do |x|
|
1698
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Compound)
|
1699
|
+
expect(x.statements).to be_instance_of(Array)
|
1700
|
+
expect(x.statements.count).to eq(1)
|
1701
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1702
|
+
end
|
1703
|
+
|
1704
|
+
x.procedures.find{|x| x.id == "escape_statement"}.statements[0].tap do |x|
|
1705
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Escape)
|
1706
|
+
end
|
1707
|
+
|
1708
|
+
x.procedures.find{|x| x.id == "if_statement"}.statements[0].tap do |x|
|
1709
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::If)
|
1710
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1711
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1712
|
+
expect(x.statements).to be_instance_of(Array)
|
1713
|
+
expect(x.statements.count).to eq(1)
|
1714
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1715
|
+
end
|
1716
|
+
|
1717
|
+
x.procedures.find{|x| x.id == "if2_statement"}.statements[0].tap do |x|
|
1718
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::If)
|
1719
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1720
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1721
|
+
expect(x.statements).to be_instance_of(Array)
|
1722
|
+
expect(x.statements.count).to eq(2)
|
1723
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1724
|
+
expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
|
1725
|
+
end
|
1726
|
+
|
1727
|
+
x.procedures.find{|x| x.id == "if_else_statement"}.statements[0].tap do |x|
|
1728
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::If)
|
1729
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1730
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1731
|
+
expect(x.statements).to be_instance_of(Array)
|
1732
|
+
expect(x.statements.count).to eq(1)
|
1733
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1734
|
+
expect(x.else_statements).to be_instance_of(Array)
|
1735
|
+
expect(x.else_statements.count).to eq(1)
|
1736
|
+
expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1737
|
+
end
|
1738
|
+
|
1739
|
+
x.procedures.find{|x| x.id == "if2_else_statement"}.statements[0].tap do |x|
|
1740
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::If)
|
1741
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1742
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1743
|
+
expect(x.statements).to be_instance_of(Array)
|
1744
|
+
expect(x.statements.count).to eq(2)
|
1745
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1746
|
+
expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
|
1747
|
+
expect(x.else_statements).to be_instance_of(Array)
|
1748
|
+
expect(x.else_statements.count).to eq(1)
|
1749
|
+
expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1750
|
+
end
|
1751
|
+
|
1752
|
+
x.procedures.find{|x| x.id == "if_else2_statement"}.statements[0].tap do |x|
|
1753
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::If)
|
1754
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1755
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1756
|
+
expect(x.statements).to be_instance_of(Array)
|
1757
|
+
expect(x.statements.count).to eq(1)
|
1758
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1759
|
+
expect(x.else_statements).to be_instance_of(Array)
|
1760
|
+
expect(x.else_statements.count).to eq(2)
|
1761
|
+
expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1762
|
+
expect(x.else_statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
|
1763
|
+
end
|
1764
|
+
|
1765
|
+
x.procedures.find{|x| x.id == "if2_else2_statement"}.statements[0].tap do |x|
|
1766
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::If)
|
1767
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1768
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1769
|
+
expect(x.statements).to be_instance_of(Array)
|
1770
|
+
expect(x.statements.count).to eq(2)
|
1771
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1772
|
+
expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
|
1773
|
+
expect(x.else_statements).to be_instance_of(Array)
|
1774
|
+
expect(x.else_statements.count).to eq(2)
|
1775
|
+
expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1776
|
+
expect(x.else_statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
|
1777
|
+
end
|
1778
|
+
|
1779
|
+
x.procedures.find{|x| x.id == "null_statement"}.statements[0].tap do |x|
|
1780
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Null)
|
1781
|
+
end
|
1782
|
+
|
1783
|
+
x.procedures.find{|x| x.id == "call_statement"}.statements[0].tap do |x|
|
1784
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Call)
|
1785
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1786
|
+
expect(x.ref.id).to eq("empty_procedure")
|
1787
|
+
end
|
1788
|
+
|
1789
|
+
x.procedures.find{|x| x.id == "call_parameter_statement"}.statements[0].tap do |x|
|
1790
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Call)
|
1791
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1792
|
+
expect(x.ref.id).to eq("empty_procedure")
|
1793
|
+
expect(x.parameters).to be_instance_of(Array)
|
1794
|
+
expect(x.parameters.count).to eq(1)
|
1795
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1796
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1797
|
+
end
|
1798
|
+
|
1799
|
+
x.procedures.find{|x| x.id == "call_parameter2_statement"}.statements[0].tap do |x|
|
1800
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Call)
|
1801
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1802
|
+
expect(x.ref.id).to eq("empty_procedure")
|
1803
|
+
expect(x.parameters).to be_instance_of(Array)
|
1804
|
+
expect(x.parameters.count).to eq(2)
|
1805
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1806
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1807
|
+
expect(x.parameters[1]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1808
|
+
expect(x.parameters[1].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1809
|
+
end
|
1810
|
+
|
1811
|
+
x.procedures.find{|x| x.id == "call_insert_statement"}.statements[0].tap do |x|
|
1812
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Call)
|
1813
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1814
|
+
expect(x.ref.id).to eq("INSERT")
|
1815
|
+
expect(x.parameters).to be_instance_of(Array)
|
1816
|
+
expect(x.parameters.count).to eq(1)
|
1817
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1818
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1819
|
+
end
|
1820
|
+
|
1821
|
+
x.procedures.find{|x| x.id == "call_remove_statement"}.statements[0].tap do |x|
|
1822
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Call)
|
1823
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
1824
|
+
expect(x.ref.id).to eq("REMOVE")
|
1825
|
+
expect(x.parameters).to be_instance_of(Array)
|
1826
|
+
expect(x.parameters.count).to eq(1)
|
1827
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
1828
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1829
|
+
end
|
1830
|
+
|
1831
|
+
x.procedures.find{|x| x.id == "repeat_statement"}.statements[0].tap do |x|
|
1832
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
|
1833
|
+
expect(x.statements).to be_instance_of(Array)
|
1834
|
+
expect(x.statements.count).to eq(1)
|
1835
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1836
|
+
end
|
1837
|
+
|
1838
|
+
x.procedures.find{|x| x.id == "repeat_variable_statement"}.statements[0].tap do |x|
|
1839
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
|
1840
|
+
expect(x.id).to eq("test")
|
1841
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1842
|
+
expect(x.bound1.value).to eq("1")
|
1843
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1844
|
+
expect(x.bound2.value).to eq("9")
|
1845
|
+
expect(x.statements).to be_instance_of(Array)
|
1846
|
+
expect(x.statements.count).to eq(1)
|
1847
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1848
|
+
end
|
1849
|
+
|
1850
|
+
x.procedures.find{|x| x.id == "repeat_variable_increment_statement"}.statements[0].tap do |x|
|
1851
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
|
1852
|
+
expect(x.id).to eq("test")
|
1853
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1854
|
+
expect(x.bound1.value).to eq("1")
|
1855
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1856
|
+
expect(x.bound2.value).to eq("9")
|
1857
|
+
expect(x.increment).to be_instance_of(Expressir::Model::Literals::Integer)
|
1858
|
+
expect(x.increment.value).to eq("2")
|
1859
|
+
expect(x.statements).to be_instance_of(Array)
|
1860
|
+
expect(x.statements.count).to eq(1)
|
1861
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1862
|
+
end
|
1863
|
+
|
1864
|
+
x.procedures.find{|x| x.id == "repeat_while_statement"}.statements[0].tap do |x|
|
1865
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
|
1866
|
+
expect(x.while_expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1867
|
+
expect(x.while_expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1868
|
+
expect(x.statements).to be_instance_of(Array)
|
1869
|
+
expect(x.statements.count).to eq(1)
|
1870
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1871
|
+
end
|
1872
|
+
|
1873
|
+
x.procedures.find{|x| x.id == "repeat_until_statement"}.statements[0].tap do |x|
|
1874
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
|
1875
|
+
expect(x.until_expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1876
|
+
expect(x.until_expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1877
|
+
expect(x.statements).to be_instance_of(Array)
|
1878
|
+
expect(x.statements.count).to eq(1)
|
1879
|
+
expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
|
1880
|
+
end
|
1881
|
+
|
1882
|
+
x.procedures.find{|x| x.id == "return_statement"}.statements[0].tap do |x|
|
1883
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Return)
|
1884
|
+
end
|
1885
|
+
|
1886
|
+
x.procedures.find{|x| x.id == "return_expression_statement"}.statements[0].tap do |x|
|
1887
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Return)
|
1888
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
1889
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
1890
|
+
end
|
1891
|
+
|
1892
|
+
x.procedures.find{|x| x.id == "skip_statement"}.statements[0].tap do |x|
|
1893
|
+
expect(x).to be_instance_of(Expressir::Model::Statements::Skip)
|
1894
|
+
end
|
1895
|
+
end
|
1896
|
+
|
1897
|
+
procedures.find{|x| x.id == "types"}.tap do |x|
|
1898
|
+
# simple types
|
1899
|
+
x.types.find{|x| x.id == "binary_type"}.type.tap do |x|
|
1900
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Binary)
|
1901
|
+
end
|
1902
|
+
|
1903
|
+
x.types.find{|x| x.id == "binary_width_type"}.type.tap do |x|
|
1904
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Binary)
|
1905
|
+
expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
|
1906
|
+
expect(x.width.value).to eq("3")
|
1907
|
+
end
|
1908
|
+
|
1909
|
+
x.types.find{|x| x.id == "binary_width_fixed_type"}.type.tap do |x|
|
1910
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Binary)
|
1911
|
+
expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
|
1912
|
+
expect(x.width.value).to eq("3")
|
1913
|
+
expect(x.fixed).to eq(true)
|
1914
|
+
end
|
1915
|
+
|
1916
|
+
x.types.find{|x| x.id == "boolean_type"}.type.tap do |x|
|
1917
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Boolean)
|
1918
|
+
end
|
1919
|
+
|
1920
|
+
x.types.find{|x| x.id == "integer_type"}.type.tap do |x|
|
1921
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Integer)
|
1922
|
+
end
|
1923
|
+
|
1924
|
+
x.types.find{|x| x.id == "logical_type"}.type.tap do |x|
|
1925
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Logical)
|
1926
|
+
end
|
1927
|
+
|
1928
|
+
x.types.find{|x| x.id == "number_type"}.type.tap do |x|
|
1929
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Number)
|
1930
|
+
end
|
1931
|
+
|
1932
|
+
x.types.find{|x| x.id == "real_type"}.type.tap do |x|
|
1933
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Real)
|
1934
|
+
end
|
1935
|
+
|
1936
|
+
x.types.find{|x| x.id == "real_precision_type"}.type.tap do |x|
|
1937
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Real)
|
1938
|
+
expect(x.precision).to be_instance_of(Expressir::Model::Literals::Integer)
|
1939
|
+
expect(x.precision.value).to eq("3")
|
1940
|
+
end
|
1941
|
+
|
1942
|
+
x.types.find{|x| x.id == "string_type"}.type.tap do |x|
|
1943
|
+
expect(x).to be_instance_of(Expressir::Model::Types::String)
|
1944
|
+
end
|
1945
|
+
|
1946
|
+
x.types.find{|x| x.id == "string_width_type"}.type.tap do |x|
|
1947
|
+
expect(x).to be_instance_of(Expressir::Model::Types::String)
|
1948
|
+
expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
|
1949
|
+
expect(x.width.value).to eq("3")
|
1950
|
+
end
|
1951
|
+
|
1952
|
+
x.types.find{|x| x.id == "string_width_fixed_type"}.type.tap do |x|
|
1953
|
+
expect(x).to be_instance_of(Expressir::Model::Types::String)
|
1954
|
+
expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
|
1955
|
+
expect(x.width.value).to eq("3")
|
1956
|
+
expect(x.fixed).to eq(true)
|
1957
|
+
end
|
1958
|
+
|
1959
|
+
# aggregation types
|
1960
|
+
x.types.find{|x| x.id == "array_type"}.type.tap do |x|
|
1961
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Array)
|
1962
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1963
|
+
expect(x.bound1.value).to eq("1")
|
1964
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1965
|
+
expect(x.bound2.value).to eq("9")
|
1966
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
1967
|
+
end
|
1968
|
+
|
1969
|
+
x.types.find{|x| x.id == "array_optional_type"}.type.tap do |x|
|
1970
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Array)
|
1971
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1972
|
+
expect(x.bound1.value).to eq("1")
|
1973
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1974
|
+
expect(x.bound2.value).to eq("9")
|
1975
|
+
expect(x.optional).to eq(true)
|
1976
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
1977
|
+
end
|
1978
|
+
|
1979
|
+
x.types.find{|x| x.id == "array_unique_type"}.type.tap do |x|
|
1980
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Array)
|
1981
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1982
|
+
expect(x.bound1.value).to eq("1")
|
1983
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1984
|
+
expect(x.bound2.value).to eq("9")
|
1985
|
+
expect(x.unique).to eq(true)
|
1986
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
1987
|
+
end
|
1988
|
+
|
1989
|
+
x.types.find{|x| x.id == "array_optional_unique_type"}.type.tap do |x|
|
1990
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Array)
|
1991
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
1992
|
+
expect(x.bound1.value).to eq("1")
|
1993
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
1994
|
+
expect(x.bound2.value).to eq("9")
|
1995
|
+
expect(x.optional).to eq(true)
|
1996
|
+
expect(x.unique).to eq(true)
|
1997
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
1998
|
+
end
|
1999
|
+
|
2000
|
+
x.types.find{|x| x.id == "bag_type"}.type.tap do |x|
|
2001
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Bag)
|
2002
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2003
|
+
end
|
2004
|
+
|
2005
|
+
x.types.find{|x| x.id == "bag_bound_type"}.type.tap do |x|
|
2006
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Bag)
|
2007
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2008
|
+
expect(x.bound1.value).to eq("1")
|
2009
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2010
|
+
expect(x.bound2.value).to eq("9")
|
2011
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2012
|
+
end
|
2013
|
+
|
2014
|
+
x.types.find{|x| x.id == "list_type"}.type.tap do |x|
|
2015
|
+
expect(x).to be_instance_of(Expressir::Model::Types::List)
|
2016
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2017
|
+
end
|
2018
|
+
|
2019
|
+
x.types.find{|x| x.id == "list_bound_type"}.type.tap do |x|
|
2020
|
+
expect(x).to be_instance_of(Expressir::Model::Types::List)
|
2021
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2022
|
+
expect(x.bound1.value).to eq("1")
|
2023
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2024
|
+
expect(x.bound2.value).to eq("9")
|
2025
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2026
|
+
end
|
2027
|
+
|
2028
|
+
x.types.find{|x| x.id == "list_unique_type"}.type.tap do |x|
|
2029
|
+
expect(x).to be_instance_of(Expressir::Model::Types::List)
|
2030
|
+
expect(x.unique).to eq(true)
|
2031
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2032
|
+
end
|
2033
|
+
|
2034
|
+
x.types.find{|x| x.id == "list_bound_unique_type"}.type.tap do |x|
|
2035
|
+
expect(x).to be_instance_of(Expressir::Model::Types::List)
|
2036
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2037
|
+
expect(x.bound1.value).to eq("1")
|
2038
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2039
|
+
expect(x.bound2.value).to eq("9")
|
2040
|
+
expect(x.unique).to eq(true)
|
2041
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2042
|
+
end
|
2043
|
+
|
2044
|
+
x.types.find{|x| x.id == "set_type"}.type.tap do |x|
|
2045
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Set)
|
2046
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2047
|
+
end
|
2048
|
+
|
2049
|
+
x.types.find{|x| x.id == "set_bound_type"}.type.tap do |x|
|
2050
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Set)
|
2051
|
+
expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2052
|
+
expect(x.bound1.value).to eq("1")
|
2053
|
+
expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2054
|
+
expect(x.bound2.value).to eq("9")
|
2055
|
+
expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
|
2056
|
+
end
|
2057
|
+
|
2058
|
+
# constructed types
|
2059
|
+
x.types.find{|x| x.id == "select_type"}.type.tap do |x|
|
2060
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Select)
|
2061
|
+
end
|
2062
|
+
|
2063
|
+
x.types.find{|x| x.id == "select_extensible_type"}.type.tap do |x|
|
2064
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Select)
|
2065
|
+
expect(x.extensible).to eq(true)
|
2066
|
+
end
|
2067
|
+
|
2068
|
+
x.types.find{|x| x.id == "select_extensible_generic_entity_type"}.type.tap do |x|
|
2069
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Select)
|
2070
|
+
expect(x.extensible).to eq(true)
|
2071
|
+
expect(x.generic_entity).to eq(true)
|
2072
|
+
end
|
2073
|
+
|
2074
|
+
x.types.find{|x| x.id == "select_list_type"}.type.tap do |x|
|
2075
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Select)
|
2076
|
+
expect(x.items).to be_instance_of(Array)
|
2077
|
+
expect(x.items.count).to eq(1)
|
2078
|
+
expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2079
|
+
expect(x.items[0].id).to eq("empty_type")
|
2080
|
+
end
|
2081
|
+
|
2082
|
+
x.types.find{|x| x.id == "select_extension_type_ref_type"}.type.tap do |x|
|
2083
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Select)
|
2084
|
+
expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2085
|
+
expect(x.extension_type.id).to eq("select_type")
|
2086
|
+
end
|
2087
|
+
|
2088
|
+
x.types.find{|x| x.id == "select_extension_type_ref_list_type"}.type.tap do |x|
|
2089
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Select)
|
2090
|
+
expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2091
|
+
expect(x.extension_type.id).to eq("select_type")
|
2092
|
+
expect(x.extension_items).to be_instance_of(Array)
|
2093
|
+
expect(x.extension_items.count).to eq(1)
|
2094
|
+
expect(x.extension_items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2095
|
+
expect(x.extension_items[0].id).to eq("empty_type")
|
2096
|
+
end
|
2097
|
+
|
2098
|
+
x.types.find{|x| x.id == "enumeration_type"}.type.tap do |x|
|
2099
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
|
2100
|
+
end
|
2101
|
+
|
2102
|
+
x.types.find{|x| x.id == "enumeration_extensible_type"}.type.tap do |x|
|
2103
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
|
2104
|
+
expect(x.extensible).to eq(true)
|
2105
|
+
end
|
2106
|
+
|
2107
|
+
x.types.find{|x| x.id == "enumeration_list_type"}.type.tap do |x|
|
2108
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
|
2109
|
+
expect(x.items).to be_instance_of(Array)
|
2110
|
+
expect(x.items.count).to eq(1)
|
2111
|
+
expect(x.items[0]).to be_instance_of(Expressir::Model::EnumerationItem)
|
2112
|
+
expect(x.items[0].id).to eq("test")
|
2113
|
+
end
|
2114
|
+
|
2115
|
+
x.types.find{|x| x.id == "enumeration_extension_type_ref_type"}.type.tap do |x|
|
2116
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
|
2117
|
+
expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2118
|
+
expect(x.extension_type.id).to eq("enumeration_type")
|
2119
|
+
end
|
2120
|
+
|
2121
|
+
x.types.find{|x| x.id == "enumeration_extension_type_ref_list_type"}.type.tap do |x|
|
2122
|
+
expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
|
2123
|
+
expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2124
|
+
expect(x.extension_type.id).to eq("enumeration_type")
|
2125
|
+
expect(x.extension_items).to be_instance_of(Array)
|
2126
|
+
expect(x.extension_items[0]).to be_instance_of(Expressir::Model::EnumerationItem)
|
2127
|
+
expect(x.extension_items[0].id).to eq("test")
|
2128
|
+
end
|
2129
|
+
end
|
2130
|
+
|
2131
|
+
procedures.find{|x| x.id == "expressions"}.tap do |x|
|
2132
|
+
# literal expressions
|
2133
|
+
x.variables.find{|x| x.id == "binary_expression"}.expression.tap do |x|
|
2134
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::Binary)
|
2135
|
+
expect(x.value).to eq("011110000111100001111000")
|
2136
|
+
end
|
2137
|
+
|
2138
|
+
x.variables.find{|x| x.id == "integer_expression"}.expression.tap do |x|
|
2139
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::Integer)
|
2140
|
+
expect(x.value).to eq("999")
|
2141
|
+
end
|
2142
|
+
|
2143
|
+
x.variables.find{|x| x.id == "true_logical_expression"}.expression.tap do |x|
|
2144
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
|
2145
|
+
expect(x.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2146
|
+
end
|
2147
|
+
|
2148
|
+
x.variables.find{|x| x.id == "false_logical_expression"}.expression.tap do |x|
|
2149
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
|
2150
|
+
expect(x.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2151
|
+
end
|
2152
|
+
|
2153
|
+
x.variables.find{|x| x.id == "unknown_logical_expression"}.expression.tap do |x|
|
2154
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
|
2155
|
+
expect(x.value).to eq(Expressir::Model::Literals::Logical::UNKNOWN)
|
2156
|
+
end
|
2157
|
+
|
2158
|
+
x.variables.find{|x| x.id == "real_expression"}.expression.tap do |x|
|
2159
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::Real)
|
2160
|
+
expect(x.value).to eq("999.999")
|
2161
|
+
end
|
2162
|
+
|
2163
|
+
x.variables.find{|x| x.id == "simple_string_expression"}.expression.tap do |x|
|
2164
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::String)
|
2165
|
+
expect(x.value).to eq("xxx")
|
2166
|
+
end
|
2167
|
+
|
2168
|
+
x.variables.find{|x| x.id == "utf8_simple_string_expression"}.expression.tap do |x|
|
2169
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::String)
|
2170
|
+
expect(x.value).to eq("UTF8 test: Příliš žluťoučký kůň úpěl ďábelské ódy.")
|
2171
|
+
end
|
2172
|
+
|
2173
|
+
x.variables.find{|x| x.id == "encoded_string_expression"}.expression.tap do |x|
|
2174
|
+
expect(x).to be_instance_of(Expressir::Model::Literals::String)
|
2175
|
+
expect(x.value).to eq("000000780000007800000078")
|
2176
|
+
expect(x.encoded).to eq(true)
|
2177
|
+
end
|
2178
|
+
|
2179
|
+
# constant expressions
|
2180
|
+
x.variables.find{|x| x.id == "const_e_expression"}.expression.tap do |x|
|
2181
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2182
|
+
expect(x.id).to eq("CONST_E")
|
2183
|
+
end
|
2184
|
+
|
2185
|
+
x.variables.find{|x| x.id == "indeterminate_expression"}.expression.tap do |x|
|
2186
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2187
|
+
expect(x.id).to eq("?")
|
2188
|
+
end
|
2189
|
+
|
2190
|
+
x.variables.find{|x| x.id == "pi_expression"}.expression.tap do |x|
|
2191
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2192
|
+
expect(x.id).to eq("PI")
|
2193
|
+
end
|
2194
|
+
|
2195
|
+
x.variables.find{|x| x.id == "self_expression"}.expression.tap do |x|
|
2196
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2197
|
+
expect(x.id).to eq("SELF")
|
2198
|
+
end
|
2199
|
+
|
2200
|
+
# function expressions
|
2201
|
+
x.variables.find{|x| x.id == "abs_expression"}.expression.tap do |x|
|
2202
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2203
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2204
|
+
expect(x.ref.id).to eq("ABS")
|
2205
|
+
expect(x.parameters).to be_instance_of(Array)
|
2206
|
+
expect(x.parameters.count).to eq(1)
|
2207
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2208
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2209
|
+
end
|
2210
|
+
|
2211
|
+
x.variables.find{|x| x.id == "acos_expression"}.expression.tap do |x|
|
2212
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2213
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2214
|
+
expect(x.ref.id).to eq("ACOS")
|
2215
|
+
expect(x.parameters).to be_instance_of(Array)
|
2216
|
+
expect(x.parameters.count).to eq(1)
|
2217
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2218
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2219
|
+
end
|
2220
|
+
|
2221
|
+
x.variables.find{|x| x.id == "asin_expression"}.expression.tap do |x|
|
2222
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2223
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2224
|
+
expect(x.ref.id).to eq("ASIN")
|
2225
|
+
expect(x.parameters).to be_instance_of(Array)
|
2226
|
+
expect(x.parameters.count).to eq(1)
|
2227
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2228
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2229
|
+
end
|
2230
|
+
|
2231
|
+
x.variables.find{|x| x.id == "atan_expression"}.expression.tap do |x|
|
2232
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2233
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2234
|
+
expect(x.ref.id).to eq("ATAN")
|
2235
|
+
expect(x.parameters).to be_instance_of(Array)
|
2236
|
+
expect(x.parameters.count).to eq(1)
|
2237
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2238
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2239
|
+
end
|
2240
|
+
|
2241
|
+
x.variables.find{|x| x.id == "blength_expression"}.expression.tap do |x|
|
2242
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2243
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2244
|
+
expect(x.ref.id).to eq("BLENGTH")
|
2245
|
+
expect(x.parameters).to be_instance_of(Array)
|
2246
|
+
expect(x.parameters.count).to eq(1)
|
2247
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2248
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2249
|
+
end
|
2250
|
+
|
2251
|
+
x.variables.find{|x| x.id == "cos_expression"}.expression.tap do |x|
|
2252
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2253
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2254
|
+
expect(x.ref.id).to eq("COS")
|
2255
|
+
expect(x.parameters).to be_instance_of(Array)
|
2256
|
+
expect(x.parameters.count).to eq(1)
|
2257
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2258
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2259
|
+
end
|
2260
|
+
|
2261
|
+
x.variables.find{|x| x.id == "exists_expression"}.expression.tap do |x|
|
2262
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2263
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2264
|
+
expect(x.ref.id).to eq("EXISTS")
|
2265
|
+
expect(x.parameters).to be_instance_of(Array)
|
2266
|
+
expect(x.parameters.count).to eq(1)
|
2267
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2268
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2269
|
+
end
|
2270
|
+
|
2271
|
+
x.variables.find{|x| x.id == "exp_expression"}.expression.tap do |x|
|
2272
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2273
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2274
|
+
expect(x.ref.id).to eq("EXP")
|
2275
|
+
expect(x.parameters).to be_instance_of(Array)
|
2276
|
+
expect(x.parameters.count).to eq(1)
|
2277
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2278
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2279
|
+
end
|
2280
|
+
|
2281
|
+
x.variables.find{|x| x.id == "format_expression"}.expression.tap do |x|
|
2282
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2283
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2284
|
+
expect(x.ref.id).to eq("FORMAT")
|
2285
|
+
expect(x.parameters).to be_instance_of(Array)
|
2286
|
+
expect(x.parameters.count).to eq(1)
|
2287
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2288
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2289
|
+
end
|
2290
|
+
|
2291
|
+
x.variables.find{|x| x.id == "hibound_expression"}.expression.tap do |x|
|
2292
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2293
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2294
|
+
expect(x.ref.id).to eq("HIBOUND")
|
2295
|
+
expect(x.parameters).to be_instance_of(Array)
|
2296
|
+
expect(x.parameters.count).to eq(1)
|
2297
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2298
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2299
|
+
end
|
2300
|
+
|
2301
|
+
x.variables.find{|x| x.id == "hiindex_expression"}.expression.tap do |x|
|
2302
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2303
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2304
|
+
expect(x.ref.id).to eq("HIINDEX")
|
2305
|
+
expect(x.parameters).to be_instance_of(Array)
|
2306
|
+
expect(x.parameters.count).to eq(1)
|
2307
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2308
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2309
|
+
end
|
2310
|
+
|
2311
|
+
x.variables.find{|x| x.id == "length_expression"}.expression.tap do |x|
|
2312
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2313
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2314
|
+
expect(x.ref.id).to eq("LENGTH")
|
2315
|
+
expect(x.parameters).to be_instance_of(Array)
|
2316
|
+
expect(x.parameters.count).to eq(1)
|
2317
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2318
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2319
|
+
end
|
2320
|
+
|
2321
|
+
x.variables.find{|x| x.id == "lobound_expression"}.expression.tap do |x|
|
2322
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2323
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2324
|
+
expect(x.ref.id).to eq("LOBOUND")
|
2325
|
+
expect(x.parameters).to be_instance_of(Array)
|
2326
|
+
expect(x.parameters.count).to eq(1)
|
2327
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2328
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2329
|
+
end
|
2330
|
+
|
2331
|
+
x.variables.find{|x| x.id == "loindex_expression"}.expression.tap do |x|
|
2332
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2333
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2334
|
+
expect(x.ref.id).to eq("LOINDEX")
|
2335
|
+
expect(x.parameters).to be_instance_of(Array)
|
2336
|
+
expect(x.parameters.count).to eq(1)
|
2337
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2338
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2339
|
+
end
|
2340
|
+
|
2341
|
+
x.variables.find{|x| x.id == "log_expression"}.expression.tap do |x|
|
2342
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2343
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2344
|
+
expect(x.ref.id).to eq("LOG")
|
2345
|
+
expect(x.parameters).to be_instance_of(Array)
|
2346
|
+
expect(x.parameters.count).to eq(1)
|
2347
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2348
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2349
|
+
end
|
2350
|
+
|
2351
|
+
x.variables.find{|x| x.id == "log2_expression"}.expression.tap do |x|
|
2352
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2353
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2354
|
+
expect(x.ref.id).to eq("LOG2")
|
2355
|
+
expect(x.parameters).to be_instance_of(Array)
|
2356
|
+
expect(x.parameters.count).to eq(1)
|
2357
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2358
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2359
|
+
end
|
2360
|
+
|
2361
|
+
x.variables.find{|x| x.id == "log10_expression"}.expression.tap do |x|
|
2362
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2363
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2364
|
+
expect(x.ref.id).to eq("LOG10")
|
2365
|
+
expect(x.parameters).to be_instance_of(Array)
|
2366
|
+
expect(x.parameters.count).to eq(1)
|
2367
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2368
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2369
|
+
end
|
2370
|
+
|
2371
|
+
x.variables.find{|x| x.id == "nvl_expression"}.expression.tap do |x|
|
2372
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2373
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2374
|
+
expect(x.ref.id).to eq("NVL")
|
2375
|
+
expect(x.parameters).to be_instance_of(Array)
|
2376
|
+
expect(x.parameters.count).to eq(1)
|
2377
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2378
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2379
|
+
end
|
2380
|
+
|
2381
|
+
x.variables.find{|x| x.id == "odd_expression"}.expression.tap do |x|
|
2382
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2383
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2384
|
+
expect(x.ref.id).to eq("ODD")
|
2385
|
+
expect(x.parameters).to be_instance_of(Array)
|
2386
|
+
expect(x.parameters.count).to eq(1)
|
2387
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2388
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2389
|
+
end
|
2390
|
+
|
2391
|
+
x.variables.find{|x| x.id == "rolesof_expression"}.expression.tap do |x|
|
2392
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2393
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2394
|
+
expect(x.ref.id).to eq("ROLESOF")
|
2395
|
+
expect(x.parameters).to be_instance_of(Array)
|
2396
|
+
expect(x.parameters.count).to eq(1)
|
2397
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2398
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2399
|
+
end
|
2400
|
+
|
2401
|
+
x.variables.find{|x| x.id == "sin_expression"}.expression.tap do |x|
|
2402
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2403
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2404
|
+
expect(x.ref.id).to eq("SIN")
|
2405
|
+
expect(x.parameters).to be_instance_of(Array)
|
2406
|
+
expect(x.parameters.count).to eq(1)
|
2407
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2408
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2409
|
+
end
|
2410
|
+
|
2411
|
+
x.variables.find{|x| x.id == "sizeof_expression"}.expression.tap do |x|
|
2412
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2413
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2414
|
+
expect(x.ref.id).to eq("SIZEOF")
|
2415
|
+
expect(x.parameters).to be_instance_of(Array)
|
2416
|
+
expect(x.parameters.count).to eq(1)
|
2417
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2418
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2419
|
+
end
|
2420
|
+
|
2421
|
+
x.variables.find{|x| x.id == "sqrt_expression"}.expression.tap do |x|
|
2422
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2423
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2424
|
+
expect(x.ref.id).to eq("SQRT")
|
2425
|
+
expect(x.parameters).to be_instance_of(Array)
|
2426
|
+
expect(x.parameters.count).to eq(1)
|
2427
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2428
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2429
|
+
end
|
2430
|
+
|
2431
|
+
x.variables.find{|x| x.id == "tan_expression"}.expression.tap do |x|
|
2432
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2433
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2434
|
+
expect(x.ref.id).to eq("TAN")
|
2435
|
+
expect(x.parameters).to be_instance_of(Array)
|
2436
|
+
expect(x.parameters.count).to eq(1)
|
2437
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2438
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2439
|
+
end
|
2440
|
+
|
2441
|
+
x.variables.find{|x| x.id == "typeof_expression"}.expression.tap do |x|
|
2442
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2443
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2444
|
+
expect(x.ref.id).to eq("TYPEOF")
|
2445
|
+
expect(x.parameters).to be_instance_of(Array)
|
2446
|
+
expect(x.parameters.count).to eq(1)
|
2447
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2448
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2449
|
+
end
|
2450
|
+
|
2451
|
+
x.variables.find{|x| x.id == "usedin_expression"}.expression.tap do |x|
|
2452
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2453
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2454
|
+
expect(x.ref.id).to eq("USEDIN")
|
2455
|
+
expect(x.parameters).to be_instance_of(Array)
|
2456
|
+
expect(x.parameters.count).to eq(1)
|
2457
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2458
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2459
|
+
end
|
2460
|
+
|
2461
|
+
x.variables.find{|x| x.id == "value_expression"}.expression.tap do |x|
|
2462
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2463
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2464
|
+
expect(x.ref.id).to eq("VALUE")
|
2465
|
+
expect(x.parameters).to be_instance_of(Array)
|
2466
|
+
expect(x.parameters.count).to eq(1)
|
2467
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2468
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2469
|
+
end
|
2470
|
+
|
2471
|
+
x.variables.find{|x| x.id == "value_in_expression"}.expression.tap do |x|
|
2472
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2473
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2474
|
+
expect(x.ref.id).to eq("VALUE_IN")
|
2475
|
+
expect(x.parameters).to be_instance_of(Array)
|
2476
|
+
expect(x.parameters.count).to eq(1)
|
2477
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2478
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2479
|
+
end
|
2480
|
+
|
2481
|
+
x.variables.find{|x| x.id == "value_unique_expression"}.expression.tap do |x|
|
2482
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2483
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2484
|
+
expect(x.ref.id).to eq("VALUE_UNIQUE")
|
2485
|
+
expect(x.parameters).to be_instance_of(Array)
|
2486
|
+
expect(x.parameters.count).to eq(1)
|
2487
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2488
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2489
|
+
end
|
2490
|
+
|
2491
|
+
# operator expressions
|
2492
|
+
x.variables.find{|x| x.id == "plus_expression"}.expression.tap do |x|
|
2493
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
|
2494
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::PLUS)
|
2495
|
+
expect(x.operand).to be_instance_of(Expressir::Model::Literals::Integer)
|
2496
|
+
expect(x.operand.value).to eq("4")
|
2497
|
+
end
|
2498
|
+
|
2499
|
+
x.variables.find{|x| x.id == "plus_addition_expression"}.expression.tap do |x|
|
2500
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
|
2501
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::PLUS)
|
2502
|
+
expect(x.operand).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2503
|
+
expect(x.operand.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2504
|
+
expect(x.operand.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2505
|
+
expect(x.operand.operand1.value).to eq("4")
|
2506
|
+
expect(x.operand.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2507
|
+
expect(x.operand.operand2.value).to eq("2")
|
2508
|
+
end
|
2509
|
+
|
2510
|
+
x.variables.find{|x| x.id == "minus_expression"}.expression.tap do |x|
|
2511
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
|
2512
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::MINUS)
|
2513
|
+
expect(x.operand).to be_instance_of(Expressir::Model::Literals::Integer)
|
2514
|
+
expect(x.operand.value).to eq("4")
|
2515
|
+
end
|
2516
|
+
|
2517
|
+
x.variables.find{|x| x.id == "minus_addition_expression"}.expression.tap do |x|
|
2518
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
|
2519
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::MINUS)
|
2520
|
+
expect(x.operand).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2521
|
+
expect(x.operand.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2522
|
+
expect(x.operand.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2523
|
+
expect(x.operand.operand1.value).to eq("4")
|
2524
|
+
expect(x.operand.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2525
|
+
expect(x.operand.operand2.value).to eq("2")
|
2526
|
+
end
|
2527
|
+
|
2528
|
+
x.variables.find{|x| x.id == "addition_expression"}.expression.tap do |x|
|
2529
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2530
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2531
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2532
|
+
expect(x.operand1.value).to eq("4")
|
2533
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2534
|
+
expect(x.operand2.value).to eq("2")
|
2535
|
+
end
|
2536
|
+
|
2537
|
+
x.variables.find{|x| x.id == "subtraction_expression"}.expression.tap do |x|
|
2538
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2539
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
|
2540
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2541
|
+
expect(x.operand1.value).to eq("4")
|
2542
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2543
|
+
expect(x.operand2.value).to eq("2")
|
2544
|
+
end
|
2545
|
+
|
2546
|
+
x.variables.find{|x| x.id == "multiplication_expression"}.expression.tap do |x|
|
2547
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2548
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
|
2549
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2550
|
+
expect(x.operand1.value).to eq("4")
|
2551
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2552
|
+
expect(x.operand2.value).to eq("2")
|
2553
|
+
end
|
2554
|
+
|
2555
|
+
x.variables.find{|x| x.id == "real_division_expression"}.expression.tap do |x|
|
2556
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2557
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::REAL_DIVISION)
|
2558
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2559
|
+
expect(x.operand1.value).to eq("4")
|
2560
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2561
|
+
expect(x.operand2.value).to eq("2")
|
2562
|
+
end
|
2563
|
+
|
2564
|
+
x.variables.find{|x| x.id == "integer_division_expression"}.expression.tap do |x|
|
2565
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2566
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::INTEGER_DIVISION)
|
2567
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2568
|
+
expect(x.operand1.value).to eq("4")
|
2569
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2570
|
+
expect(x.operand2.value).to eq("2")
|
2571
|
+
end
|
2572
|
+
|
2573
|
+
x.variables.find{|x| x.id == "modulo_expression"}.expression.tap do |x|
|
2574
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2575
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MODULO)
|
2576
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2577
|
+
expect(x.operand1.value).to eq("4")
|
2578
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2579
|
+
expect(x.operand2.value).to eq("2")
|
2580
|
+
end
|
2581
|
+
|
2582
|
+
x.variables.find{|x| x.id == "exponentiation_expression"}.expression.tap do |x|
|
2583
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2584
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::EXPONENTIATION)
|
2585
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2586
|
+
expect(x.operand1.value).to eq("4")
|
2587
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2588
|
+
expect(x.operand2.value).to eq("2")
|
2589
|
+
end
|
2590
|
+
|
2591
|
+
x.variables.find{|x| x.id == "addition_addition_expression"}.expression.tap do |x|
|
2592
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2593
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2594
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2595
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2596
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2597
|
+
expect(x.operand1.operand1.value).to eq("4")
|
2598
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2599
|
+
expect(x.operand1.operand2.value).to eq("2")
|
2600
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2601
|
+
expect(x.operand2.value).to eq("1")
|
2602
|
+
end
|
2603
|
+
|
2604
|
+
x.variables.find{|x| x.id == "subtraction_subtraction_expression"}.expression.tap do |x|
|
2605
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2606
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
|
2607
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2608
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
|
2609
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2610
|
+
expect(x.operand1.operand1.value).to eq("4")
|
2611
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2612
|
+
expect(x.operand1.operand2.value).to eq("2")
|
2613
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2614
|
+
expect(x.operand2.value).to eq("1")
|
2615
|
+
end
|
2616
|
+
|
2617
|
+
x.variables.find{|x| x.id == "addition_subtraction_expression"}.expression.tap do |x|
|
2618
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2619
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
|
2620
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2621
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2622
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2623
|
+
expect(x.operand1.operand1.value).to eq("4")
|
2624
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2625
|
+
expect(x.operand1.operand2.value).to eq("2")
|
2626
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2627
|
+
expect(x.operand2.value).to eq("1")
|
2628
|
+
end
|
2629
|
+
|
2630
|
+
x.variables.find{|x| x.id == "subtraction_addition_expression"}.expression.tap do |x|
|
2631
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2632
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2633
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2634
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
|
2635
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2636
|
+
expect(x.operand1.operand1.value).to eq("4")
|
2637
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2638
|
+
expect(x.operand1.operand2.value).to eq("2")
|
2639
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2640
|
+
expect(x.operand2.value).to eq("1")
|
2641
|
+
end
|
2642
|
+
|
2643
|
+
x.variables.find{|x| x.id == "addition_multiplication_expression"}.expression.tap do |x|
|
2644
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2645
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2646
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2647
|
+
expect(x.operand1.value).to eq("8")
|
2648
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2649
|
+
expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
|
2650
|
+
expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2651
|
+
expect(x.operand2.operand1.value).to eq("4")
|
2652
|
+
expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2653
|
+
expect(x.operand2.operand2.value).to eq("2")
|
2654
|
+
end
|
2655
|
+
|
2656
|
+
x.variables.find{|x| x.id == "multiplication_addition_expression"}.expression.tap do |x|
|
2657
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2658
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2659
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2660
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
|
2661
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2662
|
+
expect(x.operand1.operand1.value).to eq("8")
|
2663
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2664
|
+
expect(x.operand1.operand2.value).to eq("4")
|
2665
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2666
|
+
expect(x.operand2.value).to eq("2")
|
2667
|
+
end
|
2668
|
+
|
2669
|
+
x.variables.find{|x| x.id == "parenthesis_addition_multiplication_expression"}.expression.tap do |x|
|
2670
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2671
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
|
2672
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2673
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2674
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2675
|
+
expect(x.operand1.operand1.value).to eq("8")
|
2676
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2677
|
+
expect(x.operand1.operand2.value).to eq("4")
|
2678
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2679
|
+
expect(x.operand2.value).to eq("2")
|
2680
|
+
end
|
2681
|
+
|
2682
|
+
x.variables.find{|x| x.id == "multiplication_parenthesis_addition_expression"}.expression.tap do |x|
|
2683
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2684
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
|
2685
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2686
|
+
expect(x.operand1.value).to eq("8")
|
2687
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2688
|
+
expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2689
|
+
expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2690
|
+
expect(x.operand2.operand1.value).to eq("4")
|
2691
|
+
expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2692
|
+
expect(x.operand2.operand2.value).to eq("2")
|
2693
|
+
end
|
2694
|
+
|
2695
|
+
x.variables.find{|x| x.id == "equal_expression"}.expression.tap do |x|
|
2696
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2697
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::EQUAL)
|
2698
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2699
|
+
expect(x.operand1.value).to eq("4")
|
2700
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2701
|
+
expect(x.operand2.value).to eq("2")
|
2702
|
+
end
|
2703
|
+
|
2704
|
+
x.variables.find{|x| x.id == "not_equal_expression"}.expression.tap do |x|
|
2705
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2706
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::NOT_EQUAL)
|
2707
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2708
|
+
expect(x.operand1.value).to eq("4")
|
2709
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2710
|
+
expect(x.operand2.value).to eq("2")
|
2711
|
+
end
|
2712
|
+
|
2713
|
+
x.variables.find{|x| x.id == "instance_equal_expression"}.expression.tap do |x|
|
2714
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2715
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::INSTANCE_EQUAL)
|
2716
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2717
|
+
expect(x.operand1.value).to eq("4")
|
2718
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2719
|
+
expect(x.operand2.value).to eq("2")
|
2720
|
+
end
|
2721
|
+
|
2722
|
+
x.variables.find{|x| x.id == "instance_not_equal_expression"}.expression.tap do |x|
|
2723
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2724
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::INSTANCE_NOT_EQUAL)
|
2725
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2726
|
+
expect(x.operand1.value).to eq("4")
|
2727
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2728
|
+
expect(x.operand2.value).to eq("2")
|
2729
|
+
end
|
2730
|
+
|
2731
|
+
x.variables.find{|x| x.id == "lt_expression"}.expression.tap do |x|
|
2732
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2733
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
|
2734
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2735
|
+
expect(x.operand1.value).to eq("4")
|
2736
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2737
|
+
expect(x.operand2.value).to eq("2")
|
2738
|
+
end
|
2739
|
+
|
2740
|
+
x.variables.find{|x| x.id == "gt_expression"}.expression.tap do |x|
|
2741
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2742
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::GREATER_THAN)
|
2743
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2744
|
+
expect(x.operand1.value).to eq("4")
|
2745
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2746
|
+
expect(x.operand2.value).to eq("2")
|
2747
|
+
end
|
2748
|
+
|
2749
|
+
x.variables.find{|x| x.id == "lte_expression"}.expression.tap do |x|
|
2750
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2751
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
|
2752
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2753
|
+
expect(x.operand1.value).to eq("4")
|
2754
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2755
|
+
expect(x.operand2.value).to eq("2")
|
2756
|
+
end
|
2757
|
+
|
2758
|
+
x.variables.find{|x| x.id == "gte_expression"}.expression.tap do |x|
|
2759
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2760
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::GREATER_THAN_OR_EQUAL)
|
2761
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2762
|
+
expect(x.operand1.value).to eq("4")
|
2763
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2764
|
+
expect(x.operand2.value).to eq("2")
|
2765
|
+
end
|
2766
|
+
|
2767
|
+
x.variables.find{|x| x.id == "not_expression"}.expression.tap do |x|
|
2768
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
|
2769
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::NOT)
|
2770
|
+
expect(x.operand).to be_instance_of(Expressir::Model::Literals::Logical)
|
2771
|
+
expect(x.operand.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2772
|
+
end
|
2773
|
+
|
2774
|
+
x.variables.find{|x| x.id == "not_or_expression"}.expression.tap do |x|
|
2775
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
|
2776
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::NOT)
|
2777
|
+
expect(x.operand).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2778
|
+
expect(x.operand.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2779
|
+
expect(x.operand.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2780
|
+
expect(x.operand.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2781
|
+
expect(x.operand.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2782
|
+
expect(x.operand.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2783
|
+
end
|
2784
|
+
|
2785
|
+
x.variables.find{|x| x.id == "or_expression"}.expression.tap do |x|
|
2786
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2787
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2788
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2789
|
+
expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2790
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2791
|
+
expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2792
|
+
end
|
2793
|
+
|
2794
|
+
x.variables.find{|x| x.id == "and_expression"}.expression.tap do |x|
|
2795
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2796
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2797
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2798
|
+
expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2799
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2800
|
+
expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2801
|
+
end
|
2802
|
+
|
2803
|
+
x.variables.find{|x| x.id == "or_or_expression"}.expression.tap do |x|
|
2804
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2805
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2806
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2807
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2808
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2809
|
+
expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2810
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2811
|
+
expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2812
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2813
|
+
expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2814
|
+
end
|
2815
|
+
|
2816
|
+
x.variables.find{|x| x.id == "and_and_expression"}.expression.tap do |x|
|
2817
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2818
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2819
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2820
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2821
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2822
|
+
expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2823
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2824
|
+
expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2825
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2826
|
+
expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2827
|
+
end
|
2828
|
+
|
2829
|
+
x.variables.find{|x| x.id == "or_and_expression"}.expression.tap do |x|
|
2830
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2831
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2832
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2833
|
+
expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2834
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2835
|
+
expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2836
|
+
expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2837
|
+
expect(x.operand2.operand1.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2838
|
+
expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2839
|
+
expect(x.operand2.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2840
|
+
end
|
2841
|
+
|
2842
|
+
x.variables.find{|x| x.id == "and_or_expression"}.expression.tap do |x|
|
2843
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2844
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2845
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2846
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2847
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2848
|
+
expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2849
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2850
|
+
expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2851
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2852
|
+
expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2853
|
+
end
|
2854
|
+
|
2855
|
+
x.variables.find{|x| x.id == "parenthesis_or_and_expression"}.expression.tap do |x|
|
2856
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2857
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2858
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2859
|
+
expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2860
|
+
expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2861
|
+
expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2862
|
+
expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2863
|
+
expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2864
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2865
|
+
expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2866
|
+
end
|
2867
|
+
|
2868
|
+
x.variables.find{|x| x.id == "and_parenthesis_or_expression"}.expression.tap do |x|
|
2869
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2870
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
|
2871
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2872
|
+
expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2873
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2874
|
+
expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
|
2875
|
+
expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
2876
|
+
expect(x.operand2.operand1.value).to eq(Expressir::Model::Literals::Logical::FALSE)
|
2877
|
+
expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
|
2878
|
+
expect(x.operand2.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2879
|
+
end
|
2880
|
+
|
2881
|
+
# aggregate initializer expressions
|
2882
|
+
x.variables.find{|x| x.id == "aggregate_initializer_expression"}.expression.tap do |x|
|
2883
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
|
2884
|
+
expect(x.items).to be_instance_of(Array)
|
2885
|
+
expect(x.items.count).to eq(1)
|
2886
|
+
expect(x.items[0]).to be_instance_of(Expressir::Model::Literals::Integer)
|
2887
|
+
expect(x.items[0].value).to eq("4")
|
2888
|
+
end
|
2889
|
+
|
2890
|
+
x.variables.find{|x| x.id == "repeated_aggregate_initializer_expression"}.expression.tap do |x|
|
2891
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
|
2892
|
+
expect(x.items).to be_instance_of(Array)
|
2893
|
+
expect(x.items.count).to eq(1)
|
2894
|
+
expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::AggregateItem)
|
2895
|
+
expect(x.items[0].expression).to be_instance_of(Expressir::Model::Literals::Integer)
|
2896
|
+
expect(x.items[0].expression.value).to eq("4")
|
2897
|
+
expect(x.items[0].repetition).to be_instance_of(Expressir::Model::Literals::Integer)
|
2898
|
+
expect(x.items[0].repetition.value).to eq("2")
|
2899
|
+
end
|
2900
|
+
|
2901
|
+
x.variables.find{|x| x.id == "complex_aggregate_initializer_expression"}.expression.tap do |x|
|
2902
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
|
2903
|
+
expect(x.items).to be_instance_of(Array)
|
2904
|
+
expect(x.items.count).to eq(1)
|
2905
|
+
expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2906
|
+
expect(x.items[0].operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2907
|
+
expect(x.items[0].operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2908
|
+
expect(x.items[0].operand1.value).to eq("4")
|
2909
|
+
expect(x.items[0].operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2910
|
+
expect(x.items[0].operand2.value).to eq("2")
|
2911
|
+
end
|
2912
|
+
|
2913
|
+
x.variables.find{|x| x.id == "complex_repeated_aggregate_initializer_expression"}.expression.tap do |x|
|
2914
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
|
2915
|
+
expect(x.items).to be_instance_of(Array)
|
2916
|
+
expect(x.items.count).to eq(1)
|
2917
|
+
expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::AggregateItem)
|
2918
|
+
expect(x.items[0].expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2919
|
+
expect(x.items[0].expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2920
|
+
expect(x.items[0].expression.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2921
|
+
expect(x.items[0].expression.operand1.value).to eq("4")
|
2922
|
+
expect(x.items[0].expression.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2923
|
+
expect(x.items[0].expression.operand2.value).to eq("2")
|
2924
|
+
expect(x.items[0].repetition).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
2925
|
+
expect(x.items[0].repetition.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
|
2926
|
+
expect(x.items[0].repetition.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2927
|
+
expect(x.items[0].repetition.operand1.value).to eq("4")
|
2928
|
+
expect(x.items[0].repetition.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2929
|
+
expect(x.items[0].repetition.operand2.value).to eq("2")
|
2930
|
+
end
|
2931
|
+
|
2932
|
+
# function call or entity constructor expressions
|
2933
|
+
x.variables.find{|x| x.id == "call_expression"}.expression.tap do |x|
|
2934
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
|
2935
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2936
|
+
expect(x.ref.id).to eq("parameter_function")
|
2937
|
+
expect(x.parameters).to be_instance_of(Array)
|
2938
|
+
expect(x.parameters.count).to eq(1)
|
2939
|
+
expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
2940
|
+
expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
2941
|
+
end
|
2942
|
+
|
2943
|
+
# reference expressions
|
2944
|
+
x.variables.find{|x| x.id == "simple_reference_expression"}.expression.tap do |x|
|
2945
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2946
|
+
expect(x.id).to eq("test")
|
2947
|
+
end
|
2948
|
+
|
2949
|
+
x.variables.find{|x| x.id == "group_reference_expression"}.expression.tap do |x|
|
2950
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::GroupReference)
|
2951
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2952
|
+
expect(x.ref.id).to eq("test")
|
2953
|
+
expect(x.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2954
|
+
expect(x.entity.id).to eq("test2")
|
2955
|
+
end
|
2956
|
+
|
2957
|
+
x.variables.find{|x| x.id == "index_reference_expression"}.expression.tap do |x|
|
2958
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::IndexReference)
|
2959
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2960
|
+
expect(x.ref.id).to eq("test")
|
2961
|
+
expect(x.index1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2962
|
+
expect(x.index1.value).to eq("1")
|
2963
|
+
end
|
2964
|
+
|
2965
|
+
x.variables.find{|x| x.id == "index2_reference_expression"}.expression.tap do |x|
|
2966
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::IndexReference)
|
2967
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2968
|
+
expect(x.ref.id).to eq("test")
|
2969
|
+
expect(x.index1).to be_instance_of(Expressir::Model::Literals::Integer)
|
2970
|
+
expect(x.index1.value).to eq("1")
|
2971
|
+
expect(x.index2).to be_instance_of(Expressir::Model::Literals::Integer)
|
2972
|
+
expect(x.index2.value).to eq("9")
|
2973
|
+
end
|
2974
|
+
|
2975
|
+
x.variables.find{|x| x.id == "attribute_reference_expression"}.expression.tap do |x|
|
2976
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
|
2977
|
+
expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2978
|
+
expect(x.ref.id).to eq("test")
|
2979
|
+
expect(x.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
2980
|
+
expect(x.attribute.id).to eq("test2")
|
2981
|
+
end
|
2982
|
+
|
2983
|
+
# interval expressions
|
2984
|
+
x.variables.find{|x| x.id == "lt_lt_interval_expression"}.expression.tap do |x|
|
2985
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
|
2986
|
+
expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
|
2987
|
+
expect(x.low.value).to eq("1")
|
2988
|
+
expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
|
2989
|
+
expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
|
2990
|
+
expect(x.item.value).to eq("5")
|
2991
|
+
expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
|
2992
|
+
expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
|
2993
|
+
expect(x.high.value).to eq("9")
|
2994
|
+
end
|
2995
|
+
|
2996
|
+
x.variables.find{|x| x.id == "lte_lt_interval_expression"}.expression.tap do |x|
|
2997
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
|
2998
|
+
expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
|
2999
|
+
expect(x.low.value).to eq("1")
|
3000
|
+
expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
|
3001
|
+
expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
|
3002
|
+
expect(x.item.value).to eq("5")
|
3003
|
+
expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
|
3004
|
+
expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
|
3005
|
+
expect(x.high.value).to eq("9")
|
3006
|
+
end
|
3007
|
+
|
3008
|
+
x.variables.find{|x| x.id == "lt_lte_interval_expression"}.expression.tap do |x|
|
3009
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
|
3010
|
+
expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
|
3011
|
+
expect(x.low.value).to eq("1")
|
3012
|
+
expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
|
3013
|
+
expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
|
3014
|
+
expect(x.item.value).to eq("5")
|
3015
|
+
expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
|
3016
|
+
expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
|
3017
|
+
expect(x.high.value).to eq("9")
|
3018
|
+
end
|
3019
|
+
|
3020
|
+
x.variables.find{|x| x.id == "lte_lte_interval_expression"}.expression.tap do |x|
|
3021
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
|
3022
|
+
expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
|
3023
|
+
expect(x.low.value).to eq("1")
|
3024
|
+
expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
|
3025
|
+
expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
|
3026
|
+
expect(x.item.value).to eq("5")
|
3027
|
+
expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
|
3028
|
+
expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
|
3029
|
+
expect(x.high.value).to eq("9")
|
3030
|
+
end
|
3031
|
+
|
3032
|
+
x.variables.find{|x| x.id == "combine_expression"}.expression.tap do |x|
|
3033
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
3034
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::COMBINE)
|
3035
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
3036
|
+
expect(x.operand1.id).to eq("test")
|
3037
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
3038
|
+
expect(x.operand2.id).to eq("test2")
|
3039
|
+
end
|
3040
|
+
|
3041
|
+
x.variables.find{|x| x.id == "in_expression"}.expression.tap do |x|
|
3042
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
3043
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::IN)
|
3044
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
|
3045
|
+
expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
3046
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
|
3047
|
+
expect(x.operand2.items).to be_instance_of(Array)
|
3048
|
+
expect(x.operand2.items.count).to eq(1)
|
3049
|
+
expect(x.operand2.items[0]).to be_instance_of(Expressir::Model::Literals::Logical)
|
3050
|
+
expect(x.operand2.items[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
3051
|
+
end
|
3052
|
+
|
3053
|
+
x.variables.find{|x| x.id == "like_expression"}.expression.tap do |x|
|
3054
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
|
3055
|
+
expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::LIKE)
|
3056
|
+
expect(x.operand1).to be_instance_of(Expressir::Model::Literals::String)
|
3057
|
+
expect(x.operand1.value).to eq("xxx")
|
3058
|
+
expect(x.operand2).to be_instance_of(Expressir::Model::Literals::String)
|
3059
|
+
expect(x.operand2.value).to eq("xxx")
|
3060
|
+
end
|
3061
|
+
|
3062
|
+
# query expressions
|
3063
|
+
x.variables.find{|x| x.id == "query_expression"}.expression.tap do |x|
|
3064
|
+
expect(x).to be_instance_of(Expressir::Model::Expressions::QueryExpression)
|
3065
|
+
expect(x.id).to eq("test")
|
3066
|
+
expect(x.aggregate_source).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
|
3067
|
+
expect(x.aggregate_source.id).to eq("test2")
|
3068
|
+
expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
|
3069
|
+
expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
|
3070
|
+
end
|
3034
3071
|
end
|
3035
3072
|
end
|
3036
3073
|
end
|