expressir 0.2.9-x86-mingw32 → 0.2.10-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
- data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
- data/lib/expressir/express_exp/formatter.rb +71 -16
- data/lib/expressir/express_exp/visitor.rb +95 -41
- data/lib/expressir/model.rb +2 -0
- data/lib/expressir/model/attribute.rb +3 -1
- data/lib/expressir/model/constant.rb +3 -1
- data/lib/expressir/model/entity.rb +11 -21
- data/lib/expressir/model/enumeration_item.rb +3 -1
- data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
- data/lib/expressir/model/expressions/aggregate_item.rb +1 -1
- data/lib/expressir/model/expressions/attribute_reference.rb +1 -1
- data/lib/expressir/model/expressions/binary_expression.rb +1 -1
- data/lib/expressir/model/expressions/call.rb +2 -2
- data/lib/expressir/model/expressions/entity_constructor.rb +2 -2
- data/lib/expressir/model/expressions/group_reference.rb +1 -1
- data/lib/expressir/model/expressions/index_reference.rb +1 -1
- data/lib/expressir/model/expressions/interval.rb +1 -1
- data/lib/expressir/model/expressions/query_expression.rb +3 -1
- data/lib/expressir/model/expressions/simple_reference.rb +1 -1
- data/lib/expressir/model/expressions/unary_expression.rb +1 -1
- data/lib/expressir/model/function.rb +32 -38
- data/lib/expressir/model/identifier.rb +1 -2
- data/lib/expressir/model/informal_proposition.rb +3 -1
- data/lib/expressir/model/interface.rb +2 -2
- 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 +1 -1
- data/lib/expressir/model/model_element.rb +67 -0
- data/lib/expressir/model/parameter.rb +3 -1
- data/lib/expressir/model/procedure.rb +33 -39
- data/lib/expressir/model/renamed_ref.rb +1 -1
- data/lib/expressir/model/repository.rb +3 -3
- data/lib/expressir/model/rule.rb +34 -40
- data/lib/expressir/model/schema.rb +35 -48
- data/lib/expressir/model/scope.rb +0 -3
- data/lib/expressir/model/statements/alias.rb +4 -2
- data/lib/expressir/model/statements/assignment.rb +1 -1
- data/lib/expressir/model/statements/call.rb +2 -2
- data/lib/expressir/model/statements/case.rb +2 -2
- data/lib/expressir/model/statements/case_action.rb +2 -2
- data/lib/expressir/model/statements/compound.rb +2 -2
- data/lib/expressir/model/statements/escape.rb +1 -1
- data/lib/expressir/model/statements/if.rb +3 -3
- data/lib/expressir/model/statements/null.rb +1 -1
- data/lib/expressir/model/statements/repeat.rb +4 -2
- data/lib/expressir/model/statements/return.rb +1 -1
- data/lib/expressir/model/statements/skip.rb +1 -1
- data/lib/expressir/model/subtype_constraint.rb +3 -1
- data/lib/expressir/model/type.rb +7 -5
- data/lib/expressir/model/types/aggregate.rb +3 -1
- data/lib/expressir/model/types/array.rb +1 -1
- data/lib/expressir/model/types/bag.rb +1 -1
- data/lib/expressir/model/types/binary.rb +1 -1
- data/lib/expressir/model/types/boolean.rb +1 -1
- data/lib/expressir/model/types/enumeration.rb +3 -3
- data/lib/expressir/model/types/generic.rb +3 -1
- data/lib/expressir/model/types/generic_entity.rb +3 -1
- data/lib/expressir/model/types/integer.rb +1 -1
- data/lib/expressir/model/types/list.rb +1 -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 +1 -1
- data/lib/expressir/model/types/select.rb +3 -3
- data/lib/expressir/model/types/set.rb +1 -1
- data/lib/expressir/model/types/string.rb +1 -1
- data/lib/expressir/model/unique.rb +4 -2
- data/lib/expressir/model/variable.rb +3 -1
- data/lib/expressir/model/where.rb +3 -1
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/remark_formatted.exp +0 -5
- data/original/examples/syntax/simple.exp +3 -0
- data/original/examples/syntax/syntax.exp +189 -181
- data/original/examples/syntax/syntax_formatted.exp +346 -792
- data/spec/expressir/express_exp/head_source_spec.rb +1 -4
- data/spec/expressir/express_exp/parse_remark_spec.rb +3 -3
- data/spec/expressir/express_exp/parse_syntax_spec.rb +1583 -1578
- data/spec/expressir/express_exp/source_spec.rb +1 -4
- data/spec/expressir/model/model_element_spec.rb +59 -0
- data/spec/expressir/model/{find_spec.rb → scope_spec.rb} +1 -1
- metadata +6 -3
data/lib/expressir/model.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Attribute
|
3
|
+
class Attribute < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
EXPLICIT = :EXPLICIT
|
@@ -15,6 +15,8 @@ module Expressir
|
|
15
15
|
|
16
16
|
def initialize(options = {})
|
17
17
|
@id = options[:id]
|
18
|
+
@remarks = options.fetch(:remarks, [])
|
19
|
+
@source = options[:source]
|
18
20
|
|
19
21
|
@kind = options[:kind]
|
20
22
|
@supertype_attribute = options[:supertype_attribute]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Constant
|
3
|
+
class Constant < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
attr_accessor :type
|
@@ -8,6 +8,8 @@ module Expressir
|
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
@id = options[:id]
|
11
|
+
@remarks = options.fetch(:remarks, [])
|
12
|
+
@source = options[:source]
|
11
13
|
|
12
14
|
@type = options[:type]
|
13
15
|
@expression = options[:expression]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Entity
|
3
|
+
class Entity < ModelElement
|
4
4
|
include Scope
|
5
5
|
include Identifier
|
6
6
|
|
@@ -14,34 +14,24 @@ module Expressir
|
|
14
14
|
|
15
15
|
def initialize(options = {})
|
16
16
|
@id = options[:id]
|
17
|
+
@remarks = options.fetch(:remarks, [])
|
18
|
+
@source = options[:source]
|
17
19
|
|
18
20
|
@abstract = options[:abstract]
|
19
21
|
@supertype_expression = options[:supertype_expression]
|
20
22
|
@subtype_of = options[:subtype_of]
|
21
|
-
@attributes = options
|
22
|
-
@unique = options
|
23
|
-
@where = options
|
24
|
-
@informal_propositions = options
|
25
|
-
end
|
26
|
-
|
27
|
-
def explicit_attributes
|
28
|
-
@attributes.select{|x| x.kind == Expressir::Model::Attribute::EXPLICIT}
|
29
|
-
end
|
30
|
-
|
31
|
-
def derived_attributes
|
32
|
-
@attributes.select{|x| x.kind == Expressir::Model::Attribute::DERIVED}
|
33
|
-
end
|
34
|
-
|
35
|
-
def inverse_attributes
|
36
|
-
@attributes.select{|x| x.kind == Expressir::Model::Attribute::INVERSE}
|
23
|
+
@attributes = options.fetch(:attributes, [])
|
24
|
+
@unique = options.fetch(:unique, [])
|
25
|
+
@where = options.fetch(:where, [])
|
26
|
+
@informal_propositions = options.fetch(:informal_propositions, [])
|
37
27
|
end
|
38
28
|
|
39
29
|
def children
|
40
30
|
items = []
|
41
|
-
items.push(*@attributes)
|
42
|
-
items.push(*@unique)
|
43
|
-
items.push(*@where)
|
44
|
-
items.push(*@informal_propositions)
|
31
|
+
items.push(*@attributes)
|
32
|
+
items.push(*@unique)
|
33
|
+
items.push(*@where)
|
34
|
+
items.push(*@informal_propositions)
|
45
35
|
items
|
46
36
|
end
|
47
37
|
end
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class EnumerationItem
|
3
|
+
class EnumerationItem < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
def initialize(options = {})
|
7
7
|
@id = options[:id]
|
8
|
+
@remarks = options.fetch(:remarks, [])
|
9
|
+
@source = options[:source]
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Expressions
|
4
|
-
class AggregateInitializer
|
4
|
+
class AggregateInitializer < ModelElement
|
5
5
|
attr_accessor :items
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
|
-
@items = options
|
8
|
+
@items = options.fetch(:items, [])
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Expressions
|
4
|
-
class Call
|
4
|
+
class Call < ModelElement
|
5
5
|
attr_accessor :ref
|
6
6
|
attr_accessor :parameters
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@ref = options[:ref]
|
10
|
-
@parameters = options
|
10
|
+
@parameters = options.fetch(:parameters, [])
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Expressions
|
4
|
-
class EntityConstructor
|
4
|
+
class EntityConstructor < ModelElement
|
5
5
|
attr_accessor :entity
|
6
6
|
attr_accessor :parameters
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@entity = options[:entity]
|
10
|
-
@parameters = options
|
10
|
+
@parameters = options.fetch(:parameters, [])
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Expressions
|
4
|
-
class QueryExpression
|
4
|
+
class QueryExpression < ModelElement
|
5
5
|
include Scope
|
6
6
|
include Identifier
|
7
7
|
|
@@ -10,6 +10,8 @@ module Expressir
|
|
10
10
|
|
11
11
|
def initialize(options = {})
|
12
12
|
@id = options[:id]
|
13
|
+
@remarks = options.fetch(:remarks, [])
|
14
|
+
@source = options[:source]
|
13
15
|
|
14
16
|
@aggregate_source = options[:aggregate_source]
|
15
17
|
@expression = options[:expression]
|
@@ -1,60 +1,54 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Function
|
3
|
+
class Function < ModelElement
|
4
4
|
include Scope
|
5
5
|
include Identifier
|
6
6
|
|
7
7
|
attr_accessor :parameters
|
8
8
|
attr_accessor :return_type
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :types
|
10
|
+
attr_accessor :entities
|
11
|
+
attr_accessor :subtype_constraints
|
12
|
+
attr_accessor :functions
|
13
|
+
attr_accessor :procedures
|
10
14
|
attr_accessor :constants
|
11
15
|
attr_accessor :variables
|
12
16
|
attr_accessor :statements
|
13
17
|
|
14
18
|
def initialize(options = {})
|
15
19
|
@id = options[:id]
|
20
|
+
@remarks = options.fetch(:remarks, [])
|
21
|
+
@source = options[:source]
|
16
22
|
|
17
|
-
@parameters = options
|
23
|
+
@parameters = options.fetch(:parameters, [])
|
18
24
|
@return_type = options[:return_type]
|
19
|
-
@
|
20
|
-
@
|
21
|
-
@
|
22
|
-
@
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
@
|
27
|
-
end
|
28
|
-
|
29
|
-
def entities
|
30
|
-
@declarations.select{|x| x.instance_of? Expressir::Model::Entity}
|
31
|
-
end
|
32
|
-
|
33
|
-
def subtype_constraints
|
34
|
-
@declarations.select{|x| x.instance_of? Expressir::Model::SubtypeConstraint}
|
35
|
-
end
|
36
|
-
|
37
|
-
def functions
|
38
|
-
@declarations.select{|x| x.instance_of? Expressir::Model::Function}
|
39
|
-
end
|
40
|
-
|
41
|
-
def procedures
|
42
|
-
@declarations.select{|x| x.instance_of? Expressir::Model::Procedure}
|
25
|
+
@types = options.fetch(:types, [])
|
26
|
+
@entities = options.fetch(:entities, [])
|
27
|
+
@subtype_constraints = options.fetch(:subtype_constraints, [])
|
28
|
+
@functions = options.fetch(:functions, [])
|
29
|
+
@procedures = options.fetch(:procedures, [])
|
30
|
+
@constants = options.fetch(:constants, [])
|
31
|
+
@variables = options.fetch(:variables, [])
|
32
|
+
@statements = options.fetch(:statements, [])
|
43
33
|
end
|
44
34
|
|
45
35
|
def children
|
46
36
|
items = []
|
47
|
-
items.push(*@parameters)
|
48
|
-
items.push(*@
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end)
|
56
|
-
items.push(*@
|
57
|
-
items.push(*@
|
37
|
+
items.push(*@parameters)
|
38
|
+
items.push(*@types)
|
39
|
+
items.push(*@types.flat_map do |x|
|
40
|
+
if x.type.instance_of? Expressir::Model::Types::Enumeration
|
41
|
+
x.type.items
|
42
|
+
else
|
43
|
+
[]
|
44
|
+
end
|
45
|
+
end)
|
46
|
+
items.push(*@entities)
|
47
|
+
items.push(*@subtype_constraints)
|
48
|
+
items.push(*@functions)
|
49
|
+
items.push(*@procedures)
|
50
|
+
items.push(*@constants)
|
51
|
+
items.push(*@variables)
|
58
52
|
items
|
59
53
|
end
|
60
54
|
end
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class InformalProposition
|
3
|
+
class InformalProposition < ModelElement
|
4
4
|
include Identifier
|
5
5
|
|
6
6
|
def initialize(options = {})
|
7
7
|
@id = options[:id]
|
8
|
+
@remarks = options.fetch(:remarks, [])
|
9
|
+
@source = options[:source]
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
|
-
class Interface
|
3
|
+
class Interface < ModelElement
|
4
4
|
USE = :USE
|
5
5
|
REFERENCE = :REFERENCE
|
6
6
|
|
@@ -11,7 +11,7 @@ module Expressir
|
|
11
11
|
def initialize(options = {})
|
12
12
|
@kind = options[:kind]
|
13
13
|
@schema = options[:schema]
|
14
|
-
@items = options
|
14
|
+
@items = options.fetch(:items, [])
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|