racc 1.4.14-java → 1.5.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) 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/cparse-jruby.jar +0 -0
  12. data/lib/racc/debugflags.rb +5 -4
  13. data/lib/racc/exception.rb +5 -4
  14. data/lib/racc/grammar.rb +25 -22
  15. data/lib/racc/grammarfileparser.rb +10 -8
  16. data/lib/racc/info.rb +6 -5
  17. data/lib/racc/iset.rb +6 -5
  18. data/lib/racc/logfilegenerator.rb +6 -5
  19. data/lib/racc/parser-text.rb +20 -23
  20. data/lib/racc/parser.rb +20 -23
  21. data/lib/racc/parserfilegenerator.rb +10 -10
  22. data/lib/racc/sourcetext.rb +5 -4
  23. data/lib/racc/state.rb +13 -12
  24. data/lib/racc/statetransitiontable.rb +7 -6
  25. data/rdoc/ja/command.ja.html +1 -1
  26. data/sample/array.y +1 -1
  27. data/sample/array2.y +1 -1
  28. data/sample/calc-ja.y +2 -2
  29. data/sample/calc.y +2 -2
  30. data/sample/conflict.y +1 -1
  31. data/sample/hash.y +1 -1
  32. data/sample/lalr.y +1 -1
  33. data/sample/lists.y +1 -1
  34. data/sample/syntax.y +1 -1
  35. data/sample/yyerr.y +1 -1
  36. data/test/assets/cadenza.y +170 -0
  37. data/test/assets/cast.y +926 -0
  38. data/test/assets/csspool.y +729 -0
  39. data/test/assets/edtf.y +583 -0
  40. data/test/assets/huia.y +318 -0
  41. data/test/assets/intp.y +4 -4
  42. data/test/assets/journey.y +47 -0
  43. data/test/assets/liquor.y +313 -0
  44. data/test/assets/machete.y +423 -0
  45. data/test/assets/macruby.y +2197 -0
  46. data/test/assets/mailp.y +27 -27
  47. data/test/assets/mediacloth.y +599 -0
  48. data/test/assets/mof.y +649 -0
  49. data/test/assets/namae.y +302 -0
  50. data/test/assets/nasl.y +626 -0
  51. data/test/assets/nokogiri-css.y +255 -0
  52. data/test/assets/nullbug2.y +2 -2
  53. data/test/assets/opal.y +1807 -0
  54. data/test/assets/php_serialization.y +98 -0
  55. data/test/assets/recv.y +20 -20
  56. data/test/assets/riml.y +665 -0
  57. data/test/assets/ruby18.y +1943 -0
  58. data/test/assets/ruby19.y +2174 -0
  59. data/test/assets/ruby20.y +2350 -0
  60. data/test/assets/ruby21.y +2359 -0
  61. data/test/assets/ruby22.y +2381 -0
  62. data/test/assets/syntax.y +1 -1
  63. data/test/assets/tp_plus.y +622 -0
  64. data/test/assets/twowaysql.y +278 -0
  65. data/test/helper.rb +68 -41
  66. data/test/regress/cadenza +796 -0
  67. data/test/regress/cast +3428 -0
  68. data/test/regress/csspool +2314 -0
  69. data/test/regress/edtf +1794 -0
  70. data/test/regress/huia +1392 -0
  71. data/test/regress/journey +222 -0
  72. data/test/regress/liquor +885 -0
  73. data/test/regress/machete +833 -0
  74. data/test/regress/mediacloth +1463 -0
  75. data/test/regress/mof +1368 -0
  76. data/test/regress/namae +634 -0
  77. data/test/regress/nasl +2058 -0
  78. data/test/regress/nokogiri-css +836 -0
  79. data/test/regress/opal +6431 -0
  80. data/test/regress/php_serialization +336 -0
  81. data/test/regress/riml +3283 -0
  82. data/test/regress/ruby18 +6344 -0
  83. data/test/regress/ruby22 +7460 -0
  84. data/test/regress/tp_plus +1933 -0
  85. data/test/regress/twowaysql +556 -0
  86. data/test/test_chk_y.rb +1 -0
  87. data/test/test_racc_command.rb +177 -2
  88. data/test/test_scan_y.rb +1 -0
  89. data/test/testscanner.rb +1 -1
  90. metadata +55 -80
  91. data/.gemtest +0 -0
  92. data/DEPENDS +0 -4
  93. data/Manifest.txt +0 -102
  94. data/bin/racc2y +0 -195
  95. data/bin/y2racc +0 -339
  96. data/ext/racc/depend +0 -1
  97. data/fastcache/extconf.rb +0 -2
  98. data/fastcache/fastcache.c +0 -185
  99. data/misc/dist.sh +0 -31
  100. data/setup.rb +0 -1587
  101. data/tasks/doc.rb +0 -12
  102. 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: java
6
6
  authors:
7
+ - Minero Aoki
7
8
  - Aaron Patterson
