rdl 1.1.0 → 1.1.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGES.md +25 -0
- data/README.md +104 -64
- data/extras/type_tests/%.rb +171 -0
- data/extras/type_tests/&.rb +159 -0
- data/extras/type_tests/**.rb +222 -0
- data/extras/type_tests/*.rb +177 -0
- data/extras/type_tests/+.rb +170 -0
- data/extras/type_tests/-.rb +171 -0
- data/extras/type_tests/1scomp.rb +157 -0
- data/extras/type_tests/<.rb +170 -0
- data/extras/type_tests/<<.rb +159 -0
- data/extras/type_tests/>>.rb +159 -0
- data/extras/type_tests/[].rb +163 -0
- data/extras/type_tests/^.rb +159 -0
- data/extras/type_tests/abs.rb +155 -0
- data/extras/type_tests/abs2.rb +164 -0
- data/extras/type_tests/angle.rb +157 -0
- data/extras/type_tests/arg.rb +157 -0
- data/extras/type_tests/bit_length.rb +157 -0
- data/extras/type_tests/ceil.rb +157 -0
- data/extras/type_tests/ceilRational.rb +160 -0
- data/extras/type_tests/conj.rb +158 -0
- data/extras/type_tests/defwhere.rb +86 -0
- data/extras/type_tests/denominator.rb +157 -0
- data/extras/type_tests/div.rb +172 -0
- data/extras/type_tests/divslash.rb +179 -0
- data/extras/type_tests/even?.rb +157 -0
- data/extras/type_tests/fdiv.rb +244 -0
- data/extras/type_tests/finite?.rb +157 -0
- data/extras/type_tests/floor.rb +157 -0
- data/extras/type_tests/floorRational.rb +161 -0
- data/extras/type_tests/hash.rb +157 -0
- data/extras/type_tests/imag.rb +158 -0
- data/extras/type_tests/infinite?.rb +157 -0
- data/extras/type_tests/modulo.rb +171 -0
- data/extras/type_tests/nan?.rb +157 -0
- data/extras/type_tests/neg.rb +155 -0
- data/extras/type_tests/next.rb +157 -0
- data/extras/type_tests/next_float.rb +157 -0
- data/extras/type_tests/numerator.rb +157 -0
- data/extras/type_tests/phase.rb +157 -0
- data/extras/type_tests/prev_float.rb +157 -0
- data/extras/type_tests/quo.rb +179 -0
- data/extras/type_tests/rationalize.rb +157 -0
- data/extras/type_tests/rationalizeArg.rb +198 -0
- data/extras/type_tests/real.rb +157 -0
- data/extras/type_tests/real?.rb +157 -0
- data/extras/type_tests/round.rb +157 -0
- data/extras/type_tests/roundArg.rb +169 -0
- data/extras/type_tests/size.rb +157 -0
- data/extras/type_tests/to_c.rb +157 -0
- data/extras/type_tests/to_f.rb +155 -0
- data/extras/type_tests/to_i.rb +157 -0
- data/extras/type_tests/to_r.rb +157 -0
- data/extras/type_tests/to_s.rb +157 -0
- data/extras/type_tests/truncate.rb +157 -0
- data/extras/type_tests/truncateArg.rb +166 -0
- data/extras/type_tests/type tests +1 -0
- data/extras/type_tests/zero?.rb +155 -0
- data/extras/type_tests/|.rb +159 -0
- data/lib/rdl/contracts/and.rb +1 -1
- data/lib/rdl/contracts/flat.rb +2 -2
- data/lib/rdl/contracts/proc.rb +2 -1
- data/lib/rdl/types/.#lexer.rex +1 -0
- data/lib/rdl/types/dependent_arg.rb +47 -0
- data/lib/rdl/types/finitehash.rb +5 -5
- data/lib/rdl/types/generic.rb +3 -3
- data/lib/rdl/types/lexer.rex +5 -2
- data/lib/rdl/types/lexer.rex.rb +3 -0
- data/lib/rdl/types/method.rb +144 -15
- data/lib/rdl/types/nominal.rb +1 -1
- data/lib/rdl/types/parser.racc +6 -1
- data/lib/rdl/types/parser.tab.rb +272 -245
- data/lib/rdl/types/tuple.rb +1 -1
- data/lib/rdl/types/type_inferencer.rb +7 -7
- data/lib/rdl/wrap.rb +16 -11
- data/rdl.gemspec +3 -3
- data/test/test_dsl.rb +4 -5
- data/test/test_le.rb +5 -5
- data/test/test_lib_types.rb +34 -34
- data/test/test_member.rb +3 -3
- data/test/test_type_contract.rb +63 -1
- data/test/test_types.rb +2 -0
- data/types/ruby-2.x/_aliases.rb +2 -2
- data/types/ruby-2.x/bigdecimal.rb +246 -12
- data/types/ruby-2.x/bignum.rb +253 -0
- data/types/ruby-2.x/complex.rb +111 -22
- data/types/ruby-2.x/fixnum.rb +238 -31
- data/types/ruby-2.x/float.rb +217 -35
- data/types/ruby-2.x/integer.rb +17 -16
- data/types/ruby-2.x/numeric.rb +31 -21
- data/types/ruby-2.x/rational.rb +196 -18
- metadata +67 -4
data/lib/rdl/types/lexer.rex
CHANGED
@@ -7,6 +7,8 @@ macro
|
|
7
7
|
SPECIAL_ID %\w+
|
8
8
|
FIXNUM -?(\d)+
|
9
9
|
FLOAT -?\d\.\d+
|
10
|
+
PREDICATE \{\{(?:(?!}}).)+\}\}
|
11
|
+
|
10
12
|
|
11
13
|
rule
|
12
14
|
\s # skip
|
@@ -15,6 +17,7 @@ rule
|
|
15
17
|
=> { [:RASSOC, text] }
|
16
18
|
\( { [:LPAREN, text] }
|
17
19
|
\) { [:RPAREN, text] }
|
20
|
+
{PREDICATE} { [:PREDICATE, text] }
|
18
21
|
\{ { [:LBRACE, text] }
|
19
22
|
\} { [:RBRACE, text] }
|
20
23
|
\[ { [:LBRACKET, text] }
|
@@ -24,8 +27,8 @@ rule
|
|
24
27
|
, { [:COMMA, text] }
|
25
28
|
\? { [:QUERY, text] }
|
26
29
|
\* { [:STAR, text] }
|
27
|
-
\#T
|
28
|
-
\#Q
|
30
|
+
\#T { [:HASH_TYPE, text] }
|
31
|
+
\#Q { [:HASH_QUERY, text] }
|
29
32
|
\$\{ { [:CONST_BEGIN, text] }
|
30
33
|
\.\.\. { [:DOTS, text] }
|
31
34
|
\. { [:DOT, text] }
|
data/lib/rdl/types/lexer.rex.rb
CHANGED
data/lib/rdl/types/method.rb
CHANGED
@@ -57,14 +57,23 @@ module RDL::Type
|
|
57
57
|
end
|
58
58
|
|
59
59
|
# TODO: Check blk
|
60
|
-
def pre_cond?(inst, *args
|
60
|
+
def pre_cond?(blk, slf, inst, bind, *args)
|
61
61
|
states = [[0, 0]] # [position in @arg, position in args]
|
62
|
+
preds = []
|
62
63
|
until states.empty?
|
63
64
|
formal, actual = states.pop
|
64
|
-
|
65
|
+
if formal == @args.size && actual == args.size then # Matched all actuals, no formals left over
|
66
|
+
check_arg_preds(bind, preds) if preds.size>0
|
67
|
+
@args.each_with_index {|a,i| args[i] = block_wrap(slf,inst,a,bind,&args[i]) if a.is_a?(RDL::Type::MethodType) }
|
68
|
+
blk = block_wrap(slf,inst,@block,bind,&blk) if @block
|
69
|
+
return [true, args, blk, bind]
|
70
|
+
end
|
65
71
|
next if formal >= @args.size # Too many actuals to match
|
66
72
|
t = @args[formal]
|
67
|
-
|
73
|
+
if t.instance_of? AnnotatedArgType then
|
74
|
+
bind.local_variable_set(t.name.to_sym,args[actual])
|
75
|
+
t = t.type
|
76
|
+
end
|
68
77
|
case t
|
69
78
|
when OptionalType
|
70
79
|
t = t.type.instantiate(inst)
|
@@ -87,7 +96,22 @@ module RDL::Type
|
|
87
96
|
else
|
88
97
|
states << [formal+1, actual] # skip
|
89
98
|
end
|
99
|
+
when DependentArgType
|
100
|
+
bind.local_variable_set(t.name.to_sym,args[actual])
|
101
|
+
preds.push(t)
|
102
|
+
t = t.type.instantiate(inst)
|
103
|
+
the_actual = nil
|
104
|
+
if actual == args.size
|
105
|
+
next unless t.instance_of? FiniteHashType
|
106
|
+
if t.member?({}, vars_wild: true) # try matching against the empty hash
|
107
|
+
states << [formal+1, actual]
|
108
|
+
end
|
109
|
+
elsif t.member?(args[actual], vars_wild: true)
|
110
|
+
states << [formal+1, actual+1] # match
|
111
|
+
# no else case; if there is no match, this is a dead end
|
112
|
+
end
|
90
113
|
else
|
114
|
+
t = RDL::Type::NominalType.new 'Proc' if t.instance_of? MethodType
|
91
115
|
t = t.instantiate(inst)
|
92
116
|
the_actual = nil
|
93
117
|
if actual == args.size
|
@@ -101,43 +125,104 @@ module RDL::Type
|
|
101
125
|
end
|
102
126
|
end
|
103
127
|
end
|
104
|
-
return false
|
128
|
+
return [false, args, blk, bind]
|
105
129
|
end
|
106
130
|
|
107
|
-
def
|
131
|
+
def check_arg_preds(bind, preds)
|
132
|
+
preds.each_with_index { |p,i|
|
133
|
+
if !eval(p.predicate, bind) then
|
134
|
+
raise TypeError, <<RUBY
|
135
|
+
Argument does not match type predicate.
|
136
|
+
Expected arg type:
|
137
|
+
#{p}
|
138
|
+
Actual argument value:
|
139
|
+
#{bind.local_variable_get(p.name)}
|
140
|
+
RUBY
|
141
|
+
end
|
142
|
+
}
|
143
|
+
return true
|
144
|
+
end
|
145
|
+
|
146
|
+
def check_ret_pred(bind, pred)
|
147
|
+
if !eval(pred.predicate, bind) then
|
148
|
+
raise TypeError, <<RUBY
|
149
|
+
Return value does not match type predicate.
|
150
|
+
Expected return type:
|
151
|
+
#{pred}
|
152
|
+
Actual return value:
|
153
|
+
#{bind.local_variable_get(pred.name)}
|
154
|
+
RUBY
|
155
|
+
end
|
156
|
+
return true
|
157
|
+
end
|
158
|
+
|
159
|
+
def post_cond?(slf, inst, ret, bind, *args)
|
160
|
+
new_ret = ret
|
161
|
+
if @ret.is_a?(RDL::Type::MethodType) then
|
162
|
+
if !ret.is_a?(Proc) then
|
163
|
+
return [false,ret]
|
164
|
+
else
|
165
|
+
new_ret = block_wrap(slf,inst,@ret,bind,&ret)
|
166
|
+
return [true, new_ret]
|
167
|
+
end
|
168
|
+
end
|
108
169
|
method_name = method_name ? method_name + ": " : ""
|
109
|
-
|
170
|
+
if @ret.is_a?(DependentArgType) then
|
171
|
+
bind.local_variable_set(@ret.name.to_sym, ret)
|
172
|
+
check_ret_pred(bind,@ret)
|
173
|
+
end
|
174
|
+
return [@ret.instantiate(inst).member?(ret, vars_wild: true), new_ret]
|
110
175
|
end
|
111
176
|
|
112
177
|
def to_contract(inst: nil)
|
113
178
|
c = @@contract_cache[self]
|
114
179
|
return c if c
|
115
|
-
|
116
180
|
# slf.ret, slf.args are the formals
|
117
181
|
# ret, args are the actuals
|
118
182
|
slf = self # Bind self so it's captured in a closure, since contracts are executed
|
119
183
|
# with self bound to the receiver method's self
|
184
|
+
bind = binding
|
120
185
|
prec = RDL::Contract::FlatContract.new { |*args, &blk|
|
121
|
-
raise TypeError, "Arguments #{args} do not match argument types #{slf}" unless slf.pre_cond?(inst, *args
|
186
|
+
raise TypeError, "Arguments #{args} do not match argument types #{slf}" unless slf.pre_cond?(blk, slf, inst, bind, *args)[0]
|
122
187
|
true
|
123
188
|
}
|
124
189
|
postc = RDL::Contract::FlatContract.new { |ret, *args|
|
125
|
-
raise TypeError, "Return #{ret} does not match return type #{slf}" unless slf.post_cond?(inst, ret, *args)
|
190
|
+
raise TypeError, "Return #{ret} does not match return type #{slf}" unless slf.post_cond?(slf, inst, ret, bind, *args)[0]
|
126
191
|
true
|
127
192
|
}
|
128
193
|
c = RDL::Contract::ProcContract.new(pre_cond: prec, post_cond: postc)
|
129
194
|
return (@@contract_cache[self] = c) # assignment evaluates to c
|
130
195
|
end
|
131
196
|
|
197
|
+
def to_higher_contract(sf, &blk)
|
198
|
+
#method for testing higher order contracts
|
199
|
+
#to_contract method only works for flat contracts
|
200
|
+
slf = self
|
201
|
+
inst = nil
|
202
|
+
bind = binding
|
203
|
+
Proc.new {|*args, &other_blk|
|
204
|
+
res,args,other_blk,bind = slf.pre_cond?(other_blk, slf, inst, bind, *args)
|
205
|
+
raise TypeError, "Arguments #{args} do not match argument types #{slf}" unless res
|
206
|
+
tmp = other_blk ? sf.instance_exec(*args, other_blk, &blk) : sf.instance_exec(*args, &blk)
|
207
|
+
res_post, ret = slf.post_cond?(slf, inst, tmp, bind, *args)
|
208
|
+
raise TypeError, "Return #{ret} does not match return type #{slf}" unless res_post
|
209
|
+
ret
|
210
|
+
}
|
211
|
+
end
|
212
|
+
|
213
|
+
|
132
214
|
# [+types+] is an array of method types. Checks that [+args+] and
|
133
215
|
# [+blk+] match at least one arm of the intersection type;
|
134
216
|
# otherwise raises exception. Returns array of method types that
|
135
217
|
# matched [+args+] and [+blk+]
|
136
|
-
def self.check_arg_types(method_name, types, inst, *args, &blk)
|
218
|
+
def self.check_arg_types(method_name, slf, bind, types, inst, *args, &blk)
|
137
219
|
$__rdl_contract_switch.off {
|
138
220
|
matches = [] # types that matched args
|
139
|
-
types.each_with_index { |t, i|
|
140
|
-
|
221
|
+
types.each_with_index { |t, i|
|
222
|
+
res,args,blk,bind =t.pre_cond?(blk,slf,inst,bind,*args)
|
223
|
+
matches << i if res
|
224
|
+
}
|
225
|
+
return [matches, args, blk, bind] if matches.size > 0
|
141
226
|
method_name = method_name ? method_name + ": " : ""
|
142
227
|
raise TypeError, <<RUBY
|
143
228
|
#{method_name}Argument type error.
|
@@ -151,9 +236,11 @@ RUBY
|
|
151
236
|
}
|
152
237
|
end
|
153
238
|
|
154
|
-
def self.check_ret_types(method_name, types, inst, matches, ret, *args, &blk)
|
239
|
+
def self.check_ret_types(slf, method_name, types, inst, matches, ret, bind, *args, &blk)
|
155
240
|
$__rdl_contract_switch.off {
|
156
|
-
matches.each { |i|
|
241
|
+
matches.each { |i| res,new_ret = types[i].post_cond?(slf, inst, ret, bind, *args)
|
242
|
+
return new_ret if res
|
243
|
+
}
|
157
244
|
method_name = method_name ? method_name + ": " : ""
|
158
245
|
raise TypeError, <<RUBY
|
159
246
|
#{method_name}Return type error. *'s indicate argument lists that matched.
|
@@ -252,5 +339,47 @@ RUBY
|
|
252
339
|
h = h * 31 + @block.hash if @block
|
253
340
|
return h
|
254
341
|
end
|
255
|
-
|
342
|
+
|
343
|
+
def self.check_block_arg_types(slf, types, inst, bind, *args)
|
344
|
+
$__rdl_contract_switch.off {
|
345
|
+
res,args,blk,bind = types.pre_cond?(nil, slf, inst, bind, *args)
|
346
|
+
return [true, args,blk,bind] if res
|
347
|
+
raise TypeError, <<RUBY
|
348
|
+
Proc argument type error.
|
349
|
+
Proc type:
|
350
|
+
#{ [types].map { |t| " " + t.to_s }.join("\n") }
|
351
|
+
Actual argument type#{args.size > 1 ? "s" : ""}:
|
352
|
+
(#{args.map { |arg| RDL::Util.rdl_type_or_class(arg) }.join(', ')})
|
353
|
+
Actual argument values (one per line):
|
354
|
+
#{ args.map { |arg| " " + arg.inspect }.join("\n") }
|
355
|
+
RUBY
|
356
|
+
}
|
357
|
+
end
|
358
|
+
|
359
|
+
def self.check_block_ret_types(slf, types, inst, ret, bind, *args)
|
360
|
+
$__rdl_contract_switch.off {
|
361
|
+
res,new_ret = types.post_cond?(slf, inst, ret, bind, *args)
|
362
|
+
return new_ret if res
|
363
|
+
raise TypeError, <<RUBY
|
364
|
+
Proc return type error.
|
365
|
+
Proc type:
|
366
|
+
#{[types].each_with_index.map { |t,i| " " + t.to_s }.join("\n") }
|
367
|
+
Actual Proc return type:
|
368
|
+
#{ RDL::Util.rdl_type_or_class(ret)}
|
369
|
+
Actual Proc return value:
|
370
|
+
#{ ret.inspect }
|
371
|
+
RUBY
|
372
|
+
}
|
373
|
+
end
|
374
|
+
|
375
|
+
def block_wrap(slf, inst, types, bind, &blk)
|
376
|
+
Proc.new {|*v, &other_blk|
|
377
|
+
_, v, other_blk, bind = RDL::Type::MethodType.check_block_arg_types(slf, types, inst, bind, *v)
|
378
|
+
tmp = other_blk ? slf.instance_exec(*v, other_blk, &blk) : slf.instance_exec(*v, &blk)
|
379
|
+
tmp = RDL::Type::MethodType.check_block_ret_types(slf, types, inst, tmp, bind, *v)
|
380
|
+
tmp
|
381
|
+
}
|
382
|
+
end
|
383
|
+
|
384
|
+
end
|
256
385
|
end
|
data/lib/rdl/types/nominal.rb
CHANGED
data/lib/rdl/types/parser.racc
CHANGED
@@ -8,7 +8,7 @@ class Parser
|
|
8
8
|
start entry
|
9
9
|
|
10
10
|
token HASH_TYPE HASH_QUERY CONST_BEGIN RASSOC
|
11
|
-
token OR FIXNUM FLOAT COLON RARROW DOT DOTS ID SYMBOL SPECIAL_ID STRING
|
11
|
+
token OR FIXNUM FLOAT COLON RARROW DOT DOTS ID SYMBOL SPECIAL_ID STRING PREDICATE
|
12
12
|
token LPAREN RPAREN LBRACE RBRACE LBRACKET RBRACKET
|
13
13
|
token COMMA QUERY STAR LESS GREATER
|
14
14
|
token EOF
|
@@ -33,6 +33,9 @@ rule
|
|
33
33
|
| LPAREN arg_list RPAREN block RARROW type_expr ID {
|
34
34
|
result = RDL::Type::MethodType.new val[1], val[3], RDL::Type::AnnotatedArgType.new(val[6], val[5])
|
35
35
|
}
|
36
|
+
| LPAREN arg_list RPAREN block RARROW type_expr ID PREDICATE {
|
37
|
+
result = RDL::Type::MethodType.new val[1], val[3], RDL::Type::DependentArgType.new(val[6], val[5], val[7])
|
38
|
+
}
|
36
39
|
|
37
40
|
method_sig_list:
|
38
41
|
ID COLON method_type { result = [val[0].to_sym, val[2]] }
|
@@ -52,6 +55,7 @@ rule
|
|
52
55
|
}
|
53
56
|
arg:
|
54
57
|
base_arg { result = val[0] }
|
58
|
+
| base_arg ID PREDICATE {result = RDL::Type::DependentArgType.new(val[1], val[0], val[2])}
|
55
59
|
| base_arg ID { result = RDL::Type::AnnotatedArgType.new(val[1], val[0]) }
|
56
60
|
| DOTS { result = RDL::Type::DotsQuery.new }
|
57
61
|
named_arg_list:
|
@@ -119,6 +123,7 @@ rule
|
|
119
123
|
n = RDL::Type::NominalType.new(val[0])
|
120
124
|
result = RDL::Type::GenericType.new(n, *val[2])
|
121
125
|
}
|
126
|
+
| LBRACE method_type RBRACE { result = val[1] }
|
122
127
|
| LBRACKET type_expr_comma_list RBRACKET {
|
123
128
|
result = RDL::Type::TupleType.new(*val[1])
|
124
129
|
}
|
data/lib/rdl/types/parser.tab.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.9
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -13,7 +13,7 @@ module RDL::Type
|
|
13
13
|
|
14
14
|
class Parser < Racc::Parser
|
15
15
|
|
16
|
-
module_eval(<<'...end parser.racc/module_eval...', 'parser.racc',
|
16
|
+
module_eval(<<'...end parser.racc/module_eval...', 'parser.racc', 152)
|
17
17
|
|
18
18
|
def initialize()
|
19
19
|
@yydebug = true
|
@@ -23,176 +23,179 @@ end
|
|
23
23
|
##### State transition tables begin ###
|
24
24
|
|
25
25
|
racc_action_table = [
|
26
|
-
20,
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
18, 19,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
13, 15,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
18, 19, nil, 21, nil,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
nil,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
nil,
|
51
|
-
|
52
|
-
47, nil, nil, 42, nil, nil, 47 ]
|
26
|
+
20, 69, 18, 19, 56, 21, 28, 30, 13, 15,
|
27
|
+
5, 6, 11, 62, 16, 56, 17, 37, 31, 32,
|
28
|
+
20, 63, 18, 19, 7, 21, 28, 30, 13, 15,
|
29
|
+
64, 37, 11, 65, 16, 66, 17, 67, 31, 32,
|
30
|
+
20, 68, 18, 19, 59, 21, 70, 14, 13, 15,
|
31
|
+
71, 72, 11, 73, 16, 75, 17, 20, 81, 18,
|
32
|
+
19, 55, 21, 78, 14, 13, 15, 20, 38, 18,
|
33
|
+
19, 16, 21, 17, 14, 13, 15, 54, 83, 11,
|
34
|
+
53, 16, 20, 17, 18, 19, 52, 21, 86, 14,
|
35
|
+
13, 15, 51, 37, 11, 7, 16, 20, 17, 18,
|
36
|
+
19, 36, 21, 91, 14, 13, 15, 7, 34, 11,
|
37
|
+
94, 16, 20, 17, 18, 19, 95, 21, 7, 14,
|
38
|
+
13, 15, 97, 8, 11, 99, 16, 20, 17, 18,
|
39
|
+
19, 101, 21, 69, 14, 13, 15, 102, nil, 11,
|
40
|
+
nil, 16, 20, 17, 18, 19, nil, 21, nil, 14,
|
41
|
+
13, 15, nil, nil, 11, nil, 16, 20, 17, 18,
|
42
|
+
19, nil, 21, nil, 14, 13, 15, 20, nil, 18,
|
43
|
+
19, 16, 21, 17, 14, 13, 15, 20, nil, 18,
|
44
|
+
19, 16, 21, 17, 14, 13, 15, 20, nil, 18,
|
45
|
+
19, 16, 21, 17, 14, 13, 15, nil, nil, 11,
|
46
|
+
nil, 16, 20, 17, 18, 19, nil, 21, nil, 14,
|
47
|
+
13, 15, 20, nil, 18, 19, 16, 21, 17, 14,
|
48
|
+
13, 15, nil, nil, 11, nil, 16, 20, 17, 18,
|
49
|
+
19, nil, 21, nil, 47, 13, 15, nil, nil, 11,
|
50
|
+
nil, 16, 42, 17, 40, 41, nil, nil, 42, 38,
|
51
|
+
40, 41, 43, nil, 7, 38, nil, nil, 43 ]
|
53
52
|
|
54
53
|
racc_action_check = [
|
55
|
-
7,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
nil,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
nil,
|
80
|
-
|
81
|
-
69, nil, nil, 17, nil, nil, 17 ]
|
54
|
+
7, 47, 7, 7, 38, 7, 7, 7, 7, 7,
|
55
|
+
0, 0, 7, 40, 7, 30, 7, 47, 7, 7,
|
56
|
+
53, 41, 53, 53, 0, 53, 53, 53, 53, 53,
|
57
|
+
42, 30, 53, 43, 53, 44, 53, 45, 53, 53,
|
58
|
+
56, 46, 56, 56, 35, 56, 48, 56, 56, 56,
|
59
|
+
49, 50, 56, 51, 56, 52, 56, 36, 56, 36,
|
60
|
+
36, 29, 36, 54, 36, 36, 36, 81, 55, 81,
|
61
|
+
81, 36, 81, 36, 81, 81, 81, 27, 61, 81,
|
62
|
+
26, 81, 11, 81, 11, 11, 23, 11, 64, 11,
|
63
|
+
11, 11, 20, 14, 11, 69, 11, 70, 11, 70,
|
64
|
+
70, 12, 70, 74, 70, 70, 70, 75, 8, 70,
|
65
|
+
86, 70, 37, 70, 37, 37, 89, 37, 6, 37,
|
66
|
+
37, 37, 92, 1, 37, 95, 37, 91, 37, 91,
|
67
|
+
91, 96, 91, 99, 91, 91, 91, 101, nil, 91,
|
68
|
+
nil, 91, 32, 91, 32, 32, nil, 32, nil, 32,
|
69
|
+
32, 32, nil, nil, 32, nil, 32, 65, 32, 65,
|
70
|
+
65, nil, 65, nil, 65, 65, 65, 63, nil, 63,
|
71
|
+
63, 65, 63, 65, 63, 63, 63, 62, nil, 62,
|
72
|
+
62, 63, 62, 63, 62, 62, 62, 5, nil, 5,
|
73
|
+
5, 62, 5, 62, 5, 5, 5, nil, nil, 5,
|
74
|
+
nil, 5, 94, 5, 94, 94, nil, 94, nil, 94,
|
75
|
+
94, 94, 31, nil, 31, 31, 94, 31, 94, 31,
|
76
|
+
31, 31, nil, nil, 31, nil, 31, 17, 31, 17,
|
77
|
+
17, nil, 17, nil, 17, 17, 17, nil, nil, 17,
|
78
|
+
nil, 17, 16, 17, 16, 16, nil, nil, 66, 16,
|
79
|
+
66, 66, 16, nil, 16, 66, nil, nil, 66 ]
|
82
80
|
|
83
81
|
racc_action_pointer = [
|
84
|
-
|
85
|
-
nil,
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
nil, nil,
|
92
|
-
nil,
|
93
|
-
nil,
|
82
|
+
5, 123, nil, nil, nil, 180, 99, -7, 108, nil,
|
83
|
+
nil, 75, 97, nil, 66, nil, 235, 220, nil, nil,
|
84
|
+
78, nil, nil, 66, nil, nil, 78, 63, nil, 59,
|
85
|
+
4, 205, 135, nil, nil, 24, 50, 105, -7, nil,
|
86
|
+
5, 13, 16, 25, 33, 15, 19, -10, 44, 26,
|
87
|
+
27, 31, 34, 13, 45, 54, 33, nil, nil, nil,
|
88
|
+
nil, 50, 170, 160, 66, 150, 241, nil, nil, 76,
|
89
|
+
90, nil, nil, nil, 100, 88, nil, nil, nil, nil,
|
90
|
+
nil, 60, nil, nil, nil, nil, 102, nil, nil, 114,
|
91
|
+
nil, 120, 100, nil, 195, 111, 117, nil, nil, 122,
|
92
|
+
nil, 119, nil ]
|
94
93
|
|
95
94
|
racc_action_default = [
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
95
|
+
-57, -57, -1, -2, -3, -57, -57, -11, -57, -4,
|
96
|
+
-31, -57, -43, -45, -46, -47, -35, -57, -53, -54,
|
97
|
+
-57, -56, -5, -57, -12, -13, -14, -17, -20, -21,
|
98
|
+
-46, -57, -57, -26, 103, -57, -57, -57, -57, -36,
|
99
|
+
-57, -57, -57, -57, -41, -57, -57, -46, -33, -57,
|
100
|
+
-57, -57, -29, -57, -19, -57, -57, -24, -25, -32,
|
101
|
+
-44, -57, -57, -57, -57, -57, -35, -49, -52, -57,
|
102
|
+
-57, -50, -51, -55, -57, -57, -15, -16, -18, -22,
|
103
|
+
-23, -57, -28, -48, -37, -38, -57, -40, -42, -9,
|
104
|
+
-34, -57, -57, -27, -57, -57, -6, -30, -39, -57,
|
105
|
+
-10, -7, -8 ]
|
106
106
|
|
107
107
|
racc_goto_table = [
|
108
|
-
9,
|
109
|
-
|
110
|
-
nil, nil, nil, nil, nil,
|
111
|
-
|
112
|
-
nil, nil, nil, nil, nil, nil, nil, 33, nil,
|
113
|
-
|
114
|
-
|
115
|
-
nil, nil, nil,
|
116
|
-
nil, nil, nil,
|
108
|
+
9, 50, 33, 2, 60, 49, 35, 39, 25, 22,
|
109
|
+
46, 80, 23, 24, 74, 4, 3, 1, nil, 45,
|
110
|
+
nil, nil, nil, nil, nil, 61, 57, 58, nil, nil,
|
111
|
+
84, 85, nil, 87, nil, nil, nil, nil, nil, nil,
|
112
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 33, nil,
|
113
|
+
nil, 82, nil, nil, 77, nil, 79, 39, 90, 76,
|
114
|
+
88, nil, 98, nil, nil, nil, nil, nil, nil, nil,
|
115
|
+
nil, nil, 89, nil, nil, nil, 93, nil, 92, 100,
|
116
|
+
nil, nil, nil, nil, nil, nil, 96 ]
|
117
117
|
|
118
118
|
racc_goto_check = [
|
119
|
-
5, 8, 5,
|
120
|
-
|
121
|
-
nil, nil, nil, nil, nil,
|
122
|
-
|
123
|
-
nil, nil, nil, nil, nil, nil, nil, 5, nil,
|
124
|
-
5, nil, 10, nil, 10, 16, 9,
|
125
|
-
|
126
|
-
nil, nil, nil,
|
127
|
-
nil, nil, nil, 5 ]
|
119
|
+
5, 8, 5, 2, 15, 16, 5, 13, 10, 2,
|
120
|
+
18, 14, 6, 9, 7, 4, 3, 1, nil, 2,
|
121
|
+
nil, nil, nil, nil, nil, 16, 5, 5, nil, nil,
|
122
|
+
15, 15, nil, 15, nil, nil, nil, nil, nil, nil,
|
123
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 5, nil,
|
124
|
+
nil, 5, nil, nil, 10, nil, 10, 13, 16, 9,
|
125
|
+
18, nil, 15, nil, nil, nil, nil, nil, nil, nil,
|
126
|
+
nil, nil, 2, nil, nil, nil, 5, nil, 2, 8,
|
127
|
+
nil, nil, nil, nil, nil, nil, 5 ]
|
128
128
|
|
129
129
|
racc_goto_pointer = [
|
130
|
-
nil, 17,
|
131
|
-
|
130
|
+
nil, 17, 3, 16, 15, -5, 5, -38, -16, 6,
|
131
|
+
1, nil, nil, -9, -45, -32, -12, nil, -6, nil ]
|
132
132
|
|
133
133
|
racc_goto_default = [
|
134
|
-
nil, nil, nil, nil, nil,
|
135
|
-
nil, 26, 27, 29, nil, 10, nil,
|
134
|
+
nil, nil, nil, nil, nil, 48, nil, nil, nil, nil,
|
135
|
+
nil, 26, 27, 29, nil, 10, nil, 44, nil, 12 ]
|
136
136
|
|
137
137
|
racc_reduce_table = [
|
138
138
|
0, 0, :racc_error,
|
139
|
-
1,
|
140
|
-
1,
|
141
|
-
1,
|
142
|
-
2,
|
143
|
-
2,
|
144
|
-
6,
|
145
|
-
7,
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
1,
|
151
|
-
1,
|
152
|
-
|
153
|
-
3,
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
2,
|
164
|
-
1,
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
3,
|
169
|
-
1,
|
170
|
-
3,
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
3,
|
177
|
-
|
139
|
+
1, 31, :_reduce_1,
|
140
|
+
1, 31, :_reduce_2,
|
141
|
+
1, 31, :_reduce_3,
|
142
|
+
2, 33, :_reduce_4,
|
143
|
+
2, 34, :_reduce_5,
|
144
|
+
6, 32, :_reduce_6,
|
145
|
+
7, 32, :_reduce_7,
|
146
|
+
8, 32, :_reduce_8,
|
147
|
+
3, 38, :_reduce_9,
|
148
|
+
5, 38, :_reduce_10,
|
149
|
+
0, 36, :_reduce_11,
|
150
|
+
1, 36, :_reduce_12,
|
151
|
+
1, 36, :_reduce_13,
|
152
|
+
1, 39, :_reduce_14,
|
153
|
+
3, 39, :_reduce_15,
|
154
|
+
3, 39, :_reduce_16,
|
155
|
+
1, 41, :_reduce_17,
|
156
|
+
3, 41, :_reduce_18,
|
157
|
+
2, 41, :_reduce_19,
|
158
|
+
1, 41, :_reduce_20,
|
159
|
+
1, 40, :_reduce_21,
|
160
|
+
3, 40, :_reduce_22,
|
161
|
+
3, 43, :_reduce_23,
|
162
|
+
2, 42, :_reduce_24,
|
163
|
+
2, 42, :_reduce_25,
|
164
|
+
1, 42, :_reduce_26,
|
165
|
+
2, 44, :_reduce_27,
|
166
|
+
1, 44, :_reduce_28,
|
167
|
+
0, 37, :_reduce_29,
|
168
|
+
3, 37, :_reduce_30,
|
169
|
+
1, 35, :_reduce_31,
|
170
|
+
3, 35, :_reduce_32,
|
171
|
+
1, 46, :_reduce_33,
|
172
|
+
3, 46, :_reduce_34,
|
173
|
+
0, 47, :_reduce_none,
|
174
|
+
1, 47, :_reduce_36,
|
175
|
+
3, 47, :_reduce_37,
|
176
|
+
3, 47, :_reduce_38,
|
177
|
+
5, 47, :_reduce_39,
|
178
178
|
3, 47, :_reduce_40,
|
179
|
-
1,
|
180
|
-
3,
|
181
|
-
1,
|
182
|
-
|
183
|
-
1,
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
3,
|
188
|
-
|
189
|
-
|
190
|
-
3,
|
191
|
-
1,
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
179
|
+
1, 48, :_reduce_41,
|
180
|
+
3, 48, :_reduce_42,
|
181
|
+
1, 45, :_reduce_43,
|
182
|
+
3, 45, :_reduce_44,
|
183
|
+
1, 49, :_reduce_45,
|
184
|
+
1, 49, :_reduce_46,
|
185
|
+
1, 49, :_reduce_47,
|
186
|
+
4, 49, :_reduce_48,
|
187
|
+
3, 49, :_reduce_49,
|
188
|
+
3, 49, :_reduce_50,
|
189
|
+
3, 49, :_reduce_51,
|
190
|
+
3, 49, :_reduce_52,
|
191
|
+
1, 49, :_reduce_53,
|
192
|
+
1, 49, :_reduce_54,
|
193
|
+
3, 49, :_reduce_55,
|
194
|
+
1, 49, :_reduce_56 ]
|
195
|
+
|
196
|
+
racc_reduce_n = 57
|
197
|
+
|
198
|
+
racc_shift_n = 103
|
196
199
|
|
197
200
|
racc_token_table = {
|
198
201
|
false => 0,
|
@@ -213,19 +216,20 @@ racc_token_table = {
|
|
213
216
|
:SYMBOL => 15,
|
214
217
|
:SPECIAL_ID => 16,
|
215
218
|
:STRING => 17,
|
216
|
-
:
|
217
|
-
:
|
218
|
-
:
|
219
|
-
:
|
220
|
-
:
|
221
|
-
:
|
222
|
-
:
|
223
|
-
:
|
224
|
-
:
|
225
|
-
:
|
226
|
-
:
|
227
|
-
|
228
|
-
|
219
|
+
:PREDICATE => 18,
|
220
|
+
:LPAREN => 19,
|
221
|
+
:RPAREN => 20,
|
222
|
+
:LBRACE => 21,
|
223
|
+
:RBRACE => 22,
|
224
|
+
:LBRACKET => 23,
|
225
|
+
:RBRACKET => 24,
|
226
|
+
:QUERY => 25,
|
227
|
+
:STAR => 26,
|
228
|
+
:LESS => 27,
|
229
|
+
:GREATER => 28,
|
230
|
+
:EOF => 29 }
|
231
|
+
|
232
|
+
racc_nt_base = 30
|
229
233
|
|
230
234
|
racc_use_result_var = true
|
231
235
|
|
@@ -264,6 +268,7 @@ Racc_token_to_s_table = [
|
|
264
268
|
"SYMBOL",
|
265
269
|
"SPECIAL_ID",
|
266
270
|
"STRING",
|
271
|
+
"PREDICATE",
|
267
272
|
"LPAREN",
|
268
273
|
"RPAREN",
|
269
274
|
"LBRACE",
|
@@ -353,136 +358,137 @@ module_eval(<<'.,.,', 'parser.racc', 33)
|
|
353
358
|
end
|
354
359
|
.,.,
|
355
360
|
|
356
|
-
module_eval(<<'.,.,', 'parser.racc',
|
361
|
+
module_eval(<<'.,.,', 'parser.racc', 36)
|
357
362
|
def _reduce_8(val, _values, result)
|
358
|
-
|
363
|
+
result = RDL::Type::MethodType.new val[1], val[3], RDL::Type::DependentArgType.new(val[6], val[5], val[7])
|
364
|
+
|
359
365
|
result
|
360
366
|
end
|
361
367
|
.,.,
|
362
368
|
|
363
|
-
module_eval(<<'.,.,', 'parser.racc',
|
369
|
+
module_eval(<<'.,.,', 'parser.racc', 40)
|
364
370
|
def _reduce_9(val, _values, result)
|
365
|
-
result = [val[0].to_sym, val[2]]
|
371
|
+
result = [val[0].to_sym, val[2]]
|
366
372
|
result
|
367
373
|
end
|
368
374
|
.,.,
|
369
375
|
|
370
376
|
module_eval(<<'.,.,', 'parser.racc', 41)
|
371
377
|
def _reduce_10(val, _values, result)
|
372
|
-
result = []
|
378
|
+
result = [val[0].to_sym, val[2]] + val[4]
|
373
379
|
result
|
374
380
|
end
|
375
381
|
.,.,
|
376
382
|
|
377
|
-
module_eval(<<'.,.,', 'parser.racc',
|
383
|
+
module_eval(<<'.,.,', 'parser.racc', 44)
|
378
384
|
def _reduce_11(val, _values, result)
|
379
|
-
result =
|
385
|
+
result = []
|
380
386
|
result
|
381
387
|
end
|
382
388
|
.,.,
|
383
389
|
|
384
|
-
module_eval(<<'.,.,', 'parser.racc',
|
390
|
+
module_eval(<<'.,.,', 'parser.racc', 45)
|
385
391
|
def _reduce_12(val, _values, result)
|
386
|
-
|
387
|
-
|
392
|
+
result = val[0]
|
388
393
|
result
|
389
394
|
end
|
390
395
|
.,.,
|
391
396
|
|
392
397
|
module_eval(<<'.,.,', 'parser.racc', 47)
|
393
398
|
def _reduce_13(val, _values, result)
|
394
|
-
|
399
|
+
result = [RDL::Type::FiniteHashType.new(Hash[*val[0]])]
|
400
|
+
|
395
401
|
result
|
396
402
|
end
|
397
403
|
.,.,
|
398
404
|
|
399
|
-
module_eval(<<'.,.,', 'parser.racc',
|
405
|
+
module_eval(<<'.,.,', 'parser.racc', 50)
|
400
406
|
def _reduce_14(val, _values, result)
|
401
|
-
result =
|
407
|
+
result = [val[0]]
|
402
408
|
result
|
403
409
|
end
|
404
410
|
.,.,
|
405
411
|
|
406
|
-
module_eval(<<'.,.,', 'parser.racc',
|
412
|
+
module_eval(<<'.,.,', 'parser.racc', 51)
|
407
413
|
def _reduce_15(val, _values, result)
|
408
|
-
|
409
|
-
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2]])]
|
410
|
-
|
414
|
+
result = val[2].unshift val[0]
|
411
415
|
result
|
412
416
|
end
|
413
417
|
.,.,
|
414
418
|
|
415
|
-
module_eval(<<'.,.,', 'parser.racc',
|
419
|
+
module_eval(<<'.,.,', 'parser.racc', 52)
|
416
420
|
def _reduce_16(val, _values, result)
|
417
|
-
|
421
|
+
# named arg list must come last
|
422
|
+
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2]])]
|
423
|
+
|
418
424
|
result
|
419
425
|
end
|
420
426
|
.,.,
|
421
427
|
|
422
|
-
module_eval(<<'.,.,', 'parser.racc',
|
428
|
+
module_eval(<<'.,.,', 'parser.racc', 56)
|
423
429
|
def _reduce_17(val, _values, result)
|
424
|
-
result =
|
430
|
+
result = val[0]
|
425
431
|
result
|
426
432
|
end
|
427
433
|
.,.,
|
428
434
|
|
429
|
-
module_eval(<<'.,.,', 'parser.racc',
|
435
|
+
module_eval(<<'.,.,', 'parser.racc', 57)
|
430
436
|
def _reduce_18(val, _values, result)
|
431
|
-
|
437
|
+
result = RDL::Type::DependentArgType.new(val[1], val[0], val[2])
|
432
438
|
result
|
433
439
|
end
|
434
440
|
.,.,
|
435
441
|
|
436
|
-
module_eval(<<'.,.,', 'parser.racc',
|
442
|
+
module_eval(<<'.,.,', 'parser.racc', 58)
|
437
443
|
def _reduce_19(val, _values, result)
|
438
|
-
result = val[0]
|
444
|
+
result = RDL::Type::AnnotatedArgType.new(val[1], val[0])
|
439
445
|
result
|
440
446
|
end
|
441
447
|
.,.,
|
442
448
|
|
443
|
-
module_eval(<<'.,.,', 'parser.racc',
|
449
|
+
module_eval(<<'.,.,', 'parser.racc', 59)
|
444
450
|
def _reduce_20(val, _values, result)
|
445
|
-
result =
|
451
|
+
result = RDL::Type::DotsQuery.new
|
446
452
|
result
|
447
453
|
end
|
448
454
|
.,.,
|
449
455
|
|
450
|
-
module_eval(<<'.,.,', 'parser.racc',
|
456
|
+
module_eval(<<'.,.,', 'parser.racc', 61)
|
451
457
|
def _reduce_21(val, _values, result)
|
452
|
-
result =
|
458
|
+
result = val[0]
|
453
459
|
result
|
454
460
|
end
|
455
461
|
.,.,
|
456
462
|
|
457
|
-
module_eval(<<'.,.,', 'parser.racc',
|
463
|
+
module_eval(<<'.,.,', 'parser.racc', 62)
|
458
464
|
def _reduce_22(val, _values, result)
|
459
|
-
result =
|
465
|
+
result = val[0] + val[2]
|
460
466
|
result
|
461
467
|
end
|
462
468
|
.,.,
|
463
469
|
|
464
470
|
module_eval(<<'.,.,', 'parser.racc', 64)
|
465
471
|
def _reduce_23(val, _values, result)
|
466
|
-
result =
|
472
|
+
result = [val[0].to_sym, val[2]]
|
467
473
|
result
|
468
474
|
end
|
469
475
|
.,.,
|
470
476
|
|
471
|
-
module_eval(<<'.,.,', 'parser.racc',
|
477
|
+
module_eval(<<'.,.,', 'parser.racc', 67)
|
472
478
|
def _reduce_24(val, _values, result)
|
473
|
-
result = val[
|
479
|
+
result = RDL::Type::OptionalType.new val[1]
|
474
480
|
result
|
475
481
|
end
|
476
482
|
.,.,
|
477
483
|
|
478
|
-
module_eval(<<'.,.,', 'parser.racc',
|
484
|
+
module_eval(<<'.,.,', 'parser.racc', 68)
|
479
485
|
def _reduce_25(val, _values, result)
|
480
|
-
result = RDL::Type::
|
486
|
+
result = RDL::Type::VarargType.new val[1]
|
481
487
|
result
|
482
488
|
end
|
483
489
|
.,.,
|
484
490
|
|
485
|
-
module_eval(<<'.,.,', 'parser.racc',
|
491
|
+
module_eval(<<'.,.,', 'parser.racc', 69)
|
486
492
|
def _reduce_26(val, _values, result)
|
487
493
|
result = val[0]
|
488
494
|
result
|
@@ -491,21 +497,21 @@ module_eval(<<'.,.,', 'parser.racc', 68)
|
|
491
497
|
|
492
498
|
module_eval(<<'.,.,', 'parser.racc', 71)
|
493
499
|
def _reduce_27(val, _values, result)
|
494
|
-
result =
|
500
|
+
result = RDL::Type::OptionalType.new val[1]
|
495
501
|
result
|
496
502
|
end
|
497
503
|
.,.,
|
498
504
|
|
499
505
|
module_eval(<<'.,.,', 'parser.racc', 72)
|
500
506
|
def _reduce_28(val, _values, result)
|
501
|
-
result = val[
|
507
|
+
result = val[0]
|
502
508
|
result
|
503
509
|
end
|
504
510
|
.,.,
|
505
511
|
|
506
512
|
module_eval(<<'.,.,', 'parser.racc', 75)
|
507
513
|
def _reduce_29(val, _values, result)
|
508
|
-
result =
|
514
|
+
result = nil
|
509
515
|
result
|
510
516
|
end
|
511
517
|
.,.,
|
@@ -519,66 +525,66 @@ module_eval(<<'.,.,', 'parser.racc', 76)
|
|
519
525
|
|
520
526
|
module_eval(<<'.,.,', 'parser.racc', 79)
|
521
527
|
def _reduce_31(val, _values, result)
|
522
|
-
result =
|
528
|
+
result = val[0]
|
523
529
|
result
|
524
530
|
end
|
525
531
|
.,.,
|
526
532
|
|
527
533
|
module_eval(<<'.,.,', 'parser.racc', 80)
|
528
534
|
def _reduce_32(val, _values, result)
|
529
|
-
result =
|
535
|
+
result = val[1]
|
530
536
|
result
|
531
537
|
end
|
532
538
|
.,.,
|
533
539
|
|
534
|
-
# reduce 33 omitted
|
535
|
-
|
536
540
|
module_eval(<<'.,.,', 'parser.racc', 83)
|
537
|
-
def
|
538
|
-
result = val[0]
|
541
|
+
def _reduce_33(val, _values, result)
|
542
|
+
result = [val[0]]
|
539
543
|
result
|
540
544
|
end
|
541
545
|
.,.,
|
542
546
|
|
543
547
|
module_eval(<<'.,.,', 'parser.racc', 84)
|
544
|
-
def
|
545
|
-
result = [val[0]
|
548
|
+
def _reduce_34(val, _values, result)
|
549
|
+
result = [val[0]] + val[2]
|
546
550
|
result
|
547
551
|
end
|
548
552
|
.,.,
|
549
553
|
|
550
|
-
|
554
|
+
# reduce 35 omitted
|
555
|
+
|
556
|
+
module_eval(<<'.,.,', 'parser.racc', 87)
|
551
557
|
def _reduce_36(val, _values, result)
|
552
|
-
result =
|
558
|
+
result = val[0]
|
553
559
|
result
|
554
560
|
end
|
555
561
|
.,.,
|
556
562
|
|
557
|
-
module_eval(<<'.,.,', 'parser.racc',
|
563
|
+
module_eval(<<'.,.,', 'parser.racc', 88)
|
558
564
|
def _reduce_37(val, _values, result)
|
559
|
-
|
560
|
-
|
565
|
+
result = [val[0].to_i, val[2]]
|
561
566
|
result
|
562
567
|
end
|
563
568
|
.,.,
|
564
569
|
|
565
570
|
module_eval(<<'.,.,', 'parser.racc', 89)
|
566
571
|
def _reduce_38(val, _values, result)
|
567
|
-
result = [val[0], val[2]]
|
572
|
+
result = [val[0].to_f, val[2]]
|
568
573
|
result
|
569
574
|
end
|
570
575
|
.,.,
|
571
576
|
|
572
|
-
module_eval(<<'.,.,', 'parser.racc',
|
577
|
+
module_eval(<<'.,.,', 'parser.racc', 91)
|
573
578
|
def _reduce_39(val, _values, result)
|
574
|
-
|
579
|
+
result = [Kernel.const_get(val[0]), val[2]]
|
580
|
+
|
575
581
|
result
|
576
582
|
end
|
577
583
|
.,.,
|
578
584
|
|
579
585
|
module_eval(<<'.,.,', 'parser.racc', 93)
|
580
586
|
def _reduce_40(val, _values, result)
|
581
|
-
result = val[0]
|
587
|
+
result = [val[0], val[2]]
|
582
588
|
result
|
583
589
|
end
|
584
590
|
.,.,
|
@@ -592,20 +598,34 @@ module_eval(<<'.,.,', 'parser.racc', 96)
|
|
592
598
|
|
593
599
|
module_eval(<<'.,.,', 'parser.racc', 97)
|
594
600
|
def _reduce_42(val, _values, result)
|
595
|
-
result =
|
601
|
+
result = val[0] + val[2]
|
596
602
|
result
|
597
603
|
end
|
598
604
|
.,.,
|
599
605
|
|
600
606
|
module_eval(<<'.,.,', 'parser.racc', 100)
|
601
607
|
def _reduce_43(val, _values, result)
|
602
|
-
result =
|
608
|
+
result = val[0]
|
603
609
|
result
|
604
610
|
end
|
605
611
|
.,.,
|
606
612
|
|
607
|
-
module_eval(<<'.,.,', 'parser.racc',
|
613
|
+
module_eval(<<'.,.,', 'parser.racc', 101)
|
608
614
|
def _reduce_44(val, _values, result)
|
615
|
+
result = RDL::Type::UnionType.new val[0], val[2]
|
616
|
+
result
|
617
|
+
end
|
618
|
+
.,.,
|
619
|
+
|
620
|
+
module_eval(<<'.,.,', 'parser.racc', 104)
|
621
|
+
def _reduce_45(val, _values, result)
|
622
|
+
result = RDL::Type::SingletonType.new(val[0].to_sym)
|
623
|
+
result
|
624
|
+
end
|
625
|
+
.,.,
|
626
|
+
|
627
|
+
module_eval(<<'.,.,', 'parser.racc', 106)
|
628
|
+
def _reduce_46(val, _values, result)
|
609
629
|
if val[0] == 'nil' then
|
610
630
|
result = RDL::Type::NilType.new
|
611
631
|
elsif val[0] =~ /^[a-z_]+\w*\'?/ then
|
@@ -618,8 +638,8 @@ module_eval(<<'.,.,', 'parser.racc', 102)
|
|
618
638
|
end
|
619
639
|
.,.,
|
620
640
|
|
621
|
-
module_eval(<<'.,.,', 'parser.racc',
|
622
|
-
def
|
641
|
+
module_eval(<<'.,.,', 'parser.racc', 115)
|
642
|
+
def _reduce_47(val, _values, result)
|
623
643
|
if $__rdl_special_types.has_key? val[0] then
|
624
644
|
result = $__rdl_special_types[val[0]]
|
625
645
|
else
|
@@ -630,8 +650,8 @@ module_eval(<<'.,.,', 'parser.racc', 111)
|
|
630
650
|
end
|
631
651
|
.,.,
|
632
652
|
|
633
|
-
module_eval(<<'.,.,', 'parser.racc',
|
634
|
-
def
|
653
|
+
module_eval(<<'.,.,', 'parser.racc', 122)
|
654
|
+
def _reduce_48(val, _values, result)
|
635
655
|
n = RDL::Type::NominalType.new(val[0])
|
636
656
|
result = RDL::Type::GenericType.new(n, *val[2])
|
637
657
|
|
@@ -639,54 +659,61 @@ module_eval(<<'.,.,', 'parser.racc', 118)
|
|
639
659
|
end
|
640
660
|
.,.,
|
641
661
|
|
642
|
-
module_eval(<<'.,.,', 'parser.racc',
|
643
|
-
def
|
662
|
+
module_eval(<<'.,.,', 'parser.racc', 125)
|
663
|
+
def _reduce_49(val, _values, result)
|
664
|
+
result = val[1]
|
665
|
+
result
|
666
|
+
end
|
667
|
+
.,.,
|
668
|
+
|
669
|
+
module_eval(<<'.,.,', 'parser.racc', 127)
|
670
|
+
def _reduce_50(val, _values, result)
|
644
671
|
result = RDL::Type::TupleType.new(*val[1])
|
645
672
|
|
646
673
|
result
|
647
674
|
end
|
648
675
|
.,.,
|
649
676
|
|
650
|
-
module_eval(<<'.,.,', 'parser.racc',
|
651
|
-
def
|
677
|
+
module_eval(<<'.,.,', 'parser.racc', 130)
|
678
|
+
def _reduce_51(val, _values, result)
|
652
679
|
result = RDL::Type::StructuralType.new(Hash[*val[1]])
|
653
680
|
|
654
681
|
result
|
655
682
|
end
|
656
683
|
.,.,
|
657
684
|
|
658
|
-
module_eval(<<'.,.,', 'parser.racc',
|
659
|
-
def
|
685
|
+
module_eval(<<'.,.,', 'parser.racc', 133)
|
686
|
+
def _reduce_52(val, _values, result)
|
660
687
|
result = RDL::Type::FiniteHashType.new(Hash[*val[1]])
|
661
688
|
|
662
689
|
result
|
663
690
|
end
|
664
691
|
.,.,
|
665
692
|
|
666
|
-
module_eval(<<'.,.,', 'parser.racc',
|
667
|
-
def
|
693
|
+
module_eval(<<'.,.,', 'parser.racc', 135)
|
694
|
+
def _reduce_53(val, _values, result)
|
668
695
|
result = RDL::Type::SingletonType.new(val[0].to_i)
|
669
696
|
result
|
670
697
|
end
|
671
698
|
.,.,
|
672
699
|
|
673
|
-
module_eval(<<'.,.,', 'parser.racc',
|
674
|
-
def
|
700
|
+
module_eval(<<'.,.,', 'parser.racc', 136)
|
701
|
+
def _reduce_54(val, _values, result)
|
675
702
|
result = RDL::Type::SingletonType.new(val[0].to_f)
|
676
703
|
result
|
677
704
|
end
|
678
705
|
.,.,
|
679
706
|
|
680
|
-
module_eval(<<'.,.,', 'parser.racc',
|
681
|
-
def
|
707
|
+
module_eval(<<'.,.,', 'parser.racc', 138)
|
708
|
+
def _reduce_55(val, _values, result)
|
682
709
|
result = RDL::Type::SingletonType.new(Kernel.const_get(val[1]))
|
683
710
|
|
684
711
|
result
|
685
712
|
end
|
686
713
|
.,.,
|
687
714
|
|
688
|
-
module_eval(<<'.,.,', 'parser.racc',
|
689
|
-
def
|
715
|
+
module_eval(<<'.,.,', 'parser.racc', 142)
|
716
|
+
def _reduce_56(val, _values, result)
|
690
717
|
result = RDL::Type::WildQuery.new
|
691
718
|
result
|
692
719
|
end
|