racc 1.5.2-java → 1.6.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) 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/cparse-jruby.jar +0 -0
  17. data/lib/racc/info.rb +1 -1
  18. data/lib/racc/parser-text.rb +1 -1
  19. data/lib/racc/parser.rb +1 -1
  20. data/lib/racc/parserfilegenerator.rb +0 -44
  21. data/lib/racc/statetransitiontable.rb +2 -8
  22. metadata +15 -121
  23. data/Rakefile +0 -79
  24. data/ext/racc/com/headius/racc/Cparse.java +0 -849
  25. data/lib/racc/pre-setup +0 -13
  26. data/sample/array.y +0 -67
  27. data/sample/array2.y +0 -59
  28. data/sample/calc-ja.y +0 -66
  29. data/sample/calc.y +0 -65
  30. data/sample/conflict.y +0 -15
  31. data/sample/hash.y +0 -60
  32. data/sample/lalr.y +0 -17
  33. data/sample/lists.y +0 -57
  34. data/sample/syntax.y +0 -46
  35. data/sample/yyerr.y +0 -46
  36. data/test/assets/cadenza.y +0 -170
  37. data/test/assets/cast.y +0 -926
  38. data/test/assets/chk.y +0 -126
  39. data/test/assets/conf.y +0 -16
  40. data/test/assets/csspool.y +0 -729
  41. data/test/assets/digraph.y +0 -29
  42. data/test/assets/echk.y +0 -118
  43. data/test/assets/edtf.y +0 -583
  44. data/test/assets/err.y +0 -60
  45. data/test/assets/error_recovery.y +0 -35
  46. data/test/assets/expect.y +0 -7
  47. data/test/assets/firstline.y +0 -4
  48. data/test/assets/huia.y +0 -318
  49. data/test/assets/ichk.y +0 -102
  50. data/test/assets/intp.y +0 -546
  51. data/test/assets/journey.y +0 -47
  52. data/test/assets/liquor.y +0 -313
  53. data/test/assets/machete.y +0 -423
  54. data/test/assets/macruby.y +0 -2197
  55. data/test/assets/mailp.y +0 -437
  56. data/test/assets/mediacloth.y +0 -599
  57. data/test/assets/mof.y +0 -649
  58. data/test/assets/namae.y +0 -302
  59. data/test/assets/nasl.y +0 -626
  60. data/test/assets/newsyn.y +0 -25
  61. data/test/assets/noend.y +0 -4
  62. data/test/assets/nokogiri-css.y +0 -255
  63. data/test/assets/nonass.y +0 -41
  64. data/test/assets/normal.y +0 -27
  65. data/test/assets/norule.y +0 -4
  66. data/test/assets/nullbug1.y +0 -25
  67. data/test/assets/nullbug2.y +0 -15
  68. data/test/assets/opal.y +0 -1807
  69. data/test/assets/opt.y +0 -123
  70. data/test/assets/percent.y +0 -35
  71. data/test/assets/php_serialization.y +0 -98
  72. data/test/assets/recv.y +0 -97
  73. data/test/assets/riml.y +0 -665
  74. data/test/assets/rrconf.y +0 -14
  75. data/test/assets/ruby18.y +0 -1943
  76. data/test/assets/ruby19.y +0 -2174
  77. data/test/assets/ruby20.y +0 -2350
  78. data/test/assets/ruby21.y +0 -2359
  79. data/test/assets/ruby22.y +0 -2381
  80. data/test/assets/scan.y +0 -72
  81. data/test/assets/syntax.y +0 -50
  82. data/test/assets/tp_plus.y +0 -622
  83. data/test/assets/twowaysql.y +0 -278
  84. data/test/assets/unterm.y +0 -5
  85. data/test/assets/useless.y +0 -12
  86. data/test/assets/yyerr.y +0 -46
  87. data/test/bench.y +0 -36
  88. data/test/helper.rb +0 -115
  89. data/test/infini.y +0 -8
  90. data/test/regress/cadenza +0 -796
  91. data/test/regress/cast +0 -3428
  92. data/test/regress/csspool +0 -2314
  93. data/test/regress/edtf +0 -1794
  94. data/test/regress/huia +0 -1392
  95. data/test/regress/journey +0 -222
  96. data/test/regress/liquor +0 -885
  97. data/test/regress/machete +0 -833
  98. data/test/regress/mediacloth +0 -1463
  99. data/test/regress/mof +0 -1368
  100. data/test/regress/namae +0 -634
  101. data/test/regress/nasl +0 -2058
  102. data/test/regress/nokogiri-css +0 -836
  103. data/test/regress/opal +0 -6431
  104. data/test/regress/php_serialization +0 -336
  105. data/test/regress/riml +0 -3283
  106. data/test/regress/ruby18 +0 -6344
  107. data/test/regress/ruby22 +0 -7460
  108. data/test/regress/tp_plus +0 -1933
  109. data/test/regress/twowaysql +0 -556
  110. data/test/scandata/brace +0 -7
  111. data/test/scandata/gvar +0 -1
  112. data/test/scandata/normal +0 -4
  113. data/test/scandata/percent +0 -18
  114. data/test/scandata/slash +0 -10
  115. data/test/src.intp +0 -34
  116. data/test/start.y +0 -20
  117. data/test/test_chk_y.rb +0 -52
  118. data/test/test_grammar_file_parser.rb +0 -15
  119. data/test/test_racc_command.rb +0 -339
  120. data/test/test_scan_y.rb +0 -52
  121. data/test/testscanner.rb +0 -51
  122. data/web/racc.en.rhtml +0 -42
  123. data/web/racc.ja.rhtml +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a26f2c06fa7d06485c01e3dd3ee7c51625901086f5767d23ca69aedb08760385
