rdtool 0.6.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/COPYING.txt +674 -0
  2. data/Gemfile +9 -0
  3. data/HISTORY +284 -0
  4. data/LICENSE.txt +58 -0
  5. data/MANIFEST +89 -0
  6. data/README.html +44 -0
  7. data/README.ja.html +46 -0
  8. data/README.rd +52 -0
  9. data/README.rd.ja +54 -0
  10. data/Rakefile +29 -0
  11. data/TODO +15 -0
  12. data/VERSION +1 -0
  13. data/bin/rd2 +281 -0
  14. data/bin/rdswap.rb +207 -0
  15. data/doc/rd-draft.rd +479 -0
  16. data/doc/rd-draft.rd.ja +487 -0
  17. data/lib/rd/block-element.rb +114 -0
  18. data/lib/rd/complex-list-item.rb +65 -0
  19. data/lib/rd/desclist.rb +55 -0
  20. data/lib/rd/document-struct.rb +46 -0
  21. data/lib/rd/dot.rd2rc +18 -0
  22. data/lib/rd/element.rb +160 -0
  23. data/lib/rd/filter.rb +255 -0
  24. data/lib/rd/inline-element.rb +233 -0
  25. data/lib/rd/labeled-element.rb +14 -0
  26. data/lib/rd/list.rb +57 -0
  27. data/lib/rd/loose-struct.rb +11 -0
  28. data/lib/rd/methodlist.rb +57 -0
  29. data/lib/rd/output-format-visitor.rb +28 -0
  30. data/lib/rd/package.rb +4 -0
  31. data/lib/rd/parser-util.rb +14 -0
  32. data/lib/rd/post-install +1 -0
  33. data/lib/rd/rbl-file.rb +69 -0
  34. data/lib/rd/rbl-suite.rb +37 -0
  35. data/lib/rd/rd-struct.rb +86 -0
  36. data/lib/rd/rd2html-lib.rb +490 -0
  37. data/lib/rd/rd2html-opt.rb +67 -0
  38. data/lib/rd/rd2man-lib.rb +241 -0
  39. data/lib/rd/rd2rdo-lib.rb +19 -0
  40. data/lib/rd/rd2rmi-lib.rb +32 -0
  41. data/lib/rd/rdblockparser.ry +518 -0
  42. data/lib/rd/rdblockparser.tab.rb +1050 -0
  43. data/lib/rd/rdfmt.rb +15 -0
  44. data/lib/rd/rdinlineparser.ry +503 -0
  45. data/lib/rd/rdinlineparser.tab.rb +1243 -0
  46. data/lib/rd/rdvisitor.rb +214 -0
  47. data/lib/rd/reference-resolver.rb +114 -0
  48. data/lib/rd/search-file.rb +14 -0
  49. data/lib/rd/tree.rb +103 -0
  50. data/lib/rd/version.rb +39 -0
  51. data/lib/rd/visitor.rb +86 -0
  52. data/makerdtool.rb +75 -0
  53. data/setup.rb +1596 -0
  54. data/test.rb +33 -0
  55. data/test/data/includee1.html +1 -0
  56. data/test/data/includee2.html +1 -0
  57. data/test/data/includee3.nothtml +1 -0
  58. data/test/data/includee4.xhtml +0 -0
  59. data/test/data/label.rbl +2 -0
  60. data/test/data/label2.rbl +2 -0
  61. data/test/data/sub/includee2.html +1 -0
  62. data/test/data/sub/includee4.html +0 -0
  63. data/test/dummy-observer.rb +6 -0
  64. data/test/dummy.rb +33 -0
  65. data/test/temp-dir.rb +19 -0
  66. data/test/test-block-parser.rb +46 -0
  67. data/test/test-desclist-item.rb +219 -0
  68. data/test/test-document-element.rb +46 -0
  69. data/test/test-document-struct.rb +66 -0
  70. data/test/test-element.rb +46 -0
  71. data/test/test-headline.rb +80 -0
  72. data/test/test-inline-parser.rb +46 -0
  73. data/test/test-list-item.rb +54 -0
  74. data/test/test-list.rb +53 -0
  75. data/test/test-methodlist-item.rb +73 -0
  76. data/test/test-nonterminal-element.rb +170 -0
  77. data/test/test-nonterminal-inline.rb +33 -0
  78. data/test/test-output-format-visitor.rb +48 -0
  79. data/test/test-parser-util.rb +41 -0
  80. data/test/test-rbl-file.rb +156 -0
  81. data/test/test-rbl-suite.rb +43 -0
  82. data/test/test-rd2html-lib.rb +496 -0
  83. data/test/test-rdtree.rb +17 -0
  84. data/test/test-rdvisitor.rb +29 -0
  85. data/test/test-reference-resolver.rb +202 -0
  86. data/test/test-reference.rb +132 -0
  87. data/test/test-search-file.rb +22 -0
  88. data/test/test-terminal-inline.rb +41 -0
  89. data/test/test-textblock.rb +44 -0
  90. data/test/test-tree.rb +82 -0
  91. data/test/test-version.rb +57 -0
  92. data/test/test-visitor.rb +230 -0
  93. data/utils/rd-mode.el +425 -0
  94. metadata +203 -0
