racc 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/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
data/test/assets/digraph.y
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# ? detect digraph bug
|
2
|
-
|
3
|
-
class P
|
4
|
-
token A B C D
|
5
|
-
rule
|
6
|
-
target : a b c d
|
7
|
-
a : A
|
8
|
-
|
|
9
|
-
b : B
|
10
|
-
|
|
11
|
-
c : C
|
12
|
-
|
|
13
|
-
d : D
|
14
|
-
|
|
15
|
-
end
|
16
|
-
|
17
|
-
---- inner
|
18
|
-
|
19
|
-
def parse
|
20
|
-
do_parse
|
21
|
-
end
|
22
|
-
|
23
|
-
def next_token
|
24
|
-
[false, '$']
|
25
|
-
end
|
26
|
-
|
27
|
-
---- footer
|
28
|
-
|
29
|
-
P.new.parse
|
data/test/assets/echk.y
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# racc tester
|
3
|
-
#
|
4
|
-
|
5
|
-
class Calcp
|
6
|
-
|
7
|
-
prechigh
|
8
|
-
left '*' '/'
|
9
|
-
left '+' '-'
|
10
|
-
preclow
|
11
|
-
|
12
|
-
convert
|
13
|
-
NUMBER 'Number'
|
14
|
-
end
|
15
|
-
|
16
|
-
rule
|
17
|
-
|
18
|
-
target : exp | /* none */ { result = 0 } ;
|
19
|
-
|
20
|
-
exp : exp '+' exp { result += val[2]; a = 'plus' }
|
21
|
-
| exp '-' exp { result -= val[2]; "string test" }
|
22
|
-
| exp '*' exp { result *= val[2] }
|
23
|
-
| exp '/' exp { result /= val[2] }
|
24
|
-
| '(' { $emb = true } exp ')'
|
25
|
-
{
|
26
|
-
raise 'must not happen' unless $emb
|
27
|
-
result = val[2]
|
28
|
-
}
|
29
|
-
| '-' NUMBER { result = -val[1] }
|
30
|
-
| NUMBER
|
31
|
-
;
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
----header
|
36
|
-
|
37
|
-
class Number ; end
|
38
|
-
|
39
|
-
----inner
|
40
|
-
|
41
|
-
def parse( src )
|
42
|
-
@src = src
|
43
|
-
do_parse
|
44
|
-
end
|
45
|
-
|
46
|
-
def next_token
|
47
|
-
@src.shift
|
48
|
-
end
|
49
|
-
|
50
|
-
def initialize
|
51
|
-
@yydebug = true
|
52
|
-
end
|
53
|
-
|
54
|
-
----footer
|
55
|
-
|
56
|
-
$parser = Calcp.new
|
57
|
-
$tidx = 1
|
58
|
-
|
59
|
-
def chk( src, ans )
|
60
|
-
ret = $parser.parse( src )
|
61
|
-
unless ret == ans then
|
62
|
-
bug! "test #{$tidx} fail"
|
63
|
-
end
|
64
|
-
$tidx += 1
|
65
|
-
end
|
66
|
-
|
67
|
-
chk(
|
68
|
-
[ [Number, 9],
|
69
|
-
[false, false],
|
70
|
-
[false, false] ], 9
|
71
|
-
)
|
72
|
-
|
73
|
-
chk(
|
74
|
-
[ [Number, 5],
|
75
|
-
['*', nil],
|
76
|
-
[Number, 1],
|
77
|
-
['-', nil],
|
78
|
-
[Number, 1],
|
79
|
-
['*', nil],
|
80
|
-
[Number, 8],
|
81
|
-
[false, false],
|
82
|
-
[false, false] ], -3
|
83
|
-
)
|
84
|
-
|
85
|
-
chk(
|
86
|
-
[ [Number, 5],
|
87
|
-
['+', nil],
|
88
|
-
[Number, 2],
|
89
|
-
['-', nil],
|
90
|
-
[Number, 5],
|
91
|
-
['+', nil],
|
92
|
-
[Number, 2],
|
93
|
-
['-', nil],
|
94
|
-
[Number, 5],
|
95
|
-
[false, false],
|
96
|
-
[false, false] ], -1
|
97
|
-
)
|
98
|
-
|
99
|
-
chk(
|
100
|
-
[ ['-', nil],
|
101
|
-
[Number, 4],
|
102
|
-
[false, false],
|
103
|
-
[false, false] ], -4
|
104
|
-
)
|
105
|
-
|
106
|
-
chk(
|
107
|
-
[ [Number, 7],
|
108
|
-
['*', nil],
|
109
|
-
['(', nil],
|
110
|
-
[Number, 4],
|
111
|
-
['+', nil],
|
112
|
-
[Number, 3],
|
113
|
-
[')', nil],
|
114
|
-
['-', nil],
|
115
|
-
[Number, 9],
|
116
|
-
[false, false],
|
117
|
-
[false, false] ], 40
|
118
|
-
)
|