expressir 0.2.11-x86-linux → 0.2.12-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/exe/format +16 -0
  3. data/expressir.gemspec +1 -0
  4. data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
  5. data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
  6. data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
  7. data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
  8. data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
  9. data/lib/expressir/express_exp/formatter.rb +75 -89
  10. data/lib/expressir/express_exp/hyperlink_formatter.rb +25 -0
  11. data/lib/expressir/express_exp/schema_head_formatter.rb +14 -0
  12. data/lib/expressir/express_exp/visitor.rb +58 -58
  13. data/lib/expressir/model.rb +0 -1
  14. data/lib/expressir/model/attribute.rb +2 -0
  15. data/lib/expressir/model/constant.rb +2 -0
  16. data/lib/expressir/model/entity.rb +3 -2
  17. data/lib/expressir/model/enumeration_item.rb +2 -0
  18. data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -0
  19. data/lib/expressir/model/expressions/aggregate_item.rb +2 -0
  20. data/lib/expressir/model/expressions/attribute_reference.rb +2 -0
  21. data/lib/expressir/model/expressions/binary_expression.rb +2 -0
  22. data/lib/expressir/model/expressions/call.rb +2 -0
  23. data/lib/expressir/model/expressions/entity_constructor.rb +2 -0
  24. data/lib/expressir/model/expressions/group_reference.rb +2 -0
  25. data/lib/expressir/model/expressions/index_reference.rb +2 -0
  26. data/lib/expressir/model/expressions/interval.rb +2 -0
  27. data/lib/expressir/model/expressions/query_expression.rb +2 -1
  28. data/lib/expressir/model/expressions/simple_reference.rb +2 -0
  29. data/lib/expressir/model/expressions/unary_expression.rb +2 -0
  30. data/lib/expressir/model/function.rb +3 -8
  31. data/lib/expressir/model/identifier.rb +0 -1
  32. data/lib/expressir/model/informal_proposition.rb +2 -0
  33. data/lib/expressir/model/interface.rb +2 -0
  34. data/lib/expressir/model/literals/binary.rb +2 -0
  35. data/lib/expressir/model/literals/integer.rb +2 -0
  36. data/lib/expressir/model/literals/logical.rb +2 -0
  37. data/lib/expressir/model/literals/real.rb +2 -0
  38. data/lib/expressir/model/literals/string.rb +2 -0
  39. data/lib/expressir/model/model_element.rb +71 -4
  40. data/lib/expressir/model/parameter.rb +2 -0
  41. data/lib/expressir/model/procedure.rb +3 -8
  42. data/lib/expressir/model/renamed_ref.rb +2 -0
  43. data/lib/expressir/model/repository.rb +2 -2
  44. data/lib/expressir/model/rule.rb +4 -9
  45. data/lib/expressir/model/schema.rb +5 -8
  46. data/lib/expressir/model/statements/alias.rb +2 -1
  47. data/lib/expressir/model/statements/assignment.rb +2 -0
  48. data/lib/expressir/model/statements/call.rb +2 -0
  49. data/lib/expressir/model/statements/case.rb +2 -0
  50. data/lib/expressir/model/statements/case_action.rb +2 -0
  51. data/lib/expressir/model/statements/compound.rb +2 -0
  52. data/lib/expressir/model/statements/if.rb +2 -0
  53. data/lib/expressir/model/statements/repeat.rb +2 -1
  54. data/lib/expressir/model/statements/return.rb +2 -0
  55. data/lib/expressir/model/subtype_constraint.rb +2 -1
  56. data/lib/expressir/model/type.rb +3 -6
  57. data/lib/expressir/model/types/aggregate.rb +2 -0
  58. data/lib/expressir/model/types/array.rb +2 -0
  59. data/lib/expressir/model/types/bag.rb +2 -0
  60. data/lib/expressir/model/types/binary.rb +2 -0
  61. data/lib/expressir/model/types/enumeration.rb +2 -0
  62. data/lib/expressir/model/types/generic.rb +2 -0
  63. data/lib/expressir/model/types/generic_entity.rb +2 -0
  64. data/lib/expressir/model/types/list.rb +2 -0
  65. data/lib/expressir/model/types/real.rb +2 -0
  66. data/lib/expressir/model/types/select.rb +2 -0
  67. data/lib/expressir/model/types/set.rb +2 -0
  68. data/lib/expressir/model/types/string.rb +2 -0
  69. data/lib/expressir/model/unique.rb +2 -0
  70. data/lib/expressir/model/variable.rb +2 -0
  71. data/lib/expressir/model/where.rb +2 -0
  72. data/lib/expressir/version.rb +1 -1
  73. data/original/examples/syntax/hyperlink.exp +8 -0
  74. data/original/examples/syntax/hyperlink_formatted.exp +19 -0
  75. data/original/examples/syntax/syntax.exp +18 -18
  76. data/original/examples/syntax/syntax_formatted.exp +32 -24
  77. data/spec/expressir/express_exp/{format_remark_spec.rb → formatter/remark_spec.rb} +2 -2
  78. data/spec/expressir/express_exp/{format_syntax_spec.rb → formatter/syntax_spec.rb} +2 -2
  79. data/spec/expressir/express_exp/hyperlink_formatter_spec.rb +24 -0
  80. data/spec/expressir/express_exp/{head_source_spec.rb → parser/head_source_spec.rb} +1 -1
  81. data/spec/expressir/express_exp/{parse_multiple_spec.rb → parser/multiple_spec.rb} +1 -1
  82. data/spec/expressir/express_exp/{parse_remark_spec.rb → parser/remark_spec.rb} +2 -2
  83. data/spec/expressir/express_exp/{source_spec.rb → parser/source_spec.rb} +1 -1
  84. data/spec/expressir/express_exp/{parse_syntax_spec.rb → parser/syntax_spec.rb} +76 -44
  85. data/spec/expressir/express_exp/schema_head_formatter_spec.rb +36 -0
  86. data/spec/expressir/model/{scope_spec.rb → model_element/find_spec.rb} +7 -2
  87. data/spec/expressir/model/{model_element_spec.rb → model_element/hash_spec.rb} +7 -18
  88. metadata +32 -13
  89. data/lib/expressir/model/scope.rb +0 -71
  90. data/spec/expressir/express_exp/ap233_spec.rb +0 -22
