expressir 0.2.21-arm64-darwin → 1.0.0-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +7 -6
- data/.github/workflows/release.yml +22 -6
- data/.gitignore +2 -2
- data/demo.rb +5 -5
- data/exe/format +10 -73
- data/exe/format-test +81 -0
- data/expressir.gemspec +0 -1
- data/lib/expressir.rb +0 -1
- data/lib/expressir/cli.rb +0 -6
- data/lib/expressir/{express_exp → express}/2.4/express_parser.bundle +0 -0
- data/lib/expressir/{express_exp → express}/2.5/express_parser.bundle +0 -0
- data/lib/expressir/{express_exp → express}/2.6/express_parser.bundle +0 -0
- data/lib/expressir/{express_exp → express}/2.7/express_parser.bundle +0 -0
- data/lib/expressir/{express_exp → express}/3.0/express_parser.bundle +0 -0
- data/lib/expressir/{express_exp → express}/cache.rb +3 -6
- data/lib/expressir/{express_exp → express}/formatter.rb +84 -68
- data/lib/expressir/express/hyperlink_formatter.rb +22 -0
- data/lib/expressir/express/model_visitor.rb +23 -0
- data/lib/expressir/{express_exp → express}/parser.rb +16 -5
- data/lib/expressir/express/resolve_references_model_visitor.rb +29 -0
- data/lib/expressir/{express_exp → express}/schema_head_formatter.rb +1 -1
- data/lib/expressir/{express_exp → express}/visitor.rb +67 -44
- data/lib/expressir/model.rb +5 -3
- data/lib/expressir/model/attribute.rb +13 -6
- data/lib/expressir/model/cache.rb +2 -2
- data/lib/expressir/model/constant.rb +10 -3
- data/lib/expressir/model/entity.rb +18 -16
- data/lib/expressir/model/enumeration_item.rb +8 -1
- data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
- data/lib/expressir/model/expressions/aggregate_item.rb +2 -2
- data/lib/expressir/model/expressions/attribute_reference.rb +2 -2
- data/lib/expressir/model/expressions/binary_expression.rb +3 -3
- data/lib/expressir/model/expressions/call.rb +3 -3
- data/lib/expressir/model/expressions/entity_constructor.rb +3 -3
- data/lib/expressir/model/expressions/group_reference.rb +2 -2
- data/lib/expressir/model/expressions/index_reference.rb +3 -3
- data/lib/expressir/model/expressions/interval.rb +5 -5
- data/lib/expressir/model/expressions/query_expression.rb +6 -4
- data/lib/expressir/model/expressions/simple_reference.rb +5 -1
- data/lib/expressir/model/expressions/unary_expression.rb +2 -2
- data/lib/expressir/model/function.rb +23 -21
- data/lib/expressir/model/identifier.rb +6 -3
- data/lib/expressir/model/interface.rb +4 -4
- data/lib/expressir/model/interface_item.rb +2 -2
- data/lib/expressir/model/interfaced_item.rb +10 -9
- data/lib/expressir/model/literals/binary.rb +1 -1
- data/lib/expressir/model/literals/integer.rb +1 -1
- data/lib/expressir/model/literals/logical.rb +1 -1
- data/lib/expressir/model/literals/real.rb +1 -1
- data/lib/expressir/model/literals/string.rb +2 -2
- data/lib/expressir/model/model_element.rb +39 -27
- data/lib/expressir/model/parameter.rb +10 -3
- data/lib/expressir/model/procedure.rb +22 -20
- data/lib/expressir/model/remark_item.rb +15 -0
- data/lib/expressir/model/repository.rb +2 -2
- data/lib/expressir/model/rule.rb +27 -25
- data/lib/expressir/model/schema.rb +24 -20
- data/lib/expressir/model/schema_version.rb +15 -0
- data/lib/expressir/model/schema_version_item.rb +15 -0
- data/lib/expressir/model/statements/alias.rb +7 -5
- data/lib/expressir/model/statements/assignment.rb +2 -2
- data/lib/expressir/model/statements/call.rb +3 -3
- data/lib/expressir/model/statements/case.rb +4 -4
- data/lib/expressir/model/statements/case_action.rb +3 -3
- data/lib/expressir/model/statements/compound.rb +2 -2
- data/lib/expressir/model/statements/if.rb +5 -5
- data/lib/expressir/model/statements/repeat.rb +11 -9
- data/lib/expressir/model/statements/return.rb +1 -1
- data/lib/expressir/model/subtype_constraint.rb +13 -6
- data/lib/expressir/model/type.rb +12 -10
- data/lib/expressir/model/types/aggregate.rb +9 -2
- data/lib/expressir/model/types/array.rb +5 -5
- data/lib/expressir/model/types/bag.rb +3 -3
- data/lib/expressir/model/types/binary.rb +2 -2
- data/lib/expressir/model/types/enumeration.rb +5 -7
- data/lib/expressir/model/types/generic.rb +8 -1
- data/lib/expressir/model/types/generic_entity.rb +8 -1
- data/lib/expressir/model/types/list.rb +4 -4
- data/lib/expressir/model/types/real.rb +1 -1
- data/lib/expressir/model/types/select.rb +6 -8
- data/lib/expressir/model/types/set.rb +3 -3
- data/lib/expressir/model/types/string.rb +2 -2
- data/lib/expressir/model/unique_rule.rb +26 -0
- data/lib/expressir/model/variable.rb +10 -3
- data/lib/expressir/model/where_rule.rb +26 -0
- data/lib/expressir/version.rb +1 -1
- data/rakelib/cross-ruby.rake +1 -1
- data/spec/expressir/{express_exp → express}/cache_spec.rb +9 -9
- data/spec/expressir/express/formatter_spec.rb +127 -0
- data/spec/expressir/{express_exp → express}/parser_spec.rb +24 -24
- data/spec/expressir/model/model_element_spec.rb +112 -60
- data/{original/examples → spec}/syntax/multiple.exp +1 -1
- data/{original/examples → spec}/syntax/multiple.yaml +19 -5
- data/{original/examples → spec}/syntax/multiple_formatted.exp +1 -1
- data/{original/examples → spec}/syntax/multiple_hyperlink_formatted.exp +4 -4
- data/{original/examples → spec}/syntax/multiple_schema_head_hyperlink_formatted.exp +1 -1
- data/{original/examples → spec}/syntax/remark.exp +12 -10
- data/{original/examples → spec}/syntax/remark.yaml +36 -16
- data/{original/examples → spec}/syntax/remark_formatted.exp +3 -1
- data/spec/syntax/single.exp +4 -0
- data/spec/syntax/single.yaml +18 -0
- data/spec/syntax/single_formatted.exp +10 -0
- data/spec/syntax/single_formatted.yaml +36 -0
- data/{original/examples → spec}/syntax/syntax.exp +11 -11
- data/{original/examples → spec}/syntax/syntax.yaml +205 -108
- data/{original/examples → spec}/syntax/syntax_formatted.exp +11 -11
- data/spec/syntax/syntax_hyperlink_formatted.exp +902 -0
- data/{original/examples → spec}/syntax/syntax_schema_head_formatted.exp +1 -1
- metadata +41 -83
- data/lib/expressir/express.rb +0 -11
- data/lib/expressir/express/aggregate_dimension.rb +0 -38
- data/lib/expressir/express/attribute.rb +0 -15
- data/lib/expressir/express/comment.rb +0 -7
- data/lib/expressir/express/defined_type.rb +0 -36
- data/lib/expressir/express/derived.rb +0 -65
- data/lib/expressir/express/derived_aggregate.rb +0 -43
- data/lib/expressir/express/entity.rb +0 -137
- data/lib/expressir/express/explicit.rb +0 -70
- data/lib/expressir/express/explicit_aggregate.rb +0 -46
- data/lib/expressir/express/explicit_or_derived.rb +0 -16
- data/lib/expressir/express/global_rule.rb +0 -44
- data/lib/expressir/express/interface_specification.rb +0 -51
- data/lib/expressir/express/interfaced_item.rb +0 -38
- data/lib/expressir/express/inverse.rb +0 -46
- data/lib/expressir/express/inverse_aggregate.rb +0 -37
- data/lib/expressir/express/model_element.rb +0 -7
- data/lib/expressir/express/named_type.rb +0 -19
- data/lib/expressir/express/remark.rb +0 -8
- data/lib/expressir/express/repository.rb +0 -306
- data/lib/expressir/express/schema_definition.rb +0 -96
- data/lib/expressir/express/subtype_constraint.rb +0 -14
- data/lib/expressir/express/type.rb +0 -26
- data/lib/expressir/express/type_aggregate.rb +0 -42
- data/lib/expressir/express/type_enum.rb +0 -29
- data/lib/expressir/express/type_parser.rb +0 -45
- data/lib/expressir/express/type_select.rb +0 -82
- data/lib/expressir/express/unique_rule.rb +0 -35
- data/lib/expressir/express/where_rule.rb +0 -32
- data/lib/expressir/express_exp/hyperlink_formatter.rb +0 -27
- data/lib/expressir/express_parser.rb +0 -30
- data/lib/expressir/model/informal_proposition.rb +0 -18
- data/lib/expressir/model/unique.rb +0 -19
- data/lib/expressir/model/where.rb +0 -19
- data/lib/expressir/parser.rb +0 -6
- data/lib/expressir/parser/owl_parser.rb +0 -8
- data/original/examples/syntax/single.exp +0 -3
- data/original/examples/syntax/single.yaml +0 -9
- data/original/examples/syntax/single_formatted.exp +0 -6
- data/original/examples/syntax/single_formatted.yaml +0 -19
- data/spec/acceptance/express_to_owl_spec.rb +0 -18
- data/spec/expressir/express/repository_spec.rb +0 -25
- data/spec/expressir/express_exp/formatter_spec.rb +0 -111
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class SchemaVersionItem < ModelElement
|
4
|
+
model_attr_accessor :name
|
5
|
+
model_attr_accessor :value
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
@name = options[:name]
|
9
|
+
@value = options[:value]
|
10
|
+
|
11
|
+
super
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -4,23 +4,25 @@ module Expressir
|
|
4
4
|
class Alias < ModelElement
|
5
5
|
include Identifier
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
model_attr_accessor :expression
|
8
|
+
model_attr_accessor :statements
|
9
9
|
|
10
10
|
def initialize(options = {})
|
11
11
|
@id = options[:id]
|
12
|
-
@remarks = options
|
12
|
+
@remarks = options[:remarks] || []
|
13
|
+
@remark_items = options[:remark_items] || []
|
13
14
|
@source = options[:source]
|
14
15
|
|
15
16
|
@expression = options[:expression]
|
16
|
-
@statements = options
|
17
|
+
@statements = options[:statements] || []
|
17
18
|
|
18
19
|
super
|
19
20
|
end
|
20
21
|
|
21
22
|
def children
|
22
23
|
[
|
23
|
-
self
|
24
|
+
self,
|
25
|
+
*remark_items
|
24
26
|
]
|
25
27
|
end
|
26
28
|
end
|
@@ -2,12 +2,12 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Statements
|
4
4
|
class Call < ModelElement
|
5
|
-
|
6
|
-
|
5
|
+
model_attr_accessor :ref
|
6
|
+
model_attr_accessor :parameters
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@ref = options[:ref]
|
10
|
-
@parameters = options
|
10
|
+
@parameters = options[:parameters] || []
|
11
11
|
|
12
12
|
super
|
13
13
|
end
|
@@ -2,13 +2,13 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Statements
|
4
4
|
class Case < ModelElement
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
model_attr_accessor :expression
|
6
|
+
model_attr_accessor :actions
|
7
|
+
model_attr_accessor :otherwise_statement
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
@expression = options[:expression]
|
11
|
-
@actions = options
|
11
|
+
@actions = options[:actions] || []
|
12
12
|
@otherwise_statement = options[:otherwise_statement]
|
13
13
|
|
14
14
|
super
|
@@ -2,11 +2,11 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Statements
|
4
4
|
class CaseAction < ModelElement
|
5
|
-
|
6
|
-
|
5
|
+
model_attr_accessor :labels
|
6
|
+
model_attr_accessor :statement
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
|
-
@labels = options
|
9
|
+
@labels = options[:labels] || []
|
10
10
|
@statement = options[:statement]
|
11
11
|
|
12
12
|
super
|
@@ -2,10 +2,10 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Statements
|
4
4
|
class Compound < ModelElement
|
5
|
-
|
5
|
+
model_attr_accessor :statements
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
|
-
@statements = options
|
8
|
+
@statements = options[:statements] || []
|
9
9
|
|
10
10
|
super
|
11
11
|
end
|
@@ -2,14 +2,14 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Statements
|
4
4
|
class If < ModelElement
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
model_attr_accessor :expression
|
6
|
+
model_attr_accessor :statements
|
7
|
+
model_attr_accessor :else_statements
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
@expression = options[:expression]
|
11
|
-
@statements = options
|
12
|
-
@else_statements = options
|
11
|
+
@statements = options[:statements] || []
|
12
|
+
@else_statements = options[:else_statements] || []
|
13
13
|
|
14
14
|
super
|
15
15
|
end
|
@@ -4,16 +4,17 @@ module Expressir
|
|
4
4
|
class Repeat < ModelElement
|
5
5
|
include Identifier
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
model_attr_accessor :bound1
|
8
|
+
model_attr_accessor :bound2
|
9
|
+
model_attr_accessor :increment
|
10
|
+
model_attr_accessor :while_expression
|
11
|
+
model_attr_accessor :until_expression
|
12
|
+
model_attr_accessor :statements
|
13
13
|
|
14
14
|
def initialize(options = {})
|
15
15
|
@id = options[:id]
|
16
|
-
@remarks = options
|
16
|
+
@remarks = options[:remarks] || []
|
17
|
+
@remark_items = options[:remark_items] || []
|
17
18
|
@source = options[:source]
|
18
19
|
|
19
20
|
@bound1 = options[:bound1]
|
@@ -21,14 +22,15 @@ module Expressir
|
|
21
22
|
@increment = options[:increment]
|
22
23
|
@while_expression = options[:while_expression]
|
23
24
|
@until_expression = options[:until_expression]
|
24
|
-
@statements = options
|
25
|
+
@statements = options[:statements] || []
|
25
26
|
|
26
27
|
super
|
27
28
|
end
|
28
29
|
|
29
30
|
def children
|
30
31
|
[
|
31
|
-
self
|
32
|
+
self,
|
33
|
+
*remark_items
|
32
34
|
]
|
33
35
|
end
|
34
36
|
end
|
@@ -3,23 +3,30 @@ module Expressir
|
|
3
3
|
class SubtypeConstraint < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
model_attr_accessor :applies_to
|
7
|
+
model_attr_accessor :abstract
|
8
|
+
model_attr_accessor :total_over
|
9
|
+
model_attr_accessor :supertype_expression
|
10
10
|
|
11
11
|
def initialize(options = {})
|
12
12
|
@id = options[:id]
|
13
|
-
@remarks = options
|
13
|
+
@remarks = options[:remarks] || []
|
14
|
+
@remark_items = options[:remark_items] || []
|
14
15
|
@source = options[:source]
|
15
16
|
|
16
17
|
@applies_to = options[:applies_to]
|
17
18
|
@abstract = options[:abstract]
|
18
|
-
@total_over = options
|
19
|
+
@total_over = options[:total_over] || []
|
19
20
|
@supertype_expression = options[:supertype_expression]
|
20
21
|
|
21
22
|
super
|
22
23
|
end
|
24
|
+
|
25
|
+
def children
|
26
|
+
[
|
27
|
+
*remark_items
|
28
|
+
]
|
29
|
+
end
|
23
30
|
end
|
24
31
|
end
|
25
32
|
end
|
data/lib/expressir/model/type.rb
CHANGED
@@ -3,31 +3,33 @@ module Expressir
|
|
3
3
|
class Type < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
model_attr_accessor :underlying_type
|
7
|
+
model_attr_accessor :where_rules
|
8
|
+
model_attr_accessor :informal_propositions
|
9
9
|
|
10
10
|
def initialize(options = {})
|
11
11
|
@id = options[:id]
|
12
|
-
@remarks = options
|
12
|
+
@remarks = options[:remarks] || []
|
13
|
+
@remark_items = options[:remark_items] || []
|
13
14
|
@source = options[:source]
|
14
15
|
|
15
|
-
@
|
16
|
-
@
|
17
|
-
@informal_propositions = options
|
16
|
+
@underlying_type = options[:underlying_type]
|
17
|
+
@where_rules = options[:where_rules] || []
|
18
|
+
@informal_propositions = options[:informal_propositions] || []
|
18
19
|
|
19
20
|
super
|
20
21
|
end
|
21
22
|
|
22
23
|
def enumeration_items
|
23
|
-
|
24
|
+
underlying_type.is_a?(Types::Enumeration) ? underlying_type.items : []
|
24
25
|
end
|
25
26
|
|
26
27
|
def children
|
27
28
|
[
|
28
29
|
*enumeration_items,
|
29
|
-
*
|
30
|
-
*informal_propositions
|
30
|
+
*where_rules,
|
31
|
+
*informal_propositions,
|
32
|
+
*remark_items
|
31
33
|
]
|
32
34
|
end
|
33
35
|
end
|
@@ -4,17 +4,24 @@ module Expressir
|
|
4
4
|
class Aggregate < ModelElement
|
5
5
|
include Identifier
|
6
6
|
|
7
|
-
|
7
|
+
model_attr_accessor :base_type
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
@id = options[:id]
|
11
|
-
@remarks = options
|
11
|
+
@remarks = options[:remarks] || []
|
12
|
+
@remark_items = options[:remark_items] || []
|
12
13
|
@source = options[:source]
|
13
14
|
|
14
15
|
@base_type = options[:base_type]
|
15
16
|
|
16
17
|
super
|
17
18
|
end
|
19
|
+
|
20
|
+
def children
|
21
|
+
[
|
22
|
+
*remark_items
|
23
|
+
]
|
24
|
+
end
|
18
25
|
end
|
19
26
|
end
|
20
27
|
end
|
@@ -2,11 +2,11 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Types
|
4
4
|
class Array < ModelElement
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
model_attr_accessor :bound1
|
6
|
+
model_attr_accessor :bound2
|
7
|
+
model_attr_accessor :optional
|
8
|
+
model_attr_accessor :unique
|
9
|
+
model_attr_accessor :base_type
|
10
10
|
|
11
11
|
def initialize(options = {})
|
12
12
|
@bound1 = options[:bound1]
|
@@ -2,9 +2,9 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Types
|
4
4
|
class Bag < ModelElement
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
model_attr_accessor :bound1
|
6
|
+
model_attr_accessor :bound2
|
7
|
+
model_attr_accessor :base_type
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
@bound1 = options[:bound1]
|
@@ -2,16 +2,14 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Types
|
4
4
|
class Enumeration < ModelElement
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
attr_accessor :extension_items
|
5
|
+
model_attr_accessor :extensible
|
6
|
+
model_attr_accessor :based_on
|
7
|
+
model_attr_accessor :items
|
9
8
|
|
10
9
|
def initialize(options = {})
|
11
10
|
@extensible = options[:extensible]
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@extension_items = options.fetch(:extension_items, [])
|
11
|
+
@based_on = options[:based_on]
|
12
|
+
@items = options[:items] || []
|
15
13
|
|
16
14
|
super
|
17
15
|
end
|
@@ -6,11 +6,18 @@ module Expressir
|
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
8
|
@id = options[:id]
|
9
|
-
@remarks = options
|
9
|
+
@remarks = options[:remarks] || []
|
10
|
+
@remark_items = options[:remark_items] || []
|
10
11
|
@source = options[:source]
|
11
12
|
|
12
13
|
super
|
13
14
|
end
|
15
|
+
|
16
|
+
def children
|
17
|
+
[
|
18
|
+
*remark_items
|
19
|
+
]
|
20
|
+
end
|
14
21
|
end
|
15
22
|
end
|
16
23
|
end
|
@@ -6,12 +6,19 @@ module Expressir
|
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
8
|
@id = options[:id]
|
9
|
-
@remarks = options
|
9
|
+
@remarks = options[:remarks] || []
|
10
|
+
@remark_items = options[:remark_items] || []
|
10
11
|
@source = options[:source]
|
11
12
|
|
12
13
|
super
|
13
14
|
end
|
14
15
|
end
|
16
|
+
|
17
|
+
def children
|
18
|
+
[
|
19
|
+
*remark_items
|
20
|
+
]
|
21
|
+
end
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|
@@ -2,10 +2,10 @@ module Expressir
|
|
2
2
|
module Model
|
3
3
|
module Types
|
4
4
|
class List < ModelElement
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
model_attr_accessor :bound1
|
6
|
+
model_attr_accessor :bound2
|
7
|
+
model_attr_accessor :unique
|
8
|
+
model_attr_accessor :base_type
|
9
9
|
|
10
10
|
def initialize(options = {})
|
11
11
|
@bound1 = options[:bound1]
|