racc 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.ja.rdoc +0 -1
- data/README.rdoc +6 -7
- data/{rdoc → doc}/en/NEWS.en.rdoc +0 -0
- data/{rdoc → doc}/en/grammar.en.rdoc +27 -31
- data/doc/en/grammar2.en.rdoc +219 -0
- data/{rdoc → doc}/ja/NEWS.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/command.ja.html +0 -0
- data/{rdoc → doc}/ja/debug.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/grammar.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/index.ja.html +0 -0
- data/{rdoc → doc}/ja/parser.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/usage.ja.html +0 -0
- data/ext/racc/cparse/cparse.c +1 -1
- data/ext/racc/cparse/extconf.rb +1 -0
- data/lib/racc/info.rb +1 -1
- data/lib/racc/parser-text.rb +1 -1
- data/lib/racc/parser.rb +1 -1
- data/lib/racc/parserfilegenerator.rb +0 -44
- data/lib/racc/statetransitiontable.rb +2 -8
- metadata +15 -121
- data/Rakefile +0 -79
- data/ext/racc/com/headius/racc/Cparse.java +0 -849
- data/lib/racc/pre-setup +0 -13
- data/sample/array.y +0 -67
- data/sample/array2.y +0 -59
- data/sample/calc-ja.y +0 -66
- data/sample/calc.y +0 -65
- data/sample/conflict.y +0 -15
- data/sample/hash.y +0 -60
- data/sample/lalr.y +0 -17
- data/sample/lists.y +0 -57
- data/sample/syntax.y +0 -46
- data/sample/yyerr.y +0 -46
- data/test/assets/cadenza.y +0 -170
- data/test/assets/cast.y +0 -926
- data/test/assets/chk.y +0 -126
- data/test/assets/conf.y +0 -16
- data/test/assets/csspool.y +0 -729
- data/test/assets/digraph.y +0 -29
- data/test/assets/echk.y +0 -118
- data/test/assets/edtf.y +0 -583
- data/test/assets/err.y +0 -60
- data/test/assets/error_recovery.y +0 -35
- data/test/assets/expect.y +0 -7
- data/test/assets/firstline.y +0 -4
- data/test/assets/huia.y +0 -318
- data/test/assets/ichk.y +0 -102
- data/test/assets/intp.y +0 -546
- data/test/assets/journey.y +0 -47
- data/test/assets/liquor.y +0 -313
- data/test/assets/machete.y +0 -423
- data/test/assets/macruby.y +0 -2197
- data/test/assets/mailp.y +0 -437
- data/test/assets/mediacloth.y +0 -599
- data/test/assets/mof.y +0 -649
- data/test/assets/namae.y +0 -302
- data/test/assets/nasl.y +0 -626
- data/test/assets/newsyn.y +0 -25
- data/test/assets/noend.y +0 -4
- data/test/assets/nokogiri-css.y +0 -255
- data/test/assets/nonass.y +0 -41
- data/test/assets/normal.y +0 -27
- data/test/assets/norule.y +0 -4
- data/test/assets/nullbug1.y +0 -25
- data/test/assets/nullbug2.y +0 -15
- data/test/assets/opal.y +0 -1807
- data/test/assets/opt.y +0 -123
- data/test/assets/percent.y +0 -35
- data/test/assets/php_serialization.y +0 -98
- data/test/assets/recv.y +0 -97
- data/test/assets/riml.y +0 -665
- data/test/assets/rrconf.y +0 -14
- data/test/assets/ruby18.y +0 -1943
- data/test/assets/ruby19.y +0 -2174
- data/test/assets/ruby20.y +0 -2350
- data/test/assets/ruby21.y +0 -2359
- data/test/assets/ruby22.y +0 -2381
- data/test/assets/scan.y +0 -72
- data/test/assets/syntax.y +0 -50
- data/test/assets/tp_plus.y +0 -622
- data/test/assets/twowaysql.y +0 -278
- data/test/assets/unterm.y +0 -5
- data/test/assets/useless.y +0 -12
- data/test/assets/yyerr.y +0 -46
- data/test/bench.y +0 -36
- data/test/helper.rb +0 -115
- data/test/infini.y +0 -8
- data/test/regress/cadenza +0 -796
- data/test/regress/cast +0 -3428
- data/test/regress/csspool +0 -2314
- data/test/regress/edtf +0 -1794
- data/test/regress/huia +0 -1392
- data/test/regress/journey +0 -222
- data/test/regress/liquor +0 -885
- data/test/regress/machete +0 -833
- data/test/regress/mediacloth +0 -1463
- data/test/regress/mof +0 -1368
- data/test/regress/namae +0 -634
- data/test/regress/nasl +0 -2058
- data/test/regress/nokogiri-css +0 -836
- data/test/regress/opal +0 -6431
- data/test/regress/php_serialization +0 -336
- data/test/regress/riml +0 -3283
- data/test/regress/ruby18 +0 -6344
- data/test/regress/ruby22 +0 -7460
- data/test/regress/tp_plus +0 -1933
- data/test/regress/twowaysql +0 -556
- data/test/scandata/brace +0 -7
- data/test/scandata/gvar +0 -1
- data/test/scandata/normal +0 -4
- data/test/scandata/percent +0 -18
- data/test/scandata/slash +0 -10
- data/test/src.intp +0 -34
- data/test/start.y +0 -20
- data/test/test_chk_y.rb +0 -52
- data/test/test_grammar_file_parser.rb +0 -15
- data/test/test_racc_command.rb +0 -339
- data/test/test_scan_y.rb +0 -52
- data/test/testscanner.rb +0 -51
- data/web/racc.en.rhtml +0 -42
- data/web/racc.ja.rhtml +0 -51
data/test/regress/namae
DELETED
@@ -1,634 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.5.0
|
4
|
-
# from Racc grammar file "".
|
5
|
-
#
|
6
|
-
|
7
|
-
require 'racc/parser.rb'
|
8
|
-
|
9
|
-
require 'singleton'
|
10
|
-
require 'strscan'
|
11
|
-
|
12
|
-
module Namae
|
13
|
-
class Parser < Racc::Parser
|
14
|
-
|
15
|
-
module_eval(<<'...end namae.y/module_eval...', 'namae.y', 135)
|
16
|
-
|
17
|
-
include Singleton
|
18
|
-
|
19
|
-
attr_reader :options, :input
|
20
|
-
|
21
|
-
def initialize
|
22
|
-
@input, @options = StringScanner.new(''), {
|
23
|
-
:debug => false,
|
24
|
-
:prefer_comma_as_separator => false,
|
25
|
-
:comma => ',',
|
26
|
-
:stops => ',;',
|
27
|
-
:separator => /\s*(\band\b|\&|;)\s*/i,
|
28
|
-
:title => /\s*\b(sir|lord|count(ess)?|(gen|adm|col|maj|capt|cmdr|lt|sgt|cpl|pvt|prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
|
29
|
-
:suffix => /\s*\b(JR|Jr|jr|SR|Sr|sr|[IVX]{2,})(\.|\b)/,
|
30
|
-
:appellation => /\s*\b((mrs?|ms|fr|hr)\.?|miss|herr|frau)(\s+|$)/i
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
def debug?
|
35
|
-
options[:debug] || ENV['DEBUG']
|
36
|
-
end
|
37
|
-
|
38
|
-
def separator
|
39
|
-
options[:separator]
|
40
|
-
end
|
41
|
-
|
42
|
-
def comma
|
43
|
-
options[:comma]
|
44
|
-
end
|
45
|
-
|
46
|
-
def stops
|
47
|
-
options[:stops]
|
48
|
-
end
|
49
|
-
|
50
|
-
def title
|
51
|
-
options[:title]
|
52
|
-
end
|
53
|
-
|
54
|
-
def suffix
|
55
|
-
options[:suffix]
|
56
|
-
end
|
57
|
-
|
58
|
-
def appellation
|
59
|
-
options[:appellation]
|
60
|
-
end
|
61
|
-
|
62
|
-
def prefer_comma_as_separator?
|
63
|
-
options[:prefer_comma_as_separator]
|
64
|
-
end
|
65
|
-
|
66
|
-
def parse(input)
|
67
|
-
parse!(input)
|
68
|
-
rescue => e
|
69
|
-
warn e.message if debug?
|
70
|
-
[]
|
71
|
-
end
|
72
|
-
|
73
|
-
def parse!(string)
|
74
|
-
input.string = normalize(string)
|
75
|
-
reset
|
76
|
-
do_parse
|
77
|
-
end
|
78
|
-
|
79
|
-
def normalize(string)
|
80
|
-
string = string.strip
|
81
|
-
string
|
82
|
-
end
|
83
|
-
|
84
|
-
def reset
|
85
|
-
@commas, @words, @initials, @suffices, @yydebug = 0, 0, 0, 0, debug?
|
86
|
-
self
|
87
|
-
end
|
88
|
-
|
89
|
-
private
|
90
|
-
|
91
|
-
def stack
|
92
|
-
@vstack || @racc_vstack || []
|
93
|
-
end
|
94
|
-
|
95
|
-
def last_token
|
96
|
-
stack[-1]
|
97
|
-
end
|
98
|
-
|
99
|
-
def consume_separator
|
100
|
-
return next_token if seen_separator?
|
101
|
-
@commas, @words, @initials, @suffices = 0, 0, 0, 0
|
102
|
-
[:AND, :AND]
|
103
|
-
end
|
104
|
-
|
105
|
-
def consume_comma
|
106
|
-
@commas += 1
|
107
|
-
[:COMMA, :COMMA]
|
108
|
-
end
|
109
|
-
|
110
|
-
def consume_word(type, word)
|
111
|
-
@words += 1
|
112
|
-
|
113
|
-
case type
|
114
|
-
when :UWORD
|
115
|
-
@initials += 1 if word =~ /^[[:upper:]]+\b/
|
116
|
-
when :SUFFIX
|
117
|
-
@suffices += 1
|
118
|
-
end
|
119
|
-
|
120
|
-
[type, word]
|
121
|
-
end
|
122
|
-
|
123
|
-
def seen_separator?
|
124
|
-
!stack.empty? && last_token == :AND
|
125
|
-
end
|
126
|
-
|
127
|
-
def suffix?
|
128
|
-
!@suffices.zero? || will_see_suffix?
|
129
|
-
end
|
130
|
-
|
131
|
-
def will_see_suffix?
|
132
|
-
input.peek(8).to_s.strip.split(/\s+/)[0] =~ suffix
|
133
|
-
end
|
134
|
-
|
135
|
-
def will_see_initial?
|
136
|
-
input.peek(6).to_s.strip.split(/\s+/)[0] =~ /^[[:upper:]]+\b/
|
137
|
-
end
|
138
|
-
|
139
|
-
def seen_full_name?
|
140
|
-
prefer_comma_as_separator? && @words > 1 &&
|
141
|
-
(@initials > 0 || !will_see_initial?) && !will_see_suffix?
|
142
|
-
end
|
143
|
-
|
144
|
-
def next_token
|
145
|
-
case
|
146
|
-
when input.nil?, input.eos?
|
147
|
-
nil
|
148
|
-
when input.scan(separator)
|
149
|
-
consume_separator
|
150
|
-
when input.scan(/\s*#{comma}\s*/)
|
151
|
-
if @commas.zero? && !seen_full_name? || @commas == 1 && suffix?
|
152
|
-
consume_comma
|
153
|
-
else
|
154
|
-
consume_separator
|
155
|
-
end
|
156
|
-
when input.scan(/\s+/)
|
157
|
-
next_token
|
158
|
-
when input.scan(title)
|
159
|
-
consume_word(:TITLE, input.matched.strip)
|
160
|
-
when input.scan(suffix)
|
161
|
-
consume_word(:SUFFIX, input.matched.strip)
|
162
|
-
when input.scan(appellation)
|
163
|
-
[:APPELLATION, input.matched.strip]
|
164
|
-
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:upper:]][^\s#{stops}]*/)
|
165
|
-
consume_word(:UWORD, input.matched)
|
166
|
-
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:lower:]][^\s#{stops}]*/)
|
167
|
-
consume_word(:LWORD, input.matched)
|
168
|
-
when input.scan(/(\\\w+)?\{[^\}]*\}[^\s#{stops}]*/)
|
169
|
-
consume_word(:PWORD, input.matched)
|
170
|
-
when input.scan(/('[^'\n]+')|("[^"\n]+")/)
|
171
|
-
consume_word(:NICK, input.matched[1...-1])
|
172
|
-
else
|
173
|
-
raise ArgumentError,
|
174
|
-
"Failed to parse name #{input.string.inspect}: unmatched data at offset #{input.pos}"
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
def on_error(tid, value, stack)
|
179
|
-
raise ArgumentError,
|
180
|
-
"Failed to parse name: unexpected '#{value}' at #{stack.inspect}"
|
181
|
-
end
|
182
|
-
|
183
|
-
# -*- racc -*-
|
184
|
-
...end namae.y/module_eval...
|
185
|
-
##### State transition tables begin ###
|
186
|
-
|
187
|
-
racc_action_table = [
|
188
|
-
-39, 16, 32, 30, -40, 31, 33, -39, 17, -39,
|
189
|
-
-39, -40, 67, -40, -40, 66, 53, 52, 54, -38,
|
190
|
-
59, -22, 39, -34, 45, 58, -38, 53, 52, 54,
|
191
|
-
53, 52, 54, 59, 39, 39, 62, 39, 53, 52,
|
192
|
-
54, 14, 12, 15, 68, 39, 7, 8, 14, 12,
|
193
|
-
15, 58, 39, 7, 8, 14, 22, 15, 24, 14,
|
194
|
-
22, 15, 24, 14, 22, 15, 30, 28, 31, 30,
|
195
|
-
28, 31, -19, -19, -19, 30, 42, 31, 30, 28,
|
196
|
-
31, -20, -20, -20, 30, 46, 31, 30, 28, 31,
|
197
|
-
30, 28, 31, -19, -19, -19, 53, 52, 54, 53,
|
198
|
-
52, 54, 39, 58, 59 ]
|
199
|
-
|
200
|
-
racc_action_check = [
|
201
|
-
14, 1, 11, 43, 15, 43, 16, 14, 1, 14,
|
202
|
-
14, 15, 50, 15, 15, 49, 49, 49, 49, 12,
|
203
|
-
50, 12, 23, 49, 27, 37, 12, 32, 32, 32,
|
204
|
-
45, 45, 45, 38, 32, 40, 44, 45, 62, 62,
|
205
|
-
62, 0, 0, 0, 57, 62, 0, 0, 17, 17,
|
206
|
-
17, 60, 61, 17, 17, 9, 9, 9, 9, 20,
|
207
|
-
20, 20, 20, 5, 5, 5, 10, 10, 10, 21,
|
208
|
-
21, 21, 22, 22, 22, 24, 24, 24, 25, 25,
|
209
|
-
25, 28, 28, 28, 29, 29, 29, 35, 35, 35,
|
210
|
-
41, 41, 41, 42, 42, 42, 67, 67, 67, 73,
|
211
|
-
73, 73, 64, 70, 72 ]
|
212
|
-
|
213
|
-
racc_action_pointer = [
|
214
|
-
38, 1, nil, nil, nil, 60, nil, nil, nil, 52,
|
215
|
-
63, 0, 19, nil, 0, 4, 6, 45, nil, nil,
|
216
|
-
56, 66, 69, 12, 72, 75, nil, 22, 78, 81,
|
217
|
-
nil, nil, 24, nil, nil, 84, nil, 16, 23, nil,
|
218
|
-
25, 87, 90, 0, 34, 27, nil, nil, nil, 13,
|
219
|
-
10, nil, nil, nil, nil, nil, nil, 35, nil, nil,
|
220
|
-
42, 42, 35, nil, 92, nil, nil, 93, nil, nil,
|
221
|
-
94, nil, 94, 96, nil ]
|
222
|
-
|
223
|
-
racc_action_default = [
|
224
|
-
-1, -49, -2, -4, -5, -49, -8, -9, -10, -23,
|
225
|
-
-49, -49, -19, -28, -30, -31, -49, -49, -6, -7,
|
226
|
-
-49, -49, -38, -41, -49, -49, -29, -15, -22, -23,
|
227
|
-
-30, -31, -36, 75, -3, -49, -15, -45, -42, -43,
|
228
|
-
-41, -49, -22, -23, -14, -36, -21, -16, -24, -37,
|
229
|
-
-26, -32, -38, -39, -40, -14, -11, -46, -47, -44,
|
230
|
-
-45, -41, -36, -17, -49, -33, -35, -49, -48, -12,
|
231
|
-
-45, -18, -25, -27, -13 ]
|
232
|
-
|
233
|
-
racc_goto_table = [
|
234
|
-
3, 37, 26, 50, 56, 18, 2, 9, 47, 23,
|
235
|
-
1, 19, 20, 26, 73, 27, 50, 3, 60, 64,
|
236
|
-
23, 63, 26, 34, 9, nil, 36, 69, 21, 40,
|
237
|
-
44, 43, 25, 50, nil, 72, 26, 74, 71, 70,
|
238
|
-
55, nil, nil, 35, nil, nil, 61, 41, nil, 65,
|
239
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
240
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
241
|
-
nil, nil, nil, 65 ]
|
242
|
-
|
243
|
-
racc_goto_check = [
|
244
|
-
3, 8, 17, 16, 9, 3, 2, 7, 12, 3,
|
245
|
-
1, 4, 7, 17, 14, 10, 16, 3, 8, 15,
|
246
|
-
3, 12, 17, 2, 7, nil, 10, 9, 11, 10,
|
247
|
-
10, 7, 11, 16, nil, 16, 17, 9, 12, 8,
|
248
|
-
10, nil, nil, 11, nil, nil, 10, 11, nil, 3,
|
249
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
250
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
251
|
-
nil, nil, nil, 3 ]
|
252
|
-
|
253
|
-
racc_goto_pointer = [
|
254
|
-
nil, 10, 6, 0, 6, nil, nil, 7, -22, -33,
|
255
|
-
5, 23, -24, nil, -53, -30, -29, -7, nil ]
|
256
|
-
|
257
|
-
racc_goto_default = [
|
258
|
-
nil, nil, nil, 51, 4, 5, 6, 29, nil, nil,
|
259
|
-
11, 10, nil, 48, 49, nil, 38, 13, 57 ]
|
260
|
-
|
261
|
-
racc_reduce_table = [
|
262
|
-
0, 0, :racc_error,
|
263
|
-
0, 12, :_reduce_1,
|
264
|
-
1, 12, :_reduce_2,
|
265
|
-
3, 12, :_reduce_3,
|
266
|
-
1, 13, :_reduce_4,
|
267
|
-
1, 13, :_reduce_none,
|
268
|
-
2, 13, :_reduce_6,
|
269
|
-
2, 13, :_reduce_7,
|
270
|
-
1, 13, :_reduce_none,
|
271
|
-
1, 16, :_reduce_9,
|
272
|
-
1, 16, :_reduce_10,
|
273
|
-
4, 15, :_reduce_11,
|
274
|
-
5, 15, :_reduce_12,
|
275
|
-
6, 15, :_reduce_13,
|
276
|
-
3, 15, :_reduce_14,
|
277
|
-
2, 15, :_reduce_15,
|
278
|
-
3, 17, :_reduce_16,
|
279
|
-
4, 17, :_reduce_17,
|
280
|
-
5, 17, :_reduce_18,
|
281
|
-
1, 22, :_reduce_none,
|
282
|
-
2, 22, :_reduce_20,
|
283
|
-
3, 22, :_reduce_21,
|
284
|
-
1, 21, :_reduce_none,
|
285
|
-
1, 21, :_reduce_none,
|
286
|
-
1, 23, :_reduce_24,
|
287
|
-
3, 23, :_reduce_25,
|
288
|
-
1, 23, :_reduce_26,
|
289
|
-
3, 23, :_reduce_27,
|
290
|
-
1, 18, :_reduce_none,
|
291
|
-
2, 18, :_reduce_29,
|
292
|
-
1, 28, :_reduce_none,
|
293
|
-
1, 28, :_reduce_none,
|
294
|
-
1, 25, :_reduce_none,
|
295
|
-
2, 25, :_reduce_33,
|
296
|
-
0, 26, :_reduce_none,
|
297
|
-
1, 26, :_reduce_none,
|
298
|
-
0, 24, :_reduce_none,
|
299
|
-
1, 24, :_reduce_none,
|
300
|
-
1, 14, :_reduce_none,
|
301
|
-
1, 14, :_reduce_none,
|
302
|
-
1, 14, :_reduce_none,
|
303
|
-
0, 19, :_reduce_none,
|
304
|
-
1, 19, :_reduce_none,
|
305
|
-
1, 27, :_reduce_none,
|
306
|
-
2, 27, :_reduce_44,
|
307
|
-
0, 20, :_reduce_none,
|
308
|
-
1, 20, :_reduce_none,
|
309
|
-
1, 29, :_reduce_none,
|
310
|
-
2, 29, :_reduce_48 ]
|
311
|
-
|
312
|
-
racc_reduce_n = 49
|
313
|
-
|
314
|
-
racc_shift_n = 75
|
315
|
-
|
316
|
-
racc_token_table = {
|
317
|
-
false => 0,
|
318
|
-
:error => 1,
|
319
|
-
:COMMA => 2,
|
320
|
-
:UWORD => 3,
|
321
|
-
:LWORD => 4,
|
322
|
-
:PWORD => 5,
|
323
|
-
:NICK => 6,
|
324
|
-
:AND => 7,
|
325
|
-
:APPELLATION => 8,
|
326
|
-
:TITLE => 9,
|
327
|
-
:SUFFIX => 10 }
|
328
|
-
|
329
|
-
racc_nt_base = 11
|
330
|
-
|
331
|
-
racc_use_result_var = true
|
332
|
-
|
333
|
-
Racc_arg = [
|
334
|
-
racc_action_table,
|
335
|
-
racc_action_check,
|
336
|
-
racc_action_default,
|
337
|
-
racc_action_pointer,
|
338
|
-
racc_goto_table,
|
339
|
-
racc_goto_check,
|
340
|
-
racc_goto_default,
|
341
|
-
racc_goto_pointer,
|
342
|
-
racc_nt_base,
|
343
|
-
racc_reduce_table,
|
344
|
-
racc_token_table,
|
345
|
-
racc_shift_n,
|
346
|
-
racc_reduce_n,
|
347
|
-
racc_use_result_var ]
|
348
|
-
|
349
|
-
Racc_token_to_s_table = [
|
350
|
-
"$end",
|
351
|
-
"error",
|
352
|
-
"COMMA",
|
353
|
-
"UWORD",
|
354
|
-
"LWORD",
|
355
|
-
"PWORD",
|
356
|
-
"NICK",
|
357
|
-
"AND",
|
358
|
-
"APPELLATION",
|
359
|
-
"TITLE",
|
360
|
-
"SUFFIX",
|
361
|
-
"$start",
|
362
|
-
"names",
|
363
|
-
"name",
|
364
|
-
"word",
|
365
|
-
"display_order",
|
366
|
-
"honorific",
|
367
|
-
"sort_order",
|
368
|
-
"u_words",
|
369
|
-
"opt_suffices",
|
370
|
-
"opt_titles",
|
371
|
-
"last",
|
372
|
-
"von",
|
373
|
-
"first",
|
374
|
-
"opt_words",
|
375
|
-
"words",
|
376
|
-
"opt_comma",
|
377
|
-
"suffices",
|
378
|
-
"u_word",
|
379
|
-
"titles" ]
|
380
|
-
|
381
|
-
Racc_debug_parser = false
|
382
|
-
|
383
|
-
##### State transition tables end #####
|
384
|
-
|
385
|
-
# reduce 0 omitted
|
386
|
-
|
387
|
-
module_eval(<<'.,.,', 'namae.y', 39)
|
388
|
-
def _reduce_1(val, _values, result)
|
389
|
-
result = []
|
390
|
-
result
|
391
|
-
end
|
392
|
-
.,.,
|
393
|
-
|
394
|
-
module_eval(<<'.,.,', 'namae.y', 40)
|
395
|
-
def _reduce_2(val, _values, result)
|
396
|
-
result = [val[0]]
|
397
|
-
result
|
398
|
-
end
|
399
|
-
.,.,
|
400
|
-
|
401
|
-
module_eval(<<'.,.,', 'namae.y', 41)
|
402
|
-
def _reduce_3(val, _values, result)
|
403
|
-
result = val[0] << val[2]
|
404
|
-
result
|
405
|
-
end
|
406
|
-
.,.,
|
407
|
-
|
408
|
-
module_eval(<<'.,.,', 'namae.y', 43)
|
409
|
-
def _reduce_4(val, _values, result)
|
410
|
-
result = Name.new(:given => val[0])
|
411
|
-
result
|
412
|
-
end
|
413
|
-
.,.,
|
414
|
-
|
415
|
-
# reduce 5 omitted
|
416
|
-
|
417
|
-
module_eval(<<'.,.,', 'namae.y', 45)
|
418
|
-
def _reduce_6(val, _values, result)
|
419
|
-
result = val[0].merge(:family => val[1])
|
420
|
-
result
|
421
|
-
end
|
422
|
-
.,.,
|
423
|
-
|
424
|
-
module_eval(<<'.,.,', 'namae.y', 46)
|
425
|
-
def _reduce_7(val, _values, result)
|
426
|
-
result = val[1].merge(val[0])
|
427
|
-
result
|
428
|
-
end
|
429
|
-
.,.,
|
430
|
-
|
431
|
-
# reduce 8 omitted
|
432
|
-
|
433
|
-
module_eval(<<'.,.,', 'namae.y', 49)
|
434
|
-
def _reduce_9(val, _values, result)
|
435
|
-
result = Name.new(:appellation => val[0])
|
436
|
-
result
|
437
|
-
end
|
438
|
-
.,.,
|
439
|
-
|
440
|
-
module_eval(<<'.,.,', 'namae.y', 50)
|
441
|
-
def _reduce_10(val, _values, result)
|
442
|
-
result = Name.new(:title => val[0])
|
443
|
-
result
|
444
|
-
end
|
445
|
-
.,.,
|
446
|
-
|
447
|
-
module_eval(<<'.,.,', 'namae.y', 54)
|
448
|
-
def _reduce_11(val, _values, result)
|
449
|
-
result = Name.new(:given => val[0], :family => val[1],
|
450
|
-
:suffix => val[2], :title => val[3])
|
451
|
-
|
452
|
-
result
|
453
|
-
end
|
454
|
-
.,.,
|
455
|
-
|
456
|
-
module_eval(<<'.,.,', 'namae.y', 59)
|
457
|
-
def _reduce_12(val, _values, result)
|
458
|
-
result = Name.new(:given => val[0], :nick => val[1],
|
459
|
-
:family => val[2], :suffix => val[3], :title => val[4])
|
460
|
-
|
461
|
-
result
|
462
|
-
end
|
463
|
-
.,.,
|
464
|
-
|
465
|
-
module_eval(<<'.,.,', 'namae.y', 64)
|
466
|
-
def _reduce_13(val, _values, result)
|
467
|
-
result = Name.new(:given => val[0], :nick => val[1],
|
468
|
-
:particle => val[2], :family => val[3],
|
469
|
-
:suffix => val[4], :title => val[5])
|
470
|
-
|
471
|
-
result
|
472
|
-
end
|
473
|
-
.,.,
|
474
|
-
|
475
|
-
module_eval(<<'.,.,', 'namae.y', 70)
|
476
|
-
def _reduce_14(val, _values, result)
|
477
|
-
result = Name.new(:given => val[0], :particle => val[1],
|
478
|
-
:family => val[2])
|
479
|
-
|
480
|
-
result
|
481
|
-
end
|
482
|
-
.,.,
|
483
|
-
|
484
|
-
module_eval(<<'.,.,', 'namae.y', 75)
|
485
|
-
def _reduce_15(val, _values, result)
|
486
|
-
result = Name.new(:particle => val[0], :family => val[1])
|
487
|
-
|
488
|
-
result
|
489
|
-
end
|
490
|
-
.,.,
|
491
|
-
|
492
|
-
module_eval(<<'.,.,', 'namae.y', 80)
|
493
|
-
def _reduce_16(val, _values, result)
|
494
|
-
result = Name.new({ :family => val[0], :suffix => val[2][0],
|
495
|
-
:given => val[2][1] }, !!val[2][0])
|
496
|
-
|
497
|
-
result
|
498
|
-
end
|
499
|
-
.,.,
|
500
|
-
|
501
|
-
module_eval(<<'.,.,', 'namae.y', 85)
|
502
|
-
def _reduce_17(val, _values, result)
|
503
|
-
result = Name.new({ :particle => val[0], :family => val[1],
|
504
|
-
:suffix => val[3][0], :given => val[3][1] }, !!val[3][0])
|
505
|
-
|
506
|
-
result
|
507
|
-
end
|
508
|
-
.,.,
|
509
|
-
|
510
|
-
module_eval(<<'.,.,', 'namae.y', 90)
|
511
|
-
def _reduce_18(val, _values, result)
|
512
|
-
result = Name.new({ :particle => val[0,2].join(' '), :family => val[2],
|
513
|
-
:suffix => val[4][0], :given => val[4][1] }, !!val[4][0])
|
514
|
-
|
515
|
-
result
|
516
|
-
end
|
517
|
-
.,.,
|
518
|
-
|
519
|
-
# reduce 19 omitted
|
520
|
-
|
521
|
-
module_eval(<<'.,.,', 'namae.y', 96)
|
522
|
-
def _reduce_20(val, _values, result)
|
523
|
-
result = val.join(' ')
|
524
|
-
result
|
525
|
-
end
|
526
|
-
.,.,
|
527
|
-
|
528
|
-
module_eval(<<'.,.,', 'namae.y', 97)
|
529
|
-
def _reduce_21(val, _values, result)
|
530
|
-
result = val.join(' ')
|
531
|
-
result
|
532
|
-
end
|
533
|
-
.,.,
|
534
|
-
|
535
|
-
# reduce 22 omitted
|
536
|
-
|
537
|
-
# reduce 23 omitted
|
538
|
-
|
539
|
-
module_eval(<<'.,.,', 'namae.y', 101)
|
540
|
-
def _reduce_24(val, _values, result)
|
541
|
-
result = [nil,val[0]]
|
542
|
-
result
|
543
|
-
end
|
544
|
-
.,.,
|
545
|
-
|
546
|
-
module_eval(<<'.,.,', 'namae.y', 102)
|
547
|
-
def _reduce_25(val, _values, result)
|
548
|
-
result = [val[2],val[0]]
|
549
|
-
result
|
550
|
-
end
|
551
|
-
.,.,
|
552
|
-
|
553
|
-
module_eval(<<'.,.,', 'namae.y', 103)
|
554
|
-
def _reduce_26(val, _values, result)
|
555
|
-
result = [val[0],nil]
|
556
|
-
result
|
557
|
-
end
|
558
|
-
.,.,
|
559
|
-
|
560
|
-
module_eval(<<'.,.,', 'namae.y', 104)
|
561
|
-
def _reduce_27(val, _values, result)
|
562
|
-
result = [val[0],val[2]]
|
563
|
-
result
|
564
|
-
end
|
565
|
-
.,.,
|
566
|
-
|
567
|
-
# reduce 28 omitted
|
568
|
-
|
569
|
-
module_eval(<<'.,.,', 'namae.y', 107)
|
570
|
-
def _reduce_29(val, _values, result)
|
571
|
-
result = val.join(' ')
|
572
|
-
result
|
573
|
-
end
|
574
|
-
.,.,
|
575
|
-
|
576
|
-
# reduce 30 omitted
|
577
|
-
|
578
|
-
# reduce 31 omitted
|
579
|
-
|
580
|
-
# reduce 32 omitted
|
581
|
-
|
582
|
-
module_eval(<<'.,.,', 'namae.y', 112)
|
583
|
-
def _reduce_33(val, _values, result)
|
584
|
-
result = val.join(' ')
|
585
|
-
result
|
586
|
-
end
|
587
|
-
.,.,
|
588
|
-
|
589
|
-
# reduce 34 omitted
|
590
|
-
|
591
|
-
# reduce 35 omitted
|
592
|
-
|
593
|
-
# reduce 36 omitted
|
594
|
-
|
595
|
-
# reduce 37 omitted
|
596
|
-
|
597
|
-
# reduce 38 omitted
|
598
|
-
|
599
|
-
# reduce 39 omitted
|
600
|
-
|
601
|
-
# reduce 40 omitted
|
602
|
-
|
603
|
-
# reduce 41 omitted
|
604
|
-
|
605
|
-
# reduce 42 omitted
|
606
|
-
|
607
|
-
# reduce 43 omitted
|
608
|
-
|
609
|
-
module_eval(<<'.,.,', 'namae.y', 122)
|
610
|
-
def _reduce_44(val, _values, result)
|
611
|
-
result = val.join(' ')
|
612
|
-
result
|
613
|
-
end
|
614
|
-
.,.,
|
615
|
-
|
616
|
-
# reduce 45 omitted
|
617
|
-
|
618
|
-
# reduce 46 omitted
|
619
|
-
|
620
|
-
# reduce 47 omitted
|
621
|
-
|
622
|
-
module_eval(<<'.,.,', 'namae.y', 127)
|
623
|
-
def _reduce_48(val, _values, result)
|
624
|
-
result = val.join(' ')
|
625
|
-
result
|
626
|
-
end
|
627
|
-
.,.,
|
628
|
-
|
629
|
-
def _reduce_none(val, _values, result)
|
630
|
-
val[0]
|
631
|
-
end
|
632
|
-
|
633
|
-
end # class Parser
|
634
|
-
end # module Namae
|