8
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
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.0'
20
- requirement: !ruby/object:Gem::Requirement
21
- requirements:
22
- - - "~>"
23
- - !ruby/object:Gem::Version
24
- version: '4.0'
25
- prerelease: false
26
- type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rake-compiler
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.4.1
34
- requirement: !ruby/object:Gem::Requirement
35
- requirements:
36
- - - ">="
37
- - !ruby/object:Gem::Version
38
- version: 0.4.1
39
- prerelease: false
40
- type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- version_requirements: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '4.7'
48
- requirement: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - "~>"
51
- - !ruby/object:Gem::Version
52
- version: '4.7'
53
- prerelease: false
54
- type: :development
55
- - !ruby/object:Gem::Dependency
56
- name: hoe
57
- version_requirements: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.13'
62
- requirement: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '3.13'
67
- prerelease: false
68
- type: :development
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,14 +19,12 @@ 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
27
  extra_rdoc_files:
84
- - Manifest.txt
85
28
  - README.ja.rdoc
86
29
  - README.rdoc
87
30
  - rdoc/en/NEWS.en.rdoc
@@ -91,25 +34,17 @@ extra_rdoc_files:
91
34
  - rdoc/ja/grammar.ja.rdoc
92
35
  - rdoc/ja/parser.ja.rdoc
93
36
  files:
94
- - ".gemtest"
95
37
  - COPYING
96
38
  - ChangeLog
97
- - DEPENDS
98
- - Manifest.txt
99
39
  - README.ja.rdoc
100
40
  - README.rdoc
101
41
  - Rakefile
102
42
  - TODO
103
43
  - bin/racc
104
- - bin/racc2y
105
- - bin/y2racc
106
44
  - ext/racc/MANIFEST
107
45
  - 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
46
+ - ext/racc/cparse/cparse.c
47
+ - ext/racc/cparse/extconf.rb
113
48
  - lib/racc.rb
114
49
  - lib/racc/compat.rb
115
50
  - lib/racc/cparse-jruby.jar
@@ -128,7 +63,6 @@ files:
128
63
  - lib/racc/state.rb
129
64
  - lib/racc/statetransitiontable.rb
130
65
  - lib/racc/static.rb
131
- - misc/dist.sh
132
66
  - rdoc/en/NEWS.en.rdoc
133
67
  - rdoc/en/grammar.en.rdoc
134
68
  - rdoc/ja/NEWS.ja.rdoc
@@ -148,39 +82,80 @@ files:
148
82
  - sample/lists.y
149
83
  - sample/syntax.y
150
84
  - sample/yyerr.y
151
- - setup.rb
152
- - tasks/doc.rb
153
- - tasks/email.rb
85
+ - test/assets/cadenza.y
86
+ - test/assets/cast.y
154
87
  - test/assets/chk.y
155
88
  - test/assets/conf.y
89
+ - test/assets/csspool.y
156
90
  - test/assets/digraph.y
157
91
  - test/assets/echk.y
92
+ - test/assets/edtf.y
158
93
  - test/assets/err.y
159
94
  - test/assets/error_recovery.y
160
95
  - test/assets/expect.y
161
96
  - test/assets/firstline.y
97
+ - test/assets/huia.y
162
98
  - test/assets/ichk.y
163
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
164
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
165
109
  - test/assets/newsyn.y
166
110
  - test/assets/noend.y
111
+ - test/assets/nokogiri-css.y
167
112
  - test/assets/nonass.y
168
113
  - test/assets/normal.y
169
114
  - test/assets/norule.y
170
115
  - test/assets/nullbug1.y
171
116
  - test/assets/nullbug2.y
117
+ - test/assets/opal.y
172
118
  - test/assets/opt.y
173
119
  - test/assets/percent.y
120
+ - test/assets/php_serialization.y
174
121
  - test/assets/recv.y
122
+ - test/assets/riml.y
175
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
176
129
  - test/assets/scan.y
177
130
  - test/assets/syntax.y
131
+ - test/assets/tp_plus.y
132
+ - test/assets/twowaysql.y
178
133
  - test/assets/unterm.y
179
134
  - test/assets/useless.y
180
135
  - test/assets/yyerr.y
181
136
  - test/bench.y
182
137
  - test/helper.rb
183
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
184
159
  - test/scandata/brace
185
160
  - test/scandata/gvar
186
161
  - test/scandata/normal
@@ -197,7 +172,8 @@ files:
197
172
  - web/racc.ja.rhtml
198
173
  homepage: http://i.loveruby.net/en/projects/racc/
199
174
  licenses:
200
- - MIT
175
+ - Ruby
176
+ - BSD-2-Clause
201
177
  metadata: {}
202
178
  post_install_message:
203
179
  rdoc_options:
@@ -216,8 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
192
  - !ruby/object:Gem::Version
217
193
  version: '0'
218
194
  requirements: []
219
- rubyforge_project:
220
- rubygems_version: 2.4.8
195
+ rubygems_version: 3.0.6
221
196
  signing_key:
222
197
  specification_version: 4
223
198
  summary: Racc is a LALR(1) parser generator