@@ -61,21 +61,25 @@ ENTITY attribute_multiple_shorthand_entity;
61
61
  test : BOOLEAN;
62
62
  test2 : BOOLEAN;
63
63
  END_ENTITY;
64
- ENTITY attribute_redeclared_entity;
64
+ ENTITY attribute_redeclared_entity
65
+ SUBTYPE OF (attribute_entity);
65
66
  SELF\attribute_entity.test : BOOLEAN;
66
67
  END_ENTITY;
67
- ENTITY attribute_redeclared_renamed_entity;
68
+ ENTITY attribute_redeclared_renamed_entity
69
+ SUBTYPE OF (attribute_entity);
68
70
  SELF\attribute_entity.test RENAMED test2 : BOOLEAN;
69
71
  END_ENTITY;
70
72
  ENTITY derived_attribute_entity;
71
73
  DERIVE
72
74
  test : BOOLEAN := TRUE;
73
75
  END_ENTITY;
74
- ENTITY derived_attribute_redeclared_entity;
76
+ ENTITY derived_attribute_redeclared_entity
77
+ SUBTYPE OF (attribute_entity);
75
78
  DERIVE
76
79
  SELF\attribute_entity.test : BOOLEAN := TRUE;
77
80
  END_ENTITY;
78
- ENTITY derived_attribute_redeclared_renamed_entity;
81
+ ENTITY derived_attribute_redeclared_renamed_entity
82
+ SUBTYPE OF (attribute_entity);
79
83
  DERIVE
80
84
  SELF\attribute_entity.test RENAMED test2 : BOOLEAN := TRUE;
81
85
  END_ENTITY;
@@ -103,11 +107,13 @@ ENTITY inverse_attribute_bag_bound_entity;
103
107
  INVERSE
104
108
  test : BAG [1:9] OF attribute_entity FOR test;
105
109
  END_ENTITY;
