racc 1.5.2-java → 1.6.0-java
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.
- 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/cparse-jruby.jar +0 -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
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
-
|
3
|
-
module Racc
|
4
|
-
class TestGrammarFileParser < TestCase
|
5
|
-
def test_parse
|
6
|
-
file = File.join(ASSET_DIR, 'yyerr.y')
|
7
|
-
|
8
|
-
debug_flags = Racc::DebugFlags.parse_option_string('o')
|
9
|
-
assert debug_flags.status_logging
|
10
|
-
|
11
|
-
parser = Racc::GrammarFileParser.new(debug_flags)
|
12
|
-
parser.parse(File.read(file), File.basename(file))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/test/test_racc_command.rb
DELETED
@@ -1,339 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
-
|
3
|
-
module Racc
|
4
|
-
class TestRaccCommand < TestCase
|
5
|
-
def test_syntax_y
|
6
|
-
assert_compile 'syntax.y', '-v'
|
7
|
-
assert_debugfile 'syntax.y', [0,0,0,0,0]
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_percent_y
|
11
|
-
assert_compile 'percent.y'
|
12
|
-
assert_debugfile 'percent.y', []
|
13
|
-
assert_exec 'percent.y'
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_scan_y
|
17
|
-
assert_compile 'scan.y'
|
18
|
-
assert_debugfile 'scan.y', []
|
19
|
-
assert_exec 'scan.y'
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_newsyn_y
|
23
|
-
assert_compile 'newsyn.y'
|
24
|
-
assert_debugfile 'newsyn.y', []
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_normal_y
|
28
|
-
assert_compile 'normal.y'
|
29
|
-
assert_debugfile 'normal.y', []
|
30
|
-
|
31
|
-
assert_compile 'normal.y', '-vg'
|
32
|
-
assert_debugfile 'normal.y', []
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_chk_y
|
36
|
-
assert_compile 'chk.y', '-vg'
|
37
|
-
assert_debugfile 'chk.y', []
|
38
|
-
assert_exec 'chk.y'
|
39
|
-
|
40
|
-
assert_compile 'chk.y', '--line-convert-all'
|
41
|
-
assert_debugfile 'chk.y', []
|
42
|
-
assert_exec 'chk.y'
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_echk_y
|
46
|
-
assert_compile 'echk.y', '-E'
|
47
|
-
assert_debugfile 'echk.y', []
|
48
|
-
assert_exec 'echk.y'
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_err_y
|
52
|
-
assert_compile 'err.y'
|
53
|
-
assert_debugfile 'err.y', []
|
54
|
-
assert_exec 'err.y'
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_mailp_y
|
58
|
-
assert_compile 'mailp.y'
|
59
|
-
assert_debugfile 'mailp.y', []
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_conf_y
|
63
|
-
assert_compile 'conf.y', '-v'
|
64
|
-
assert_debugfile 'conf.y', [4,1,1,2]
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_rrconf_y
|
68
|
-
assert_compile 'rrconf.y'
|
69
|
-
assert_debugfile 'rrconf.y', [1,1,0,0]
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_useless_y
|
73
|
-
assert_compile 'useless.y'
|
74
|
-
assert_debugfile 'useless.y', [0,0,1,2]
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_opt_y
|
78
|
-
assert_compile 'opt.y'
|
79
|
-
assert_debugfile 'opt.y', []
|
80
|
-
assert_exec 'opt.y'
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_yyerr_y
|
84
|
-
assert_compile 'yyerr.y'
|
85
|
-
assert_debugfile 'yyerr.y', []
|
86
|
-
assert_exec 'yyerr.y'
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_recv_y
|
90
|
-
assert_compile 'recv.y'
|
91
|
-
assert_debugfile 'recv.y', [5,10,1,4]
|
92
|
-
end
|
93
|
-
|
94
|
-
def test_ichk_y
|
95
|
-
assert_compile 'ichk.y'
|
96
|
-
assert_debugfile 'ichk.y', []
|
97
|
-
assert_exec 'ichk.y'
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_intp_y
|
101
|
-
assert_compile 'intp.y'
|
102
|
-
assert_debugfile 'intp.y', []
|
103
|
-
assert_exec 'intp.y'
|
104
|
-
end
|
105
|
-
|
106
|
-
def test_expect_y
|
107
|
-
assert_compile 'expect.y'
|
108
|
-
assert_debugfile 'expect.y', [1,0,0,0,1]
|
109
|
-
end
|
110
|
-
|
111
|
-
def test_nullbug1_y
|
112
|
-
assert_compile 'nullbug1.y'
|
113
|
-
assert_debugfile 'nullbug1.y', [0,0,0,0]
|
114
|
-
end
|
115
|
-
|
116
|
-
def test_nullbug2_y
|
117
|
-
assert_compile 'nullbug2.y'
|
118
|
-
assert_debugfile 'nullbug2.y', [0,0,0,0]
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_firstline_y
|
122
|
-
assert_compile 'firstline.y'
|
123
|
-
assert_debugfile 'firstline.y', []
|
124
|
-
end
|
125
|
-
|
126
|
-
def test_nonass_y
|
127
|
-
assert_compile 'nonass.y'
|
128
|
-
assert_debugfile 'nonass.y', []
|
129
|
-
assert_exec 'nonass.y'
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_digraph_y
|
133
|
-
assert_compile 'digraph.y'
|
134
|
-
assert_debugfile 'digraph.y', []
|
135
|
-
assert_exec 'digraph.y'
|
136
|
-
end
|
137
|
-
|
138
|
-
def test_noend_y
|
139
|
-
assert_compile 'noend.y'
|
140
|
-
assert_debugfile 'noend.y', []
|
141
|
-
end
|
142
|
-
|
143
|
-
def test_norule_y
|
144
|
-
assert_raise(Test::Unit::AssertionFailedError) {
|
145
|
-
assert_compile 'norule.y'
|
146
|
-
}
|
147
|
-
end
|
148
|
-
|
149
|
-
def test_unterm_y
|
150
|
-
assert_raise(Test::Unit::AssertionFailedError) {
|
151
|
-
assert_compile 'unterm.y'
|
152
|
-
}
|
153
|
-
end
|
154
|
-
|
155
|
-
# Regression test for a problem where error recovery at EOF would cause
|
156
|
-
# a Racc-generated parser to go into an infinite loop (on some grammars)
|
157
|
-
def test_error_recovery_y
|
158
|
-
assert_compile 'error_recovery.y'
|
159
|
-
Timeout.timeout(10) do
|
160
|
-
assert_exec 'error_recovery.y'
|
161
|
-
end
|
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
|
338
|
-
end
|
339
|
-
end
|
data/test/test_scan_y.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
-
|
3
|
-
module Racc
|
4
|
-
class TestScanY < TestCase
|
5
|
-
def setup
|
6
|
-
super
|
7
|
-
file = File.join(ASSET_DIR, 'scan.y')
|
8
|
-
@debug_flags = Racc::DebugFlags.parse_option_string('o')
|
9
|
-
parser = Racc::GrammarFileParser.new(@debug_flags)
|
10
|
-
@result = parser.parse(File.read(file), File.basename(file))
|
11
|
-
@states = Racc::States.new(@result.grammar).nfa
|
12
|
-
@states.dfa
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_compile
|
16
|
-
generator = Racc::ParserFileGenerator.new(@states, @result.params.dup)
|
17
|
-
|
18
|
-
# it generates valid ruby
|
19
|
-
assert Module.new {
|
20
|
-
self.class_eval(generator.generate_parser)
|
21
|
-
}
|
22
|
-
|
23
|
-
grammar = @states.grammar
|
24
|
-
|
25
|
-
assert_equal 0, @states.n_srconflicts
|
26
|
-
assert_equal 0, @states.n_rrconflicts
|
27
|
-
assert_equal 0, grammar.n_useless_nonterminals
|
28
|
-
assert_equal 0, grammar.n_useless_rules
|
29
|
-
assert_nil grammar.n_expected_srconflicts
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_compile_line_convert
|
33
|
-
params = @result.params.dup
|
34
|
-
params.convert_line_all = true
|
35
|
-
|
36
|
-
generator = Racc::ParserFileGenerator.new(@states, @result.params.dup)
|
37
|
-
|
38
|
-
# it generates valid ruby
|
39
|
-
assert Module.new {
|
40
|
-
self.class_eval(generator.generate_parser)
|
41
|
-
}
|
42
|
-
|
43
|
-
grammar = @states.grammar
|
44
|
-
|
45
|
-
assert_equal 0, @states.n_srconflicts
|
46
|
-
assert_equal 0, @states.n_rrconflicts
|
47
|
-
assert_equal 0, grammar.n_useless_nonterminals
|
48
|
-
assert_equal 0, grammar.n_useless_rules
|
49
|
-
assert_nil grammar.n_expected_srconflicts
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
data/test/testscanner.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# racc scanner tester
|
3
|
-
#
|
4
|
-
|
5
|
-
require 'racc/raccs'
|
6
|
-
|
7
|
-
|
8
|
-
class ScanError < StandardError; end
|
9
|
-
|
10
|
-
def testdata( dir, argv )
|
11
|
-
if argv.empty? then
|
12
|
-
Dir.glob( dir + '/*' ) -
|
13
|
-
Dir.glob( dir + '/*.swp' ) -
|
14
|
-
[ dir + '/CVS' ]
|
15
|
-
else
|
16
|
-
argv.collect {|i| dir + '/' + i }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
if ARGV.delete '--print' then
|
22
|
-
$raccs_print_type = true
|
23
|
-
printonly = true
|
24
|
-
else
|
25
|
-
printonly = false
|
26
|
-
end
|
27
|
-
|
28
|
-
testdata( File.dirname($0) + '/scandata', ARGV ).each do |file|
|
29
|
-
$stderr.print File.basename(file) + ': '
|
30
|
-
begin
|
31
|
-
ok = File.read(file)
|
32
|
-
s = Racc::GrammarFileScanner.new( ok )
|
33
|
-
sym, (val, _lineno) = s.scan
|
34
|
-
if printonly then
|
35
|
-
$stderr.puts
|
36
|
-
$stderr.puts val
|
37
|
-
next
|
38
|
-
end
|
39
|
-
|
40
|
-
val = '{' + val + "}\n"
|
41
|
-
sym == :ACTION or raise ScanError, 'is not action!'
|
42
|
-
val == ok or raise ScanError, "\n>>>\n#{ok}----\n#{val}<<<"
|
43
|
-
|
44
|
-
$stderr.puts 'ok'
|
45
|
-
rescue => err
|
46
|
-
$stderr.puts 'fail (' + err.type.to_s + ')'
|
47
|
-
$stderr.puts err.message
|
48
|
-
$stderr.puts err.backtrace
|
49
|
-
$stderr.puts
|
50
|
-
end
|
51
|
-
end
|
data/web/racc.en.rhtml
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
% require 'makefile'
|
2
|
-
% version = Makefile.get_parameter('Makefile', 'version')
|
3
|
-
<h1>Racc</h1>
|
4
|
-
<p>
|
5
|
-
$Id$
|
6
|
-
</p>
|
7
|
-
|
8
|
-
<table summary="package descriptor">
|
9
|
-
<tr><th>Version</th><td><%= version %></td></tr>
|
10
|
-
<tr><th>Type</th><td>Parser Generator</td></tr>
|
11
|
-
<tr><th>Format</th><td>Ruby script + Ruby extention</td></tr>
|
12
|
-
<tr><th>Requirement</th><td>ruby (>=1.6)</td></tr>
|
13
|
-
<tr><th>License</th><td>LGPL</td></tr>
|
14
|
-
</table>
|
15
|
-
<p>
|
16
|
-
-- <a href="/archive/racc/racc-<%= version %>-all.tar.gz">Download (.tar.gz)</a>
|
17
|
-
-- <a href="/archive/racc/">Old Versions</a>
|
18
|
-
-- <a href="doc/">Online Manual</a>
|
19
|
-
--
|
20
|
-
</p>
|
21
|
-
|
22
|
-
<p>
|
23
|
-
Racc (Ruby yACC) is a LALR(1) parser generator for Ruby.
|
24
|
-
Version 1.4.x is stable release.
|
25
|
-
</p>
|
26
|
-
<p>
|
27
|
-
Parsers generated by Racc requires "Racc Runtime Module".
|
28
|
-
Ruby 1.8.x comes with this runtime.
|
29
|
-
If you want to run your parsers with ruby 1.6.x,
|
30
|
-
use "racc -E" command. For details, see <a href="doc/">online manual</a>.
|
31
|
-
</p>
|
32
|
-
|
33
|
-
<h2>Anonymous CVS</h2>
|
34
|
-
<p>
|
35
|
-
You can true latest version of Racc via anonymous CVS.
|
36
|
-
To check out working copy, type:
|
37
|
-
</p>
|
38
|
-
<pre>
|
39
|
-
$ cvs -d :pserver:anonymous@cvs.loveruby.net:/src login
|
40
|
-
Password: (Just hit [Enter])
|
41
|
-
$ cvs -d :pserver:anonymous@cvs.loveruby.net:/src co racc
|
42
|
-
</pre>
|
data/web/racc.ja.rhtml
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
% require 'makefile'
|
2
|
-
% version = Makefile.get_parameter('Makefile', 'version')
|
3
|
-
<h1>Racc</h1>
|
4
|
-
<p>
|
5
|
-
$Id$
|
6
|
-
</p>
|
7
|
-
<table summary="package descriptor">
|
8
|
-
<tr><th>�ǿ���</th><td><%= version %></td></tr>
|
9
|
-
<tr><th>����</th><td>parser generator</td></tr>
|
10
|
-
<tr><th>����</th><td>ruby script, ruby extention</td></tr>
|
11
|
-
<tr><th>ɬ�״Ķ�</th><td>ruby (>=1.6)</td></tr>
|
12
|
-
<tr><th>���۾��</th><td>LGPL</td></tr>
|
13
|
-
</table>
|
14
|
-
<ul>
|
15
|
-
<li><a href="/archive/racc/racc-<%= version %>-all.tar.gz">�����������</a></li>
|
16
|
-
<li><a href="/archive/racc/">��С������ꥹ��</a></li>
|
17
|
-
<li><a href="doc/">����饤��ޥ˥奢��</a></li>
|
18
|
-
</ul>
|
19
|
-
</p>
|
20
|
-
<p>
|
21
|
-
Ruby �Ѥ� LALR(1) �ѡ��������ͥ졼���Ǥ���
|
22
|
-
���������ѡ����Ϥ���ʤ�˹�®��ư��ޤ���
|
23
|
-
</p>
|
24
|
-
<p>
|
25
|
-
Racc �����������ѡ�����ư����˥����⥸�塼�뤬ɬ�פǤ���
|
26
|
-
Ruby 1.8 �ˤϤ��Υ���ब�ǽ餫��ź�դ���Ƥ���Τ�
|
27
|
-
����ͤ��ʤ�������פǤ�����Ruby 1.6 �������оݤˤ���Ȥ���
|
28
|
-
racc -E �ǥѡ�������������ɬ�פ�����ޤ���
|
29
|
-
</p>
|
30
|
-
<p>
|
31
|
-
�ʤ���Racc 1.4.x �Υ����� Ruby 1.8 ź�դ� Racc �����ϡ�
|
32
|
-
�����������ɾ�Ǥ���̯�˰㤤������ޤ����������˸ߴ���������ޤ���
|
33
|
-
</p>
|
34
|
-
|
35
|
-
<h2>����</h2>
|
36
|
-
<p>
|
37
|
-
�⤦����Ū����ʬ�ϸϤ�Ƥ���Ϥ��Ǥ���
|
38
|
-
TODO �Ϥޤ������Ĥ�����ޤ�������������¾�ˤ��äƤ�Τ�
|
39
|
-
��ʬ���礭���ѹ�����Ĥ��Ϥ���ޤ���
|
40
|
-
</p>
|
41
|
-
|
42
|
-
<h2>CVS ��ݥ��ȥ�</h2>
|
43
|
-
<p>
|
44
|
-
CVS ��Ȥ��� Racc �ο��κǿ��Ǥ�����Ǥ��ޤ���
|
45
|
-
���ޥ�ɥ饤��Ǽ��Τ褦���ǤäƤ���������
|
46
|
-
</p>
|
47
|
-
<pre>
|
48
|
-
$ cvs -d :pserver:anonymous@cvs.loveruby.net:/src login
|
49
|
-
Password: (������Enter���Ǥ�)
|
50
|
-
$ cvs -d :pserver:anonymous@cvs.loveruby.net:/src co racc
|
51
|
-
</pre>
|