racc 1.4.14 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +22 -515
  3. data/README.ja.rdoc +3 -4
  4. data/README.rdoc +6 -8
  5. data/Rakefile +32 -53
  6. data/bin/racc +39 -27
  7. data/ext/racc/com/headius/racc/Cparse.java +66 -23
  8. data/ext/racc/{cparse.c → cparse/cparse.c} +82 -47
  9. data/ext/racc/{extconf.rb → cparse/extconf.rb} +2 -1
  10. data/lib/racc/compat.rb +5 -4
  11. data/lib/racc/debugflags.rb +5 -4
  12. data/lib/racc/exception.rb +5 -4
  13. data/lib/racc/grammar.rb +25 -22
  14. data/lib/racc/grammarfileparser.rb +10 -8
  15. data/lib/racc/info.rb +6 -5
  16. data/lib/racc/iset.rb +6 -5
  17. data/lib/racc/logfilegenerator.rb +6 -5
  18. data/lib/racc/parser-text.rb +20 -23
  19. data/lib/racc/parser.rb +20 -23
  20. data/lib/racc/parserfilegenerator.rb +10 -10
  21. data/lib/racc/sourcetext.rb +5 -4
  22. data/lib/racc/state.rb +13 -12
  23. data/lib/racc/statetransitiontable.rb +7 -6
  24. data/rdoc/ja/command.ja.html +1 -1
  25. data/sample/array.y +1 -1
  26. data/sample/array2.y +1 -1
  27. data/sample/calc-ja.y +2 -2
  28. data/sample/calc.y +2 -2
  29. data/sample/conflict.y +1 -1
  30. data/sample/hash.y +1 -1
  31. data/sample/lalr.y +1 -1
  32. data/sample/lists.y +1 -1
  33. data/sample/syntax.y +1 -1
  34. data/sample/yyerr.y +1 -1
  35. data/test/assets/cadenza.y +170 -0
  36. data/test/assets/cast.y +926 -0
  37. data/test/assets/csspool.y +729 -0
  38. data/test/assets/edtf.y +583 -0
  39. data/test/assets/huia.y +318 -0
  40. data/test/assets/intp.y +4 -4
  41. data/test/assets/journey.y +47 -0
  42. data/test/assets/liquor.y +313 -0
  43. data/test/assets/machete.y +423 -0
  44. data/test/assets/macruby.y +2197 -0
  45. data/test/assets/mailp.y +27 -27
  46. data/test/assets/mediacloth.y +599 -0
  47. data/test/assets/mof.y +649 -0
  48. data/test/assets/namae.y +302 -0
  49. data/test/assets/nasl.y +626 -0
  50. data/test/assets/nokogiri-css.y +255 -0
  51. data/test/assets/nullbug2.y +2 -2
  52. data/test/assets/opal.y +1807 -0
  53. data/test/assets/php_serialization.y +98 -0
  54. data/test/assets/recv.y +20 -20
  55. data/test/assets/riml.y +665 -0
  56. data/test/assets/ruby18.y +1943 -0
  57. data/test/assets/ruby19.y +2174 -0
  58. data/test/assets/ruby20.y +2350 -0
  59. data/test/assets/ruby21.y +2359 -0
  60. data/test/assets/ruby22.y +2381 -0
  61. data/test/assets/syntax.y +1 -1
  62. data/test/assets/tp_plus.y +622 -0
  63. data/test/assets/twowaysql.y +278 -0
  64. data/test/helper.rb +68 -41
  65. data/test/regress/cadenza +796 -0
  66. data/test/regress/cast +3428 -0
  67. data/test/regress/csspool +2314 -0
  68. data/test/regress/edtf +1794 -0
  69. data/test/regress/huia +1392 -0
  70. data/test/regress/journey +222 -0
  71. data/test/regress/liquor +885 -0
  72. data/test/regress/machete +833 -0
  73. data/test/regress/mediacloth +1463 -0
  74. data/test/regress/mof +1368 -0
  75. data/test/regress/namae +634 -0
  76. data/test/regress/nasl +2058 -0
  77. data/test/regress/nokogiri-css +836 -0
  78. data/test/regress/opal +6431 -0
  79. data/test/regress/php_serialization +336 -0
  80. data/test/regress/riml +3283 -0
  81. data/test/regress/ruby18 +6344 -0
  82. data/test/regress/ruby22 +7460 -0
  83. data/test/regress/tp_plus +1933 -0
  84. data/test/regress/twowaysql +556 -0
  85. data/test/test_chk_y.rb +1 -0
  86. data/test/test_racc_command.rb +177 -2
  87. data/test/test_scan_y.rb +1 -0
  88. data/test/testscanner.rb +1 -1
  89. metadata +59 -83
  90. data/DEPENDS +0 -4
  91. data/Manifest.txt +0 -102
  92. data/bin/racc2y +0 -195
  93. data/bin/y2racc +0 -339
  94. data/ext/racc/depend +0 -1
  95. data/fastcache/extconf.rb +0 -2
  96. data/fastcache/fastcache.c +0 -185
  97. data/misc/dist.sh +0 -31
  98. data/setup.rb +0 -1587
  99. data/tasks/doc.rb +0 -12
  100. data/tasks/email.rb +0 -55
