racc 1.5.2 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/README.ja.rdoc +0 -1
  3. data/README.rdoc +6 -7
  4. data/{rdoc → doc}/en/NEWS.en.rdoc +0 -0
  5. data/{rdoc → doc}/en/grammar.en.rdoc +27 -31
  6. data/doc/en/grammar2.en.rdoc +219 -0
  7. data/{rdoc → doc}/ja/NEWS.ja.rdoc +0 -0
  8. data/{rdoc → doc}/ja/command.ja.html +0 -0
  9. data/{rdoc → doc}/ja/debug.ja.rdoc +0 -0
  10. data/{rdoc → doc}/ja/grammar.ja.rdoc +0 -0
  11. data/{rdoc → doc}/ja/index.ja.html +0 -0
  12. data/{rdoc → doc}/ja/parser.ja.rdoc +0 -0
  13. data/{rdoc → doc}/ja/usage.ja.html +0 -0
  14. data/ext/racc/cparse/cparse.c +1 -1
  15. data/ext/racc/cparse/extconf.rb +1 -0
  16. data/lib/racc/info.rb +1 -1
  17. data/lib/racc/parser-text.rb +1 -1
  18. data/lib/racc/parser.rb +1 -1
  19. data/lib/racc/parserfilegenerator.rb +0 -44
  20. data/lib/racc/statetransitiontable.rb +2 -8
  21. metadata +15 -121
  22. data/Rakefile +0 -79
  23. data/ext/racc/com/headius/racc/Cparse.java +0 -849
  24. data/lib/racc/pre-setup +0 -13
  25. data/sample/array.y +0 -67
  26. data/sample/array2.y +0 -59
  27. data/sample/calc-ja.y +0 -66
  28. data/sample/calc.y +0 -65
  29. data/sample/conflict.y +0 -15
  30. data/sample/hash.y +0 -60
  31. data/sample/lalr.y +0 -17
  32. data/sample/lists.y +0 -57
  33. data/sample/syntax.y +0 -46
  34. data/sample/yyerr.y +0 -46
  35. data/test/assets/cadenza.y +0 -170
  36. data/test/assets/cast.y +0 -926
  37. data/test/assets/chk.y +0 -126
  38. data/test/assets/conf.y +0 -16
  39. data/test/assets/csspool.y +0 -729
  40. data/test/assets/digraph.y +0 -29
  41. data/test/assets/echk.y +0 -118
  42. data/test/assets/edtf.y +0 -583
  43. data/test/assets/err.y +0 -60
  44. data/test/assets/error_recovery.y +0 -35
  45. data/test/assets/expect.y +0 -7
  46. data/test/assets/firstline.y +0 -4
  47. data/test/assets/huia.y +0 -318
  48. data/test/assets/ichk.y +0 -102
  49. data/test/assets/intp.y +0 -546
  50. data/test/assets/journey.y +0 -47
  51. data/test/assets/liquor.y +0 -313
  52. data/test/assets/machete.y +0 -423
  53. data/test/assets/macruby.y +0 -2197
  54. data/test/assets/mailp.y +0 -437
  55. data/test/assets/mediacloth.y +0 -599
  56. data/test/assets/mof.y +0 -649
  57. data/test/assets/namae.y +0 -302
  58. data/test/assets/nasl.y +0 -626
  59. data/test/assets/newsyn.y +0 -25
  60. data/test/assets/noend.y +0 -4
  61. data/test/assets/nokogiri-css.y +0 -255
  62. data/test/assets/nonass.y +0 -41
  63. data/test/assets/normal.y +0 -27
  64. data/test/assets/norule.y +0 -4
  65. data/test/assets/nullbug1.y +0 -25
  66. data/test/assets/nullbug2.y +0 -15
  67. data/test/assets/opal.y +0 -1807
  68. data/test/assets/opt.y +0 -123
  69. data/test/assets/percent.y +0 -35
  70. data/test/assets/php_serialization.y +0 -98
  71. data/test/assets/recv.y +0 -97
  72. data/test/assets/riml.y +0 -665
  73. data/test/assets/rrconf.y +0 -14
  74. data/test/assets/ruby18.y +0 -1943
  75. data/test/assets/ruby19.y +0 -2174
  76. data/test/assets/ruby20.y +0 -2350
  77. data/test/assets/ruby21.y +0 -2359
  78. data/test/assets/ruby22.y +0 -2381
  79. data/test/assets/scan.y +0 -72
  80. data/test/assets/syntax.y +0 -50
  81. data/test/assets/tp_plus.y +0 -622
  82. data/test/assets/twowaysql.y +0 -278
  83. data/test/assets/unterm.y +0 -5
  84. data/test/assets/useless.y +0 -12
  85. data/test/assets/yyerr.y +0 -46
  86. data/test/bench.y +0 -36
  87. data/test/helper.rb +0 -115
  88. data/test/infini.y +0 -8
  89. data/test/regress/cadenza +0 -796
  90. data/test/regress/cast +0 -3428
  91. data/test/regress/csspool +0 -2314
  92. data/test/regress/edtf +0 -1794
  93. data/test/regress/huia +0 -1392
  94. data/test/regress/journey +0 -222
  95. data/test/regress/liquor +0 -885
  96. data/test/regress/machete +0 -833
  97. data/test/regress/mediacloth +0 -1463
  98. data/test/regress/mof +0 -1368
  99. data/test/regress/namae +0 -634
  100. data/test/regress/nasl +0 -2058
  101. data/test/regress/nokogiri-css +0 -836
  102. data/test/regress/opal +0 -6431
  103. data/test/regress/php_serialization +0 -336
  104. data/test/regress/riml +0 -3283
  105. data/test/regress/ruby18 +0 -6344
  106. data/test/regress/ruby22 +0 -7460
  107. data/test/regress/tp_plus +0 -1933
  108. data/test/regress/twowaysql +0 -556
  109. data/test/scandata/brace +0 -7
  110. data/test/scandata/gvar +0 -1
  111. data/test/scandata/normal +0 -4
  112. data/test/scandata/percent +0 -18
  113. data/test/scandata/slash +0 -10
  114. data/test/src.intp +0 -34
  115. data/test/start.y +0 -20
  116. data/test/test_chk_y.rb +0 -52
  117. data/test/test_grammar_file_parser.rb +0 -15
  118. data/test/test_racc_command.rb +0 -339
  119. data/test/test_scan_y.rb +0 -52
  120. data/test/testscanner.rb +0 -51
  121. data/web/racc.en.rhtml +0 -42
  122. data/web/racc.ja.rhtml +0 -51
