racc 1.4.9 → 1.4.10

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 678067056a78af4ab020b8cbdd35502a1a27ea16
4
+ data.tar.gz: 8b19bd475f558fc1c3802063e6181584854abe55
5
+ SHA512:
6
+ metadata.gz: 493e3227232a476dbe7d727d1d16a77a5050b3959ff4c631244bdb6f05bc88d19dd8a91fde2915bd4c81bcbd34c92c1cf075f63fae44f72c179c309f04b6f256
7
+ data.tar.gz: 9ef0cd010deb4fda96c73c2403dec66dbcc2790df1640cdc001553597ea558a71a60b26daf49fa246241a2ce336588f4fd40ff4e49f308efbed1b4294e90d809
@@ -34,12 +34,7 @@ lib/racc/statetransitiontable.rb
34
34
  lib/racc/static.rb
35
35
  misc/dist.sh
36
36
  rdoc/en/NEWS.en.rdoc
37
- rdoc/en/command.en.html
38
- rdoc/en/debug.en.rdoc
39
37
  rdoc/en/grammar.en.rdoc
40
- rdoc/en/index.en.html
41
- rdoc/en/parser.en.rdoc
42
- rdoc/en/usage.en.html
43
38
  rdoc/ja/NEWS.ja.rdoc
44
39
  rdoc/ja/command.ja.html
45
40
  rdoc/ja/debug.ja.rdoc
data/Rakefile CHANGED
@@ -14,13 +14,17 @@ Hoe.spec 'racc' do
14
14
  self.extra_rdoc_files = Dir['*.rdoc']
15
15
  self.history_file = 'ChangeLog'
16
16
  self.readme_file = 'README.rdoc'
17
- self.testlib = :minitest
17
+ self.testlib = :testunit
18
18
 
19
19
  extra_dev_deps << ['rake-compiler', '>= 0.4.1']
20
20
 
21
- self.spec_extras = {
22
- :extensions => ["ext/racc/extconf.rb"]
23
- }
21
+ if RUBY_PLATFORM =~ /java/
22
+ self.spec_extras = { :platform => 'java' }
23
+ else
24
+ self.spec_extras = {
25
+ :extensions => ["ext/racc/extconf.rb"]
26
+ }
27
+ end
24
28
 
25
29
  Rake::ExtensionTask.new "cparse", spec do |ext|
26
30
  ext.lib_dir = File.join 'lib', 'racc'
@@ -42,6 +46,6 @@ end
42
46
  }
43
47
  end
44
48
 
45
- Hoe.add_include_dirs('.:lib/psych')
49
+ Hoe.add_include_dirs('.:lib/racc')
46
50
 
47
51
  task :compile => 'lib/racc/parser-text.rb'
@@ -17,7 +17,7 @@
17
17
  Important Constants
18
18
  ----------------------------------------------------------------------- */
19
19
 
20
- #define RACC_VERSION "1.4.9"
20
+ #define RACC_VERSION "1.4.10"
21
21
 
22
22
  #define DEFAULT_TOKEN -1
23
23
  #define ERROR_TOKEN 1
@@ -84,7 +84,7 @@ num_to_long(VALUE n)
84
84
  }
85
85
 
86
86
  #define AREF(s, idx) \
87
- ((0 <= idx && idx < RARRAY_LEN(s)) ? RARRAY_PTR(s)[idx] : Qnil)
87
+ ((0 <= idx && idx < RARRAY_LEN(s)) ? rb_ary_entry(s, idx) : Qnil)
88
88
 
89
89
  /* -----------------------------------------------------------------------
90
90
  Parser Stack Interfaces
@@ -98,7 +98,7 @@ get_stack_tail(VALUE stack, long len)
98
98
  {
99
99
  if (len < 0) return Qnil; /* system error */
100
100
  if (len > RARRAY_LEN(stack)) len = RARRAY_LEN(stack);
101
- return rb_ary_new4(len, RARRAY_PTR(stack) + RARRAY_LEN(stack) - len);
101
+ return rb_ary_subseq(stack, RARRAY_LEN(stack) - len, len);
102
102
  }