@@ -0,0 +1,1050 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by racc 1.4.4
4
+ # from racc grammer file "lib/rd/rdblockparser.ry".
5
+ #
6
+
7
+ require 'racc/parser'
8
+
9
+
10
+ require "rd/rdinlineparser.tab.rb"
11
+ require "rd/parser-util"
12
+
13
+ module RD
14
+
15
+ class RDParser < Racc::Parser
16
+
17
+ module_eval <<'..end lib/rd/rdblockparser.ry modeval..idc4b57748f0', 'lib/rd/rdblockparser.ry', 231
18
+ include ParserUtility
19
+
20
+ TMPFILE = ["rdtmp", $$, 0]
21
+
22
+ attr_reader :tree
23
+
24
+ def initialize
25
+ @inline_parser = RDInlineParser.new(self)
26
+ end
27
+
28
+ def parse(src, tree)
29
+ @src = src
30
+ @src.push(false)
31
+ # RDtree
32
+ @tree = tree
33
+
34
+ # @i: index(line no.) of src
35
+ @i = 0
36
+ # stack for current indentation
37
+ @indent_stack = []
38
+ # how indented.
39
+ @current_indent = @indent_stack.join("")
40
+ # RDParser for tmp src
41
+ @subparser = nil
42
+ # which part is in now
43
+ @in_part = nil
44
+ @part_content = []
45
+
46
+ @in_verbatim = false
47
+
48
+ @yydebug = true
49
+ do_parse
50
+ end
51
+
52
+ def next_token
53
+ # preprocessing
54
+ # if it is not in RD part
55
+ # => method
56
+ while @in_part != "rd"
57
+ line = @src[@i]
58
+ @i += 1 # next line
59
+
60
+ case line
61
+ # src end
62
+ when false
63
+ return [false, false]
64
+ # RD part begin
65
+ when /^=begin\s*(?:\bRD\b.*)?\s*$/
66
+ if @in_part # if in non-RD part
67
+ @part_content.push(line)
68
+ else
69
+ @in_part = "rd"
70
+ return [:WHITELINE, "=begin\n"] # <= for textblockand
71
+ end
72
+ # non-RD part begin
73
+ when /^=begin\s+(\w+)/
74
+ part = $1
75
+ if @in_part # if in non-RD part
76
+ @part_content.push(line)
77
+ else
78
+ @in_part = part if @tree.filter[part] # if filter exists
79
+ # p "BEGIN_PART: #{@in_part}" # DEBUG
80
+ end
81
+ # non-RD part end
82
+ when /^=end/
83
+ if @in_part # if in non-RD part
84
+ # p "END_PART: #{@in_part}" # DEBUG
85
+ # make Part-in object
86
+ part = RD::Part.new(@part_content.join(""), @tree, "r")
87
+ @part_content.clear
88
+ # call filter, part_out is output(Part object)
89
+ part_out = @tree.filter[@in_part].call(part)
90
+
91
+ if @tree.filter[@in_part].mode == :rd # if output is RD formated
92
+ subtree = parse_subtree(part_out.to_a)
93
+ else # if output is target formated
94
+ basename = TMPFILE.join('.')
95
+ TMPFILE[-1] += 1
96
+ tmpfile = open(@tree.tmp_dir + "/" + basename + ".#{@in_part}", "w")
97
+ tmpfile.print(part_out)
98
+ tmpfile.close
99
+ subtree = parse_subtree(["=begin\n", "<<< #{basename}\n", "=end\n"])
100
+ end
101
+ @in_part = nil
102
+ return [:SUBTREE, subtree]
103
+ end
104
+ else
105
+ if @in_part # if in non-RD part
106
+ @part_content.push(line)
107
+ end
108
+ end
109
+ end
110
+
111
+ @current_indent = @indent_stack.join("")
112
+ line = @src[@i]
113
+ case line
114
+ when false
115
+ if_current_indent_equal("") do
116
+ [false, false]
117
+ end
118
+ when /^=end/
119
+ if_current_indent_equal("") do
120
+ @in_part = nil
121
+ [:WHITELINE, "=end"] # MUST CHANGE??
122
+ end
123
+ when /^\s*$/
124
+ @i += 1 # next line
125
+ return [:WHITELINE, ':WHITELINE']
126
+ when /^\#/ # comment line
127
+ @i += 1 # next line
128
+ self.next_token()
129
+ when /^(={1,4})(?!=)\s*(?=\S)/, /^(\+{1,2})(?!\+)\s*(?=\S)/
130
+ rest = $' # '
131
+ rest.strip!
132
+ mark = $1
133
+ if_current_indent_equal("") do
134
+ return [:HEADLINE, [Headline.mark_to_level(mark), rest]]
135
+ end
136
+ when /^<<<\s*(\S+)/
137
+ file = $1
138
+ if_current_indent_equal("") do
139
+ suffix = file[-3 .. -1]
140
+ if suffix == ".rd" or suffix == ".rb"
141
+ subtree = parse_subtree(get_included(file))
142
+ [:SUBTREE, subtree]
143
+ else
144
+ [:INCLUDE, file]
145
+ end
146
+ end
147
+ when /^(\s*)\*(\s*)/
148
+ rest = $' # '
149
+ newIndent = $2
150
+ if_current_indent_equal($1) do
151
+ if @in_verbatim
152
+ [:STRINGLINE, line]
153
+ else
154
+ @indent_stack.push("\s" << newIndent)
155
+ [:ITEMLISTLINE, rest]
156
+ end
157
+ end
158
+ when /^(\s*)(\(\d+\))(\s*)/
159
+ rest = $' # '
160
+ mark = $2
161
+ newIndent = $3
162
+ if_current_indent_equal($1) do
163
+ if @in_verbatim
164
+ [:STRINGLINE, line]
165
+ else
166
+ @indent_stack.push("\s" * mark.size << newIndent)
167
+ [:ENUMLISTLINE, rest]
168
+ end
169
+ end
170
+ when /^(\s*):(\s*)/
171
+ rest = $' # '
172
+ newIndent = $2
173
+ if_current_indent_equal($1) do
174
+ if @in_verbatim
175
+ [:STRINGLINE, line]
176
+ else
177
+ @indent_stack.push("\s" << $2)
178
+ [:DESCLISTLINE, rest]
179
+ end
180
+ end
181
+ when /^(\s*)---(?!-|\s*$)/
182
+ indent = $1
183
+ rest = $'
184
+ /\s*/ === rest
185
+ term = $'
186
+ new_indent = $&
187
+ if_current_indent_equal(indent) do
188
+ if @in_verbatim
189
+ [:STRINGLINE, line]
190
+ else
191
+ @indent_stack.push("\s\s\s" + new_indent)
192
+ [:METHODLISTLINE, term]
193
+ end
194
+ end
195
+ when /^(\s*)/
196
+ if_current_indent_equal($1) do
197
+ [:STRINGLINE, line]
198
+ end
199
+ else
200
+ raise "[BUG] parsing error may occured."
201
+ end
202
+ end
203
+
204
+ =begin private
205
+ --- RDParser#if_current_indent_equal(indent)
206
+ if (({@current_indent == ((|indent|))})) then yield block, otherwise
207
+ process indentation.
208
+ =end
209
+ # always @current_indent = @indent_stack.join("")
210
+ def if_current_indent_equal(indent)
211
+ indent = indent.sub(/\t/, "\s" * 8)
212
+ if @current_indent == indent
213
+ @i += 1 # next line
214
+ yield
215
+ elsif indent.index(@current_indent) == 0
216
+ @indent_stack.push(indent[@current_indent.size .. -1])
217
+ [:INDENT, ":INDENT"]
218
+ else
219
+ @indent_stack.pop
220
+ [:DEDENT, ":DEDENT"]
221
+ end
222
+ end
223
+ private :if_current_indent_equal
224
+
225
+ def cut_off(src)
226
+ ret = []
227
+ whiteline_buf = []
228
+ line = src.shift
229
+ /^\s*/ =~ line
230
+ indent = Regexp.quote($&)
231
+ ret.push($') # '
232
+ while line = src.shift
233
+ if /^(\s*)$/ =~ line
234
+ whiteline_buf.push(line)
235
+ elsif /^#{indent}/ =~ line
236
+ unless whiteline_buf.empty?
237
+ ret.concat(whiteline_buf)
238
+ whiteline_buf.clear
239
+ end
240
+ ret.push($') # '
241
+ else
242
+ raise "[BUG]: probably Parser Error while cutting off.\n"
243
+ end
244
+ end
245
+ ret
246
+ end
247
+ private :cut_off
248
+
249
+ def set_term_to_element(parent, term)
250
+ # parent.set_term_under_document_struct(term, @tree.document_struct)
251
+ parent.set_term_without_document_struct(term)
252
+ end
253
+ private :set_term_to_element
254
+
255
+ def on_error( et, ev, _values )
256
+ line = @src[@i]
257
+ prv, cur, nxt = format_line_num(@i, @i+1, @i+2)
258
+
259
+ raise ParseError, <<Msg
260
+
261
+ RD syntax error: line #{@i+1}:
262
+ #{prv} |#{@src[@i-1].chomp}
263
+ #{cur}=>|#{@src[@i].chomp}
264
+ #{nxt} |#{@src[@i+1].chomp}
265
+
266
+ Msg
267
+ end
268
+
269
+ def line_index
270
+ @i
271
+ end
272
+
273
+ def parse_subtree(src)
274
+ @subparser = RD::RDParser.new() unless @subparser
275
+
276
+ @subparser.parse(src, @tree)
277
+ end
278
+ private :parse_subtree
279
+
280
+ def get_included(file)
281
+ included = ""
282
+ @tree.include_path.each do |dir|
283
+ file_name = dir + "/" + file
284
+ if test(?e, file_name)
285
+ included = IO.readlines(file_name)
286
+ break
287
+ end
288
+ end
289
+ included
290
+ end
291
+ private :get_included
292
+
293
+ def format_line_num(*args)
294
+ width = args.collect{|i| i.to_s.length }.max
295
+ args.collect{|i| sprintf("%#{width}d", i) }
296
+ end
297
+ private :format_line_num
298
+
299
+ ..end lib/rd/rdblockparser.ry modeval..idc4b57748f0
300
+
301
+ ##### racc 1.4.4 generates ###
302
+
303
+ racc_reduce_table = [
304
+ 0, 0, :racc_error,
305
+ 1, 15, :_reduce_1,
306
+ 0, 15, :_reduce_2,
307
+ 2, 16, :_reduce_3,
308
+ 1, 16, :_reduce_none,
309
+ 1, 17, :_reduce_5,
310
+ 1, 17, :_reduce_6,
311
+ 1, 17, :_reduce_none,
312
+ 1, 17, :_reduce_8,
313
+ 1, 17, :_reduce_9,
314
+ 1, 17, :_reduce_10,
315
+ 1, 17, :_reduce_11,
316
+ 1, 21, :_reduce_12,
317
+ 1, 22, :_reduce_13,
318
+ 1, 18, :_reduce_14,
319
+ 2, 23, :_reduce_15,
320
+ 1, 23, :_reduce_16,
321
+ 3, 19, :_reduce_17,
322
+ 1, 25, :_reduce_18,
323
+ 2, 24, :_reduce_19,
324
+ 4, 24, :_reduce_20,
325
+ 2, 24, :_reduce_21,
326
+ 1, 24, :_reduce_22,
327
+ 1, 26, :_reduce_none,
328
+ 1, 26, :_reduce_none,
329
+ 1, 26, :_reduce_none,
330
+ 1, 26, :_reduce_none,
331
+ 1, 20, :_reduce_none,
332
+ 3, 20, :_reduce_28,
333
+ 4, 20, :_reduce_29,
334
+ 2, 31, :_reduce_30,
335
+ 1, 31, :_reduce_31,
336
+ 1, 27, :_reduce_32,
337
+ 2, 32, :_reduce_33,
338
+ 1, 32, :_reduce_34,
339
+ 3, 33, :_reduce_35,
340
+ 1, 28, :_reduce_36,
341
+ 2, 36, :_reduce_37,
342
+ 1, 36, :_reduce_38,
343
+ 3, 37, :_reduce_39,
344
+ 1, 29, :_reduce_40,
345
+ 2, 39, :_reduce_41,
346
+ 1, 39, :_reduce_42,
347
+ 3, 40, :_reduce_43,
348
+ 1, 30, :_reduce_44,
349
+ 2, 42, :_reduce_45,
350
+ 1, 42, :_reduce_46,
351
+ 3, 43, :_reduce_47,
352
+ 3, 41, :_reduce_48,
353
+ 2, 41, :_reduce_49,
354
+ 4, 41, :_reduce_50,
355
+ 1, 41, :_reduce_51,
356
+ 2, 45, :_reduce_52,
357
+ 1, 45, :_reduce_none,
358
+ 1, 46, :_reduce_54,
359
+ 1, 46, :_reduce_55,
360
+ 1, 46, :_reduce_none,
361
+ 1, 46, :_reduce_57,
362
+ 1, 44, :_reduce_none,
363
+ 0, 44, :_reduce_none,
364
+ 2, 47, :_reduce_none,
365
+ 1, 47, :_reduce_none,
366
+ 2, 34, :_reduce_62,
367
+ 1, 34, :_reduce_63,
368
+ 2, 38, :_reduce_64,
369
+ 1, 38, :_reduce_65,
370
+ 2, 35, :_reduce_66,
371
+ 2, 35, :_reduce_67,
372
+ 2, 35, :_reduce_68,
373
+ 1, 35, :_reduce_69,
374
+ 1, 35, :_reduce_none,
375
+ 1, 35, :_reduce_71,
376
+ 0, 35, :_reduce_72 ]
377
+
378
+ racc_reduce_n = 73
379
+
380
+ racc_shift_n = 89
381
+
382
+ racc_action_table = [
383
+ 7, 9, 13, 17, 23, 63, 80, 43, 43, 5,
384
+ 88, 7, 9, 13, 17, 41, 7, 9, 13, 17,
385
+ 41, 72, 7, 9, 13, 17, 23, 63, 75, 50,
386
+ 50, 5, 7, 9, 13, 17, 23, 63, 79, 50,
387
+ 81, 5, 7, 9, 13, 17, 23, 63, 47, 23,
388
+ 9, 5, 7, 9, 13, 17, 23, 63, 41, 13,
389
+ 84, 5, 7, 9, 13, 17, 23, 63, 23, 43,
390
+ 17, 5, 7, 9, 13, 17, 23, 26, 30, 34,
391
+ 2, 5, 7, 9, 13, 17, 59, 37, 7, nil,
392
+ nil, 5, 7, 9, 13, 17, nil, 37, nil, nil,
393
+ nil, 5, 7, 9, 13, 17, 23, 26, 30, 34,
394
+ 2, 5, 7, 9, 13, 17, 23, 63, nil, nil,
395
+ nil, 5, 7, 9, 13, 17, 23, 63, nil, nil,
396
+ nil, 5, 7, 9, 13, 17, 23, 63, nil, nil,
397
+ nil, 5, 7, 9, 13, 17, 23, 63, 70, 71,
398
+ nil, 5, 23, 68, 69, 70, 71, 76, 70, 71,
399
+ 68, 87, nil, 68, 7, 9, 13, 17 ]
400
+
401
+ racc_action_check = [
402
+ 85, 85, 85, 85, 85, 85, 52, 44, 46, 85,
403
+ 85, 42, 42, 42, 42, 42, 5, 5, 5, 5,
404
+ 5, 42, 60, 60, 60, 60, 60, 60, 47, 17,
405
+ 50, 60, 77, 77, 77, 77, 77, 77, 51, 13,
406
+ 54, 77, 76, 76, 76, 76, 76, 76, 12, 9,
407
+ 8, 76, 67, 67, 67, 67, 67, 67, 68, 18,
408
+ 74, 67, 66, 66, 66, 66, 66, 66, 7, 6,
409
+ 28, 66, 0, 0, 0, 0, 0, 0, 0, 0,
410
+ 0, 0, 4, 4, 4, 4, 36, 4, 33, nil,
411
+ nil, 4, 14, 14, 14, 14, nil, 14, nil, nil,
412
+ nil, 14, 16, 16, 16, 16, 16, 16, 16, 16,
413
+ 16, 16, 37, 37, 37, 37, 37, 37, nil, nil,
414
+ nil, 37, 39, 39, 39, 39, 39, 39, nil, nil,
415
+ nil, 39, 38, 38, 38, 38, 38, 38, nil, nil,
416
+ nil, 38, 86, 86, 86, 86, 86, 86, 40, 40,
417
+ nil, 86, 48, 40, 40, 83, 83, 48, 73, 73,
418
+ 83, 83, nil, 73, 29, 29, 29, 29 ]
419
+
420
+ racc_action_pointer = [
421
+ 69, nil, nil, nil, 79, 13, 62, 61, 46, 42,
422
+ nil, nil, 48, 31, 89, nil, 99, 21, 54, nil,
423
+ nil, nil, nil, nil, nil, nil, nil, nil, 64, 161,
424
+ nil, nil, nil, 85, nil, nil, 73, 109, 129, 119,
425
+ 141, nil, 8, nil, 0, nil, 1, 28, 145, nil,
426
+ 22, 25, -7, nil, 27, nil, nil, nil, nil, nil,
427
+ 19, nil, nil, nil, nil, nil, 59, 49, 51, nil,
428
+ nil, nil, nil, 151, 47, nil, 39, 29, nil, nil,
429
+ nil, nil, nil, 148, nil, -3, 139, nil, nil ]
430
+
431
+ racc_action_default = [
432
+ -2, -34, -13, -9, -72, -73, -14, -63, -36, -65,
433
+ -38, -31, -73, -59, -72, -23, -1, -59, -40, -24,
434
+ -4, -42, -25, -16, -5, -26, -10, -6, -44, -27,
435
+ -11, -7, -46, -32, -12, -8, -73, -71, -69, -70,
436
+ -73, -22, -73, -15, -62, -37, -64, -73, -51, -58,
437
+ -61, -73, -73, -3, -73, -41, -45, -30, -33, -35,
438
+ -68, -53, -54, -57, -55, -56, -66, -67, -73, -17,
439
+ -19, -21, -28, -18, -73, 89, -73, -49, -60, -43,
440
+ -39, -47, -52, -73, -29, -73, -48, -20, -50 ]
441
+
442
+ racc_goto_table = [
443
+ 40, 24, 60, 66, 67, 82, 27, 20, 57, 36,
444
+ 38, 82, 82, 44, 51, 46, 42, 24, 54, 52,
445
+ 38, 57, 27, 53, 31, 58, 45, 55, 39, 74,
446
+ 82, 82, 56, 12, 16, 78, nil, 73, 39, nil,
447
+ 31, 85, 86, nil, nil, nil, nil, nil, nil, 77,
448
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
449
+ nil, nil, nil, 83 ]
450
+
451
+ racc_goto_check = [
452
+ 10, 4, 31, 31, 31, 32, 5, 3, 12, 21,
453
+ 5, 32, 32, 9, 27, 9, 17, 4, 27, 21,
454
+ 5, 12, 5, 3, 6, 19, 23, 26, 6, 11,
455
+ 32, 32, 29, 1, 2, 33, nil, 10, 6, nil,
456
+ 6, 31, 31, nil, nil, nil, nil, nil, nil, 4,
457
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
458
+ nil, nil, nil, 10 ]
459
+
460
+ racc_goto_pointer = [
461
+ nil, 33, 34, 7, 1, 6, 24, nil, nil, 6,
462
+ -5, -13, -21, nil, nil, nil, nil, 11, nil, -8,
463
+ nil, 5, nil, 18, nil, nil, 9, 1, nil, 4,
464
+ nil, -35, -55, -15 ]
465
+
466
+ racc_goto_default = [
467
+ nil, nil, nil, nil, 62, 64, 65, 35, 3, 6,
468
+ nil, nil, 11, 15, 19, 22, 25, 29, 33, 1,
469
+ 4, nil, 8, 10, 14, 18, 21, nil, 28, 32,
470
+ 48, nil, 61, 49 ]
471
+
472
+ racc_token_table = {
473
+ false => 0,
474
+ Object.new => 1,
475
+ :DUMMY => 2,
476
+ :ITEMLISTLINE => 3,
477
+ :ENUMLISTLINE => 4,
478
+ :DESCLISTLINE => 5,
479
+ :METHODLISTLINE => 6,
480
+ :STRINGLINE => 7,
481
+ :WHITELINE => 8,
482
+ :SUBTREE => 9,
483
+ :HEADLINE => 10,
484
+ :INCLUDE => 11,
485
+ :INDENT => 12,
486
+ :DEDENT => 13 }
487
+
488
+ racc_use_result_var = true
489
+
490
+ racc_nt_base = 14
491
+
492
+ Racc_arg = [
493
+ racc_action_table,
494
+ racc_action_check,
495
+ racc_action_default,
496
+ racc_action_pointer,
497
+ racc_goto_table,
498
+ racc_goto_check,
499
+ racc_goto_default,
500
+ racc_goto_pointer,
501
+ racc_nt_base,
502
+ racc_reduce_table,
503
+ racc_token_table,
504
+ racc_shift_n,
505
+ racc_reduce_n,
506
+ racc_use_result_var ]
507
+
508
+ Racc_token_to_s_table = [
509
+ '$end',
510
+ 'error',
511
+ 'DUMMY',
512
+ 'ITEMLISTLINE',
513
+ 'ENUMLISTLINE',
514
+ 'DESCLISTLINE',
515
+ 'METHODLISTLINE',
516
+ 'STRINGLINE',
517
+ 'WHITELINE',
518
+ 'SUBTREE',
519
+ 'HEADLINE',
520
+ 'INCLUDE',
521
+ 'INDENT',
522
+ 'DEDENT',
523
+ '$start',
524
+ 'document',
525
+ 'blocks',
526
+ 'block',
527
+ 'textblock',
528
+ 'verbatim',
529
+ 'lists',
530
+ 'headline',
531
+ 'include',
532
+ 'textblockcontent',
533
+ 'verbatimcontent',
534
+ 'verbatim_after_lists',
535
+ 'list',
536
+ 'itemlist',
537
+ 'enumlist',
538
+ 'desclist',
539
+ 'methodlist',
540
+ 'lists2',
541
+ 'itemlistitems',
542
+ 'itemlistitem',
543
+ 'first_textblock_in_itemlist',
544
+ 'other_blocks_in_list',
545
+ 'enumlistitems',
546
+ 'enumlistitem',
547
+ 'first_textblock_in_enumlist',
548
+ 'desclistitems',
549
+ 'desclistitem',
550
+ 'description_part',
551
+ 'methodlistitems',
552
+ 'methodlistitem',
553
+ 'whitelines',
554
+ 'blocks_in_list',
555
+ 'block_in_list',
556
+ 'whitelines2']
557
+
558
+ Racc_debug_parser = false
559
+
560
+ ##### racc system variables end #####
561
+
562
+ # reduce 0 omitted
563
+
564
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 14
565
+ def _reduce_1( val, _values, result )
566
+ result = DocumentElement.new
567
+ add_children_to_element(result, *val[0])
568
+ result
569
+ end
570
+ .,.,
571
+
572
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 19
573
+ def _reduce_2( val, _values, result )
574
+ raise ParseError,
575
+ "Error: file empty."
576
+ result
577
+ end
578
+ .,.,
579
+
580
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 20
581
+ def _reduce_3( val, _values, result )
582
+ result.concat(val[1])
583
+ result
584
+ end
585
+ .,.,
586
+
587
+ # reduce 4 omitted
588
+
589
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 23
590
+ def _reduce_5( val, _values, result )
591
+ result = val
592
+ result
593
+ end
594
+ .,.,
595
+
596
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 24
597
+ def _reduce_6( val, _values, result )
598
+ result = val
599
+ result
600
+ end
601
+ .,.,
602
+
603
+ # reduce 7 omitted
604
+
605
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 26
606
+ def _reduce_8( val, _values, result )
607
+ result = val
608
+ result
609
+ end
610
+ .,.,
611
+
612
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 27
613
+ def _reduce_9( val, _values, result )
614
+ result = val
615
+ result
616
+ end
617
+ .,.,
618
+
619
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 28
620
+ def _reduce_10( val, _values, result )
621
+ result = []
622
+ result
623
+ end
624
+ .,.,
625
+
626
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 29
627
+ def _reduce_11( val, _values, result )
628
+ result = val[0].blocks
629
+ result
630
+ end
631
+ .,.,
632
+
633
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 36
634
+ def _reduce_12( val, _values, result )
635
+ # val[0] is like [level, title]
636
+ title = @inline_parser.parse(val[0][1])
637
+ result = Headline.new(val[0][0])
638
+ add_children_to_element(result, *title)
639
+ result
640
+ end
641
+ .,.,
642
+
643
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 38
644
+ def _reduce_13( val, _values, result )
645
+ result = Include.new(val[0])
646
+ result
647
+ end
648
+ .,.,
649
+
650
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 47
651
+ def _reduce_14( val, _values, result )
652
+ # val[0] is Array of String
653
+ content = cut_off(val[0]).join("")
654
+ contents = @inline_parser.parse(content)
655
+ result = TextBlock.new()
656
+ add_children_to_element(result, *contents)
657
+ result
658
+ end
659
+ .,.,
660
+
661
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 50
662
+ def _reduce_15( val, _values, result )
663
+ result.push(val[1])
664
+ result
665
+ end
666
+ .,.,
667
+
668
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 51
669
+ def _reduce_16( val, _values, result )
670
+ result = val
671
+ result
672
+ end
673
+ .,.,
674
+
675
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 59
676
+ def _reduce_17( val, _values, result )
677
+ # val[1] is Array of String
678
+ content = cut_off(val[1])
679
+ result = Verbatim.new(content)
680
+ # imform to lexer.
681
+ @in_verbatim = false
682
+ result
683
+ end
684
+ .,.,
685
+
686
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 66
687
+ def _reduce_18( val, _values, result )
688
+ # val[0] is Array of String
689
+ content = cut_off(val[0])
690
+ result = Verbatim.new(content)
691
+ # imform to lexer.
692
+ @in_verbatim = false
693
+ result
694
+ end
695
+ .,.,
696
+
697
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 69
698
+ def _reduce_19( val, _values, result )
699
+ result.push(val[1])
700
+ result
701
+ end
702
+ .,.,
703
+
704
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 71
705
+ def _reduce_20( val, _values, result )
706
+ result.concat(val[2])
707
+ result
708
+ end
709
+ .,.,
710
+
711
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 73
712
+ def _reduce_21( val, _values, result )
713
+ result.push("\n")
714
+ result
715
+ end
716
+ .,.,
717
+
718
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 76
719
+ def _reduce_22( val, _values, result )
720
+ result = val
721
+ # imform to lexer.
722
+ @in_verbatim = true
723
+ result
724
+ end
725
+ .,.,
726
+
727
+ # reduce 23 omitted
728
+
729
+ # reduce 24 omitted
730
+
731
+ # reduce 25 omitted
732
+
733
+ # reduce 26 omitted
734
+
735
+ # reduce 27 omitted
736
+
737
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 85
738
+ def _reduce_28( val, _values, result )
739
+ result = val[1]
740
+ result
741
+ end
742
+ .,.,
743
+
744
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 87
745
+ def _reduce_29( val, _values, result )
746
+ result = val[1].push(val[2])
747
+ result
748
+ end
749
+ .,.,
750
+
751
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 90
752
+ def _reduce_30( val, _values, result )
753
+ result.push(val[1])
754
+ result
755
+ end
756
+ .,.,
757
+
758
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 91
759
+ def _reduce_31( val, _values, result )
760
+ result = val
761
+ result
762
+ end
763
+ .,.,
764
+
765
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 98
766
+ def _reduce_32( val, _values, result )
767
+ result = ItemList.new
768
+ add_children_to_element(result, *val[0])
769
+ result
770
+ end
771
+ .,.,
772
+
773
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 100
774
+ def _reduce_33( val, _values, result )
775
+ result.push(val[1])
776
+ result
777
+ end
778
+ .,.,
779
+
780
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 101
781
+ def _reduce_34( val, _values, result )
782
+ result = val
783
+ result
784
+ end
785
+ .,.,
786
+
787
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 108
788
+ def _reduce_35( val, _values, result )
789
+ result = ItemListItem.new
790
+ add_children_to_element(result, val[0], *val[1])
791
+ result
792
+ end
793
+ .,.,
794
+
795
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 114
796
+ def _reduce_36( val, _values, result )
797
+ result = EnumList.new
798
+ add_children_to_element(result, *val[0])
799
+ result
800
+ end
801
+ .,.,
802
+
803
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 116
804
+ def _reduce_37( val, _values, result )
805
+ result.push(val[1])
806
+ result
807
+ end
808
+ .,.,
809
+
810
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 117
811
+ def _reduce_38( val, _values, result )
812
+ result = val
813
+ result
814
+ end
815
+ .,.,
816
+
817
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 124
818
+ def _reduce_39( val, _values, result )
819
+ result = EnumListItem.new
820
+ add_children_to_element(result, val[0], *val[1])
821
+ result
822
+ end
823
+ .,.,
824
+
825
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 130
826
+ def _reduce_40( val, _values, result )
827
+ result = DescList.new
828
+ add_children_to_element(result, *val[0])
829
+ result
830
+ end
831
+ .,.,
832
+
833
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 133
834
+ def _reduce_41( val, _values, result )
835
+ result.push(val[1])
836
+ result
837
+ end
838
+ .,.,
839
+
840
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 133
841
+ def _reduce_42( val, _values, result )
842
+ result = val
843
+ result
844
+ end
845
+ .,.,
846
+
847
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 145
848
+ def _reduce_43( val, _values, result )
849
+ term = DescListItem::Term.new
850
+ term_contents = @inline_parser.parse(val[0].strip)
851
+ add_children_to_element(term, *term_contents)
852
+
853
+ result = DescListItem.new
854
+ set_term_to_element(result, term)
855
+ add_children_to_element(result, *val[1])
856
+ result
857
+ end
858
+ .,.,
859
+
860
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 151
861
+ def _reduce_44( val, _values, result )
862
+ result = MethodList.new
863
+ add_children_to_element(result, *val[0])
864
+ result
865
+ end
866
+ .,.,
867
+
868
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 153
869
+ def _reduce_45( val, _values, result )
870
+ result.push(val[1])
871
+ result
872
+ end
873
+ .,.,
874
+
875
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 154
876
+ def _reduce_46( val, _values, result )
877
+ result = val
878
+ result
879
+ end
880
+ .,.,
881
+
882
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 163
883
+ def _reduce_47( val, _values, result )
884
+ term = MethodListItem::Term.new(val[0].strip)
885
+ result = MethodListItem.new
886
+ set_term_to_element(result, term)
887
+ add_children_to_element(result, *val[1])
888
+ result
889
+ end
890
+ .,.,
891
+
892
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 166
893
+ def _reduce_48( val, _values, result )
894
+ result = [val[1]].concat(val[2])
895
+ result
896
+ end
897
+ .,.,
898
+
899
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 167
900
+ def _reduce_49( val, _values, result )
901
+ result = [val[1]]
902
+ result
903
+ end
904
+ .,.,
905
+
906
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 169
907
+ def _reduce_50( val, _values, result )
908
+ result = val[2]
909
+ result
910
+ end
911
+ .,.,
912
+
913
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 170
914
+ def _reduce_51( val, _values, result )
915
+ result = []
916
+ result
917
+ end
918
+ .,.,
919
+
920
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 173
921
+ def _reduce_52( val, _values, result )
922
+ result.concat(val[1])
923
+ result
924
+ end
925
+ .,.,
926
+
927
+ # reduce 53 omitted
928
+
929
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 176
930
+ def _reduce_54( val, _values, result )
931
+ result = val
932
+ result
933
+ end
934
+ .,.,
935
+
936
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 177
937
+ def _reduce_55( val, _values, result )
938
+ result = val
939
+ result
940
+ end
941
+ .,.,
942
+
943
+ # reduce 56 omitted
944
+
945
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 179
946
+ def _reduce_57( val, _values, result )
947
+ result = []
948
+ result
949
+ end
950
+ .,.,
951
+
952
+ # reduce 58 omitted
953
+
954
+ # reduce 59 omitted
955
+
956
+ # reduce 60 omitted
957
+
958
+ # reduce 61 omitted
959
+
960
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 194
961
+ def _reduce_62( val, _values, result )
962
+ content = cut_off([val[0]].concat(val[1])).join("")
963
+ contents = @inline_parser.parse(content)
964
+ result = TextBlock.new()
965
+ add_children_to_element(result, *contents)
966
+ result
967
+ end
968
+ .,.,
969
+
970
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 201
971
+ def _reduce_63( val, _values, result )
972
+ content = cut_off([val[0]]).join("")
973
+ contents = @inline_parser.parse(content)
974
+ result = TextBlock.new()
975
+ add_children_to_element(result, *contents)
976
+ result
977
+ end
978
+ .,.,
979
+
980
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 209
981
+ def _reduce_64( val, _values, result )
982
+ content = cut_off([val[0]].concat(val[1])).join("")
983
+ contents = @inline_parser.parse(content)
984
+ result = TextBlock.new()
985
+ add_children_to_element(result, *contents)
986
+ result
987
+ end
988
+ .,.,
989
+
990
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 216
991
+ def _reduce_65( val, _values, result )
992
+ content = cut_off([val[0]]).join("")
993
+ contents = @inline_parser.parse(content)
994
+ result = TextBlock.new()
995
+ add_children_to_element(result, *contents)
996
+ result
997
+ end
998
+ .,.,
999
+
1000
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 219
1001
+ def _reduce_66( val, _values, result )
1002
+ result = [val[0]].concat(val[1])
1003
+ result
1004
+ end
1005
+ .,.,
1006
+
1007
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 220
1008
+ def _reduce_67( val, _values, result )
1009
+ result.concat(val[1])
1010
+ result
1011
+ end
1012
+ .,.,
1013
+
1014
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 221
1015
+ def _reduce_68( val, _values, result )
1016
+ result = val[1]
1017
+ result
1018
+ end
1019
+ .,.,
1020
+
1021
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 222
1022
+ def _reduce_69( val, _values, result )
1023
+ result = val
1024
+ result
1025
+ end
1026
+ .,.,
1027
+
1028
+ # reduce 70 omitted
1029
+
1030
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 224
1031
+ def _reduce_71( val, _values, result )
1032
+ result = []
1033
+ result
1034
+ end
1035
+ .,.,
1036
+
1037
+ module_eval <<'.,.,', 'lib/rd/rdblockparser.ry', 225
1038
+ def _reduce_72( val, _values, result )
1039
+ result = []
1040
+ result
1041
+ end
1042
+ .,.,
1043
+
1044
+ def _reduce_none( val, _values, result )
1045
+ result
1046
+ end
1047
+
1048
+ end # class RDParser
1049
+
1050
+ end # end of module RD