racc 1.4.15-java → 1.4.16-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/COPYING +22 -515
  3. data/Manifest.txt +3 -9
  4. data/README.ja.rdoc +3 -4
  5. data/README.rdoc +4 -4
  6. data/Rakefile +13 -55
  7. data/bin/racc +2 -4
  8. data/ext/racc/{cparse.c → cparse/cparse.c} +64 -31
  9. data/ext/racc/cparse/extconf.rb +8 -0
  10. data/lib/racc/cparse-jruby.jar +0 -0
  11. data/lib/racc/exception.rb +3 -5
  12. data/lib/racc/grammar.rb +5 -7
  13. data/lib/racc/grammarfileparser.rb +4 -3
  14. data/lib/racc/info.rb +4 -6
  15. data/lib/racc/iset.rb +2 -2
  16. data/lib/racc/logfilegenerator.rb +2 -2
  17. data/lib/racc/parser-text.rb +14 -11
  18. data/lib/racc/parser.rb +14 -11
  19. data/lib/racc/parserfilegenerator.rb +5 -7
  20. data/lib/racc/state.rb +11 -13
  21. data/test/assets/intp.y +4 -4
  22. data/test/assets/mailp.y +27 -27
  23. data/test/assets/mof.y +12 -12
  24. data/test/assets/nullbug2.y +2 -2
  25. data/test/assets/recv.y +20 -20
  26. data/test/assets/syntax.y +1 -1
  27. data/test/assets/twowaysql.y +1 -1
  28. data/test/helper.rb +65 -54
  29. data/test/regress/cadenza +60 -60
  30. data/test/regress/cast +8 -8
  31. data/test/regress/csspool +167 -167
  32. data/test/regress/edtf +115 -115
  33. data/test/regress/huia +75 -75
  34. data/test/regress/journey +12 -12
  35. data/test/regress/liquor +54 -54
  36. data/test/regress/machete +37 -37
  37. data/test/regress/mediacloth +83 -83
  38. data/test/regress/mof +60 -60
  39. data/test/regress/namae +29 -29
  40. data/test/regress/nasl +174 -174
  41. data/test/regress/nokogiri-css +59 -59
  42. data/test/regress/opal +352 -352
  43. data/test/regress/php_serialization +20 -20
  44. data/test/regress/riml +261 -261
  45. data/test/regress/ruby18 +353 -353
  46. data/test/regress/ruby22 +433 -433
  47. data/test/regress/tp_plus +125 -125
  48. data/test/regress/twowaysql +30 -30
  49. data/test/test_chk_y.rb +1 -0
  50. data/test/test_racc_command.rb +5 -24
  51. data/test/test_scan_y.rb +1 -0
  52. data/test/testscanner.rb +1 -1
  53. metadata +8 -75
  54. data/ext/racc/depend +0 -1
  55. data/ext/racc/extconf.rb +0 -7
  56. data/test/assets/bibtex.y +0 -141
  57. data/test/assets/rdblockparser.y +0 -576
  58. data/test/assets/rdinlineparser.y +0 -561
  59. data/test/regress/bibtex +0 -474
  60. data/test/regress/rdblockparser +0 -1061
  61. data/test/regress/rdinlineparser +0 -1243
