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
data/test/assets/chk.y DELETED
@@ -1,126 +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]; @plus = 'plus' }
21
- | exp '-' exp { result -= val[2]; @str = "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
- $emb = false
43
- @plus = nil
44
- @str = nil
45
- @src = src
46
- result = do_parse
47
- if @plus
48
- raise 'string parse failed' unless @plus == 'plus'
49
- end
50
- if @str
51
- raise 'string parse failed' unless @str == 'string test'
52
- end
53
- result
54
- end
55
-
56
- def next_token
57
- @src.shift
58
- end
59
-
60
- def initialize
61
- @yydebug = true
62
- end
63
-
64
- ----footer
65
-
66
- $parser = Calcp.new
67
- $test_number = 1
68
-
69
- def chk( src, ans )
70
- result = $parser.parse(src)
71
- raise "test #{$test_number} fail" unless result == ans
72
- $test_number += 1
73
- end
74
-
75
- chk(
76
- [ [Number, 9],
77
- [false, false],
78
- [false, false] ], 9
79
- )
80
-
81
- chk(
82
- [ [Number, 5],
83
- ['*', nil],
84
- [Number, 1],
85
- ['-', nil],
86
- [Number, 1],
87
- ['*', nil],
88
- [Number, 8],
89
- [false, false],
90
- [false, false] ], -3
91
- )
92
-
93
- chk(
94
- [ [Number, 5],
95
- ['+', nil],
96
- [Number, 2],
97
- ['-', nil],
98
- [Number, 5],
99
- ['+', nil],
100
- [Number, 2],
101
- ['-', nil],
102
- [Number, 5],
103
- [false, false],
104
- [false, false] ], -1
105
- )
106
-
107
- chk(
108
- [ ['-', nil],
109
- [Number, 4],
110
- [false, false],
111
- [false, false] ], -4
112
- )
113
-
114
- chk(
115
- [ [Number, 7],
116
- ['*', nil],
117
- ['(', nil],
118
- [Number, 4],
119
- ['+', nil],
120
- [Number, 3],
121
- [')', nil],
122
- ['-', nil],
123
- [Number, 9],
124
- [false, false],
125
- [false, false] ], 40
126
- )
data/test/assets/conf.y DELETED
@@ -1,16 +0,0 @@
1
-
2
- class A
3
- rule
4
-
5
- a: A c C expr;
6
-
7
- b: A B; # useless
8
-
9
- c: A;
10
- c: A;
11
-
12
- expr: expr '+' expr
13
- expr: expr '-' expr
14
- expr: NUMBER
15
-
16
- end