@@ -3,6 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
3
3
  module Racc
4
4
  class TestChkY < TestCase
5
5
  def setup
6
+ super
6
7
  file = File.join(ASSET_DIR, 'chk.y')
7
8
  @debug_flags = Racc::DebugFlags.parse_option_string('o')
8
9
  parser = Racc::GrammarFileParser.new(@debug_flags)
@@ -141,13 +141,13 @@ module Racc
141
141
  end
142
142
 
143
143
  def test_norule_y
144
- assert_raises(MiniTest::Assertion) {
144
+ assert_raise(Test::Unit::AssertionFailedError) {
145
145
  assert_compile 'norule.y'
146
146
  }
147
147
  end
148
148
 
149
149
  def test_unterm_y
150
- assert_raises(MiniTest::Assertion) {
150
+ assert_raise(Test::Unit::AssertionFailedError) {
151
151
  assert_compile 'unterm.y'
152
152
  }
153
153
  end
@@ -160,5 +160,180 @@ module Racc
160
160
  assert_exec 'error_recovery.y'
161
161
  end
162
162
  end
163
+
164
+ # .y files from `parser` gem
165
+
166
+ def test_ruby18
167
+ assert_compile 'ruby18.y', [], timeout: 60
168
+ assert_debugfile 'ruby18.y', []
169
+ assert_output_unchanged 'ruby18.y'
170
+ end
171
+
172
+ def test_ruby22
173
+ assert_compile 'ruby22.y', [], timeout: 60
174
+ assert_debugfile 'ruby22.y', []
175
+ assert_output_unchanged 'ruby22.y'
176
+ end
177
+
178
+ # .y file from csspool gem
179
+
180
+ def test_csspool
181
+ assert_compile 'csspool.y'
182
+ assert_debugfile 'csspool.y', [5, 3]
183
+ assert_output_unchanged 'csspool.y'
184
+ end
185
+
186
+ # .y file from opal gem
187
+
188
+ def test_opal
189
+ assert_compile 'opal.y', [], timeout: 60
190
+ assert_debugfile 'opal.y', []
191
+ assert_output_unchanged 'opal.y'
192
+ end
193
+
194
+ # .y file from journey gem
195
+
196
+ def test_journey
197
+ assert_compile 'journey.y'
198
+ assert_debugfile 'journey.y', []
199
+ assert_output_unchanged 'journey.y'
200
+ end
201
+
202
+ # .y file from nokogiri gem
203
+
204
+ def test_nokogiri_css
205
+ assert_compile 'nokogiri-css.y'
206
+ assert_debugfile 'nokogiri-css.y', [0, 1]
207
+ assert_output_unchanged 'nokogiri-css.y'
208
+ end
209
+
210
+ # .y file from edtf-ruby gem
211
+
212
+ def test_edtf
213
+ assert_compile 'edtf.y'
214
+ assert_debugfile 'edtf.y', [0, 0, 0, 0, 0]
215
+ assert_output_unchanged 'edtf.y'
216
+ end
217
+
218
+ # .y file from namae gem
219
+
220
+ def test_namae
221
+ assert_compile 'namae.y'
222
+ assert_debugfile 'namae.y', [0, 0, 0, 0, 0]
223
+ assert_output_unchanged 'namae.y'
224
+ end
225
+
226
+ # .y file from liquor gem
227
+
228
+ def test_liquor
229
+ assert_compile 'liquor.y'
230
+ assert_debugfile 'liquor.y', [0, 0, 0, 0, 15]
231
+ assert_output_unchanged 'liquor.y'
232
+ end
233
+
234
+ # .y file from nasl gem
235
+
236
+ def test_nasl
237
+ assert_compile 'nasl.y'
238
+ assert_debugfile 'nasl.y', [0, 0, 0, 0, 1]
239
+ assert_output_unchanged 'nasl.y'
240
+ end
241
+
242
+ # .y file from riml gem
243
+
244
+ def test_riml
245
+ assert_compile 'riml.y'
246
+ assert_debugfile 'riml.y', [289, 0, 0, 0]
247
+ assert_output_unchanged 'riml.y'
248
+ end
249
+
250
+ # .y file from ruby-php-serialization gem
251
+
252
+ def test_php_serialization
253
+ assert_compile 'php_serialization.y'
254
+ assert_debugfile 'php_serialization.y', [0, 0, 0, 0]
255
+ assert_output_unchanged 'php_serialization.y'
256
+ end
257
+
258
+ # .y file from huia language implementation
259
+
260
+ def test_huia
261
+ assert_compile 'huia.y'
262
+ assert_debugfile 'huia.y', [285, 0, 0, 0]
263
+ assert_output_unchanged 'huia.y'
264
+ end
265
+
266
+ # .y file from cast gem
267
+
268
+ def test_cast
269
+ assert_compile 'cast.y'
270
+ assert_debugfile 'cast.y', [0, 0, 0, 0, 1]
271
+ assert_output_unchanged 'cast.y'
272
+ end
273
+
274
+ # .y file from cadenza gem
275
+
276
+ def test_cadenza
277
+ assert_compile 'cadenza.y'
278
+ assert_debugfile 'cadenza.y', [0, 0, 0, 0, 37]
279
+ assert_output_unchanged 'cadenza.y'
280
+ end
281
+
282
+ # .y file from mediacloth gem
283
+
284
+ def test_mediacloth
285
+ assert_compile 'mediacloth.y'
286
+ assert_debugfile 'mediacloth.y', [0, 0, 0, 0]
287
+ assert_output_unchanged 'mediacloth.y'
288
+ end
289
+
290
+ # .y file from twowaysql gem
291
+
292
+ def test_twowaysql
293
+ assert_compile 'twowaysql.y'
294
+ assert_debugfile 'twowaysql.y', [4, 0, 0, 0]
295
+ assert_output_unchanged 'twowaysql.y'
296
+ end
297
+
298
+ # .y file from machete gem
299
+
300
+ def test_machete
301
+ assert_compile 'machete.y'
302
+ assert_debugfile 'machete.y', [0, 0, 0, 0]
303
+ assert_output_unchanged 'machete.y'
304
+ end
305
+
306
+ # .y file from mof gem
307
+
308
+ def test_mof
309
+ assert_compile 'mof.y'
310
+ assert_debugfile 'mof.y', [7, 4, 0, 0]
311
+ assert_output_unchanged 'mof.y'
312
+ end
313
+
314
+ # .y file from tp_plus gem
315
+
316
+ def test_tp_plus
317
+ assert_compile 'tp_plus.y'
318
+ assert_debugfile 'tp_plus.y', [21, 0, 0, 0]
319
+ assert_output_unchanged 'tp_plus.y'
320
+ end
321
+
322
+ def test_ifelse
323
+ omit if RUBY_PLATFORM =~ /java/
324
+
325
+ stderr = nil
326
+ racc "-o#{@TAB_DIR}/ifelse", "#{ASSET_DIR}/ifelse.y", stdout_filter: ->(s) { stderr = s }
327
+ stderr = stderr.lines[1..-1].join if RUBY_PLATFORM.match?(/java/)
328
+ assert_equal(<<~STDERR, stderr)
329
+ 1 useless nonterminals:
330
+ dummy
331
+ 2 useless rules:
332
+ #4 (dummy)
333
+ #5 (dummy)
334
+ 1 shift/reduce conflicts
335
+ Turn on logging with "-v" and check ".output" file for details
336
+ STDERR
337
+ end
163
338
  end
164
339
  end
@@ -3,6 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
3
3
  module Racc
4
4
  class TestScanY < TestCase
5
5
  def setup
6
+ super
6
7
  file = File.join(ASSET_DIR, 'scan.y')
7
8
  @debug_flags = Racc::DebugFlags.parse_option_string('o')
8
9
  parser = Racc::GrammarFileParser.new(@debug_flags)
@@ -30,7 +30,7 @@ testdata( File.dirname($0) + '/scandata', ARGV ).each do |file|
30
30
  begin
31
31
  ok = File.read(file)
32
32
  s = Racc::GrammarFileScanner.new( ok )
33
- sym, (val, lineno) = s.scan
33
+ sym, (val, _lineno) = s.scan
34
34
  if printonly then
35
35
  $stderr.puts
36
36
  $stderr.puts val
metadata CHANGED
@@ -1,72 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.14
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
+ - Minero Aoki
7
8
  - Aaron Patterson
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rdoc
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '4.0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake-compiler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.4.1
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 0.4.1
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '4.7'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '4.7'
55
- - !ruby/object:Gem::Dependency
56
- name: hoe
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.14'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.14'
69
- description: |-
12
+ date: 2020-12-26 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: |
70
15
  Racc is a LALR(1) parser generator.
71
16
  It is written in Ruby itself, and generates Ruby program.
72
17
 
@@ -74,15 +19,13 @@ description: |-
74
19
  can run your parsers generated by racc 1.4.x out of the
75
20
  box.
76
21
  email:
22
+ -
77
23
  - aaron@tenderlovemaking.com
78
24
  executables:
79
25
  - racc
80
- - racc2y
81
- - y2racc
82
26
  extensions:
83
- - ext/racc/extconf.rb
27
+ - ext/racc/cparse/extconf.rb
84
28
  extra_rdoc_files:
85
- - Manifest.txt
86
29
  - README.ja.rdoc
87
30
  - README.rdoc
88
31
  - rdoc/en/NEWS.en.rdoc
@@ -94,22 +37,15 @@ extra_rdoc_files:
94
37
  files:
95
38
  - COPYING
96
39
  - ChangeLog
97
- - DEPENDS
98
- - Manifest.txt
99
40
  - README.ja.rdoc
100
41
  - README.rdoc
101
42
  - Rakefile
102
43
  - TODO
103
44
  - bin/racc
104
- - bin/racc2y
105
- - bin/y2racc
106
45
  - ext/racc/MANIFEST
107
46
  - ext/racc/com/headius/racc/Cparse.java
108
- - ext/racc/cparse.c
109
- - ext/racc/depend
110
- - ext/racc/extconf.rb
111
- - fastcache/extconf.rb
112
- - fastcache/fastcache.c
47
+ - ext/racc/cparse/cparse.c
48
+ - ext/racc/cparse/extconf.rb
113
49
  - lib/racc.rb
114
50
  - lib/racc/compat.rb
115
51
  - lib/racc/debugflags.rb
@@ -127,7 +63,6 @@ files:
127
63
  - lib/racc/state.rb
128
64
  - lib/racc/statetransitiontable.rb
129
65
  - lib/racc/static.rb
130
- - misc/dist.sh
131
66
  - rdoc/en/NEWS.en.rdoc
132
67
  - rdoc/en/grammar.en.rdoc
133
68
  - rdoc/ja/NEWS.ja.rdoc
@@ -147,39 +82,80 @@ files:
147
82
  - sample/lists.y
148
83
  - sample/syntax.y
149
84
  - sample/yyerr.y
150
- - setup.rb
151
- - tasks/doc.rb
152
- - tasks/email.rb
85
+ - test/assets/cadenza.y
86
+ - test/assets/cast.y
153
87
  - test/assets/chk.y
154
88
  - test/assets/conf.y
89
+ - test/assets/csspool.y
155
90
  - test/assets/digraph.y
156
91
  - test/assets/echk.y
92
+ - test/assets/edtf.y
157
93
  - test/assets/err.y
158
94
  - test/assets/error_recovery.y
159
95
  - test/assets/expect.y
160
96
  - test/assets/firstline.y
97
+ - test/assets/huia.y
161
98
  - test/assets/ichk.y
162
99
  - test/assets/intp.y
100
+ - test/assets/journey.y
101
+ - test/assets/liquor.y
102
+ - test/assets/machete.y
103
+ - test/assets/macruby.y
163
104
  - test/assets/mailp.y
105
+ - test/assets/mediacloth.y
106
+ - test/assets/mof.y
107
+ - test/assets/namae.y
108
+ - test/assets/nasl.y
164
109
  - test/assets/newsyn.y
165
110
  - test/assets/noend.y
111
+ - test/assets/nokogiri-css.y
166
112
  - test/assets/nonass.y
167
113
  - test/assets/normal.y
168
114
  - test/assets/norule.y
169
115
  - test/assets/nullbug1.y
170
116
  - test/assets/nullbug2.y
117
+ - test/assets/opal.y
171
118
  - test/assets/opt.y
172
119
  - test/assets/percent.y
120
+ - test/assets/php_serialization.y
173
121
  - test/assets/recv.y
122
+ - test/assets/riml.y
174
123
  - test/assets/rrconf.y
124
+ - test/assets/ruby18.y
125
+ - test/assets/ruby19.y
126
+ - test/assets/ruby20.y
127
+ - test/assets/ruby21.y
128
+ - test/assets/ruby22.y
175
129
  - test/assets/scan.y
176
130
  - test/assets/syntax.y
131
+ - test/assets/tp_plus.y
132
+ - test/assets/twowaysql.y
177
133
  - test/assets/unterm.y
178
134
  - test/assets/useless.y
179
135
  - test/assets/yyerr.y
180
136
  - test/bench.y
181
137
  - test/helper.rb
182
138
  - test/infini.y
139
+ - test/regress/cadenza
140
+ - test/regress/cast
141
+ - test/regress/csspool
142
+ - test/regress/edtf
143
+ - test/regress/huia
144
+ - test/regress/journey
145
+ - test/regress/liquor
146
+ - test/regress/machete
147
+ - test/regress/mediacloth
148
+ - test/regress/mof
149
+ - test/regress/namae
150
+ - test/regress/nasl
151
+ - test/regress/nokogiri-css
152
+ - test/regress/opal
153
+ - test/regress/php_serialization
154
+ - test/regress/riml
155
+ - test/regress/ruby18
156
+ - test/regress/ruby22
157
+ - test/regress/tp_plus
158
+ - test/regress/twowaysql
183
159
  - test/scandata/brace
184
160
  - test/scandata/gvar
185
161
  - test/scandata/normal
@@ -196,9 +172,10 @@ files:
196
172
  - web/racc.ja.rhtml
197
173
  homepage: http://i.loveruby.net/en/projects/racc/
198
174
  licenses:
199
- - MIT
175
+ - Ruby
176
+ - BSD-2-Clause
200
177
  metadata: {}
201
- post_install_message:
178
+ post_install_message:
202
179
  rdoc_options:
203
180
  - "--main"
204
181
  - README.rdoc
@@ -215,9 +192,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
192
  - !ruby/object:Gem::Version
216
193
  version: '0'
217
194
  requirements: []
218
- rubyforge_project:
219
- rubygems_version: 2.5.0
220
- signing_key:
195
+ rubygems_version: 3.2.3
196
+ signing_key:
221
197
  specification_version: 4
222
198
  summary: Racc is a LALR(1) parser generator
223
199
  test_files: []