@@ -1,474 +0,0 @@
1
- #
2
- # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.14
4
- # from Racc grammer file "".
5
- #
6
-
7
- require 'racc/parser.rb'
8
-
9
- require 'bibtex/lexer'
10
-
11
- module BibTeX
12
- class Parser < Racc::Parser
13
-
14
- module_eval(<<'...end bibtex.y/module_eval...', 'bibtex.y', 89)
15
-
16
- attr_reader :lexer, :options
17
-
18
- @defaults = {
19
- :include => [:errors],
20
- :allow_missing_keys => false,
21
- :debug => false
22
- }.freeze
23
-
24
- class << self
25
- attr_reader :defaults
26
- end
27
-
28
- def initialize(options = {})
29
- @options = Parser.defaults.merge(options)
30
- @lexer = Lexer.new(@options)
31
- end
32
-
33
- def parse(input)
34
- @yydebug = debug?
35
-
36
- lexer.analyse(input)
37
- do_parse
38
- #yyparse(@lexer,:each)
39
- end
40
-
41
- def next_token
42
- lexer.next_token
43
- end
44
-
45
- def debug?
46
- options[:debug] || ENV['DEBUG']
47
- end
48
-
49
- def allow_missing_keys?
50
- options[:allow_missing_keys]
51
- end
52
-
53
- def missing_key
54
- unless allow_missing_keys?
55
- raise ParseError, "Failed to parse BibTeX entry: cite-key missing"
56
- end
57
- end
58
-
59
- def on_error(tid, val, vstack)
60
- message =
61
- "Failed to parse BibTeX on value #{val.inspect} (#{token_to_str(tid) || '?'}) #{ vstack.inspect}"
62
-
63
- BibTeX.log.error message
64
- raise ParseError, message
65
- end
66
-
67
- # -*- racc -*-
68
- ...end bibtex.y/module_eval...
69
- ##### State transition tables begin ###
70
-
71
- racc_action_table = [
72
- 14, 33, 38, 26, 32, 33, 48, 18, 32, 15,
73
- 34, 42, 16, 37, 34, 33, 33, 29, 32, 32,
74
- 52, 46, 4, 4, 34, 34, 6, 6, 26, 5,
75
- 5, 24, 43, 44, 47, 54, 44, 44, 7, 19,
76
- 20, 21, 22, 27, 29, 36, 39, 41 ]
77
-
78
- racc_action_check = [
79
- 4, 44, 23, 38, 44, 21, 38, 4, 21, 4,
80
- 44, 28, 4, 23, 21, 47, 39, 33, 47, 39,
81
- 39, 35, 0, 2, 47, 39, 0, 2, 17, 0,
82
- 2, 17, 30, 30, 36, 45, 50, 55, 1, 7,
83
- 14, 15, 16, 18, 20, 22, 26, 27 ]
84
-
85
- racc_action_pointer = [
86
- 20, 38, 21, nil, -4, nil, nil, 39, nil, nil,
87
- nil, nil, nil, nil, 32, 33, 34, 17, 35, nil,
88
- 39, -3, 34, -1, nil, nil, 39, 37, -3, nil,
89
- 18, nil, nil, 12, nil, 7, 27, nil, -8, 8,
90
- nil, nil, nil, nil, -7, 21, nil, 7, nil, nil,
91
- 21, nil, nil, nil, nil, 22 ]
92
-
93
- racc_action_default = [
94
- -1, -34, -2, -3, -34, -6, -7, -34, -4, -5,
95
- -8, -9, -10, -11, -34, -34, -34, -34, -34, 56,
96
- -13, -34, -34, -34, -25, -29, -34, -27, -34, -14,
97
- -34, -18, -20, -13, -22, -34, -34, -23, -34, -34,
98
- -26, -28, -12, -15, -34, -34, -16, -34, -24, -30,
99
- -32, -31, -33, -19, -21, -17 ]
100
-
101
- racc_goto_table = [
102
- 30, 25, 28, 3, 11, 8, 12, 13, 35, 53,
103
- 17, 23, 40, 1, 51, 45, 2, 9, 50, 10,
104
- nil, nil, 49, nil, nil, nil, 55 ]
105
-
106
- racc_goto_check = [
107
- 10, 16, 9, 3, 6, 3, 7, 8, 11, 12,
108
- 13, 14, 15, 1, 17, 9, 2, 4, 10, 5,
109
- nil, nil, 16, nil, nil, nil, 10 ]
110
-
111
- racc_goto_pointer = [
112
- nil, 13, 16, 3, 13, 15, 0, 2, 3, -18,
113
- -21, -14, -35, 6, -6, -15, -16, -25 ]
114
-
115
- racc_goto_default = [
116
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
117
- nil, nil, 31, nil, nil, nil, nil, nil ]
118
-
119
- racc_reduce_table = [
120
- 0, 0, :racc_error,
121
- 0, 19, :_reduce_1,
122
- 1, 19, :_reduce_2,
123
- 1, 20, :_reduce_3,
124
- 2, 20, :_reduce_4,
125
- 2, 21, :_reduce_5,
126
- 1, 21, :_reduce_6,
127
- 1, 21, :_reduce_7,
128
- 1, 22, :_reduce_8,
129
- 1, 22, :_reduce_9,
130
- 1, 22, :_reduce_10,
131
- 1, 22, :_reduce_11,
132
- 4, 23, :_reduce_12,
133
- 0, 27, :_reduce_13,
134
- 1, 27, :_reduce_14,
135
- 4, 25, :_reduce_15,
136
- 4, 24, :_reduce_16,
137
- 3, 29, :_reduce_17,
138
- 1, 28, :_reduce_18,
139
- 3, 28, :_reduce_19,
140
- 1, 30, :_reduce_20,
141
- 3, 30, :_reduce_21,
142
- 1, 30, :_reduce_22,
143
- 3, 26, :_reduce_23,
144
- 4, 26, :_reduce_24,
145
- 2, 26, :_reduce_25,
146
- 3, 31, :_reduce_26,
147
- 0, 33, :_reduce_27,
148
- 1, 33, :_reduce_none,
149
- 1, 32, :_reduce_29,
150
- 3, 32, :_reduce_30,
151
- 3, 34, :_reduce_31,
152
- 1, 35, :_reduce_32,
153
- 1, 35, :_reduce_33 ]
154
-
155
- racc_reduce_n = 34
156
-
157
- racc_shift_n = 56
158
-
159
- racc_token_table = {
160
- false => 0,
161
- :error => 1,
162
- :AT => 2,
163
- :COMMA => 3,
164
- :COMMENT => 4,
165
- :CONTENT => 5,
166
- :ERROR => 6,
167
- :EQ => 7,
168
- :LBRACE => 8,
169
- :META_CONTENT => 9,
170
- :KEY => 10,
171
- :NAME => 11,
172
- :NUMBER => 12,
173
- :PREAMBLE => 13,
174
- :RBRACE => 14,
175
- :SHARP => 15,
176
- :STRING => 16,
177
- :STRING_LITERAL => 17 }
178
-
179
- racc_nt_base = 18
180
-
181
- racc_use_result_var = true
182
-
183
- Racc_arg = [
184
- racc_action_table,
185
- racc_action_check,
186
- racc_action_default,
187
- racc_action_pointer,
188
- racc_goto_table,
189
- racc_goto_check,
190
- racc_goto_default,
191
- racc_goto_pointer,
192
- racc_nt_base,
193
- racc_reduce_table,
194
- racc_token_table,
195
- racc_shift_n,
196
- racc_reduce_n,
197
- racc_use_result_var ]
198
-
199
- Racc_token_to_s_table = [
200
- "$end",
201
- "error",
202
- "AT",
203
- "COMMA",
204
- "COMMENT",
205
- "CONTENT",
206
- "ERROR",
207
- "EQ",
208
- "LBRACE",
209
- "META_CONTENT",
210
- "KEY",
211
- "NAME",
212
- "NUMBER",
213
- "PREAMBLE",
214
- "RBRACE",
215
- "SHARP",
216
- "STRING",
217
- "STRING_LITERAL",
218
- "$start",
219
- "bibliography",
220
- "objects",
221
- "object",
222
- "at_object",
223
- "comment",
224
- "string",
225
- "preamble",
226
- "entry",
227
- "content",
228
- "string_value",
229
- "string_assignment",
230
- "string_literal",
231
- "entry_head",
232
- "assignments",
233
- "opt_key",
234
- "assignment",
235
- "value" ]
236
-
237
- Racc_debug_parser = false
238
-
239
- ##### State transition tables end #####
240
-
241
- # reduce 0 omitted
242
-
243
- module_eval(<<'.,.,', 'bibtex.y', 32)
244
- def _reduce_1(val, _values, result)
245
- result = BibTeX::Bibliography.new(@options)
246
- result
247
- end
248
- .,.,
249
-
250
- module_eval(<<'.,.,', 'bibtex.y', 33)
251
- def _reduce_2(val, _values, result)
252
- result = val[0]
253
- result
254
- end
255
- .,.,
256
-
257
- module_eval(<<'.,.,', 'bibtex.y', 35)
258
- def _reduce_3(val, _values, result)
259
- result = BibTeX::Bibliography.new(@options) << val[0]
260
- result
261
- end
262
- .,.,
263
-
264
- module_eval(<<'.,.,', 'bibtex.y', 36)
265
- def _reduce_4(val, _values, result)
266
- result << val[1]
267
- result
268
- end
269
- .,.,
270
-
271
- module_eval(<<'.,.,', 'bibtex.y', 38)
272
- def _reduce_5(val, _values, result)
273
- result = val[1]
274
- result
275
- end
276
- .,.,
277
-
278
- module_eval(<<'.,.,', 'bibtex.y', 39)
279
- def _reduce_6(val, _values, result)
280
- result = BibTeX::MetaContent.new(val[0])
281
- result
282
- end
283
- .,.,
284
-
285
- module_eval(<<'.,.,', 'bibtex.y', 40)
286
- def _reduce_7(val, _values, result)
287
- result = BibTeX::Error.new(val[0])
288
- result
289
- end
290
- .,.,
291
-
292
- module_eval(<<'.,.,', 'bibtex.y', 42)
293
- def _reduce_8(val, _values, result)
294
- result = val[0]
295
- result
296
- end
297
- .,.,
298
-
299
- module_eval(<<'.,.,', 'bibtex.y', 43)
300
- def _reduce_9(val, _values, result)
301
- result = val[0]
302
- result
303
- end
304
- .,.,
305
-
306
- module_eval(<<'.,.,', 'bibtex.y', 44)
307
- def _reduce_10(val, _values, result)
308
- result = val[0]
309
- result
310
- end
311
- .,.,
312
-
313
- module_eval(<<'.,.,', 'bibtex.y', 45)
314
- def _reduce_11(val, _values, result)
315
- result = val[0]
316
- result
317
- end
318
- .,.,
319
-
320
- module_eval(<<'.,.,', 'bibtex.y', 47)
321
- def _reduce_12(val, _values, result)
322
- result = BibTeX::Comment.new(val[2])
323
- result
324
- end
325
- .,.,
326
-
327
- module_eval(<<'.,.,', 'bibtex.y', 49)
328
- def _reduce_13(val, _values, result)
329
- result = ''
330
- result
331
- end
332
- .,.,
333
-
334
- module_eval(<<'.,.,', 'bibtex.y', 50)
335
- def _reduce_14(val, _values, result)
336
- result = val[0]
337
- result
338
- end
339
- .,.,
340
-
341
- module_eval(<<'.,.,', 'bibtex.y', 52)
342
- def _reduce_15(val, _values, result)
343
- result = BibTeX::Preamble.new(val[2])
344
- result
345
- end
346
- .,.,
347
-
348
- module_eval(<<'.,.,', 'bibtex.y', 54)
349
- def _reduce_16(val, _values, result)
350
- result = BibTeX::String.new(val[2][0],val[2][1]);
351
- result
352
- end
353
- .,.,
354
-
355
- module_eval(<<'.,.,', 'bibtex.y', 56)
356
- def _reduce_17(val, _values, result)
357
- result = [val[0].downcase.to_sym, val[2]]
358
- result
359
- end
360
- .,.,
361
-
362
- module_eval(<<'.,.,', 'bibtex.y', 58)
363
- def _reduce_18(val, _values, result)
364
- result = [val[0]]
365
- result
366
- end
367
- .,.,
368
-
369
- module_eval(<<'.,.,', 'bibtex.y', 59)
370
- def _reduce_19(val, _values, result)
371
- result << val[2]
372
- result
373
- end
374
- .,.,
375
-
376
- module_eval(<<'.,.,', 'bibtex.y', 61)
377
- def _reduce_20(val, _values, result)
378
- result = val[0].downcase.to_sym
379
- result
380
- end
381
- .,.,
382
-
383
- module_eval(<<'.,.,', 'bibtex.y', 62)
384
- def _reduce_21(val, _values, result)
385
- result = val[1]
386
- result
387
- end
388
- .,.,
389
-
390
- module_eval(<<'.,.,', 'bibtex.y', 63)
391
- def _reduce_22(val, _values, result)
392
- result = val[0]
393
- result
394
- end
395
- .,.,
396
-
397
- module_eval(<<'.,.,', 'bibtex.y', 65)
398
- def _reduce_23(val, _values, result)
399
- result = val[0] << val[1]
400
- result
401
- end
402
- .,.,
403
-
404
- module_eval(<<'.,.,', 'bibtex.y', 66)
405
- def _reduce_24(val, _values, result)
406
- result = val[0] << val[1]
407
- result
408
- end
409
- .,.,
410
-
411
- module_eval(<<'.,.,', 'bibtex.y', 67)
412
- def _reduce_25(val, _values, result)
413
- result = val[0]
414
- result
415
- end
416
- .,.,
417
-
418
- module_eval(<<'.,.,', 'bibtex.y', 69)
419
- def _reduce_26(val, _values, result)
420
- result = BibTeX::Entry.new(:bibtex_type => val[0].downcase.to_sym, :bibtex_key => val[2])
421
- result
422
- end
423
- .,.,
424
-
425
- module_eval(<<'.,.,', 'bibtex.y', 71)
426
- def _reduce_27(val, _values, result)
427
- missing_key
428
- result
429
- end
430
- .,.,
431
-
432
- # reduce 28 omitted
433
-
434
- module_eval(<<'.,.,', 'bibtex.y', 74)
435
- def _reduce_29(val, _values, result)
436
- result = val[0]
437
- result
438
- end
439
- .,.,
440
-
441
- module_eval(<<'.,.,', 'bibtex.y', 75)
442
- def _reduce_30(val, _values, result)
443
- result.merge!(val[2])
444
- result
445
- end
446
- .,.,
447
-
448
- module_eval(<<'.,.,', 'bibtex.y', 77)
449
- def _reduce_31(val, _values, result)
450
- result = { val[0].downcase.to_sym => val[2] }
451
- result
452
- end
453
- .,.,
454
-
455
- module_eval(<<'.,.,', 'bibtex.y', 79)
456
- def _reduce_32(val, _values, result)
457
- result = val[0]
458
- result
459
- end
460
- .,.,
461
-
462
- module_eval(<<'.,.,', 'bibtex.y', 80)
463
- def _reduce_33(val, _values, result)
464
- result = val[0]
465
- result
466
- end
467
- .,.,
468
-
469
- def _reduce_none(val, _values, result)
470
- val[0]
471
- end
472
-
473
- end # class Parser
474
- end # module BibTeX