106
- ENTITY inverse_attribute_redeclared_entity;
110
+ ENTITY inverse_attribute_redeclared_entity
111
+ SUBTYPE OF (attribute_entity);
107
112
  INVERSE
108
113
  SELF\attribute_entity.test : attribute_entity FOR test;
109
114
  END_ENTITY;
110
- ENTITY inverse_attribute_redeclared_renamed_entity;
115
+ ENTITY inverse_attribute_redeclared_renamed_entity
116
+ SUBTYPE OF (attribute_entity);
111
117
  INVERSE
112
118
  SELF\attribute_entity.test RENAMED test2 : attribute_entity FOR test;
113
119
  END_ENTITY;
@@ -121,11 +127,13 @@ ENTITY unique_label_entity;
121
127
  UNIQUE
122
128
  UR1 : test;
123
129
  END_ENTITY;
124
- ENTITY unique_qualified_entity;
130
+ ENTITY unique_redeclared_entity
131
+ SUBTYPE OF (attribute_entity);
125
132
  UNIQUE
126
133
  SELF\attribute_entity.test;
127
134
  END_ENTITY;
128
- ENTITY unique_label_qualified_entity;
135
+ ENTITY unique_label_redeclared_entity
136
+ SUBTYPE OF (attribute_entity);
129
137
  UNIQUE
130
138
  UR1 : SELF\attribute_entity.test;
131
139
  END_ENTITY;
@@ -331,13 +339,8 @@ PROCEDURE statements;
331
339
  ;
332
340
  END_ALIAS;
333
341
  END_PROCEDURE;
334
- PROCEDURE alias_attribute_reference_statement;
335
- ALIAS test FOR test.test;
336
- ;
337
- END_ALIAS;
338
- END_PROCEDURE;
339
342
  PROCEDURE alias_group_reference_statement;
340
- ALIAS test FOR test\test;
343
+ ALIAS test FOR test\test2;
341
344
  ;
342
345
  END_ALIAS;
343
346
  END_PROCEDURE;
@@ -351,14 +354,16 @@ PROCEDURE statements;
351
354
  ;
352
355
  END_ALIAS;
353
356
  END_PROCEDURE;
357
+ PROCEDURE alias_attribute_reference_statement;
358
+ ALIAS test FOR test.test2;
359
+ ;
360
+ END_ALIAS;
361
+ END_PROCEDURE;
354
362
  PROCEDURE assignment_simple_reference_statement;
355
363
  test := TRUE;
356
364
  END_PROCEDURE;
357
- PROCEDURE assignment_attribute_reference_statement;
358
- test.test := TRUE;
359
- END_PROCEDURE;
360
365
  PROCEDURE assignment_group_reference_statement;
361
- test\test := TRUE;
366
+ test\test2 := TRUE;
362
367
  END_PROCEDURE;
363
368
  PROCEDURE assignment_index_reference_statement;
364
369
  test[1] := TRUE;
@@ -366,6 +371,9 @@ PROCEDURE statements;
366
371
  PROCEDURE assignment_index2_reference_statement;
367
372
  test[1:9] := TRUE;
368
373
  END_PROCEDURE;
374
+ PROCEDURE assignment_attribute_reference_statement;
375
+ test.test2 := TRUE;
376
+ END_PROCEDURE;
369
377
  PROCEDURE case_statement;
370
378
  CASE test OF
371
379
  TRUE :
@@ -651,7 +659,7 @@ PROCEDURE expressions;
651
659
  and_or_expression : BOOLEAN := TRUE AND FALSE OR TRUE;
652
660
  parenthesis_or_and_expression : BOOLEAN := (TRUE OR FALSE) AND TRUE;
653
661
  and_parenthesis_or_expression : BOOLEAN := TRUE AND (FALSE OR TRUE);
654
- combine_expression : BOOLEAN := test || test;
662
+ combine_expression : BOOLEAN := test || test2;
655
663
  in_expression : BOOLEAN := TRUE IN [TRUE];
656
664
  like_expression : BOOLEAN := 'xxx' LIKE 'xxx';
657
665
  aggregate_initializer_expression : BOOLEAN := [4];
