expressir 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/demo.rb +16 -0
- data/expressir.gemspec +1 -0
- data/generate-parser.sh +29 -0
- data/lib/expressir/express_exp/generated/ExpressBaseVisitor.rb +779 -0
- data/lib/expressir/express_exp/generated/ExpressLexer.rb +841 -0
- data/lib/expressir/express_exp/generated/ExpressParser.rb +12136 -0
- data/lib/expressir/express_exp/generated/ExpressVisitor.rb +394 -0
- data/lib/expressir/express_exp/parser.rb +25 -0
- data/lib/expressir/express_exp/visitor.rb +2103 -0
- data/lib/expressir/model/constant.rb +15 -0
- data/lib/expressir/model/derived.rb +15 -0
- data/lib/expressir/model/entity.rb +29 -0
- data/lib/expressir/model/explicit.rb +15 -0
- data/lib/expressir/model/expressions/aggregate_element.rb +15 -0
- data/lib/expressir/model/expressions/attribute_qualifier.rb +13 -0
- data/lib/expressir/model/expressions/entity_constructor.rb +15 -0
- data/lib/expressir/model/expressions/expression.rb +15 -0
- data/lib/expressir/model/expressions/function_call.rb +15 -0
- data/lib/expressir/model/expressions/group_qualifier.rb +13 -0
- data/lib/expressir/model/expressions/index_qualifier.rb +15 -0
- data/lib/expressir/model/expressions/interval.rb +21 -0
- data/lib/expressir/model/expressions/qualified_ref.rb +15 -0
- data/lib/expressir/model/expressions/query.rb +17 -0
- data/lib/expressir/model/expressions/unknown.rb +8 -0
- data/lib/expressir/model/function.rb +23 -0
- data/lib/expressir/model/inverse.rb +15 -0
- data/lib/expressir/model/local.rb +15 -0
- data/lib/expressir/model/operators/addition.rb +8 -0
- data/lib/expressir/model/operators/and.rb +8 -0
- data/lib/expressir/model/operators/andor.rb +8 -0
- data/lib/expressir/model/operators/combine.rb +8 -0
- data/lib/expressir/model/operators/equal.rb +8 -0
- data/lib/expressir/model/operators/exponentiation.rb +8 -0
- data/lib/expressir/model/operators/greater_than.rb +8 -0
- data/lib/expressir/model/operators/greater_than_or_equal.rb +8 -0
- data/lib/expressir/model/operators/in.rb +8 -0
- data/lib/expressir/model/operators/instance_equal.rb +8 -0
- data/lib/expressir/model/operators/instance_not_equal.rb +8 -0
- data/lib/expressir/model/operators/integer_division.rb +8 -0
- data/lib/expressir/model/operators/less_than.rb +8 -0
- data/lib/expressir/model/operators/less_than_or_equal.rb +8 -0
- data/lib/expressir/model/operators/like.rb +8 -0
- data/lib/expressir/model/operators/modulo.rb +8 -0
- data/lib/expressir/model/operators/multiplication.rb +8 -0
- data/lib/expressir/model/operators/not.rb +8 -0
- data/lib/expressir/model/operators/not_equal.rb +8 -0
- data/lib/expressir/model/operators/oneof.rb +8 -0
- data/lib/expressir/model/operators/or.rb +8 -0
- data/lib/expressir/model/operators/real_division.rb +8 -0
- data/lib/expressir/model/operators/subtraction.rb +8 -0
- data/lib/expressir/model/operators/unary_minus.rb +8 -0
- data/lib/expressir/model/operators/unary_plus.rb +8 -0
- data/lib/expressir/model/operators/xor.rb +8 -0
- data/lib/expressir/model/parameter.rb +15 -0
- data/lib/expressir/model/procedure.rb +21 -0
- data/lib/expressir/model/ref.rb +11 -0
- data/lib/expressir/model/reference.rb +13 -0
- data/lib/expressir/model/renamed_ref.rb +13 -0
- data/lib/expressir/model/repository.rb +11 -0
- data/lib/expressir/model/rule.rb +23 -0
- data/lib/expressir/model/schema.rb +41 -0
- data/lib/expressir/model/statements/alias.rb +17 -0
- data/lib/expressir/model/statements/assignment.rb +15 -0
- data/lib/expressir/model/statements/case.rb +17 -0
- data/lib/expressir/model/statements/case_action.rb +15 -0
- data/lib/expressir/model/statements/compound.rb +13 -0
- data/lib/expressir/model/statements/escape.rb +8 -0
- data/lib/expressir/model/statements/if.rb +17 -0
- data/lib/expressir/model/statements/null.rb +8 -0
- data/lib/expressir/model/statements/procedure_call.rb +15 -0
- data/lib/expressir/model/statements/repeat.rb +25 -0
- data/lib/expressir/model/statements/return.rb +13 -0
- data/lib/expressir/model/statements/skip.rb +8 -0
- data/lib/expressir/model/subtype_constraint.rb +19 -0
- data/lib/expressir/model/type.rb +15 -0
- data/lib/expressir/model/types/aggregate.rb +15 -0
- data/lib/expressir/model/types/array.rb +21 -0
- data/lib/expressir/model/types/bag.rb +17 -0
- data/lib/expressir/model/types/binary.rb +15 -0
- data/lib/expressir/model/types/boolean.rb +8 -0
- data/lib/expressir/model/types/enumeration.rb +19 -0
- data/lib/expressir/model/types/generic.rb +13 -0
- data/lib/expressir/model/types/generic_entity.rb +13 -0
- data/lib/expressir/model/types/integer.rb +8 -0
- data/lib/expressir/model/types/list.rb +19 -0
- data/lib/expressir/model/types/logical.rb +8 -0
- data/lib/expressir/model/types/number.rb +8 -0
- data/lib/expressir/model/types/real.rb +13 -0
- data/lib/expressir/model/types/select.rb +21 -0
- data/lib/expressir/model/types/set.rb +17 -0
- data/lib/expressir/model/types/string.rb +15 -0
- data/lib/expressir/model/unique.rb +13 -0
- data/lib/expressir/model/use.rb +13 -0
- data/lib/expressir/model/where.rb +13 -0
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/syntax.exp +295 -0
- data/spec/expressir/express_exp/ap233_spec.rb +22 -0
- data/spec/expressir/express_exp/syntax_spec.rb +2640 -0
- metadata +115 -5
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Constant
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :type
|
6
|
+
attr_accessor :expression
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@id = options[:id]
|
10
|
+
@type = options[:type]
|
11
|
+
@expression = options[:expression]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Derived
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :type
|
6
|
+
attr_accessor :expression
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@id = options[:id]
|
10
|
+
@type = options[:type]
|
11
|
+
@expression = options[:expression]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Entity
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :abstract
|
6
|
+
attr_accessor :abstract_supertype
|
7
|
+
attr_accessor :supertypes
|
8
|
+
attr_accessor :subtype_expression
|
9
|
+
attr_accessor :explicit
|
10
|
+
attr_accessor :derived
|
11
|
+
attr_accessor :inverse
|
12
|
+
attr_accessor :unique
|
13
|
+
attr_accessor :where
|
14
|
+
|
15
|
+
def initialize(options = {})
|
16
|
+
@id = options[:id]
|
17
|
+
@abstract = options[:abstract]
|
18
|
+
@abstract_supertype = options[:abstract_supertype]
|
19
|
+
@supertypes = options[:supertypes]
|
20
|
+
@subtype_expression = options[:subtype_expression]
|
21
|
+
@explicit = options[:explicit]
|
22
|
+
@derived = options[:derived]
|
23
|
+
@inverse = options[:inverse]
|
24
|
+
@unique = options[:unique]
|
25
|
+
@where = options[:where]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Explicit
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :optional
|
6
|
+
attr_accessor :type
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@id = options[:id]
|
10
|
+
@optional = options[:optional]
|
11
|
+
@type = options[:type]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class AggregateElement
|
5
|
+
attr_accessor :expression
|
6
|
+
attr_accessor :repetition
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@expression = options[:expression]
|
10
|
+
@repetition = options[:repetition]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class EntityConstructor
|
5
|
+
attr_accessor :entity
|
6
|
+
attr_accessor :parameters
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@entity = options[:entity]
|
10
|
+
@parameters = options[:parameters]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class Expression
|
5
|
+
attr_accessor :operator
|
6
|
+
attr_accessor :operands
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@operator = options[:operator]
|
10
|
+
@operands = options[:operands]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class FunctionCall
|
5
|
+
attr_accessor :function
|
6
|
+
attr_accessor :parameters
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@function = options[:function]
|
10
|
+
@parameters = options[:parameters]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class Interval
|
5
|
+
attr_accessor :low
|
6
|
+
attr_accessor :operator1
|
7
|
+
attr_accessor :item
|
8
|
+
attr_accessor :operator2
|
9
|
+
attr_accessor :high
|
10
|
+
|
11
|
+
def initialize(options = {})
|
12
|
+
@low = options[:low]
|
13
|
+
@operator1 = options[:operator1]
|
14
|
+
@item = options[:item]
|
15
|
+
@operator2 = options[:operator2]
|
16
|
+
@high = options[:high]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class QualifiedRef
|
5
|
+
attr_accessor :ref
|
6
|
+
attr_accessor :qualifiers
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@ref = options[:ref]
|
10
|
+
@qualifiers = options[:qualifiers]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
module Expressions
|
4
|
+
class Query
|
5
|
+
attr_accessor :id
|
6
|
+
attr_accessor :source
|
7
|
+
attr_accessor :expression
|
8
|
+
|
9
|
+
def initialize(options = {})
|
10
|
+
@id = options[:id]
|
11
|
+
@source = options[:source]
|
12
|
+
@expression = options[:expression]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Function
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :parameters
|
6
|
+
attr_accessor :return_type
|
7
|
+
attr_accessor :declarations
|
8
|
+
attr_accessor :constants
|
9
|
+
attr_accessor :locals
|
10
|
+
attr_accessor :statements
|
11
|
+
|
12
|
+
def initialize(options = {})
|
13
|
+
@id = options[:id]
|
14
|
+
@parameters = options[:parameters]
|
15
|
+
@return_type = options[:return_type]
|
16
|
+
@declarations = options[:declarations]
|
17
|
+
@constants = options[:constants]
|
18
|
+
@locals = options[:locals]
|
19
|
+
@statements = options[:statements]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Inverse
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :type
|
6
|
+
attr_accessor :attribute
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@id = options[:id]
|
10
|
+
@type = options[:type]
|
11
|
+
@attribute = options[:attribute]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Expressir
|
2
|
+
module Model
|
3
|
+
class Local
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :type
|
6
|
+
attr_accessor :expression
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@id = options[:id]
|
10
|
+
@type = options[:type]
|
11
|
+
@expression = options[:expression]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|