@@ -1,336 +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 'php_serialization/tokenizer'
10
-
11
- module PhpSerialization
12
- class Unserializer < Racc::Parser
13
-
14
- module_eval(<<'...end php_serialization.y/module_eval...', 'php_serialization.y', 84)
15
- def initialize(tokenizer_klass = Tokenizer)
16
- @tokenizer_klass = tokenizer_klass
17
- end
18
-
19
- def run(string)
20
- @tokenizer = @tokenizer_klass.new(string)
21
- yyparse(@tokenizer, :each)
22
- return @object
23
- ensure
24
- @tokenizer = nil
25
- end
26
-
27
- def next_token
28
- @tokenizer.next_token
29
- end
30
- ...end php_serialization.y/module_eval...
31
- ##### State transition tables begin ###
32
-
33
- racc_action_table = [
34
- 9, 10, 16, 17, 11, 12, 13, 18, 14, 9,
35
- 10, 15, 19, 11, 12, 13, 20, 14, 21, 46,
36
- 15, 9, 10, 22, 23, 11, 12, 13, 24, 14,
37
- 9, 10, 15, 25, 11, 12, 13, 26, 14, 27,
38
- 51, 15, 28, 29, 30, 31, 32, 33, 34, 35,
39
- 36, 37, 38, 39, 40, 41, 43, 47, 49 ]
40
-
41
- racc_action_check = [
42
- 0, 0, 1, 2, 0, 0, 0, 3, 0, 42,
43
- 42, 0, 4, 42, 42, 42, 5, 42, 6, 42,
44
- 42, 45, 45, 10, 11, 45, 45, 45, 12, 45,
45
- 50, 50, 45, 13, 50, 50, 50, 14, 50, 15,
46
- 50, 50, 16, 22, 23, 24, 25, 26, 27, 32,
47
- 33, 34, 35, 36, 37, 39, 41, 43, 47 ]
48
-
49
- racc_action_pointer = [
50
- -3, 2, 1, 5, 10, 14, 16, nil, nil, nil,
51
- 18, 19, 23, 28, 32, 34, 42, nil, nil, nil,
52
- nil, nil, 37, 38, 39, 40, 41, 42, nil, nil,
53
- nil, nil, 44, 45, 46, 42, 43, 42, nil, 50,
54
- nil, 50, 6, 52, nil, 18, nil, 46, nil, nil,
55
- 27, nil ]
56
-
57
- racc_action_default = [
58
- -18, -18, -18, -18, -18, -18, -18, -6, -7, -8,
59
- -18, -18, -18, -18, -18, -18, -18, -1, -2, -3,
60
- -4, -5, -18, -18, -18, -18, -18, -18, 52, -9,
61
- -10, -11, -18, -18, -18, -18, -18, -18, -12, -18,
62
- -15, -18, -18, -18, -14, -18, -17, -18, -16, -15,
63
- -18, -13 ]
64
-
65
- racc_goto_table = [
66
- 1, 42, nil, nil, nil, nil, nil, nil, nil, nil,
67
- 50, nil, nil, nil, nil, nil, nil, nil, nil, nil,
68
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
69
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
70
- nil, nil, nil, nil, nil, 48 ]
71
-
72
- racc_goto_check = [
73
- 1, 9, nil, nil, nil, nil, nil, nil, nil, nil,
74
- 9, nil, nil, nil, nil, nil, nil, nil, nil, nil,
75
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
76
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
77
- nil, nil, nil, nil, nil, 1 ]
78
-
79
- racc_goto_pointer = [
80
- nil, 0, nil, nil, nil, nil, nil, nil, nil, -39,
81
- nil ]
82
-
83
- racc_goto_default = [
84
- nil, 45, 2, 3, 4, 5, 6, 7, 8, nil,
85
- 44 ]
86
-
87
- racc_reduce_table = [
88
- 0, 0, :racc_error,
89
- 2, 16, :_reduce_1,
90
- 2, 16, :_reduce_2,
91
- 2, 16, :_reduce_3,
92
- 2, 16, :_reduce_4,
93
- 2, 16, :_reduce_5,
94
- 1, 16, :_reduce_6,
95
- 1, 16, :_reduce_7,
96
- 1, 17, :_reduce_8,
97
- 3, 18, :_reduce_9,
98
- 3, 19, :_reduce_10,
99
- 3, 20, :_reduce_11,
100
- 5, 21, :_reduce_12,
101
- 11, 23, :_reduce_13,
102
- 2, 24, :_reduce_14,
103
- 0, 24, :_reduce_15,
104
- 2, 25, :_reduce_16,
105
- 7, 22, :_reduce_17 ]
106
-
107
- racc_reduce_n = 18
108
-
109
- racc_shift_n = 52
110
-
111
- racc_token_table = {
112
- false => 0,
113
- :error => 1,
114
- ";" => 2,
115
- "N" => 3,
116
- "b" => 4,
117
- ":" => 5,
118
- :NUMBER => 6,
119
- "i" => 7,
120
- "d" => 8,
121
- "s" => 9,
122
- :STRING => 10,
123
- "O" => 11,
124
- "{" => 12,
125
- "}" => 13,
126
- "a" => 14 }
127
-
128
- racc_nt_base = 15
129
-
130
- racc_use_result_var = true
131
-
132
- Racc_arg = [
133
- racc_action_table,
134
- racc_action_check,
135
- racc_action_default,
136
- racc_action_pointer,
137
- racc_goto_table,
138
- racc_goto_check,
139
- racc_goto_default,
140
- racc_goto_pointer,
141
- racc_nt_base,
142
- racc_reduce_table,
143
- racc_token_table,
144
- racc_shift_n,
145
- racc_reduce_n,
146
- racc_use_result_var ]
147
-
148
- Racc_token_to_s_table = [
149
- "$end",
150
- "error",
151
- "\";\"",
152
- "\"N\"",
153
- "\"b\"",
154
- "\":\"",
155
- "NUMBER",
156
- "\"i\"",
157
- "\"d\"",
158
- "\"s\"",
159
- "STRING",
160
- "\"O\"",
161
- "\"{\"",
162
- "\"}\"",
163
- "\"a\"",
164
- "$start",
165
- "data",
166
- "null",
167
- "bool",
168
- "integer",
169
- "double",
170
- "string",
171
- "assoc_array",
172
- "object",
173
- "attribute_list",
174
- "attribute" ]
175
-
176
- Racc_debug_parser = false
177
-
178
- ##### State transition tables end #####
179
-
180
- # reduce 0 omitted
181
-
182
- module_eval(<<'.,.,', 'php_serialization.y', 6)
183
- def _reduce_1(val, _values, result)
184
- @object = val[0]
185
- result
186
- end
187
- .,.,
188
-
189
- module_eval(<<'.,.,', 'php_serialization.y', 7)
190
- def _reduce_2(val, _values, result)
191
- @object = val[0]
192
- result
193
- end
194
- .,.,
195
-
196
- module_eval(<<'.,.,', 'php_serialization.y', 8)
197
- def _reduce_3(val, _values, result)
198
- @object = val[0]
199
- result
200
- end
201
- .,.,
202
-
203
- module_eval(<<'.,.,', 'php_serialization.y', 9)
204
- def _reduce_4(val, _values, result)
205
- @object = val[0]
206
- result
207
- end
208
- .,.,
209
-
210
- module_eval(<<'.,.,', 'php_serialization.y', 10)
211
- def _reduce_5(val, _values, result)
212
- @object = val[0]
213
- result
214
- end
215
- .,.,
216
-
217
- module_eval(<<'.,.,', 'php_serialization.y', 11)
218
- def _reduce_6(val, _values, result)
219
- @object = val[0]
220
- result
221
- end
222
- .,.,
223
-
224
- module_eval(<<'.,.,', 'php_serialization.y', 12)
225
- def _reduce_7(val, _values, result)
226
- @object = val[0]
227
- result
228
- end
229
- .,.,
230
-
231
- module_eval(<<'.,.,', 'php_serialization.y', 15)
232
- def _reduce_8(val, _values, result)
233
- result = nil
234
- result
235
- end
236
- .,.,
237
-
238
- module_eval(<<'.,.,', 'php_serialization.y', 18)
239
- def _reduce_9(val, _values, result)
240
- result = Integer(val[2]) > 0
241
- result
242
- end
243
- .,.,
244
-
245
- module_eval(<<'.,.,', 'php_serialization.y', 21)
246
- def _reduce_10(val, _values, result)
247
- result = Integer(val[2])
248
- result
249
- end
250
- .,.,
251
-
252
- module_eval(<<'.,.,', 'php_serialization.y', 24)
253
- def _reduce_11(val, _values, result)
254
- result = Float(val[2])
255
- result
256
- end
257
- .,.,
258
-
259
- module_eval(<<'.,.,', 'php_serialization.y', 27)
260
- def _reduce_12(val, _values, result)
261
- result = val[4]
262
- result
263
- end
264
- .,.,
265
-
266
- module_eval(<<'.,.,', 'php_serialization.y', 32)
267
- def _reduce_13(val, _values, result)
268
- if eval("defined?(#{val[4]})")
269
- result = Object.const_get(val[4]).new
270
-
271
- val[9].each do |(attr_name, value)|
272
- # Protected and private attributes will have a \0..\0 prefix
273
- attr_name = attr_name.gsub(/\A\\0[^\\]+\\0/, '')
274
- result.instance_variable_set("@#{attr_name}", value)
275
- end
276
- else
277
- klass_name = val[4].gsub(/^Struct::/, '')
278
- attr_names, values = [], []
279
-
280
- val[9].each do |(attr_name, value)|
281
- # Protected and private attributes will have a \0..\0 prefix
282
- attr_names << attr_name.gsub(/\A\\0[^\\]+\\0/, '')
283
- values << value
284
- end
285
-
286
- result = Struct.new(klass_name, *attr_names).new(*values)
287
- result.instance_variable_set("@_php_class", klass_name)
288
- end
289
-
290
- result
291
- end
292
- .,.,
293
-
294
- module_eval(<<'.,.,', 'php_serialization.y', 56)
295
- def _reduce_14(val, _values, result)
296
- result = val[0] << val[1]
297
- result
298
- end
299
- .,.,
300
-
301
- module_eval(<<'.,.,', 'php_serialization.y', 57)
302
- def _reduce_15(val, _values, result)
303
- result = []
304
- result
305
- end
306
- .,.,
307
-
308
- module_eval(<<'.,.,', 'php_serialization.y', 60)
309
- def _reduce_16(val, _values, result)
310
- result = val
311
- result
312
- end
313
- .,.,
314
-
315
- module_eval(<<'.,.,', 'php_serialization.y', 65)
316
- def _reduce_17(val, _values, result)
317
- # Checks if the keys are a sequence of integers
318
- idx = -1
319
- arr = val[5].all? { |(k,v)| k == (idx += 1) }
320
-
321
- if arr
322
- result = val[5].map { |(k,v)| v }
323
- else
324
- result = Hash[val[5]]
325
- end
326
-
327
- result
328
- end
329
- .,.,
330
-
331
- def _reduce_none(val, _values, result)
332
- val[0]
333
- end
334
-
335
- end # class Unserializer
336
- end # module PhpSerialization