@@ -659,11 +667,11 @@ PROCEDURE expressions;
659
667
  complex_aggregate_initializer_expression : BOOLEAN := [4 + 2];
660
668
  complex_repeated_aggregate_initializer_expression : BOOLEAN := [4 + 2:4 + 2];
661
669
  call_expression : BOOLEAN := parameter_function(TRUE);
662
- simple_reference_expression : BOOLEAN := simple_string_expression;
663
- attribute_reference_expression : BOOLEAN := simple_string_expression.test;
664
- group_reference_expression : BOOLEAN := simple_string_expression\test;
665
- index_reference_expression : BOOLEAN := simple_string_expression[1];
666
- index2_reference_expression : BOOLEAN := simple_string_expression[1:9];
670
+ simple_reference_expression : BOOLEAN := test;
671
+ group_reference_expression : BOOLEAN := test\test2;
672
+ index_reference_expression : BOOLEAN := test[1];
673
+ index2_reference_expression : BOOLEAN := test[1:9];
674
+ attribute_reference_expression : BOOLEAN := test.test2;
667
675
  lt_lt_interval_expression : BOOLEAN := {1 < 5 < 9};
668
676
  lte_lt_interval_expression : BOOLEAN := {1 <= 5 < 9};
669
677
  lt_lte_interval_expression : BOOLEAN := {1 < 5 <= 9};
@@ -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 a file" do
8
- repo = Expressir::ExpressExp::Parser.from_exp(input_file)
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 a file" do
8
- repo = Expressir::ExpressExp::Parser.from_exp(input_file)
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
@@ -5,7 +5,7 @@ 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.from_exp(sample_file)
8
+ repo = Expressir::ExpressExp::Parser.from_file(sample_file)
9
9
 
10
10
  repo.schemas[0].tap do |x|
11
11
  start_index = x.source.index("SCHEMA")
@@ -3,7 +3,7 @@ require "expressir/express_exp/parser"
3
3
 
4
4
  RSpec.describe Expressir::ExpressExp::Parser do
5
5
  describe ".from_files" do
6
- it "build an instance from multiple files file" do
6
+ it "parses multiple files" do
7
7
  repo = Expressir::ExpressExp::Parser.from_files(sample_files)
8
8
 
9
9
  schemas = repo.schemas
@@ -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 "build an instance from a file" do
7
- repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
6
+ it "parses remark" do
7
+ repo = Expressir::ExpressExp::Parser.from_file(sample_file)
8
8
 
9
9
  schema = repo.schemas.first
10
10
 
@@ -5,7 +5,7 @@ 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.from_exp(sample_file)
8
+ repo = Expressir::ExpressExp::Parser.from_file(sample_file)
9
9
 
10
10
  schema = repo.schemas.first
11
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 "build an instance from a file" do
7
- repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
6
+ it "parses syntax" do
7
+ repo = Expressir::ExpressExp::Parser.from_file(sample_file)
8
8
 
9
9
  schemas = repo.schemas
10
10
 
@@ -242,6 +242,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
242
242
 
243
243
  entities.find{|x| x.id == "attribute_redeclared_entity"}.tap do |x|
244
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")
245
249
  expect(x.attributes).to be_instance_of(Array)
246
250
  expect(x.attributes.count).to eq(1)
247
251
  expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
@@ -259,6 +263,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
259
263
 
260
264
  entities.find{|x| x.id == "attribute_redeclared_renamed_entity"}.tap do |x|
261
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")
262
270
  expect(x.attributes).to be_instance_of(Array)
263
271
  expect(x.attributes.count).to eq(1)
264
272
  expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
@@ -289,6 +297,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
289
297
 
290
298
  entities.find{|x| x.id == "derived_attribute_redeclared_entity"}.tap do |x|
291
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")
292
304
  expect(x.attributes).to be_instance_of(Array)
293
305
  expect(x.attributes.count).to eq(1)
294
306
  expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
@@ -308,6 +320,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
308
320
 
309
321
  entities.find{|x| x.id == "derived_attribute_redeclared_renamed_entity"}.tap do |x|
310
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")
311
327
  expect(x.attributes).to be_instance_of(Array)