4
- data.tar.gz: 036de739ae55a35d616964d762c0c75e6f4bae7d796eda8c0758eb16612705b2
3
+ metadata.gz: f3870d075a9f783d53a800b73c19cb82f6be0c31ee8b222524dae4c1920ed80b
4
+ data.tar.gz: 1d6632a8e5856c6b3fb202c91e3978bf08d4cc53ad3fd3fedad81379fee5b85b
5
5
  SHA512:
6
- metadata.gz: c4213f29bbb62cbc27e0e7afd5b613bdb471db5232075f47d978b11a9f769880f22e94ce39ad385c20db3c7c0994f45d4f51f9bbebcdbe478850ac6ca2f41bc9
7
- data.tar.gz: cf67048e43843c5b74f329ccc59fdd3bab61f199708e722447cfe927bc905619c41ac20ad4645a3843bd04e2e15ed6d8b5441468d8f25adc1360a263c3dbb624
6
+ metadata.gz: fca0a358c6b77e13fbcbf403028fe5f21fbc3f9faf6c9ed6a1e00f54a5dbac1c9b488940f89ae6382ce8bcff23977850f8ca7983168a0d63a2ad96b0d55d101e
7
+ data.tar.gz: 9a70f05c829d84a665fe51efa715874350daa1a0c9e3a6acd5c1a81977818af18b8b7c92e911a25adc8c21a8b85fcaaf736a9fba92d34160313a7539aecbe01f
data/README.ja.rdoc CHANGED
@@ -1,7 +1,6 @@
1
1
  = Racc
2
2
 
3
3
  * http://i.loveruby.net/en/projects/racc/
4
- * http://racc.rubyforge.org/
5
4
 
6
5
  == DESCRIPTION:
7
6
 
data/README.rdoc CHANGED
@@ -1,7 +1,6 @@
1
1
  = Racc
2
2
 
3
3
  * http://i.loveruby.net/en/projects/racc/
4
- * http://racc.rubyforge.org/
5
4
 
6
5
  == DESCRIPTION:
7
6
 
@@ -59,9 +58,9 @@
59
58
 
60
59
  $ ruby calc
61
60
 
62
- ... Does it works?
63
- For details of Racc, see HTML documents placed under 'doc.en/'
64
- and sample grammer files under 'sample/'.
61
+ ... Does it work?
62
+ For details of Racc, see HTML documents placed under 'rdoc/en/'
63
+ and sample grammar files under 'sample/'.
65
64
 
66
65
 
67
66
  == License
@@ -74,9 +73,9 @@
74
73
 
75
74
  == Bug Reports
76
75
 