103
103
 
104
104
  static void
@@ -115,7 +115,7 @@ cut_stack_tail(VALUE stack, long len)
115
115
  #define PUSH(s, i) rb_ary_store(s, RARRAY_LEN(s), i)
116
116
  #define POP(s) rb_ary_pop(s)
117
117
  #define LAST_I(s) \
118
- ((RARRAY_LEN(s) > 0) ? RARRAY_PTR(s)[RARRAY_LEN(s) - 1] : Qnil)
118
+ ((RARRAY_LEN(s) > 0) ? rb_ary_entry(s, RARRAY_LEN(s) - 1) : Qnil)
119
119
  #define GET_TAIL(s, len) get_stack_tail(s, len)
120
120
  #define CUT_TAIL(s, len) cut_stack_tail(s, len)
121
121
 
@@ -327,21 +327,21 @@ initialize_params(VALUE vparams, VALUE parser, VALUE arg, VALUE lexer, VALUE lex
327
327
  Check_Type(arg, T_ARRAY);
328
328
  if (!(13 <= RARRAY_LEN(arg) && RARRAY_LEN(arg) <= 14))
329
329
  rb_raise(RaccBug, "[Racc Bug] wrong arg.size %ld", RARRAY_LEN(arg));
330
- v->action_table = assert_array (RARRAY_PTR(arg)[ 0]);
331
- v->action_check = assert_array (RARRAY_PTR(arg)[ 1]);
332
- v->action_default = assert_array (RARRAY_PTR(arg)[ 2]);
333
- v->action_pointer = assert_array (RARRAY_PTR(arg)[ 3]);
334
- v->goto_table = assert_array (RARRAY_PTR(arg)[ 4]);
335
- v->goto_check = assert_array (RARRAY_PTR(arg)[ 5]);
336
- v->goto_default = assert_array (RARRAY_PTR(arg)[ 6]);
337
- v->goto_pointer = assert_array (RARRAY_PTR(arg)[ 7]);
338
- v->nt_base = assert_integer(RARRAY_PTR(arg)[ 8]);
339
- v->reduce_table = assert_array (RARRAY_PTR(arg)[ 9]);
340
- v->token_table = assert_hash (RARRAY_PTR(arg)[10]);
341
- v->shift_n = assert_integer(RARRAY_PTR(arg)[11]);
342
- v->reduce_n = assert_integer(RARRAY_PTR(arg)[12]);
330
+ v->action_table = assert_array (rb_ary_entry(arg, 0));
331
+ v->action_check = assert_array (rb_ary_entry(arg, 1));
332
+ v->action_default = assert_array (rb_ary_entry(arg, 2));
333
+ v->action_pointer = assert_array (rb_ary_entry(arg, 3));
334
+ v->goto_table = assert_array (rb_ary_entry(arg, 4));
335
+ v->goto_check = assert_array (rb_ary_entry(arg, 5));
336
+ v->goto_default = assert_array (rb_ary_entry(arg, 6));
337
+ v->goto_pointer = assert_array (rb_ary_entry(arg, 7));
338
+ v->nt_base = assert_integer(rb_ary_entry(arg, 8));
339
+ v->reduce_table = assert_array (rb_ary_entry(arg, 9));
340
+ v->token_table = assert_hash (rb_ary_entry(arg, 10));
341
+ v->shift_n = assert_integer(rb_ary_entry(arg, 11));
342
+ v->reduce_n = assert_integer(rb_ary_entry(arg, 12));
343
343
  if (RARRAY_LEN(arg) > 13) {
344
- v->use_result_var = RTEST(RARRAY_PTR(arg)[13]);
344
+ v->use_result_var = RTEST(rb_ary_entry(arg, 13));
345
345
  }
346
346
  else {
347
347
  v->use_result_var = Qtrue;
@@ -557,7 +557,7 @@ parse_main(struct cparse_params *v, VALUE tok, VALUE val, int resume)
557
557
 
558
558
  accept:
559
559
  if (v->debug) rb_funcall(v->parser, id_d_accept, 0);
560
- v->retval = RARRAY_PTR(v->vstack)[0];
560
+ v->retval = rb_ary_entry(v->vstack, 0);
561
561
  v->fin = CP_FIN_ACCEPT;
562
562
  return;
563
563
 
@@ -686,9 +686,9 @@ reduce0(VALUE val, VALUE data, VALUE self)
686
686
  VALUE goto_state;
687
687
 
688
688
  Data_Get_Struct(data, struct cparse_params, v);
689
- reduce_len = RARRAY_PTR(v->reduce_table)[v->ruleno];
690
- reduce_to = RARRAY_PTR(v->reduce_table)[v->ruleno+1];
691
- method_id = RARRAY_PTR(v->reduce_table)[v->ruleno+2];
689
+ reduce_len = rb_ary_entry(v->reduce_table, v->ruleno);
690
+ reduce_to = rb_ary_entry(v->reduce_table, v->ruleno+1);
691
+ method_id = rb_ary_entry(v->reduce_table, v->ruleno+2);
692
692
  len = NUM2LONG(reduce_len);
693
693
  mid = value_to_id(method_id);
694
694
 
@@ -703,10 +703,10 @@ reduce0(VALUE val, VALUE data, VALUE self)
703
703
  else {
704
704
  if (mid != id_noreduce) {
705
705
  tmp_v = GET_TAIL(v->vstack, len);
706
- tmp = RARRAY_PTR(tmp_v)[0];
706
+ tmp = rb_ary_entry(tmp_v, 0);
707
707
  }
708
708
  else {
709
- tmp = RARRAY_PTR(v->vstack)[ RARRAY_LEN(v->vstack) - len ];
709
+ tmp = rb_ary_entry(v->vstack, RARRAY_LEN(v->vstack) - len);
710
710
  }
711
711
  CUT_TAIL(v->vstack, len);
712
712
  if (v->debug) {
@@ -1,4 +1,4 @@
1
- # $Id: 24b2ba178fd74c1e6029e30ed31e654178865854 $
1
+ # $Id: 7151daa60cd95ecbb70f5e5a8db13142d1fe2d7c $
2
2
 
3
3
  require 'mkmf'
4
4
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: 96a81cf328285b90878c3bb512715a95950dba46 $
2
+ # $Id: cacd3e912323889e11ca8e960512b4f2186a9d1a $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -10,7 +10,7 @@
10
10
  #
11
11
 
12
12
  module Racc
13
- VERSION = '1.4.9'
13
+ VERSION = '1.4.10'
14
14
  Version = VERSION
15
15
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
16
16
  end
@@ -1,7 +1,7 @@
1
1
  module Racc
2
2
  PARSER_TEXT = <<'__end_of_file__'
3
3
  #
4
- # $Id: ad1fffef443194fdfa1052d2eee6850552f94313 $
4
+ # $Id: 3c520ba1f2996b86abc21eeb54768934a7be9d0c $
5
5
  #
6
6
  # Copyright (c) 1999-2006 Minero Aoki
7
7
  #
@@ -13,8 +13,10 @@ module Racc
13
13
  # without restriction.
14
14
  #
15
15
 
16
+ require 'racc/info'
17
+
16
18
  unless defined?(NotImplementedError)
17
- NotImplementedError = NotImplementError
19
+ NotImplementedError = NotImplementError # :nodoc:
18
20
  end
19
21
 
20
22
  module Racc
@@ -24,19 +26,173 @@ unless defined?(::ParseError)
24
26
  ParseError = Racc::ParseError
25
27
  end
26
28
 
29
+ # Racc is a LALR(1) parser generator.
30
+ # It is written in Ruby itself, and generates Ruby programs.
31
+ #
32
+ # == Command-line Reference
33
+ #
34
+ # racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
35
+ # [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
36
+ # [-v] [--verbose]
37
+ # [-O<var>filename</var>] [--log-file=<var>filename</var>]
38
+ # [-g] [--debug]
39
+ # [-E] [--embedded]
40
+ # [-l] [--no-line-convert]
41
+ # [-c] [--line-convert-all]
42
+ # [-a] [--no-omit-actions]
43
+ # [-C] [--check-only]
44
+ # [-S] [--output-status]
45
+ # [--version] [--copyright] [--help] <var>grammarfile</var>
46
+ #
47
+ # [+filename+]
48
+ # Racc grammar file. Any extention is permitted.
49
+ # [-o+outfile+, --output-file=+outfile+]
50
+ # A filename for output. default is <+filename+>.tab.rb
51
+ # [-O+filename+, --log-file=+filename+]
52
+ # Place logging output in file +filename+.
53
+ # Default log file name is <+filename+>.output.
54
+ # [-e+rubypath+, --executable=+rubypath+]
55
+ # output executable file(mode 755). where +path+ is the Ruby interpreter.
56
+ # [-v, --verbose]
57
+ # verbose mode. create +filename+.output file, like yacc's y.output file.
58
+ # [-g, --debug]
59
+ # add debug code to parser class. To display debuggin information,
60
+ # use this '-g' option and set @yydebug true in parser class.
61
+ # [-E, --embedded]
62
+ # Output parser which doesn't need runtime files (racc/parser.rb).
63
+ # [-C, --check-only]
64
+ # Check syntax of racc grammer file and quit.
65
+ # [-S, --output-status]
66
+ # Print messages time to time while compiling.
67
+ # [-l, --no-line-convert]
68
+ # turns off line number converting.
69
+ # [-c, --line-convert-all]
70
+ # Convert line number of actions, inner, header and footer.
71
+ # [-a, --no-omit-actions]
72
+ # Call all actions, even if an action is empty.
73
+ # [--version]
74
+ # print Racc version and quit.
75
+ # [--copyright]
76
+ # Print copyright and quit.
77
+ # [--help]
78
+ # Print usage and quit.
79
+ #
80
+ # == Generating Parser Using Racc
81
+ #
82
+ # To compile Racc grammar file, simply type:
83
+ #
84
+ # $ racc parse.y
85
+ #
86
+ # This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
87
+ #
88
+ # == Writing A Racc Grammar File
89
+ #
90
+ # If you want your own parser, you have to write a grammar file.
91
+ # A grammar file contains the name of your parser class, grammar for the parser,
92
+ # user code, and anything else.
93
+ # When writing a grammar file, yacc's knowledge is helpful.
94
+ # If you have not used yacc before, Racc is not too difficult.
95
+ #
96
+ # Here's an example Racc grammar file.
97
+ #
98
+ # class Calcparser
99
+ # rule
100
+ # target: exp { print val[0] }
101
+ #
102
+ # exp: exp '+' exp
103
+ # | exp '*' exp
104
+ # | '(' exp ')'
105
+ # | NUMBER
106
+ # end
107
+ #
108
+ # Racc grammar files resemble yacc files.
109
+ # But (of course), this is Ruby code.
110
+ # yacc's $$ is the 'result', $0, $1... is
111
+ # an array called 'val', and $-1, $-2... is an array called '_values'.
112
+ #
113
+ # See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
114
+ # more information on grammar files.
115
+ #
116
+ # == Parser
117
+ #
118
+ # Then you must prepare the parse entry method. There are two types of
119
+ # parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
120
+ #
121
+ # Racc::Parser#do_parse is simple.
122
+ #
123
+ # It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
124
+ # This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
125
+ # EOF is [false, false].
126
+ # (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
127
+ # If you want to change this, see the grammar reference.
128
+ #
129
+ # Racc::Parser#yyparse is little complicated, but useful.
130
+ # It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
131
+ #
132
+ # For example, <code>yyparse(obj, :scan)</code> causes
133
+ # calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
134
+ #
135
+ # == Debugging
136
+ #
137
+ # When debugging, "-v" or/and the "-g" option is helpful.
138
+ #
139
+ # "-v" creates verbose log file (.output).
140
+ # "-g" creates a "Verbose Parser".
141
+ # Verbose Parser prints the internal status when parsing.
142
+ # But it's _not_ automatic.
143
+ # You must use -g option and set +@yydebug+ to +true+ in order to get output.
144
+ # -g option only creates the verbose parser.
145
+ #
146
+ # === Racc reported syntax error.
147
+ #
148
+ # Isn't there too many "end"?
149
+ # grammar of racc file is changed in v0.10.
150
+ #
151
+ # Racc does not use '%' mark, while yacc uses huge number of '%' marks..
152
+ #
153
+ # === Racc reported "XXXX conflicts".
154
+ #
155
+ # Try "racc -v xxxx.y".
156
+ # It causes producing racc's internal log file, xxxx.output.
157
+ #
158
+ # === Generated parsers does not work correctly
159
+ #
160
+ # Try "racc -g xxxx.y".
161
+ # This command let racc generate "debugging parser".
162
+ # Then set @yydebug=true in your parser.
163
+ # It produces a working log of your parser.
164
+ #
165
+ # == Re-distributing Racc runtime
166
+ #
167
+ # A parser, which is created by Racc, requires the Racc runtime module;
168
+ # racc/parser.rb.
169
+ #
170
+ # Ruby 1.8.x comes with Racc runtime module,
171
+ # you need NOT distribute Racc runtime files.
172
+ #
173
+ # If you want to include the Racc runtime module with your parser.
174
+ # This can be done by using '-E' option:
175
+ #
176
+ # $ racc -E -omyparser.rb myparser.y
177
+ #
178
+ # This command creates myparser.rb which `includes' Racc runtime.
179
+ # Only you must do is to distribute your parser file (myparser.rb).
180
+ #
181
+ # Note: parser.rb is LGPL, but your parser is not.
182
+ # Your own parser is completely yours.
27
183
  module Racc
28
184
 
29
185
  unless defined?(Racc_No_Extentions)
30
- Racc_No_Extentions = false
186
+ Racc_No_Extentions = false # :nodoc:
31
187
  end
32
188
 
33
189
  class Parser
34
190
 
35
- Racc_Runtime_Version = '1.4.6'
36
- Racc_Runtime_Revision = '$Id: ad1fffef443194fdfa1052d2eee6850552f94313 $'
191
+ Racc_Runtime_Version = ::Racc::VERSION
192
+ Racc_Runtime_Revision = '$Id: 3c520ba1f2996b86abc21eeb54768934a7be9d0c $'
37
193
 
38
- Racc_Runtime_Core_Version_R = '1.4.6'
39
- Racc_Runtime_Core_Revision_R = '$Id: ad1fffef443194fdfa1052d2eee6850552f94313 $'.split[1]
194
+ Racc_Runtime_Core_Version_R = ::Racc::VERSION
195
+ Racc_Runtime_Core_Revision_R = '$Id: 3c520ba1f2996b86abc21eeb54768934a7be9d0c $'.split[1]
40
196
  begin
41
197
  require 'racc/cparse'
42
198
  # Racc_Runtime_Core_Version_C = (defined in extention)
@@ -48,11 +204,11 @@ module Racc
48
204
  raise LoadError, 'selecting ruby version of racc runtime core'
49
205
  end
50
206
 
51
- Racc_Main_Parsing_Routine = :_racc_do_parse_c
52
- Racc_YY_Parse_Method = :_racc_yyparse_c
53
- Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C
54
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C
55
- Racc_Runtime_Type = 'c'
207
+ Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
208
+ Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
209
+ Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
210
+ Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C # :nodoc:
211
+ Racc_Runtime_Type = 'c' # :nodoc:
56
212
  rescue LoadError
57
213
  Racc_Main_Parsing_Routine = :_racc_do_parse_rb
58
214
  Racc_YY_Parse_Method = :_racc_yyparse_rb
@@ -61,12 +217,10 @@ module Racc
61
217
  Racc_Runtime_Type = 'ruby'
62
218
  end
63
219
 
64
- def Parser.racc_runtime_type
220
+ def Parser.racc_runtime_type # :nodoc:
65
221
  Racc_Runtime_Type
66
222
  end
67
223
 
68
- private
69
-
70
224
  def _racc_setup
71
225
  @yydebug = false unless self.class::Racc_debug_parser
72
226
  @yydebug = false unless defined?(@yydebug)
@@ -93,14 +247,33 @@ module Racc
93
247
  @racc_error_status = 0
94
248
  end
95
249
 
96
- ###
97
- ### do_parse
98
- ###
99
-
250
+ # The entry point of the parser. This method is used with #next_token.
251
+ # If Racc wants to get token (and its value), calls next_token.
252
+ #
253
+ # Example:
254
+ # def parse
255
+ # @q = [[1,1],
256
+ # [2,2],
257
+ # [3,3],
258
+ # [false, '$']]
259
+ # do_parse
260
+ # end
261
+ #
262
+ # def next_token
263
+ # @q.shift
264
+ # end
100
265
  def do_parse
101
266
  __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
102
267
  end
103
268
 
269
+ # The method to fetch next token.
270
+ # If you use #do_parse method, you must implement #next_token.
271
+ #
272
+ # The format of return value is [TOKEN_SYMBOL, VALUE].
273
+ # +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
274
+ # for 'IDENT'. ";" (String) for ';'.
275
+ #
276
+ # The final symbol (End of file) must be false.
104
277
  def next_token
105
278
  raise NotImplementedError, "#{self.class}\#next_token is not defined"
106
279
  end
@@ -144,10 +317,11 @@ module Racc
144
317
  }
145
318
  end
146
319
 
147
- ###
148
- ### yyparse
149
- ###
150
-
320
+ # Another entry point for the parser.
321
+ # If you use this method, you must implement RECEIVER#METHOD_ID method.
322
+ #
323
+ # RECEIVER#METHOD_ID is a method to get next token.
324
+ # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
151
325
  def yyparse(recv, mid)
152
326
  __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true)
153
327
  end
@@ -342,27 +516,43 @@ module Racc
342
516
  goto_default[k1]
343
517
  end
344
518
 
519
+ # This method is called when a parse error is found.
520
+ #
521
+ # ERROR_TOKEN_ID is an internal ID of token which caused error.
522
+ # You can get string representation of this ID by calling
523
+ # #token_to_str.
524
+ #
525
+ # ERROR_VALUE is a value of error token.
526
+ #
527
+ # value_stack is a stack of symbol values.
528
+ # DO NOT MODIFY this object.
529
+ #
530
+ # This method raises ParseError by default.
531
+ #
532
+ # If this method returns, parsers enter "error recovering mode".
345
533
  def on_error(t, val, vstack)
346
534
  raise ParseError, sprintf("\nparse error on value %s (%s)",
347
535
  val.inspect, token_to_str(t) || '?')
348
536
  end
349
537
 
538
+ # Enter error recovering mode.
539
+ # This method does not call #on_error.
350
540
  def yyerror
351
541
  throw :racc_jump, 1
352
542
  end
353
543
 
544
+ # Exit parser.
545
+ # Return value is Symbol_Value_Stack[0].
354
546
  def yyaccept
355
547
  throw :racc_jump, 2
356
548
  end
357
549
 
550
+ # Leave error recovering mode.
358
551
  def yyerrok
359
552
  @racc_error_status = 0
360
553
  end
361
554
 
362
- #
363
- # for debugging output
364
- #
365
-
555
+ # For debugging output
366
556
  def racc_read_token(t, tok, val)
367
557
  @racc_debug_out.print 'read '
368
558
  @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
@@ -385,7 +575,6 @@ module Racc
385
575
  toks.each {|t| out.print ' ', racc_token2str(t) }
386
576
  end
387
577
  out.puts " --> #{racc_token2str(sim)}"
388
-
389
578
  racc_print_stacks tstack, vstack
390
579
  @racc_debug_out.puts
391
580
  end
@@ -429,6 +618,7 @@ module Racc
429
618
  raise "[Racc Bug] can't convert token #{tok} to string"
430
619
  end
431
620
 
621
+ # Convert internal ID of token symbol to the string.
432
622
  def token_to_str(t)
433
623
  self.class::Racc_token_to_s_table[t]
434
624
  end