312
328
  expect(x.attributes.count).to eq(1)
313
329
  expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
@@ -421,6 +437,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
421
437
 
422
438
  entities.find{|x| x.id == "inverse_attribute_redeclared_entity"}.tap do |x|
423
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")
424
444
  expect(x.attributes).to be_instance_of(Array)
425
445
  expect(x.attributes.count).to eq(1)
426
446
  expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
@@ -441,6 +461,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
441
461
 
442
462
  entities.find{|x| x.id == "inverse_attribute_redeclared_renamed_entity"}.tap do |x|
443
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")
444
468
  expect(x.attributes).to be_instance_of(Array)
445
469
  expect(x.attributes.count).to eq(1)
446
470
  expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
@@ -495,8 +519,12 @@ RSpec.describe Expressir::ExpressExp::Parser do
495
519
  expect(x.unique[0].attributes[0].id).to eq("test")
496
520
  end
497
521
 
498
- entities.find{|x| x.id == "unique_qualified_entity"}.tap do |x|
522
+ entities.find{|x| x.id == "unique_redeclared_entity"}.tap do |x|
499
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")
500
528
  expect(x.unique).to be_instance_of(Array)
501
529
  expect(x.unique.count).to eq(1)
502
530
  expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
@@ -524,8 +552,12 @@ RSpec.describe Expressir::ExpressExp::Parser do
524
552
  expect(x.unique[0].attributes[0].id).to eq("test")
525
553
  end
526
554
 
527
- entities.find{|x| x.id == "unique_label_qualified_entity"}.tap do |x|
555
+ entities.find{|x| x.id == "unique_label_redeclared_entity"}.tap do |x|
528
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")
529
561
  expect(x.unique).to be_instance_of(Array)
530
562
  expect(x.unique.count).to eq(1)
531
563
  expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
@@ -1489,19 +1521,6 @@ RSpec.describe Expressir::ExpressExp::Parser do
1489
1521
  expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1490
1522
  end
1491
1523
 