77
- Any kind of bug reports are welcome.
78
- If you find a bug of Racc, please email me. Your grammer file,
79
- debug output genereted by "racc -g", are helpful.
76
+ Any kind of bug report is welcome.
77
+ If you find a bug of Racc, please email me. Your grammar file,
78
+ debug output generated by "racc -g", are helpful.
80
79
 
81
80
 
82
81
  Minero Aoki
File without changes
@@ -4,25 +4,24 @@
4
4
 
5
5
  == Class Block and User Code Block
6
6
 
7
- There's two block on toplevel.
8
- one is 'class' block, another is 'user code' block. 'user code' block MUST
9
- places after 'class' block.
7
+ There are two top-level blocks: the 'class' block, and the 'user code'
8
+ block. The 'user code' block MUST be after the 'class' block.
10
9
 
11
10
  == Comment
12
11
 
13
- You can insert comment about all places. Two style comment can be used,
14
- Ruby style (#.....) and C style (/*......*/) .
12
+ Comments can be added about everywhere. Two comment styles are
13
+ supported: Ruby style (`# ...`) and C style (`/* ... */`).
15
14
 
16
15
  == Class Block
17
16
 
18
17
  The class block is formed like this:
19
18
  --
20
19
  class CLASS_NAME
21
- [precedance table]
22
- [token declearations]
20
+ [precedence table]
21
+ [token declarations]
23
22
  [expected number of S/R conflict]
24
23
  [options]
25
- [semantic value convertion]
24
+ [semantic value conversion]
26
25
  [start rule]
27
26
  rule
28
27
  GRAMMARS
@@ -43,7 +42,7 @@ end
43
42
 
44
43
  == Grammar Block
45
44
 
46
- The grammar block discripts grammar which is able
45
+ The grammar block describes the grammar
47
46
  to be understood by parser. Syntax is:
48
47
  --
49
48
  (token): (token) (token) (token).... (action)
@@ -69,7 +68,7 @@ It is value of result, or returned value by "return" statement.
69
68
  Here is an example of whole grammar block.
70
69
  --
71
70
  rule
72
- goal: definition ruls source { result = val }
71
+ goal: definition rules source { result = val }
73
72
 
74
73
  definition: /* none */ { result = [] }
75
74
  | definition startdesig { result[0] = val[1] }
@@ -96,7 +95,7 @@ An array of value of right-hand side (rhs).
96
95
  A stack of values.
97
96
  DO NOT MODIFY this stack unless you know what you are doing.
98
97
 
99
- == Operator Precedance
98
+ == Operator Precedence
100
99
 
101
100
  This function is equal to '%prec' in yacc.
102
101
  To designate this block:
@@ -128,25 +127,24 @@ rule
128
127
 
129
128
  == expect
130
129
 
131
- Racc has bison's "expect" directive.
130
+ Racc supports Bison's "expect" directive to declare the expected
131
+ number of shift/reduce conflicts.
132
132
  --
133
- # Example
134
-
135
133
  class MyParser
136
134
  rule
137
135
  expect 3
138
136
  :
139
137
  :
140
138
  --
141
- This directive declears "expected" number of shift/reduce conflict.
142
- If "expected" number is equal to real number of conflicts,
143
- racc does not print confliction warning message.
139
+ Then warnings are issued only when the effective number of conflicts differs.
140
+
144
141
 
145
142
  == Declaring Tokens
146
143
 
147
- By declaring tokens, you can avoid many meanless bugs.
148
- If decleared token does not exist/existing token does not decleared,
149
- Racc output warnings. Declearation syntax is:
144
+ Declaring tokens avoids many bugs.
145
+
146
+ Racc outputs warnings for declared tokens that do not exist, or existing tokens not declared.
147
+ The syntax is:
150
148
  --
151
149
  token TOKEN_NAME AND_IS_THIS
152
150
  ALSO_THIS_IS AGAIN_AND_AGAIN THIS_IS_LAST
@@ -174,12 +172,12 @@ You can use 'no_' prefix to invert its meanings.
174
172
 
175
173
  Token symbols are, as default,
176
174
 
177
- * naked token string in racc file (TOK, XFILE, this_is_token, ...)
175
+ * naked token strings in racc file (TOK, XFILE, this_is_token, ...)
178
176
  --> symbol (:TOK, :XFILE, :this_is_token, ...)
179
- * quoted string (':', '.', '(', ...)
177
+ * quoted strings (':', '.', '(', ...)
180
178
  --> same string (':', '.', '(', ...)
181
179
 
182
- You can change this default by "convert" block.
180
+ You can change this default using a "convert" block.
183
181
  Here is an example:
184
182
  --
185
183
  convert
@@ -202,18 +200,19 @@ end
202
200
 
203
201
  == Start Rule
204
202
 
205
- '%start' in yacc. This changes start rule.
203
+ '%start' in yacc. This changes the start symbol.
206
204
  --
207
205
  start real_target
208
206
  --
209
- This statement will not be used forever, I think.
207
+
210
208
 
211
209
  == User Code Block
212
210
 
213
- "User Code Block" is a Ruby source code which is copied to output.
214
- There are three user code block, "header" "inner" and "footer".
211
+ A "User Code Block" is a piece of Ruby source code copied in the output.
212
+ There are three user code blocks, "header" "inner" and "footer".
215
213
 
216
- Format of user code is like this:
214
+ User code blocks are introduced by four '-' at the beginning of a line,
215
+ followed by a single-word name:
217
216
  --
218
217
  ---- header
219
218
  ruby statement
@@ -225,6 +224,3 @@ Format of user code is like this:
225
224
  :
226
225
  :
227
226
  --
228
- If four '-' exist on line head,
229
- racc treat it as beginning of user code block.
230
- A name of user code must be one word.
@@ -0,0 +1,219 @@
1
+ = Racc Grammar File Reference
2
+
3
+ == Global Structure
4
+
5
+ == Class Block and User Code Block
6
+
7
+ There are two blocks on the toplevel. One is the 'class' block, the other is the 'user code'
8
+ block. The 'user code' block MUST be placed after the 'class' block.
9
+
10
+ == Comments
11
+
12
+ You can insert comments about all places. Two styles of comments can be used, Ruby style '#.....' and C style '/\*......*\/'.
13
+
14
+ == Class Block
15
+
16
+ The class block is formed like this:
17
+
18
+ class CLASS_NAME
19
+ [precedence table]
20
+ [token declarations]
21
+ [expected number of S/R conflicts]
22
+ [options]
23
+ [semantic value conversion]
24
+ [start rule]
25
+ rule
26
+ GRAMMARS
27
+
28
+ CLASS_NAME is a name of the parser class. This is the name of the generating parser
29
+ class.
30
+
31
+ If CLASS_NAME includes '::', Racc outputs the module clause. For example, writing
32
+ "class M::C" causes the code below to be created:
33
+
34
+ module M
35
+ class C
36
+ :
37
+ :
38
+ end
39
+ end
40
+
41
+ == Grammar Block
42
+
43
+ The grammar block describes grammar which is able to be understood by the parser.
44
+ Syntax is:
45
+
46
+ (token): (token) (token) (token).... (action)
47
+
48
+ (token): (token) (token) (token).... (action)
49
+ | (token) (token) (token).... (action)
50
+ | (token) (token) (token).... (action)
51
+
52
+ (action) is an action which is executed when its (token)s are found.
53
+ (action) is a ruby code block, which is surrounded by braces:
54
+
55
+ { print val[0]
56
+ puts val[1] }
57
+
58
+ Note that you cannot use '%' string, here document, '%r' regexp in action.
59
+
60
+ Actions can be omitted. When it is omitted, '' (empty string) is used.
61
+
62
+ A return value of action is a value of the left side value ($$). It is the value of the
63
+ result, or the returned value by `return` statement.
64
+
65
+ Here is an example of the whole grammar block.
66
+
67
+ rule
68
+ goal: definition rules source { result = val }
69
+
70
+ definition: /* none */ { result = [] }
71
+ | definition startdesig { result[0] = val[1] }
72
+ | definition
73
+ precrule # this line continues from upper line
74
+ {
75
+ result[1] = val[1]
76
+ }
77
+
78
+ startdesig: START TOKEN
79
+
80
+ You can use the following special local variables in action:
81
+
82
+ * result ($$)
83
+
84
+ The value of the left-hand side (lhs). A default value is val[0].
85
+
86
+ * val ($1,$2,$3...)
87
+
88
+ An array of value of the right-hand side (rhs).
89
+
90
+ * _values (...$-2,$-1,$0)
91
+
92
+ A stack of values. DO NOT MODIFY this stack unless you know what you are doing.
93
+
94
+ == Operator Precedence
95
+
96
+ This function is equal to '%prec' in yacc.
97
+ To designate this block:
98
+
99
+ prechigh
100
+ nonassoc '++'
101
+ left '*' '/'
102
+ left '+' '-'
103
+ right '='
104
+ preclow
105
+
106
+ `right` is yacc's %right, `left` is yacc's %left.
107
+
108
+ `=` + (symbol) means yacc's %prec:
109
+
110
+ prechigh
111
+ nonassoc UMINUS
112
+ left '*' '/'
113
+ left '+' '-'
114
+ preclow
115
+
116
+ rule
117
+ exp: exp '*' exp
118
+ | exp '-' exp
119
+ | '-' exp =UMINUS # equals to "%prec UMINUS"
120
+ :
121
+ :
122
+
123
+ == expect
124
+
125
+ Racc has bison's "expect" directive.
126
+
127
+ # Example
128
+
129
+ class MyParser
130
+ rule
131
+ expect 3
132
+ :
133
+ :
134
+
135
+ This directive declares "expected" number of shift/reduce conflicts. If
136
+ "expected" number is equal to real number of conflicts, Racc does not print
137
+ conflict warning message.
138
+
139
+ == Declaring Tokens
140
+
141
+ By declaring tokens, you can avoid many meaningless bugs. If declared token
142
+ does not exist or existing token does not decleared, Racc output warnings.
143
+ Declaration syntax is:
144
+
145
+ token TOKEN_NAME AND_IS_THIS
146
+ ALSO_THIS_IS AGAIN_AND_AGAIN THIS_IS_LAST
147
+
148
+ == Options
149
+
150
+ You can write options for Racc command in your Racc file.
151
+
152
+ options OPTION OPTION ...
153
+
154
+ Options are:
155
+
156
+ * omit_action_call
157
+
158
+ omits empty action call or not.
159
+
160
+ * result_var
161
+
162
+ uses local variable "result" or not.
163
+
164
+ You can use 'no_' prefix to invert their meanings.
165
+
166
+ == Converting Token Symbol
167
+
168
+ Token symbols are, as default,
169
+
170
+ * naked token string in Racc file (TOK, XFILE, this_is_token, ...)
171
+ --> symbol (:TOK, :XFILE, :this_is_token, ...)
172
+ * quoted string (':', '.', '(', ...)
173
+ --> same string (':', '.', '(', ...)
174
+
175
+ You can change this default by "convert" block.
176
+ Here is an example:
177
+
178
+ convert
179
+ PLUS 'PlusClass' # We use PlusClass for symbol of `PLUS'
180
+ MIN 'MinusClass' # We use MinusClass for symbol of `MIN'
181
+ end
182
+
183
+ We can use almost all ruby value can be used by token symbol,
184
+ except 'false' and 'nil'. These cause unexpected parse error.
185
+
186
+ If you want to use String as token symbol, special care is required.
187
+ For example:
188
+
189
+ convert
190
+ class '"cls"' # in code, "cls"
191
+ PLUS '"plus\n"' # in code, "plus\n"
192
+ MIN "\"minus#{val}\"" # in code, \"minus#{val}\"
193
+ end
194
+
195
+ == Start Rule
196
+
197
+ '%start' in yacc. This changes start rule.
198
+
199
+ start real_target
200
+
201
+ == User Code Block
202
+
203
+ "User Code Block" is a Ruby source code which is copied to output. There are
204
+ three user code blocks, "header" "inner" and "footer".
205
+
206
+ Format of user code is like this:
207
+
208
+ ---- header
209
+ ruby statement
210
+ ruby statement
211
+ ruby statement
212
+
213
+ ---- inner
214
+ ruby statement
215
+ :
216
+ :
217
+
218
+ If four '-' exist on the line head, Racc treats it as the beginning of the
219
+ user code block. The name of the user code block must be one word.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -819,7 +819,7 @@ reduce0(RB_BLOCK_CALL_FUNC_ARGLIST(_, data))
819
819
  void
820
820
  Init_cparse(void)
821
821
  {
822
- #if HAVE_RB_EXT_RACTOR_SAFE
822
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
823
823
  rb_ext_ractor_safe(true);
824
824
  #endif
825
825
 
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'mkmf'
5
5
 
6
+ have_func('rb_block_call')
6
7
  have_func('rb_ary_subseq')
7
8
 
8
9
  create_makefile 'racc/cparse'
Binary file
data/lib/racc/info.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #++
12
12
 
13
13
  module Racc
14
- VERSION = '1.5.2'
14
+ VERSION = '1.6.0'
15
15
  Version = VERSION
16
16
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
17
17
  end
@@ -548,7 +548,7 @@ module Racc
548
548
  end
549
549
 
550
550
  # Exit parser.
551
- # Return value is Symbol_Value_Stack[0].
551
+ # Return value is +Symbol_Value_Stack[0]+.
552
552
  def yyaccept
553
553
  throw :racc_jump, 2
554
554
  end
data/lib/racc/parser.rb CHANGED
@@ -546,7 +546,7 @@ module Racc
546
546
  end
547
547
 
548
548
  # Exit parser.
549
- # Return value is Symbol_Value_Stack[0].
549
+ # Return value is +Symbol_Value_Stack[0]+.
550
550
  def yyaccept
551
551
  throw :racc_jump, 2
552
552
  end
@@ -320,50 +320,6 @@ module Racc
320
320
  end
321
321
 
322
322
  def integer_list(name, table)
323
- if table.size > 2000
324
- serialize_integer_list_compressed name, table
325
- else
326
- serialize_integer_list_std name, table
327
- end
328
- end
329
-
330
- def serialize_integer_list_compressed(name, table)
331
- # TODO: this can be made a LOT more clean with a simple split/map
332
- sep = "\n"
333
- nsep = ",\n"
334
- buf = String.new
335
- com = ''
336
- ncom = ','
337
- co = com
338
- @f.print 'clist = ['
339
- table.each do |i|
340
- buf << co << i.to_s; co = ncom
341
- if buf.size > 66
342
- @f.print sep; sep = nsep
343
- @f.print "'", buf, "'"
344
- buf = String.new
345
- co = com
346
- end
347
- end
348
- unless buf.empty?
349
- @f.print sep
350
- @f.print "'", buf, "'"
351
- end
352
- line ' ]'
353
-
354
- @f.print(<<-End)
355
- #{name} = arr = ::Array.new(#{table.size}, nil)
356
- idx = 0
357
- clist.each do |str|
358
- str.split(',', -1).each do |i|
359
- arr[idx] = i.to_i unless i.empty?
360
- idx += 1
361
- end
362
- end
363
- End
364
- end
365
-
366
- def serialize_integer_list_std(name, table)
367
323
  sep = ''
368
324
  line "#{name} = ["
369
325
  table.each_slice(10) do |ns|
@@ -12,12 +12,6 @@
12
12
 
13
13
  require 'racc/parser'
14
14
 
15
- unless Object.method_defined?(:funcall)
16
- class Object
17
- alias funcall __send__
18
- end
19
- end
20
-
21
15
  module Racc
22
16
 
23
17
  StateTransitionTable = Struct.new(:action_table,
@@ -300,9 +294,9 @@ module Racc
300
294
  c.module_eval "def _reduce_none(vals, vstack) vals[0] end"
301
295
  @grammar.each do |rule|
302
296
  if rule.action.empty?
303
- c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none)
297
+ c.alias_method("_reduce_#{rule.ident}", :_reduce_none)
304
298
  else
305
- c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc)
299
+ c.define_method("_racc_action_#{rule.ident}", &rule.action.proc)
306
300
  c.module_eval(<<-End, __FILE__, __LINE__ + 1)
307
301
  def _reduce_#{rule.ident}(vals, vstack)
308
302
  _racc_action_#{rule.ident}(*vals)