1492
- x.procedures.find{|x| x.id == "alias_attribute_reference_statement"}.statements[0].tap do |x|
1493
- expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1494
- expect(x.id).to eq("test")
1495
- expect(x.expression).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
1496
- expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1497
- expect(x.expression.ref.id).to eq("test")
1498
- expect(x.expression.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1499
- expect(x.expression.attribute.id).to eq("test")
1500
- expect(x.statements).to be_instance_of(Array)
1501
- expect(x.statements.count).to eq(1)
1502
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1503
- end
1504
-
1505
1524
  x.procedures.find{|x| x.id == "alias_group_reference_statement"}.statements[0].tap do |x|
1506
1525
  expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1507
1526
  expect(x.id).to eq("test")
@@ -1509,7 +1528,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
1509
1528
  expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1510
1529
  expect(x.expression.ref.id).to eq("test")
1511
1530
  expect(x.expression.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1512
- expect(x.expression.entity.id).to eq("test")
1531
+ expect(x.expression.entity.id).to eq("test2")
1513
1532
  expect(x.statements).to be_instance_of(Array)
1514
1533
  expect(x.statements.count).to eq(1)
1515
1534
  expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
@@ -1543,6 +1562,19 @@ RSpec.describe Expressir::ExpressExp::Parser do
1543
1562
  expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1544
1563
  end
1545
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
+
1546
1578
  x.procedures.find{|x| x.id == "assignment_simple_reference_statement"}.statements[0].tap do |x|
1547
1579
  expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1548
1580
  expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
@@ -1551,24 +1583,13 @@ RSpec.describe Expressir::ExpressExp::Parser do
1551
1583
  expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1552
1584
  end
1553
1585
 
1554
- x.procedures.find{|x| x.id == "assignment_attribute_reference_statement"}.statements[0].tap do |x|
1555
- expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1556
- expect(x.ref).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
1557
- expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1558
- expect(x.ref.ref.id).to eq("test")
1559
- expect(x.ref.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1560
- expect(x.ref.attribute.id).to eq("test")
1561
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1562
- expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1563
- end
1564
-
1565
1586
  x.procedures.find{|x| x.id == "assignment_group_reference_statement"}.statements[0].tap do |x|
1566
1587
  expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1567
1588
  expect(x.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
1568
1589
  expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1569
1590
  expect(x.ref.ref.id).to eq("test")
1570
1591
  expect(x.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1571
- expect(x.ref.entity.id).to eq("test")
1592
+ expect(x.ref.entity.id).to eq("test2")
1572
1593
  expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1573
1594
  expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1574
1595
  end
@@ -1597,6 +1618,17 @@ RSpec.describe Expressir::ExpressExp::Parser do
1597
1618
  expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1598
1619
  end
1599
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
+
1600
1632
  x.procedures.find{|x| x.id == "case_statement"}.statements[0].tap do |x|
1601
1633
  expect(x).to be_instance_of(Expressir::Model::Statements::Case)
1602
1634
  expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
@@ -2911,29 +2943,21 @@ RSpec.describe Expressir::ExpressExp::Parser do
2911
2943
  # reference expressions
2912
2944
  x.variables.find{|x| x.id == "simple_reference_expression"}.expression.tap do |x|
2913
2945
  expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2914
- expect(x.id).to eq("simple_string_expression")
2915
- end
2916
-
2917
- x.variables.find{|x| x.id == "attribute_reference_expression"}.expression.tap do |x|
2918
- expect(x).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
2919
- expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2920
- expect(x.ref.id).to eq("simple_string_expression")
2921
- expect(x.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2922
- expect(x.attribute.id).to eq("test")
2946
+ expect(x.id).to eq("test")
2923
2947
  end
2924
2948
 
2925
2949
  x.variables.find{|x| x.id == "group_reference_expression"}.expression.tap do |x|
2926
2950
  expect(x).to be_instance_of(Expressir::Model::Expressions::GroupReference)
2927
2951
  expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2928
- expect(x.ref.id).to eq("simple_string_expression")
2952
+ expect(x.ref.id).to eq("test")
2929
2953
  expect(x.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2930
- expect(x.entity.id).to eq("test")
2954
+ expect(x.entity.id).to eq("test2")
2931
2955
  end
2932
2956
 
2933
2957
  x.variables.find{|x| x.id == "index_reference_expression"}.expression.tap do |x|
2934
2958
  expect(x).to be_instance_of(Expressir::Model::Expressions::IndexReference)
2935
2959
  expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2936
- expect(x.ref.id).to eq("simple_string_expression")
2960
+ expect(x.ref.id).to eq("test")
2937
2961
  expect(x.index1).to be_instance_of(Expressir::Model::Literals::Integer)
2938
2962
  expect(x.index1.value).to eq("1")
2939
2963
  end
@@ -2941,13 +2965,21 @@ RSpec.describe Expressir::ExpressExp::Parser do
2941
2965
  x.variables.find{|x| x.id == "index2_reference_expression"}.expression.tap do |x|
2942
2966
  expect(x).to be_instance_of(Expressir::Model::Expressions::IndexReference)
2943
2967
  expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2944
- expect(x.ref.id).to eq("simple_string_expression")
2968
+ expect(x.ref.id).to eq("test")
2945
2969
  expect(x.index1).to be_instance_of(Expressir::Model::Literals::Integer)
2946
2970
  expect(x.index1.value).to eq("1")
2947
2971
  expect(x.index2).to be_instance_of(Expressir::Model::Literals::Integer)
2948
2972
  expect(x.index2.value).to eq("9")
2949
2973
  end
2950
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
+
2951
2983
  # interval expressions
2952
2984
  x.variables.find{|x| x.id == "lt_lt_interval_expression"}.expression.tap do |x|
2953
2985
  expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
@@ -3003,7 +3035,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
3003
3035
  expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
3004
3036
  expect(x.operand1.id).to eq("test")
3005
3037
  expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
3006
- expect(x.operand2.id).to eq("test")
3038
+ expect(x.operand2.id).to eq("test2")
3007
3039
  end
3008
3040
 
3009
3041
  x.variables.find{|x| x.id == "in_expression"}.expression.tap do |x|