super-quick-rb 0.0.1
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.
- checksums.yaml +7 -0
- data/rdoc-8.0.0/CONTRIBUTING.md +195 -0
- data/rdoc-8.0.0/CVE-2013-0256.rdoc +49 -0
- data/rdoc-8.0.0/History.rdoc +1668 -0
- data/rdoc-8.0.0/LEGAL.rdoc +56 -0
- data/rdoc-8.0.0/LICENSE.rdoc +63 -0
- data/rdoc-8.0.0/README.md +236 -0
- data/rdoc-8.0.0/RI.md +842 -0
- data/rdoc-8.0.0/TODO.rdoc +60 -0
- data/rdoc-8.0.0/doc/markup_reference/markdown.md +659 -0
- data/rdoc-8.0.0/doc/markup_reference/rdoc.rdoc +1169 -0
- data/rdoc-8.0.0/exe/rdoc +43 -0
- data/rdoc-8.0.0/exe/ri +12 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/alias.rb +98 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/any_method.rb +387 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/attr.rb +178 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/class_module.rb +969 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/constant.rb +221 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context/section.rb +182 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context.rb +1238 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/extend.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/include.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/method_attr.rb +417 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/mixin.rb +123 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_class.rb +92 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_module.rb +73 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/require.rb +51 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/single_class.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/top_level.rb +286 -0
- data/rdoc-8.0.0/lib/rdoc/code_object.rb +393 -0
- data/rdoc-8.0.0/lib/rdoc/code_objects.rb +5 -0
- data/rdoc-8.0.0/lib/rdoc/comment.rb +353 -0
- data/rdoc-8.0.0/lib/rdoc/cross_reference.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/encoding.rb +120 -0
- data/rdoc-8.0.0/lib/rdoc/erb_partial.rb +18 -0
- data/rdoc-8.0.0/lib/rdoc/erbio.rb +37 -0
- data/rdoc-8.0.0/lib/rdoc/generator/aliki.rb +200 -0
- data/rdoc-8.0.0/lib/rdoc/generator/darkfish.rb +824 -0
- data/rdoc-8.0.0/lib/rdoc/generator/json_index.rb +284 -0
- data/rdoc-8.0.0/lib/rdoc/generator/markup.rb +196 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot.rb +94 -0
- data/rdoc-8.0.0/lib/rdoc/generator/ri.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/class.rhtml +220 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +701 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/index.rhtml +24 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +140 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/search.js +120 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/page.rhtml +19 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +72 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/searcher.js +271 -0
- data/rdoc-8.0.0/lib/rdoc/generator.rb +52 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/locale.rb +102 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/text.rb +126 -0
- data/rdoc-8.0.0/lib/rdoc/i18n.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc/known_classes.rb +74 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/entities.rb +2131 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.kpeg +21 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.rb +454 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.kpeg +1315 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.rb +16865 -0
- data/rdoc-8.0.0/lib/rdoc/markup/blank_line.rb +29 -0
- data/rdoc-8.0.0/lib/rdoc/markup/block_quote.rb +14 -0
- data/rdoc-8.0.0/lib/rdoc/markup/document.rb +164 -0
- data/rdoc-8.0.0/lib/rdoc/markup/element.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/markup/formatter.rb +285 -0
- data/rdoc-8.0.0/lib/rdoc/markup/hard_break.rb +34 -0
- data/rdoc-8.0.0/lib/rdoc/markup/heading.rb +170 -0
- data/rdoc-8.0.0/lib/rdoc/markup/include.rb +42 -0
- data/rdoc-8.0.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
- data/rdoc-8.0.0/lib/rdoc/markup/inline_parser.rb +312 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list.rb +101 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list_item.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/markup/paragraph.rb +28 -0
- data/rdoc-8.0.0/lib/rdoc/markup/parser.rb +585 -0
- data/rdoc-8.0.0/lib/rdoc/markup/pre_process.rb +317 -0
- data/rdoc-8.0.0/lib/rdoc/markup/raw.rb +66 -0
- data/rdoc-8.0.0/lib/rdoc/markup/rule.rb +20 -0
- data/rdoc-8.0.0/lib/rdoc/markup/table.rb +64 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_ansi.rb +144 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_bs.rb +86 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html.rb +682 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_crossref.rb +261 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_joined_paragraph.rb +41 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_label.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_markdown.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_rdoc.rb +421 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_test.rb +77 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_tt_only.rb +107 -0
- data/rdoc-8.0.0/lib/rdoc/markup/verbatim.rb +83 -0
- data/rdoc-8.0.0/lib/rdoc/markup.rb +219 -0
- data/rdoc-8.0.0/lib/rdoc/options.rb +1412 -0
- data/rdoc-8.0.0/lib/rdoc/parser/c.rb +1227 -0
- data/rdoc-8.0.0/lib/rdoc/parser/changelog.rb +379 -0
- data/rdoc-8.0.0/lib/rdoc/parser/markdown.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rbs.rb +275 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rd.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby.rb +1266 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/rdoc-8.0.0/lib/rdoc/parser/simple.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/parser/text.rb +11 -0
- data/rdoc-8.0.0/lib/rdoc/parser.rb +298 -0
- data/rdoc-8.0.0/lib/rdoc/rbs_helper.rb +186 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.rb +1706 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.ry +643 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.rb +1854 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.ry +593 -0
- data/rdoc-8.0.0/lib/rdoc/rd.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/rdoc.rb +724 -0
- data/rdoc-8.0.0/lib/rdoc/ri/driver.rb +1572 -0
- data/rdoc-8.0.0/lib/rdoc/ri/formatter.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/paths.rb +171 -0
- data/rdoc-8.0.0/lib/rdoc/ri/servlet.rb +452 -0
- data/rdoc-8.0.0/lib/rdoc/ri/store.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/task.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/ri.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/rubygems_hook.rb +327 -0
- data/rdoc-8.0.0/lib/rdoc/server.rb +460 -0
- data/rdoc-8.0.0/lib/rdoc/stats/normal.rb +58 -0
- data/rdoc-8.0.0/lib/rdoc/stats/quiet.rb +59 -0
- data/rdoc-8.0.0/lib/rdoc/stats/verbose.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/stats.rb +484 -0
- data/rdoc-8.0.0/lib/rdoc/store.rb +1205 -0
- data/rdoc-8.0.0/lib/rdoc/task.rb +355 -0
- data/rdoc-8.0.0/lib/rdoc/text.rb +244 -0
- data/rdoc-8.0.0/lib/rdoc/token_stream.rb +104 -0
- data/rdoc-8.0.0/lib/rdoc/tom_doc.rb +257 -0
- data/rdoc-8.0.0/lib/rdoc/version.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc.rb +239 -0
- data/rdoc-8.0.0/lib/rubygems_plugin.rb +14 -0
- data/rdoc-8.0.0/man/ri.1 +249 -0
- data/rdoc-8.0.0/rdoc-logo.svg +43 -0
- data/rdoc-8.0.0/rdoc.gemspec +74 -0
- data/super-quick-rb.gemspec +12 -0
- metadata +257 -0
|
@@ -0,0 +1,1706 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
#
|
|
3
|
+
# DO NOT MODIFY!!!!
|
|
4
|
+
# This file is automatically generated by Racc 1.8.1
|
|
5
|
+
# from Racc grammar file "block_parser.ry".
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
###### racc/parser.rb begin
|
|
9
|
+
unless $".find {|p| p.end_with?('/racc/parser.rb')}
|
|
10
|
+
$".push "#{__dir__}/racc/parser.rb"
|
|
11
|
+
#--
|
|
12
|
+
# Copyright (c) 1999-2006 Minero Aoki
|
|
13
|
+
#
|
|
14
|
+
# This program is free software.
|
|
15
|
+
# You can distribute/modify this program under the same terms of ruby.
|
|
16
|
+
#
|
|
17
|
+
# As a special exception, when this code is copied by Racc
|
|
18
|
+
# into a Racc output file, you may use that output file
|
|
19
|
+
# without restriction.
|
|
20
|
+
#++
|
|
21
|
+
|
|
22
|
+
unless $".find {|p| p.end_with?('/racc/info.rb')}
|
|
23
|
+
$".push "#{__dir__}/racc/info.rb"
|
|
24
|
+
|
|
25
|
+
module Racc
|
|
26
|
+
VERSION = '1.8.1'
|
|
27
|
+
Version = VERSION
|
|
28
|
+
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
module Racc
|
|
35
|
+
class ParseError < StandardError; end
|
|
36
|
+
end
|
|
37
|
+
unless defined?(::ParseError)
|
|
38
|
+
ParseError = Racc::ParseError # :nodoc:
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Racc is an LALR(1) parser generator.
|
|
42
|
+
# It is written in Ruby itself, and generates Ruby programs.
|
|
43
|
+
#
|
|
44
|
+
# == Command-line Reference
|
|
45
|
+
#
|
|
46
|
+
# racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
|
|
47
|
+
# [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
|
|
48
|
+
# [-v] [--verbose]
|
|
49
|
+
# [-O<var>filename</var>] [--log-file=<var>filename</var>]
|
|
50
|
+
# [-g] [--debug]
|
|
51
|
+
# [-E] [--embedded]
|
|
52
|
+
# [-l] [--no-line-convert]
|
|
53
|
+
# [-c] [--line-convert-all]
|
|
54
|
+
# [-a] [--no-omit-actions]
|
|
55
|
+
# [-C] [--check-only]
|
|
56
|
+
# [-S] [--output-status]
|
|
57
|
+
# [--version] [--copyright] [--help] <var>grammarfile</var>
|
|
58
|
+
#
|
|
59
|
+
# [+grammarfile+]
|
|
60
|
+
# Racc grammar file. Any extension is permitted.
|
|
61
|
+
# [-o+outfile+, --output-file=+outfile+]
|
|
62
|
+
# A filename for output. default is <+filename+>.tab.rb
|
|
63
|
+
# [-O+filename+, --log-file=+filename+]
|
|
64
|
+
# Place logging output in file +filename+.
|
|
65
|
+
# Default log file name is <+filename+>.output.
|
|
66
|
+
# [-e+rubypath+, --executable=+rubypath+]
|
|
67
|
+
# output executable file(mode 755). where +path+ is the Ruby interpreter.
|
|
68
|
+
# [-v, --verbose]
|
|
69
|
+
# verbose mode. create +filename+.output file, like yacc's y.output file.
|
|
70
|
+
# [-g, --debug]
|
|
71
|
+
# add debug code to parser class. To display debugging information,
|
|
72
|
+
# use this '-g' option and set @yydebug true in parser class.
|
|
73
|
+
# [-E, --embedded]
|
|
74
|
+
# Output parser which doesn't need runtime files (racc/parser.rb).
|
|
75
|
+
# [-F, --frozen]
|
|
76
|
+
# Output parser which declares frozen_string_literals: true
|
|
77
|
+
# [-C, --check-only]
|
|
78
|
+
# Check syntax of racc grammar file and quit.
|
|
79
|
+
# [-S, --output-status]
|
|
80
|
+
# Print messages time to time while compiling.
|
|
81
|
+
# [-l, --no-line-convert]
|
|
82
|
+
# turns off line number converting.
|
|
83
|
+
# [-c, --line-convert-all]
|
|
84
|
+
# Convert line number of actions, inner, header and footer.
|
|
85
|
+
# [-a, --no-omit-actions]
|
|
86
|
+
# Call all actions, even if an action is empty.
|
|
87
|
+
# [--version]
|
|
88
|
+
# print Racc version and quit.
|
|
89
|
+
# [--copyright]
|
|
90
|
+
# Print copyright and quit.
|
|
91
|
+
# [--help]
|
|
92
|
+
# Print usage and quit.
|
|
93
|
+
#
|
|
94
|
+
# == Generating Parser Using Racc
|
|
95
|
+
#
|
|
96
|
+
# To compile Racc grammar file, simply type:
|
|
97
|
+
#
|
|
98
|
+
# $ racc parse.y
|
|
99
|
+
#
|
|
100
|
+
# This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
|
|
101
|
+
#
|
|
102
|
+
# == Writing A Racc Grammar File
|
|
103
|
+
#
|
|
104
|
+
# If you want your own parser, you have to write a grammar file.
|
|
105
|
+
# A grammar file contains the name of your parser class, grammar for the parser,
|
|
106
|
+
# user code, and anything else.
|
|
107
|
+
# When writing a grammar file, yacc's knowledge is helpful.
|
|
108
|
+
# If you have not used yacc before, Racc is not too difficult.
|
|
109
|
+
#
|
|
110
|
+
# Here's an example Racc grammar file.
|
|
111
|
+
#
|
|
112
|
+
# class Calcparser
|
|
113
|
+
# rule
|
|
114
|
+
# target: exp { print val[0] }
|
|
115
|
+
#
|
|
116
|
+
# exp: exp '+' exp
|
|
117
|
+
# | exp '*' exp
|
|
118
|
+
# | '(' exp ')'
|
|
119
|
+
# | NUMBER
|
|
120
|
+
# end
|
|
121
|
+
#
|
|
122
|
+
# Racc grammar files resemble yacc files.
|
|
123
|
+
# But (of course), this is Ruby code.
|
|
124
|
+
# yacc's $$ is the 'result', $0, $1... is
|
|
125
|
+
# an array called 'val', and $-1, $-2... is an array called '_values'.
|
|
126
|
+
#
|
|
127
|
+
# See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
|
|
128
|
+
# more information on grammar files.
|
|
129
|
+
#
|
|
130
|
+
# == Parser
|
|
131
|
+
#
|
|
132
|
+
# Then you must prepare the parse entry method. There are two types of
|
|
133
|
+
# parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
|
|
134
|
+
#
|
|
135
|
+
# Racc::Parser#do_parse is simple.
|
|
136
|
+
#
|
|
137
|
+
# It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
|
|
138
|
+
# This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
|
|
139
|
+
# EOF is [false, false].
|
|
140
|
+
# (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
|
|
141
|
+
# If you want to change this, see the grammar reference.
|
|
142
|
+
#
|
|
143
|
+
# Racc::Parser#yyparse is little complicated, but useful.
|
|
144
|
+
# It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
|
|
145
|
+
#
|
|
146
|
+
# For example, <code>yyparse(obj, :scan)</code> causes
|
|
147
|
+
# calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
|
|
148
|
+
#
|
|
149
|
+
# == Debugging
|
|
150
|
+
#
|
|
151
|
+
# When debugging, "-v" or/and the "-g" option is helpful.
|
|
152
|
+
#
|
|
153
|
+
# "-v" creates verbose log file (.output).
|
|
154
|
+
# "-g" creates a "Verbose Parser".
|
|
155
|
+
# Verbose Parser prints the internal status when parsing.
|
|
156
|
+
# But it's _not_ automatic.
|
|
157
|
+
# You must use -g option and set +@yydebug+ to +true+ in order to get output.
|
|
158
|
+
# -g option only creates the verbose parser.
|
|
159
|
+
#
|
|
160
|
+
# === Racc reported syntax error.
|
|
161
|
+
#
|
|
162
|
+
# Isn't there too many "end"?
|
|
163
|
+
# grammar of racc file is changed in v0.10.
|
|
164
|
+
#
|
|
165
|
+
# Racc does not use '%' mark, while yacc uses huge number of '%' marks..
|
|
166
|
+
#
|
|
167
|
+
# === Racc reported "XXXX conflicts".
|
|
168
|
+
#
|
|
169
|
+
# Try "racc -v xxxx.y".
|
|
170
|
+
# It causes producing racc's internal log file, xxxx.output.
|
|
171
|
+
#
|
|
172
|
+
# === Generated parsers does not work correctly
|
|
173
|
+
#
|
|
174
|
+
# Try "racc -g xxxx.y".
|
|
175
|
+
# This command let racc generate "debugging parser".
|
|
176
|
+
# Then set @yydebug=true in your parser.
|
|
177
|
+
# It produces a working log of your parser.
|
|
178
|
+
#
|
|
179
|
+
# == Re-distributing Racc runtime
|
|
180
|
+
#
|
|
181
|
+
# A parser, which is created by Racc, requires the Racc runtime module;
|
|
182
|
+
# racc/parser.rb.
|
|
183
|
+
#
|
|
184
|
+
# Ruby 1.8.x comes with Racc runtime module,
|
|
185
|
+
# you need NOT distribute Racc runtime files.
|
|
186
|
+
#
|
|
187
|
+
# If you want to include the Racc runtime module with your parser.
|
|
188
|
+
# This can be done by using '-E' option:
|
|
189
|
+
#
|
|
190
|
+
# $ racc -E -omyparser.rb myparser.y
|
|
191
|
+
#
|
|
192
|
+
# This command creates myparser.rb which `includes' Racc runtime.
|
|
193
|
+
# Only you must do is to distribute your parser file (myparser.rb).
|
|
194
|
+
#
|
|
195
|
+
# Note: parser.rb is ruby license, but your parser is not.
|
|
196
|
+
# Your own parser is completely yours.
|
|
197
|
+
module Racc
|
|
198
|
+
|
|
199
|
+
unless defined?(Racc_No_Extensions)
|
|
200
|
+
Racc_No_Extensions = false # :nodoc:
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
class Parser
|
|
204
|
+
|
|
205
|
+
Racc_Runtime_Version = ::Racc::VERSION
|
|
206
|
+
Racc_Runtime_Core_Version_R = ::Racc::VERSION
|
|
207
|
+
|
|
208
|
+
begin
|
|
209
|
+
if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
|
|
210
|
+
require 'jruby'
|
|
211
|
+
require 'racc/cparse-jruby.jar'
|
|
212
|
+
com.headius.racc.Cparse.new.load(JRuby.runtime, false)
|
|
213
|
+
else
|
|
214
|
+
require 'racc/cparse'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
unless new.respond_to?(:_racc_do_parse_c, true)
|
|
218
|
+
raise LoadError, 'old cparse.so'
|
|
219
|
+
end
|
|
220
|
+
if Racc_No_Extensions
|
|
221
|
+
raise LoadError, 'selecting ruby version of racc runtime core'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
|
|
225
|
+
Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
|
|
226
|
+
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
|
|
227
|
+
Racc_Runtime_Type = 'c' # :nodoc:
|
|
228
|
+
rescue LoadError
|
|
229
|
+
Racc_Main_Parsing_Routine = :_racc_do_parse_rb
|
|
230
|
+
Racc_YY_Parse_Method = :_racc_yyparse_rb
|
|
231
|
+
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
|
|
232
|
+
Racc_Runtime_Type = 'ruby'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
def Parser.racc_runtime_type # :nodoc:
|
|
236
|
+
Racc_Runtime_Type
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def _racc_setup
|
|
240
|
+
@yydebug = false unless self.class::Racc_debug_parser
|
|
241
|
+
@yydebug = false unless defined?(@yydebug)
|
|
242
|
+
if @yydebug
|
|
243
|
+
@racc_debug_out = $stderr unless defined?(@racc_debug_out)
|
|
244
|
+
@racc_debug_out ||= $stderr
|
|
245
|
+
end
|
|
246
|
+
arg = self.class::Racc_arg
|
|
247
|
+
arg[13] = true if arg.size < 14
|
|
248
|
+
arg
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
def _racc_init_sysvars
|
|
252
|
+
@racc_state = [0]
|
|
253
|
+
@racc_tstack = []
|
|
254
|
+
@racc_vstack = []
|
|
255
|
+
|
|
256
|
+
@racc_t = nil
|
|
257
|
+
@racc_val = nil
|
|
258
|
+
|
|
259
|
+
@racc_read_next = true
|
|
260
|
+
|
|
261
|
+
@racc_user_yyerror = false
|
|
262
|
+
@racc_error_status = 0
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# The entry point of the parser. This method is used with #next_token.
|
|
266
|
+
# If Racc wants to get token (and its value), calls next_token.
|
|
267
|
+
#
|
|
268
|
+
# Example:
|
|
269
|
+
# def parse
|
|
270
|
+
# @q = [[1,1],
|
|
271
|
+
# [2,2],
|
|
272
|
+
# [3,3],
|
|
273
|
+
# [false, '$']]
|
|
274
|
+
# do_parse
|
|
275
|
+
# end
|
|
276
|
+
#
|
|
277
|
+
# def next_token
|
|
278
|
+
# @q.shift
|
|
279
|
+
# end
|
|
280
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
|
281
|
+
def do_parse
|
|
282
|
+
#{Racc_Main_Parsing_Routine}(_racc_setup(), false)
|
|
283
|
+
end
|
|
284
|
+
RUBY
|
|
285
|
+
|
|
286
|
+
# The method to fetch next token.
|
|
287
|
+
# If you use #do_parse method, you must implement #next_token.
|
|
288
|
+
#
|
|
289
|
+
# The format of return value is [TOKEN_SYMBOL, VALUE].
|
|
290
|
+
# +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
|
|
291
|
+
# for 'IDENT'. ";" (String) for ';'.
|
|
292
|
+
#
|
|
293
|
+
# The final symbol (End of file) must be false.
|
|
294
|
+
def next_token
|
|
295
|
+
raise NotImplementedError, "#{self.class}\#next_token is not defined"
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
def _racc_do_parse_rb(arg, in_debug)
|
|
299
|
+
action_table, action_check, action_default, action_pointer,
|
|
300
|
+
_, _, _, _,
|
|
301
|
+
_, _, token_table, * = arg
|
|
302
|
+
|
|
303
|
+
_racc_init_sysvars
|
|
304
|
+
tok = act = i = nil
|
|
305
|
+
|
|
306
|
+
catch(:racc_end_parse) {
|
|
307
|
+
while true
|
|
308
|
+
if i = action_pointer[@racc_state[-1]]
|
|
309
|
+
if @racc_read_next
|
|
310
|
+
if @racc_t != 0 # not EOF
|
|
311
|
+
tok, @racc_val = next_token()
|
|
312
|
+
unless tok # EOF
|
|
313
|
+
@racc_t = 0
|
|
314
|
+
else
|
|
315
|
+
@racc_t = (token_table[tok] or 1) # error token
|
|
316
|
+
end
|
|
317
|
+
racc_read_token(@racc_t, tok, @racc_val) if @yydebug
|
|
318
|
+
@racc_read_next = false
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
i += @racc_t
|
|
322
|
+
unless i >= 0 and
|
|
323
|
+
act = action_table[i] and
|
|
324
|
+
action_check[i] == @racc_state[-1]
|
|
325
|
+
act = action_default[@racc_state[-1]]
|
|
326
|
+
end
|
|
327
|
+
else
|
|
328
|
+
act = action_default[@racc_state[-1]]
|
|
329
|
+
end
|
|
330
|
+
while act = _racc_evalact(act, arg)
|
|
331
|
+
;
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
}
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Another entry point for the parser.
|
|
338
|
+
# If you use this method, you must implement RECEIVER#METHOD_ID method.
|
|
339
|
+
#
|
|
340
|
+
# RECEIVER#METHOD_ID is a method to get next token.
|
|
341
|
+
# It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
|
|
342
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
|
343
|
+
def yyparse(recv, mid)
|
|
344
|
+
#{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
|
|
345
|
+
end
|
|
346
|
+
RUBY
|
|
347
|
+
|
|
348
|
+
def _racc_yyparse_rb(recv, mid, arg, c_debug)
|
|
349
|
+
action_table, action_check, action_default, action_pointer,
|
|
350
|
+
_, _, _, _,
|
|
351
|
+
_, _, token_table, * = arg
|
|
352
|
+
|
|
353
|
+
_racc_init_sysvars
|
|
354
|
+
|
|
355
|
+
catch(:racc_end_parse) {
|
|
356
|
+
until i = action_pointer[@racc_state[-1]]
|
|
357
|
+
while act = _racc_evalact(action_default[@racc_state[-1]], arg)
|
|
358
|
+
;
|
|
359
|
+
end
|
|
360
|
+
end
|
|
361
|
+
recv.__send__(mid) do |tok, val|
|
|
362
|
+
unless tok
|
|
363
|
+
@racc_t = 0
|
|
364
|
+
else
|
|
365
|
+
@racc_t = (token_table[tok] or 1) # error token
|
|
366
|
+
end
|
|
367
|
+
@racc_val = val
|
|
368
|
+
@racc_read_next = false
|
|
369
|
+
|
|
370
|
+
i += @racc_t
|
|
371
|
+
unless i >= 0 and
|
|
372
|
+
act = action_table[i] and
|
|
373
|
+
action_check[i] == @racc_state[-1]
|
|
374
|
+
act = action_default[@racc_state[-1]]
|
|
375
|
+
end
|
|
376
|
+
while act = _racc_evalact(act, arg)
|
|
377
|
+
;
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
while !(i = action_pointer[@racc_state[-1]]) ||
|
|
381
|
+
! @racc_read_next ||
|
|
382
|
+
@racc_t == 0 # $
|
|
383
|
+
unless i and i += @racc_t and
|
|
384
|
+
i >= 0 and
|
|
385
|
+
act = action_table[i] and
|
|
386
|
+
action_check[i] == @racc_state[-1]
|
|
387
|
+
act = action_default[@racc_state[-1]]
|
|
388
|
+
end
|
|
389
|
+
while act = _racc_evalact(act, arg)
|
|
390
|
+
;
|
|
391
|
+
end
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
}
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
###
|
|
398
|
+
### common
|
|
399
|
+
###
|
|
400
|
+
|
|
401
|
+
def _racc_evalact(act, arg)
|
|
402
|
+
action_table, action_check, _, action_pointer,
|
|
403
|
+
_, _, _, _,
|
|
404
|
+
_, _, _, shift_n,
|
|
405
|
+
reduce_n, * = arg
|
|
406
|
+
nerr = 0 # tmp
|
|
407
|
+
|
|
408
|
+
if act > 0 and act < shift_n
|
|
409
|
+
#
|
|
410
|
+
# shift
|
|
411
|
+
#
|
|
412
|
+
if @racc_error_status > 0
|
|
413
|
+
@racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
|
|
414
|
+
end
|
|
415
|
+
@racc_vstack.push @racc_val
|
|
416
|
+
@racc_state.push act
|
|
417
|
+
@racc_read_next = true
|
|
418
|
+
if @yydebug
|
|
419
|
+
@racc_tstack.push @racc_t
|
|
420
|
+
racc_shift @racc_t, @racc_tstack, @racc_vstack
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
elsif act < 0 and act > -reduce_n
|
|
424
|
+
#
|
|
425
|
+
# reduce
|
|
426
|
+
#
|
|
427
|
+
code = catch(:racc_jump) {
|
|
428
|
+
@racc_state.push _racc_do_reduce(arg, act)
|
|
429
|
+
false
|
|
430
|
+
}
|
|
431
|
+
if code
|
|
432
|
+
case code
|
|
433
|
+
when 1 # yyerror
|
|
434
|
+
@racc_user_yyerror = true # user_yyerror
|
|
435
|
+
return -reduce_n
|
|
436
|
+
when 2 # yyaccept
|
|
437
|
+
return shift_n
|
|
438
|
+
else
|
|
439
|
+
raise '[Racc Bug] unknown jump code'
|
|
440
|
+
end
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
elsif act == shift_n
|
|
444
|
+
#
|
|
445
|
+
# accept
|
|
446
|
+
#
|
|
447
|
+
racc_accept if @yydebug
|
|
448
|
+
throw :racc_end_parse, @racc_vstack[0]
|
|
449
|
+
|
|
450
|
+
elsif act == -reduce_n
|
|
451
|
+
#
|
|
452
|
+
# error
|
|
453
|
+
#
|
|
454
|
+
case @racc_error_status
|
|
455
|
+
when 0
|
|
456
|
+
unless arg[21] # user_yyerror
|
|
457
|
+
nerr += 1
|
|
458
|
+
on_error @racc_t, @racc_val, @racc_vstack
|
|
459
|
+
end
|
|
460
|
+
when 3
|
|
461
|
+
if @racc_t == 0 # is $
|
|
462
|
+
# We're at EOF, and another error occurred immediately after
|
|
463
|
+
# attempting auto-recovery
|
|
464
|
+
throw :racc_end_parse, nil
|
|
465
|
+
end
|
|
466
|
+
@racc_read_next = true
|
|
467
|
+
end
|
|
468
|
+
@racc_user_yyerror = false
|
|
469
|
+
@racc_error_status = 3
|
|
470
|
+
while true
|
|
471
|
+
if i = action_pointer[@racc_state[-1]]
|
|
472
|
+
i += 1 # error token
|
|
473
|
+
if i >= 0 and
|
|
474
|
+
(act = action_table[i]) and
|
|
475
|
+
action_check[i] == @racc_state[-1]
|
|
476
|
+
break
|
|
477
|
+
end
|
|
478
|
+
end
|
|
479
|
+
throw :racc_end_parse, nil if @racc_state.size <= 1
|
|
480
|
+
@racc_state.pop
|
|
481
|
+
@racc_vstack.pop
|
|
482
|
+
if @yydebug
|
|
483
|
+
@racc_tstack.pop
|
|
484
|
+
racc_e_pop @racc_state, @racc_tstack, @racc_vstack
|
|
485
|
+
end
|
|
486
|
+
end
|
|
487
|
+
return act
|
|
488
|
+
|
|
489
|
+
else
|
|
490
|
+
raise "[Racc Bug] unknown action #{act.inspect}"
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
racc_next_state(@racc_state[-1], @racc_state) if @yydebug
|
|
494
|
+
|
|
495
|
+
nil
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
def _racc_do_reduce(arg, act)
|
|
499
|
+
_, _, _, _,
|
|
500
|
+
goto_table, goto_check, goto_default, goto_pointer,
|
|
501
|
+
nt_base, reduce_table, _, _,
|
|
502
|
+
_, use_result, * = arg
|
|
503
|
+
|
|
504
|
+
state = @racc_state
|
|
505
|
+
vstack = @racc_vstack
|
|
506
|
+
tstack = @racc_tstack
|
|
507
|
+
|
|
508
|
+
i = act * -3
|
|
509
|
+
len = reduce_table[i]
|
|
510
|
+
reduce_to = reduce_table[i+1]
|
|
511
|
+
method_id = reduce_table[i+2]
|
|
512
|
+
void_array = []
|
|
513
|
+
|
|
514
|
+
tmp_t = tstack[-len, len] if @yydebug
|
|
515
|
+
tmp_v = vstack[-len, len]
|
|
516
|
+
tstack[-len, len] = void_array if @yydebug
|
|
517
|
+
vstack[-len, len] = void_array
|
|
518
|
+
state[-len, len] = void_array
|
|
519
|
+
|
|
520
|
+
# tstack must be updated AFTER method call
|
|
521
|
+
if use_result
|
|
522
|
+
vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
|
|
523
|
+
else
|
|
524
|
+
vstack.push __send__(method_id, tmp_v, vstack)
|
|
525
|
+
end
|
|
526
|
+
tstack.push reduce_to
|
|
527
|
+
|
|
528
|
+
racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
|
|
529
|
+
|
|
530
|
+
k1 = reduce_to - nt_base
|
|
531
|
+
if i = goto_pointer[k1]
|
|
532
|
+
i += state[-1]
|
|
533
|
+
if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
|
|
534
|
+
return curstate
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
goto_default[k1]
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
# This method is called when a parse error is found.
|
|
541
|
+
#
|
|
542
|
+
# ERROR_TOKEN_ID is an internal ID of token which caused error.
|
|
543
|
+
# You can get string representation of this ID by calling
|
|
544
|
+
# #token_to_str.
|
|
545
|
+
#
|
|
546
|
+
# ERROR_VALUE is a value of error token.
|
|
547
|
+
#
|
|
548
|
+
# value_stack is a stack of symbol values.
|
|
549
|
+
# DO NOT MODIFY this object.
|
|
550
|
+
#
|
|
551
|
+
# This method raises ParseError by default.
|
|
552
|
+
#
|
|
553
|
+
# If this method returns, parsers enter "error recovering mode".
|
|
554
|
+
def on_error(t, val, vstack)
|
|
555
|
+
raise ParseError, sprintf("parse error on value %s (%s)",
|
|
556
|
+
val.inspect, token_to_str(t) || '?')
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
# Enter error recovering mode.
|
|
560
|
+
# This method does not call #on_error.
|
|
561
|
+
def yyerror
|
|
562
|
+
throw :racc_jump, 1
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
# Exit parser.
|
|
566
|
+
# Return value is +Symbol_Value_Stack[0]+.
|
|
567
|
+
def yyaccept
|
|
568
|
+
throw :racc_jump, 2
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
# Leave error recovering mode.
|
|
572
|
+
def yyerrok
|
|
573
|
+
@racc_error_status = 0
|
|
574
|
+
end
|
|
575
|
+
|
|
576
|
+
# For debugging output
|
|
577
|
+
def racc_read_token(t, tok, val)
|
|
578
|
+
@racc_debug_out.print 'read '
|
|
579
|
+
@racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
|
|
580
|
+
@racc_debug_out.puts val.inspect
|
|
581
|
+
@racc_debug_out.puts
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
def racc_shift(tok, tstack, vstack)
|
|
585
|
+
@racc_debug_out.puts "shift #{racc_token2str tok}"
|
|
586
|
+
racc_print_stacks tstack, vstack
|
|
587
|
+
@racc_debug_out.puts
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
def racc_reduce(toks, sim, tstack, vstack)
|
|
591
|
+
out = @racc_debug_out
|
|
592
|
+
out.print 'reduce '
|
|
593
|
+
if toks.empty?
|
|
594
|
+
out.print ' <none>'
|
|
595
|
+
else
|
|
596
|
+
toks.each {|t| out.print ' ', racc_token2str(t) }
|
|
597
|
+
end
|
|
598
|
+
out.puts " --> #{racc_token2str(sim)}"
|
|
599
|
+
racc_print_stacks tstack, vstack
|
|
600
|
+
@racc_debug_out.puts
|
|
601
|
+
end
|
|
602
|
+
|
|
603
|
+
def racc_accept
|
|
604
|
+
@racc_debug_out.puts 'accept'
|
|
605
|
+
@racc_debug_out.puts
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
def racc_e_pop(state, tstack, vstack)
|
|
609
|
+
@racc_debug_out.puts 'error recovering mode: pop token'
|
|
610
|
+
racc_print_states state
|
|
611
|
+
racc_print_stacks tstack, vstack
|
|
612
|
+
@racc_debug_out.puts
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
def racc_next_state(curstate, state)
|
|
616
|
+
@racc_debug_out.puts "goto #{curstate}"
|
|
617
|
+
racc_print_states state
|
|
618
|
+
@racc_debug_out.puts
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
def racc_print_stacks(t, v)
|
|
622
|
+
out = @racc_debug_out
|
|
623
|
+
out.print ' ['
|
|
624
|
+
t.each_index do |i|
|
|
625
|
+
out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
|
|
626
|
+
end
|
|
627
|
+
out.puts ' ]'
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
def racc_print_states(s)
|
|
631
|
+
out = @racc_debug_out
|
|
632
|
+
out.print ' ['
|
|
633
|
+
s.each {|st| out.print ' ', st }
|
|
634
|
+
out.puts ' ]'
|
|
635
|
+
end
|
|
636
|
+
|
|
637
|
+
def racc_token2str(tok)
|
|
638
|
+
self.class::Racc_token_to_s_table[tok] or
|
|
639
|
+
raise "[Racc Bug] can't convert token #{tok} to string"
|
|
640
|
+
end
|
|
641
|
+
|
|
642
|
+
# Convert internal ID of token symbol to the string.
|
|
643
|
+
def token_to_str(t)
|
|
644
|
+
self.class::Racc_token_to_s_table[t]
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
end
|
|
650
|
+
|
|
651
|
+
end
|
|
652
|
+
###### racc/parser.rb end
|
|
653
|
+
|
|
654
|
+
class RDoc::RD
|
|
655
|
+
|
|
656
|
+
##
|
|
657
|
+
# RD format parser for headings, paragraphs, lists, verbatim sections that
|
|
658
|
+
# exist as blocks.
|
|
659
|
+
|
|
660
|
+
class BlockParser < Racc::Parser
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
# :stopdoc:
|
|
664
|
+
|
|
665
|
+
MARK_TO_LEVEL = {
|
|
666
|
+
'=' => 1,
|
|
667
|
+
'==' => 2,
|
|
668
|
+
'===' => 3,
|
|
669
|
+
'====' => 4,
|
|
670
|
+
'+' => 5,
|
|
671
|
+
'++' => 6,
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
# :startdoc:
|
|
675
|
+
|
|
676
|
+
##
|
|
677
|
+
# Footnotes for this document
|
|
678
|
+
|
|
679
|
+
attr_reader :footnotes
|
|
680
|
+
|
|
681
|
+
##
|
|
682
|
+
# Labels for items in this document
|
|
683
|
+
|
|
684
|
+
attr_reader :labels
|
|
685
|
+
|
|
686
|
+
##
|
|
687
|
+
# Path to find included files in
|
|
688
|
+
|
|
689
|
+
attr_accessor :include_path
|
|
690
|
+
|
|
691
|
+
##
|
|
692
|
+
# Creates a new RDoc::RD::BlockParser. Use #parse to parse an rd-format
|
|
693
|
+
# document.
|
|
694
|
+
|
|
695
|
+
def initialize
|
|
696
|
+
@inline_parser = RDoc::RD::InlineParser.new self
|
|
697
|
+
@include_path = []
|
|
698
|
+
|
|
699
|
+
# for testing
|
|
700
|
+
@footnotes = []
|
|
701
|
+
@labels = {}
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
##
|
|
705
|
+
# Parses +src+ and returns an RDoc::Markup::Document.
|
|
706
|
+
|
|
707
|
+
def parse src
|
|
708
|
+
@src = src
|
|
709
|
+
@src.push false
|
|
710
|
+
|
|
711
|
+
@footnotes = []
|
|
712
|
+
@labels = {}
|
|
713
|
+
|
|
714
|
+
# @i: index(line no.) of src
|
|
715
|
+
@i = 0
|
|
716
|
+
|
|
717
|
+
# stack for current indentation
|
|
718
|
+
@indent_stack = []
|
|
719
|
+
|
|
720
|
+
# how indented.
|
|
721
|
+
@current_indent = @indent_stack.join("")
|
|
722
|
+
|
|
723
|
+
# RDoc::RD::BlockParser for tmp src
|
|
724
|
+
@subparser = nil
|
|
725
|
+
|
|
726
|
+
# which part is in now
|
|
727
|
+
@in_part = nil
|
|
728
|
+
@part_content = []
|
|
729
|
+
|
|
730
|
+
@in_verbatim = false
|
|
731
|
+
|
|
732
|
+
@yydebug = true
|
|
733
|
+
|
|
734
|
+
document = do_parse
|
|
735
|
+
|
|
736
|
+
unless @footnotes.empty? then
|
|
737
|
+
blankline = document.parts.pop
|
|
738
|
+
|
|
739
|
+
document.parts << RDoc::Markup::Rule.new(1)
|
|
740
|
+
document.parts.concat @footnotes
|
|
741
|
+
|
|
742
|
+
document.parts.push blankline
|
|
743
|
+
end
|
|
744
|
+
|
|
745
|
+
document
|
|
746
|
+
end
|
|
747
|
+
|
|
748
|
+
##
|
|
749
|
+
# Returns the next token from the document
|
|
750
|
+
|
|
751
|
+
def next_token # :nodoc:
|
|
752
|
+
# preprocessing
|
|
753
|
+
# if it is not in RD part
|
|
754
|
+
# => method
|
|
755
|
+
while @in_part != "rd"
|
|
756
|
+
line = @src[@i]
|
|
757
|
+
@i += 1 # next line
|
|
758
|
+
|
|
759
|
+
case line
|
|
760
|
+
# src end
|
|
761
|
+
when false
|
|
762
|
+
return [false, false]
|
|
763
|
+
# RD part begin
|
|
764
|
+
when /^=begin\s*(?:\bRD\b.*)?\s*$/
|
|
765
|
+
if @in_part # if in non-RD part
|
|
766
|
+
@part_content.push(line)
|
|
767
|
+
else
|
|
768
|
+
@in_part = "rd"
|
|
769
|
+
return [:WHITELINE, "=begin\n"] # <= for textblockand
|
|
770
|
+
end
|
|
771
|
+
# non-RD part begin
|
|
772
|
+
when /^=begin\s+(\w+)/
|
|
773
|
+
part = $1
|
|
774
|
+
=begin # not imported to RDoc
|
|
775
|
+
if @in_part # if in non-RD part
|
|
776
|
+
@part_content.push(line)
|
|
777
|
+
else
|
|
778
|
+
@in_part = part if @tree.filter[part] # if filter exists
|
|
779
|
+
# p "BEGIN_PART: #{@in_part}" # DEBUG
|
|
780
|
+
end
|
|
781
|
+
=end
|
|
782
|
+
@in_part = part
|
|
783
|
+
# non-RD part end
|
|
784
|
+
when /^=end(?:$|[\s\0\C-d\C-z])/
|
|
785
|
+
if @in_part # if in non-RD part
|
|
786
|
+
=begin # not imported to RDoc
|
|
787
|
+
# p "END_PART: #{@in_part}" # DEBUG
|
|
788
|
+
# make Part-in object
|
|
789
|
+
part = RDoc::RD::Part.new(@part_content.join(""), @tree, "r")
|
|
790
|
+
@part_content.clear
|
|
791
|
+
# call filter, part_out is output(Part object)
|
|
792
|
+
part_out = @tree.filter[@in_part].call(part)
|
|
793
|
+
|
|
794
|
+
if @tree.filter[@in_part].mode == :rd # if output is RD formatted
|
|
795
|
+
subtree = parse_subtree(part_out.to_a)
|
|
796
|
+
else # if output is target formatted
|
|
797
|
+
basename = Tempfile.create(["rdtmp", ".#{@in_part}"], @tree.tmp_dir) do |tmpfile|
|
|
798
|
+
tmpfile.print(part_out)
|
|
799
|
+
File.basename(tmpfile.path)
|
|
800
|
+
end
|
|
801
|
+
subtree = parse_subtree(["=begin\n", "<<< #{basename}\n", "=end\n"])
|
|
802
|
+
end
|
|
803
|
+
@in_part = nil
|
|
804
|
+
return [:SUBTREE, subtree]
|
|
805
|
+
=end
|
|
806
|
+
end
|
|
807
|
+
else
|
|
808
|
+
=begin # not imported to RDoc
|
|
809
|
+
if @in_part # if in non-RD part
|
|
810
|
+
@part_content.push(line)
|
|
811
|
+
end
|
|
812
|
+
=end
|
|
813
|
+
end
|
|
814
|
+
end
|
|
815
|
+
|
|
816
|
+
@current_indent = @indent_stack.join("")
|
|
817
|
+
line = @src[@i]
|
|
818
|
+
case line
|
|
819
|
+
when false
|
|
820
|
+
if_current_indent_equal("") do
|
|
821
|
+
[false, false]
|
|
822
|
+
end
|
|
823
|
+
when /^=end/
|
|
824
|
+
if_current_indent_equal("") do
|
|
825
|
+
@in_part = nil
|
|
826
|
+
[:WHITELINE, "=end"] # MUST CHANGE??
|
|
827
|
+
end
|
|
828
|
+
when /^\s*$/
|
|
829
|
+
@i += 1 # next line
|
|
830
|
+
return [:WHITELINE, ':WHITELINE']
|
|
831
|
+
when /^\#/ # comment line
|
|
832
|
+
@i += 1 # next line
|
|
833
|
+
self.next_token()
|
|
834
|
+
when /^(={1,4})(?!=)\s*(?=\S)/, /^(\+{1,2})(?!\+)\s*(?=\S)/
|
|
835
|
+
rest = $' # '
|
|
836
|
+
rest.strip!
|
|
837
|
+
mark = $1
|
|
838
|
+
if_current_indent_equal("") do
|
|
839
|
+
return [:HEADLINE, [MARK_TO_LEVEL[mark], rest]]
|
|
840
|
+
end
|
|
841
|
+
when /^<<<\s*(\S+)/
|
|
842
|
+
file = $1
|
|
843
|
+
if_current_indent_equal("") do
|
|
844
|
+
suffix = file[-3 .. -1]
|
|
845
|
+
if suffix == ".rd" or suffix == ".rb"
|
|
846
|
+
subtree = parse_subtree(get_included(file))
|
|
847
|
+
[:SUBTREE, subtree]
|
|
848
|
+
else
|
|
849
|
+
[:INCLUDE, file]
|
|
850
|
+
end
|
|
851
|
+
end
|
|
852
|
+
when /^(\s*)\*(\s*)/
|
|
853
|
+
rest = $' # '
|
|
854
|
+
newIndent = $2
|
|
855
|
+
if_current_indent_equal($1) do
|
|
856
|
+
if @in_verbatim
|
|
857
|
+
[:STRINGLINE, line]
|
|
858
|
+
else
|
|
859
|
+
@indent_stack.push("\s" + newIndent)
|
|
860
|
+
[:ITEMLISTLINE, rest]
|
|
861
|
+
end
|
|
862
|
+
end
|
|
863
|
+
when /^(\s*)(\(\d+\))(\s*)/
|
|
864
|
+
rest = $' # '
|
|
865
|
+
mark = $2
|
|
866
|
+
newIndent = $3
|
|
867
|
+
if_current_indent_equal($1) do
|
|
868
|
+
if @in_verbatim
|
|
869
|
+
[:STRINGLINE, line]
|
|
870
|
+
else
|
|
871
|
+
@indent_stack.push("\s" * mark.size + newIndent)
|
|
872
|
+
[:ENUMLISTLINE, rest]
|
|
873
|
+
end
|
|
874
|
+
end
|
|
875
|
+
when /^(\s*):(\s*)/
|
|
876
|
+
rest = $' # '
|
|
877
|
+
newIndent = $2
|
|
878
|
+
if_current_indent_equal($1) do
|
|
879
|
+
if @in_verbatim
|
|
880
|
+
[:STRINGLINE, line]
|
|
881
|
+
else
|
|
882
|
+
@indent_stack.push("\s#{$2}")
|
|
883
|
+
[:DESCLISTLINE, rest]
|
|
884
|
+
end
|
|
885
|
+
end
|
|
886
|
+
when /^(\s*)---(?!-|\s*$)/
|
|
887
|
+
indent = $1
|
|
888
|
+
rest = $'
|
|
889
|
+
/\s*/ === rest
|
|
890
|
+
term = $'
|
|
891
|
+
new_indent = $&
|
|
892
|
+
if_current_indent_equal(indent) do
|
|
893
|
+
if @in_verbatim
|
|
894
|
+
[:STRINGLINE, line]
|
|
895
|
+
else
|
|
896
|
+
@indent_stack.push("\s\s\s" + new_indent)
|
|
897
|
+
[:METHODLISTLINE, term]
|
|
898
|
+
end
|
|
899
|
+
end
|
|
900
|
+
when /^(\s*)/
|
|
901
|
+
if_current_indent_equal($1) do
|
|
902
|
+
[:STRINGLINE, line]
|
|
903
|
+
end
|
|
904
|
+
else
|
|
905
|
+
raise "[BUG] parsing error may occurred."
|
|
906
|
+
end
|
|
907
|
+
end
|
|
908
|
+
|
|
909
|
+
##
|
|
910
|
+
# Yields to the given block if +indent+ matches the current indent, otherwise
|
|
911
|
+
# an indentation token is processed.
|
|
912
|
+
|
|
913
|
+
def if_current_indent_equal(indent)
|
|
914
|
+
indent = indent.sub(/\t/, "\s" * 8)
|
|
915
|
+
if @current_indent == indent
|
|
916
|
+
@i += 1 # next line
|
|
917
|
+
yield
|
|
918
|
+
elsif indent.index(@current_indent) == 0
|
|
919
|
+
@indent_stack.push(indent[@current_indent.size .. -1])
|
|
920
|
+
[:INDENT, ":INDENT"]
|
|
921
|
+
else
|
|
922
|
+
@indent_stack.pop
|
|
923
|
+
[:DEDENT, ":DEDENT"]
|
|
924
|
+
end
|
|
925
|
+
end
|
|
926
|
+
private :if_current_indent_equal
|
|
927
|
+
|
|
928
|
+
##
|
|
929
|
+
# Cuts off excess whitespace in +src+
|
|
930
|
+
|
|
931
|
+
def cut_off(src)
|
|
932
|
+
ret = []
|
|
933
|
+
whiteline_buf = []
|
|
934
|
+
|
|
935
|
+
line = src.shift
|
|
936
|
+
/^\s*/ =~ line
|
|
937
|
+
|
|
938
|
+
indent = Regexp.quote($&)
|
|
939
|
+
ret.push($')
|
|
940
|
+
|
|
941
|
+
while line = src.shift
|
|
942
|
+
if /^(\s*)$/ =~ line
|
|
943
|
+
whiteline_buf.push(line)
|
|
944
|
+
elsif /^#{indent}/ =~ line
|
|
945
|
+
unless whiteline_buf.empty?
|
|
946
|
+
ret.concat(whiteline_buf)
|
|
947
|
+
whiteline_buf.clear
|
|
948
|
+
end
|
|
949
|
+
ret.push($')
|
|
950
|
+
else
|
|
951
|
+
raise "[BUG]: probably Parser Error while cutting off.\n"
|
|
952
|
+
end
|
|
953
|
+
end
|
|
954
|
+
ret
|
|
955
|
+
end
|
|
956
|
+
private :cut_off
|
|
957
|
+
|
|
958
|
+
def set_term_to_element(parent, term)
|
|
959
|
+
# parent.set_term_under_document_struct(term, @tree.document_struct)
|
|
960
|
+
parent.set_term_without_document_struct(term)
|
|
961
|
+
end
|
|
962
|
+
private :set_term_to_element
|
|
963
|
+
|
|
964
|
+
##
|
|
965
|
+
# Raises a ParseError when invalid formatting is found
|
|
966
|
+
|
|
967
|
+
def on_error(et, ev, _values)
|
|
968
|
+
prv, cur, nxt = format_line_num(@i, @i+1, @i+2)
|
|
969
|
+
|
|
970
|
+
raise ParseError, <<Msg
|
|
971
|
+
|
|
972
|
+
RD syntax error: line #{@i+1}:
|
|
973
|
+
#{prv} |#{@src[@i-1].chomp}
|
|
974
|
+
#{cur}=>|#{@src[@i].chomp}
|
|
975
|
+
#{nxt} |#{@src[@i+1].chomp}
|
|
976
|
+
|
|
977
|
+
Msg
|
|
978
|
+
end
|
|
979
|
+
|
|
980
|
+
##
|
|
981
|
+
# Current line number
|
|
982
|
+
|
|
983
|
+
def line_index
|
|
984
|
+
@i
|
|
985
|
+
end
|
|
986
|
+
|
|
987
|
+
##
|
|
988
|
+
# Parses subtree +src+
|
|
989
|
+
|
|
990
|
+
def parse_subtree src
|
|
991
|
+
@subparser ||= RDoc::RD::BlockParser.new
|
|
992
|
+
|
|
993
|
+
@subparser.parse src
|
|
994
|
+
end
|
|
995
|
+
private :parse_subtree
|
|
996
|
+
|
|
997
|
+
##
|
|
998
|
+
# Retrieves the content for +file+ from the include_path
|
|
999
|
+
|
|
1000
|
+
def get_included(file)
|
|
1001
|
+
included = []
|
|
1002
|
+
|
|
1003
|
+
@include_path.each do |dir|
|
|
1004
|
+
file_name = File.join dir, file
|
|
1005
|
+
|
|
1006
|
+
if File.exist? file_name then
|
|
1007
|
+
included = File.readlines file_name
|
|
1008
|
+
break
|
|
1009
|
+
end
|
|
1010
|
+
end
|
|
1011
|
+
|
|
1012
|
+
included
|
|
1013
|
+
end
|
|
1014
|
+
private :get_included
|
|
1015
|
+
|
|
1016
|
+
##
|
|
1017
|
+
# Formats line numbers +line_numbers+ prettily
|
|
1018
|
+
|
|
1019
|
+
def format_line_num(*line_numbers)
|
|
1020
|
+
width = line_numbers.collect{|i| i.to_s.length }.max
|
|
1021
|
+
line_numbers.collect{|i| sprintf("%#{width}d", i) }
|
|
1022
|
+
end
|
|
1023
|
+
private :format_line_num
|
|
1024
|
+
|
|
1025
|
+
##
|
|
1026
|
+
# Retrieves the content of +values+ as a single String
|
|
1027
|
+
|
|
1028
|
+
def content values
|
|
1029
|
+
values.map { |value| value.content }.join
|
|
1030
|
+
end
|
|
1031
|
+
|
|
1032
|
+
##
|
|
1033
|
+
# Creates a paragraph for +value+
|
|
1034
|
+
|
|
1035
|
+
def paragraph value
|
|
1036
|
+
content = cut_off(value).join(' ').rstrip
|
|
1037
|
+
contents = @inline_parser.parse content
|
|
1038
|
+
|
|
1039
|
+
RDoc::Markup::Paragraph.new(*contents)
|
|
1040
|
+
end
|
|
1041
|
+
|
|
1042
|
+
##
|
|
1043
|
+
# Adds footnote +content+ to the document
|
|
1044
|
+
|
|
1045
|
+
def add_footnote content
|
|
1046
|
+
index = @footnotes.length / 2 + 1
|
|
1047
|
+
|
|
1048
|
+
footmark_link = "{^#{index}}[rdoc-label:footmark-#{index}:foottext-#{index}]"
|
|
1049
|
+
|
|
1050
|
+
@footnotes << RDoc::Markup::Paragraph.new(footmark_link, ' ', *content)
|
|
1051
|
+
@footnotes << RDoc::Markup::BlankLine.new
|
|
1052
|
+
|
|
1053
|
+
index
|
|
1054
|
+
end
|
|
1055
|
+
|
|
1056
|
+
##
|
|
1057
|
+
# Adds label +label+ to the document
|
|
1058
|
+
|
|
1059
|
+
def add_label label
|
|
1060
|
+
@labels[label] = true
|
|
1061
|
+
|
|
1062
|
+
label
|
|
1063
|
+
end
|
|
1064
|
+
|
|
1065
|
+
# :stopdoc:
|
|
1066
|
+
|
|
1067
|
+
##### State transition tables begin ###
|
|
1068
|
+
|
|
1069
|
+
racc_action_table = [
|
|
1070
|
+
34, 35, 30, 33, 40, 34, 35, 30, 33, 40,
|
|
1071
|
+
65, 34, 35, 30, 33, 14, 73, 36, 38, 34,
|
|
1072
|
+
15, 88, 34, 35, 30, 33, 14, 9, 10, 11,
|
|
1073
|
+
12, 15, 34, 35, 30, 33, 14, 9, 10, 11,
|
|
1074
|
+
12, 15, 34, 35, 30, 33, 35, 47, 30, 54,
|
|
1075
|
+
33, 15, 34, 35, 30, 33, 54, 47, 14, 14,
|
|
1076
|
+
59, 15, 34, 35, 30, 33, 14, 73, 67, 76,
|
|
1077
|
+
77, 15, 34, 35, 30, 33, 14, 73, 54, 81,
|
|
1078
|
+
38, 15, 34, 35, 30, 33, 14, 73, 38, 40,
|
|
1079
|
+
83, 15, 34, 35, 30, 33, 14, 73, nil, nil,
|
|
1080
|
+
nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
|
|
1081
|
+
nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
|
|
1082
|
+
nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
|
|
1083
|
+
nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
|
|
1084
|
+
nil, 15, 34, 35, 30, 33, 14, 73, 61, 63,
|
|
1085
|
+
nil, 15, 14, 62, 60, 61, 63, 79, 61, 63,
|
|
1086
|
+
62, 87, nil, 62, 34, 35, 30, 33 ]
|
|
1087
|
+
|
|
1088
|
+
racc_action_check = [
|
|
1089
|
+
41, 41, 41, 41, 41, 15, 15, 15, 15, 15,
|
|
1090
|
+
41, 86, 86, 86, 86, 86, 86, 1, 13, 22,
|
|
1091
|
+
86, 86, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
1092
|
+
0, 0, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
1093
|
+
2, 2, 24, 24, 24, 24, 25, 24, 28, 30,
|
|
1094
|
+
31, 24, 27, 27, 27, 27, 33, 27, 34, 35,
|
|
1095
|
+
36, 27, 45, 45, 45, 45, 45, 45, 44, 49,
|
|
1096
|
+
51, 45, 46, 46, 46, 46, 46, 46, 54, 56,
|
|
1097
|
+
57, 46, 47, 47, 47, 47, 47, 47, 58, 62,
|
|
1098
|
+
66, 47, 68, 68, 68, 68, 68, 68, nil, nil,
|
|
1099
|
+
nil, 68, 74, 74, 74, 74, 74, 74, nil, nil,
|
|
1100
|
+
nil, 74, 75, 75, 75, 75, 75, 75, nil, nil,
|
|
1101
|
+
nil, 75, 78, 78, 78, 78, 78, 78, nil, nil,
|
|
1102
|
+
nil, 78, 79, 79, 79, 79, 79, 79, nil, nil,
|
|
1103
|
+
nil, 79, 85, 85, 85, 85, 85, 85, 39, 39,
|
|
1104
|
+
nil, 85, 52, 39, 39, 82, 82, 52, 64, 64,
|
|
1105
|
+
82, 82, nil, 64, 20, 20, 20, 20 ]
|
|
1106
|
+
|
|
1107
|
+
racc_action_pointer = [
|
|
1108
|
+
19, 17, 29, nil, nil, nil, nil, nil, nil, nil,
|
|
1109
|
+
nil, nil, nil, 11, nil, 2, nil, nil, nil, nil,
|
|
1110
|
+
161, nil, 16, nil, 39, 42, nil, 49, 43, nil,
|
|
1111
|
+
41, 44, nil, 48, 51, 52, 60, nil, nil, 141,
|
|
1112
|
+
nil, -3, nil, nil, 55, 59, 69, 79, nil, 56,
|
|
1113
|
+
nil, 57, 145, nil, 70, nil, 66, 73, 81, nil,
|
|
1114
|
+
nil, nil, 82, nil, 151, nil, 77, nil, 89, nil,
|
|
1115
|
+
nil, nil, nil, nil, 99, 109, nil, nil, 119, 129,
|
|
1116
|
+
nil, nil, 148, nil, nil, 139, 8, nil, nil ]
|
|
1117
|
+
|
|
1118
|
+
racc_action_default = [
|
|
1119
|
+
-2, -73, -1, -4, -5, -6, -7, -8, -9, -10,
|
|
1120
|
+
-11, -12, -13, -14, -16, -73, -23, -24, -25, -26,
|
|
1121
|
+
-27, -31, -32, -34, -72, -36, -38, -72, -40, -42,
|
|
1122
|
+
-59, -44, -46, -59, -63, -65, -73, -3, -15, -73,
|
|
1123
|
+
-22, -73, -30, -33, -73, -69, -70, -71, -37, -73,
|
|
1124
|
+
-41, -73, -51, -58, -61, -45, -73, -62, -64, 89,
|
|
1125
|
+
-17, -19, -73, -21, -18, -28, -73, -35, -66, -53,
|
|
1126
|
+
-54, -55, -56, -57, -67, -68, -39, -43, -49, -73,
|
|
1127
|
+
-60, -47, -73, -29, -52, -48, -73, -20, -50 ]
|
|
1128
|
+
|
|
1129
|
+
racc_goto_table = [
|
|
1130
|
+
4, 39, 4, 68, 74, 75, 5, 6, 5, 6,
|
|
1131
|
+
44, 42, 51, 49, 3, 56, 37, 57, 58, 1,
|
|
1132
|
+
2, 66, 84, 41, 43, 48, 50, 64, 84, 84,
|
|
1133
|
+
45, 46, 42, 45, 46, 55, 85, 86, 80, 84,
|
|
1134
|
+
84, nil, nil, nil, nil, nil, nil, nil, 82, nil,
|
|
1135
|
+
nil, nil, 78 ]
|
|
1136
|
+
|
|
1137
|
+
racc_goto_check = [
|
|
1138
|
+
4, 10, 4, 31, 31, 31, 5, 6, 5, 6,
|
|
1139
|
+
21, 12, 27, 21, 3, 27, 3, 9, 9, 1,
|
|
1140
|
+
2, 11, 32, 17, 19, 23, 26, 10, 32, 32,
|
|
1141
|
+
5, 6, 12, 5, 6, 29, 31, 31, 33, 32,
|
|
1142
|
+
32, nil, nil, nil, nil, nil, nil, nil, 10, nil,
|
|
1143
|
+
nil, nil, 4 ]
|
|
1144
|
+
|
|
1145
|
+
racc_goto_pointer = [
|
|
1146
|
+
nil, 19, 20, 14, 0, 6, 7, nil, nil, -17,
|
|
1147
|
+
-14, -20, -9, nil, nil, nil, nil, 8, nil, 2,
|
|
1148
|
+
nil, -14, nil, 0, nil, nil, -2, -18, nil, 4,
|
|
1149
|
+
nil, -42, -46, -16 ]
|
|
1150
|
+
|
|
1151
|
+
racc_goto_default = [
|
|
1152
|
+
nil, nil, nil, nil, 70, 71, 72, 7, 8, 13,
|
|
1153
|
+
nil, nil, 21, 16, 17, 18, 19, 20, 22, 23,
|
|
1154
|
+
24, nil, 25, 26, 27, 28, 29, nil, 31, 32,
|
|
1155
|
+
52, nil, 69, 53 ]
|
|
1156
|
+
|
|
1157
|
+
racc_reduce_table = [
|
|
1158
|
+
0, 0, :racc_error,
|
|
1159
|
+
1, 15, :_reduce_1,
|
|
1160
|
+
0, 15, :_reduce_2,
|
|
1161
|
+
2, 16, :_reduce_3,
|
|
1162
|
+
1, 16, :_reduce_4,
|
|
1163
|
+
1, 17, :_reduce_5,
|
|
1164
|
+
1, 17, :_reduce_6,
|
|
1165
|
+
1, 17, :_reduce_none,
|
|
1166
|
+
1, 17, :_reduce_8,
|
|
1167
|
+
1, 17, :_reduce_9,
|
|
1168
|
+
1, 17, :_reduce_10,
|
|
1169
|
+
1, 17, :_reduce_11,
|
|
1170
|
+
1, 21, :_reduce_12,
|
|
1171
|
+
1, 22, :_reduce_13,
|
|
1172
|
+
1, 18, :_reduce_14,
|
|
1173
|
+
2, 23, :_reduce_15,
|
|
1174
|
+
1, 23, :_reduce_16,
|
|
1175
|
+
3, 19, :_reduce_17,
|
|
1176
|
+
1, 25, :_reduce_18,
|
|
1177
|
+
2, 24, :_reduce_19,
|
|
1178
|
+
4, 24, :_reduce_20,
|
|
1179
|
+
2, 24, :_reduce_21,
|
|
1180
|
+
1, 24, :_reduce_22,
|
|
1181
|
+
1, 26, :_reduce_none,
|
|
1182
|
+
1, 26, :_reduce_none,
|
|
1183
|
+
1, 26, :_reduce_none,
|
|
1184
|
+
1, 26, :_reduce_none,
|
|
1185
|
+
1, 20, :_reduce_27,
|
|
1186
|
+
3, 20, :_reduce_28,
|
|
1187
|
+
4, 20, :_reduce_29,
|
|
1188
|
+
2, 31, :_reduce_30,
|
|
1189
|
+
1, 31, :_reduce_31,
|
|
1190
|
+
1, 27, :_reduce_32,
|
|
1191
|
+
2, 32, :_reduce_33,
|
|
1192
|
+
1, 32, :_reduce_34,
|
|
1193
|
+
3, 33, :_reduce_35,
|
|
1194
|
+
1, 28, :_reduce_36,
|
|
1195
|
+
2, 36, :_reduce_37,
|
|
1196
|
+
1, 36, :_reduce_38,
|
|
1197
|
+
3, 37, :_reduce_39,
|
|
1198
|
+
1, 29, :_reduce_40,
|
|
1199
|
+
2, 39, :_reduce_41,
|
|
1200
|
+
1, 39, :_reduce_42,
|
|
1201
|
+
3, 40, :_reduce_43,
|
|
1202
|
+
1, 30, :_reduce_44,
|
|
1203
|
+
2, 42, :_reduce_45,
|
|
1204
|
+
1, 42, :_reduce_46,
|
|
1205
|
+
3, 43, :_reduce_47,
|
|
1206
|
+
3, 41, :_reduce_48,
|
|
1207
|
+
2, 41, :_reduce_49,
|
|
1208
|
+
4, 41, :_reduce_50,
|
|
1209
|
+
1, 41, :_reduce_51,
|
|
1210
|
+
2, 45, :_reduce_52,
|
|
1211
|
+
1, 45, :_reduce_none,
|
|
1212
|
+
1, 46, :_reduce_54,
|
|
1213
|
+
1, 46, :_reduce_55,
|
|
1214
|
+
1, 46, :_reduce_none,
|
|
1215
|
+
1, 46, :_reduce_57,
|
|
1216
|
+
1, 44, :_reduce_none,
|
|
1217
|
+
0, 44, :_reduce_none,
|
|
1218
|
+
2, 47, :_reduce_none,
|
|
1219
|
+
1, 47, :_reduce_none,
|
|
1220
|
+
2, 34, :_reduce_62,
|
|
1221
|
+
1, 34, :_reduce_63,
|
|
1222
|
+
2, 38, :_reduce_64,
|
|
1223
|
+
1, 38, :_reduce_65,
|
|
1224
|
+
2, 35, :_reduce_66,
|
|
1225
|
+
2, 35, :_reduce_67,
|
|
1226
|
+
2, 35, :_reduce_68,
|
|
1227
|
+
1, 35, :_reduce_69,
|
|
1228
|
+
1, 35, :_reduce_none,
|
|
1229
|
+
1, 35, :_reduce_71,
|
|
1230
|
+
0, 35, :_reduce_72 ]
|
|
1231
|
+
|
|
1232
|
+
racc_reduce_n = 73
|
|
1233
|
+
|
|
1234
|
+
racc_shift_n = 89
|
|
1235
|
+
|
|
1236
|
+
racc_token_table = {
|
|
1237
|
+
false => 0,
|
|
1238
|
+
:error => 1,
|
|
1239
|
+
:DUMMY => 2,
|
|
1240
|
+
:ITEMLISTLINE => 3,
|
|
1241
|
+
:ENUMLISTLINE => 4,
|
|
1242
|
+
:DESCLISTLINE => 5,
|
|
1243
|
+
:METHODLISTLINE => 6,
|
|
1244
|
+
:STRINGLINE => 7,
|
|
1245
|
+
:WHITELINE => 8,
|
|
1246
|
+
:SUBTREE => 9,
|
|
1247
|
+
:HEADLINE => 10,
|
|
1248
|
+
:INCLUDE => 11,
|
|
1249
|
+
:INDENT => 12,
|
|
1250
|
+
:DEDENT => 13 }
|
|
1251
|
+
|
|
1252
|
+
racc_nt_base = 14
|
|
1253
|
+
|
|
1254
|
+
racc_use_result_var = true
|
|
1255
|
+
|
|
1256
|
+
Racc_arg = [
|
|
1257
|
+
racc_action_table,
|
|
1258
|
+
racc_action_check,
|
|
1259
|
+
racc_action_default,
|
|
1260
|
+
racc_action_pointer,
|
|
1261
|
+
racc_goto_table,
|
|
1262
|
+
racc_goto_check,
|
|
1263
|
+
racc_goto_default,
|
|
1264
|
+
racc_goto_pointer,
|
|
1265
|
+
racc_nt_base,
|
|
1266
|
+
racc_reduce_table,
|
|
1267
|
+
racc_token_table,
|
|
1268
|
+
racc_shift_n,
|
|
1269
|
+
racc_reduce_n,
|
|
1270
|
+
racc_use_result_var ]
|
|
1271
|
+
Ractor.make_shareable(Racc_arg) if defined?(Ractor)
|
|
1272
|
+
|
|
1273
|
+
Racc_token_to_s_table = [
|
|
1274
|
+
"$end",
|
|
1275
|
+
"error",
|
|
1276
|
+
"DUMMY",
|
|
1277
|
+
"ITEMLISTLINE",
|
|
1278
|
+
"ENUMLISTLINE",
|
|
1279
|
+
"DESCLISTLINE",
|
|
1280
|
+
"METHODLISTLINE",
|
|
1281
|
+
"STRINGLINE",
|
|
1282
|
+
"WHITELINE",
|
|
1283
|
+
"SUBTREE",
|
|
1284
|
+
"HEADLINE",
|
|
1285
|
+
"INCLUDE",
|
|
1286
|
+
"INDENT",
|
|
1287
|
+
"DEDENT",
|
|
1288
|
+
"$start",
|
|
1289
|
+
"document",
|
|
1290
|
+
"blocks",
|
|
1291
|
+
"block",
|
|
1292
|
+
"textblock",
|
|
1293
|
+
"verbatim",
|
|
1294
|
+
"lists",
|
|
1295
|
+
"headline",
|
|
1296
|
+
"include",
|
|
1297
|
+
"textblockcontent",
|
|
1298
|
+
"verbatimcontent",
|
|
1299
|
+
"verbatim_after_lists",
|
|
1300
|
+
"list",
|
|
1301
|
+
"itemlist",
|
|
1302
|
+
"enumlist",
|
|
1303
|
+
"desclist",
|
|
1304
|
+
"methodlist",
|
|
1305
|
+
"lists2",
|
|
1306
|
+
"itemlistitems",
|
|
1307
|
+
"itemlistitem",
|
|
1308
|
+
"first_textblock_in_itemlist",
|
|
1309
|
+
"other_blocks_in_list",
|
|
1310
|
+
"enumlistitems",
|
|
1311
|
+
"enumlistitem",
|
|
1312
|
+
"first_textblock_in_enumlist",
|
|
1313
|
+
"desclistitems",
|
|
1314
|
+
"desclistitem",
|
|
1315
|
+
"description_part",
|
|
1316
|
+
"methodlistitems",
|
|
1317
|
+
"methodlistitem",
|
|
1318
|
+
"whitelines",
|
|
1319
|
+
"blocks_in_list",
|
|
1320
|
+
"block_in_list",
|
|
1321
|
+
"whitelines2" ]
|
|
1322
|
+
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
|
|
1323
|
+
|
|
1324
|
+
Racc_debug_parser = false
|
|
1325
|
+
|
|
1326
|
+
##### State transition tables end #####
|
|
1327
|
+
|
|
1328
|
+
# reduce 0 omitted
|
|
1329
|
+
|
|
1330
|
+
def _reduce_1(val, _values, result)
|
|
1331
|
+
result = RDoc::Markup::Document.new(*val[0])
|
|
1332
|
+
result
|
|
1333
|
+
end
|
|
1334
|
+
|
|
1335
|
+
def _reduce_2(val, _values, result)
|
|
1336
|
+
raise ParseError, "file empty"
|
|
1337
|
+
result
|
|
1338
|
+
end
|
|
1339
|
+
|
|
1340
|
+
def _reduce_3(val, _values, result)
|
|
1341
|
+
result = val[0].concat val[1]
|
|
1342
|
+
result
|
|
1343
|
+
end
|
|
1344
|
+
|
|
1345
|
+
def _reduce_4(val, _values, result)
|
|
1346
|
+
result = val[0]
|
|
1347
|
+
result
|
|
1348
|
+
end
|
|
1349
|
+
|
|
1350
|
+
def _reduce_5(val, _values, result)
|
|
1351
|
+
result = val
|
|
1352
|
+
result
|
|
1353
|
+
end
|
|
1354
|
+
|
|
1355
|
+
def _reduce_6(val, _values, result)
|
|
1356
|
+
result = val
|
|
1357
|
+
result
|
|
1358
|
+
end
|
|
1359
|
+
|
|
1360
|
+
# reduce 7 omitted
|
|
1361
|
+
|
|
1362
|
+
def _reduce_8(val, _values, result)
|
|
1363
|
+
result = val
|
|
1364
|
+
result
|
|
1365
|
+
end
|
|
1366
|
+
|
|
1367
|
+
def _reduce_9(val, _values, result)
|
|
1368
|
+
result = val
|
|
1369
|
+
result
|
|
1370
|
+
end
|
|
1371
|
+
|
|
1372
|
+
def _reduce_10(val, _values, result)
|
|
1373
|
+
result = [RDoc::Markup::BlankLine.new]
|
|
1374
|
+
result
|
|
1375
|
+
end
|
|
1376
|
+
|
|
1377
|
+
def _reduce_11(val, _values, result)
|
|
1378
|
+
result = val[0].parts
|
|
1379
|
+
result
|
|
1380
|
+
end
|
|
1381
|
+
|
|
1382
|
+
def _reduce_12(val, _values, result)
|
|
1383
|
+
# val[0] is like [level, title]
|
|
1384
|
+
title = @inline_parser.parse(val[0][1])
|
|
1385
|
+
result = RDoc::Markup::Heading.new(val[0][0], title)
|
|
1386
|
+
|
|
1387
|
+
result
|
|
1388
|
+
end
|
|
1389
|
+
|
|
1390
|
+
def _reduce_13(val, _values, result)
|
|
1391
|
+
result = RDoc::Markup::Include.new val[0], @include_path
|
|
1392
|
+
|
|
1393
|
+
result
|
|
1394
|
+
end
|
|
1395
|
+
|
|
1396
|
+
def _reduce_14(val, _values, result)
|
|
1397
|
+
# val[0] is Array of String
|
|
1398
|
+
result = paragraph val[0]
|
|
1399
|
+
|
|
1400
|
+
result
|
|
1401
|
+
end
|
|
1402
|
+
|
|
1403
|
+
def _reduce_15(val, _values, result)
|
|
1404
|
+
result << val[1].rstrip
|
|
1405
|
+
result
|
|
1406
|
+
end
|
|
1407
|
+
|
|
1408
|
+
def _reduce_16(val, _values, result)
|
|
1409
|
+
result = [val[0].rstrip]
|
|
1410
|
+
result
|
|
1411
|
+
end
|
|
1412
|
+
|
|
1413
|
+
def _reduce_17(val, _values, result)
|
|
1414
|
+
# val[1] is Array of String
|
|
1415
|
+
content = cut_off val[1]
|
|
1416
|
+
result = RDoc::Markup::Verbatim.new(*content)
|
|
1417
|
+
|
|
1418
|
+
# imform to lexer.
|
|
1419
|
+
@in_verbatim = false
|
|
1420
|
+
|
|
1421
|
+
result
|
|
1422
|
+
end
|
|
1423
|
+
|
|
1424
|
+
def _reduce_18(val, _values, result)
|
|
1425
|
+
# val[0] is Array of String
|
|
1426
|
+
content = cut_off val[0]
|
|
1427
|
+
result = RDoc::Markup::Verbatim.new(*content)
|
|
1428
|
+
|
|
1429
|
+
# imform to lexer.
|
|
1430
|
+
@in_verbatim = false
|
|
1431
|
+
|
|
1432
|
+
result
|
|
1433
|
+
end
|
|
1434
|
+
|
|
1435
|
+
def _reduce_19(val, _values, result)
|
|
1436
|
+
result << val[1]
|
|
1437
|
+
|
|
1438
|
+
result
|
|
1439
|
+
end
|
|
1440
|
+
|
|
1441
|
+
def _reduce_20(val, _values, result)
|
|
1442
|
+
result.concat val[2]
|
|
1443
|
+
|
|
1444
|
+
result
|
|
1445
|
+
end
|
|
1446
|
+
|
|
1447
|
+
def _reduce_21(val, _values, result)
|
|
1448
|
+
result << "\n"
|
|
1449
|
+
|
|
1450
|
+
result
|
|
1451
|
+
end
|
|
1452
|
+
|
|
1453
|
+
def _reduce_22(val, _values, result)
|
|
1454
|
+
result = val
|
|
1455
|
+
# inform to lexer.
|
|
1456
|
+
@in_verbatim = true
|
|
1457
|
+
|
|
1458
|
+
result
|
|
1459
|
+
end
|
|
1460
|
+
|
|
1461
|
+
# reduce 23 omitted
|
|
1462
|
+
|
|
1463
|
+
# reduce 24 omitted
|
|
1464
|
+
|
|
1465
|
+
# reduce 25 omitted
|
|
1466
|
+
|
|
1467
|
+
# reduce 26 omitted
|
|
1468
|
+
|
|
1469
|
+
def _reduce_27(val, _values, result)
|
|
1470
|
+
result = val[0]
|
|
1471
|
+
|
|
1472
|
+
result
|
|
1473
|
+
end
|
|
1474
|
+
|
|
1475
|
+
def _reduce_28(val, _values, result)
|
|
1476
|
+
result = val[1]
|
|
1477
|
+
|
|
1478
|
+
result
|
|
1479
|
+
end
|
|
1480
|
+
|
|
1481
|
+
def _reduce_29(val, _values, result)
|
|
1482
|
+
result = val[1].push(val[2])
|
|
1483
|
+
|
|
1484
|
+
result
|
|
1485
|
+
end
|
|
1486
|
+
|
|
1487
|
+
def _reduce_30(val, _values, result)
|
|
1488
|
+
result = val[0] << val[1]
|
|
1489
|
+
result
|
|
1490
|
+
end
|
|
1491
|
+
|
|
1492
|
+
def _reduce_31(val, _values, result)
|
|
1493
|
+
result = [val[0]]
|
|
1494
|
+
result
|
|
1495
|
+
end
|
|
1496
|
+
|
|
1497
|
+
def _reduce_32(val, _values, result)
|
|
1498
|
+
result = RDoc::Markup::List.new :BULLET, *val[0]
|
|
1499
|
+
|
|
1500
|
+
result
|
|
1501
|
+
end
|
|
1502
|
+
|
|
1503
|
+
def _reduce_33(val, _values, result)
|
|
1504
|
+
result.push(val[1])
|
|
1505
|
+
result
|
|
1506
|
+
end
|
|
1507
|
+
|
|
1508
|
+
def _reduce_34(val, _values, result)
|
|
1509
|
+
result = val
|
|
1510
|
+
result
|
|
1511
|
+
end
|
|
1512
|
+
|
|
1513
|
+
def _reduce_35(val, _values, result)
|
|
1514
|
+
result = RDoc::Markup::ListItem.new nil, val[0], *val[1]
|
|
1515
|
+
|
|
1516
|
+
result
|
|
1517
|
+
end
|
|
1518
|
+
|
|
1519
|
+
def _reduce_36(val, _values, result)
|
|
1520
|
+
result = RDoc::Markup::List.new :NUMBER, *val[0]
|
|
1521
|
+
|
|
1522
|
+
result
|
|
1523
|
+
end
|
|
1524
|
+
|
|
1525
|
+
def _reduce_37(val, _values, result)
|
|
1526
|
+
result.push(val[1])
|
|
1527
|
+
result
|
|
1528
|
+
end
|
|
1529
|
+
|
|
1530
|
+
def _reduce_38(val, _values, result)
|
|
1531
|
+
result = val
|
|
1532
|
+
result
|
|
1533
|
+
end
|
|
1534
|
+
|
|
1535
|
+
def _reduce_39(val, _values, result)
|
|
1536
|
+
result = RDoc::Markup::ListItem.new nil, val[0], *val[1]
|
|
1537
|
+
|
|
1538
|
+
result
|
|
1539
|
+
end
|
|
1540
|
+
|
|
1541
|
+
def _reduce_40(val, _values, result)
|
|
1542
|
+
result = RDoc::Markup::List.new :NOTE, *val[0]
|
|
1543
|
+
|
|
1544
|
+
result
|
|
1545
|
+
end
|
|
1546
|
+
|
|
1547
|
+
def _reduce_41(val, _values, result)
|
|
1548
|
+
result.push(val[1])
|
|
1549
|
+
result
|
|
1550
|
+
end
|
|
1551
|
+
|
|
1552
|
+
def _reduce_42(val, _values, result)
|
|
1553
|
+
result = val
|
|
1554
|
+
result
|
|
1555
|
+
end
|
|
1556
|
+
|
|
1557
|
+
def _reduce_43(val, _values, result)
|
|
1558
|
+
term = @inline_parser.parse val[0].strip
|
|
1559
|
+
|
|
1560
|
+
result = RDoc::Markup::ListItem.new term, *val[1]
|
|
1561
|
+
|
|
1562
|
+
result
|
|
1563
|
+
end
|
|
1564
|
+
|
|
1565
|
+
def _reduce_44(val, _values, result)
|
|
1566
|
+
result = RDoc::Markup::List.new :LABEL, *val[0]
|
|
1567
|
+
|
|
1568
|
+
result
|
|
1569
|
+
end
|
|
1570
|
+
|
|
1571
|
+
def _reduce_45(val, _values, result)
|
|
1572
|
+
result.push(val[1])
|
|
1573
|
+
result
|
|
1574
|
+
end
|
|
1575
|
+
|
|
1576
|
+
def _reduce_46(val, _values, result)
|
|
1577
|
+
result = val
|
|
1578
|
+
result
|
|
1579
|
+
end
|
|
1580
|
+
|
|
1581
|
+
def _reduce_47(val, _values, result)
|
|
1582
|
+
result = RDoc::Markup::ListItem.new "<tt>#{val[0].strip}</tt>", *val[1]
|
|
1583
|
+
|
|
1584
|
+
result
|
|
1585
|
+
end
|
|
1586
|
+
|
|
1587
|
+
def _reduce_48(val, _values, result)
|
|
1588
|
+
result = [val[1]].concat(val[2])
|
|
1589
|
+
|
|
1590
|
+
result
|
|
1591
|
+
end
|
|
1592
|
+
|
|
1593
|
+
def _reduce_49(val, _values, result)
|
|
1594
|
+
result = [val[1]]
|
|
1595
|
+
|
|
1596
|
+
result
|
|
1597
|
+
end
|
|
1598
|
+
|
|
1599
|
+
def _reduce_50(val, _values, result)
|
|
1600
|
+
result = val[2]
|
|
1601
|
+
|
|
1602
|
+
result
|
|
1603
|
+
end
|
|
1604
|
+
|
|
1605
|
+
def _reduce_51(val, _values, result)
|
|
1606
|
+
result = []
|
|
1607
|
+
|
|
1608
|
+
result
|
|
1609
|
+
end
|
|
1610
|
+
|
|
1611
|
+
def _reduce_52(val, _values, result)
|
|
1612
|
+
result.concat val[1]
|
|
1613
|
+
result
|
|
1614
|
+
end
|
|
1615
|
+
|
|
1616
|
+
# reduce 53 omitted
|
|
1617
|
+
|
|
1618
|
+
def _reduce_54(val, _values, result)
|
|
1619
|
+
result = val
|
|
1620
|
+
result
|
|
1621
|
+
end
|
|
1622
|
+
|
|
1623
|
+
def _reduce_55(val, _values, result)
|
|
1624
|
+
result = val
|
|
1625
|
+
result
|
|
1626
|
+
end
|
|
1627
|
+
|
|
1628
|
+
# reduce 56 omitted
|
|
1629
|
+
|
|
1630
|
+
def _reduce_57(val, _values, result)
|
|
1631
|
+
result = []
|
|
1632
|
+
result
|
|
1633
|
+
end
|
|
1634
|
+
|
|
1635
|
+
# reduce 58 omitted
|
|
1636
|
+
|
|
1637
|
+
# reduce 59 omitted
|
|
1638
|
+
|
|
1639
|
+
# reduce 60 omitted
|
|
1640
|
+
|
|
1641
|
+
# reduce 61 omitted
|
|
1642
|
+
|
|
1643
|
+
def _reduce_62(val, _values, result)
|
|
1644
|
+
result = paragraph [val[0]].concat(val[1])
|
|
1645
|
+
|
|
1646
|
+
result
|
|
1647
|
+
end
|
|
1648
|
+
|
|
1649
|
+
def _reduce_63(val, _values, result)
|
|
1650
|
+
result = paragraph [val[0]]
|
|
1651
|
+
|
|
1652
|
+
result
|
|
1653
|
+
end
|
|
1654
|
+
|
|
1655
|
+
def _reduce_64(val, _values, result)
|
|
1656
|
+
result = paragraph [val[0]].concat(val[1])
|
|
1657
|
+
|
|
1658
|
+
result
|
|
1659
|
+
end
|
|
1660
|
+
|
|
1661
|
+
def _reduce_65(val, _values, result)
|
|
1662
|
+
result = paragraph [val[0]]
|
|
1663
|
+
|
|
1664
|
+
result
|
|
1665
|
+
end
|
|
1666
|
+
|
|
1667
|
+
def _reduce_66(val, _values, result)
|
|
1668
|
+
result = [val[0]].concat(val[1])
|
|
1669
|
+
|
|
1670
|
+
result
|
|
1671
|
+
end
|
|
1672
|
+
|
|
1673
|
+
def _reduce_67(val, _values, result)
|
|
1674
|
+
result.concat val[1]
|
|
1675
|
+
result
|
|
1676
|
+
end
|
|
1677
|
+
|
|
1678
|
+
def _reduce_68(val, _values, result)
|
|
1679
|
+
result = val[1]
|
|
1680
|
+
result
|
|
1681
|
+
end
|
|
1682
|
+
|
|
1683
|
+
def _reduce_69(val, _values, result)
|
|
1684
|
+
result = val
|
|
1685
|
+
result
|
|
1686
|
+
end
|
|
1687
|
+
|
|
1688
|
+
# reduce 70 omitted
|
|
1689
|
+
|
|
1690
|
+
def _reduce_71(val, _values, result)
|
|
1691
|
+
result = []
|
|
1692
|
+
result
|
|
1693
|
+
end
|
|
1694
|
+
|
|
1695
|
+
def _reduce_72(val, _values, result)
|
|
1696
|
+
result = []
|
|
1697
|
+
result
|
|
1698
|
+
end
|
|
1699
|
+
|
|
1700
|
+
def _reduce_none(val, _values, result)
|
|
1701
|
+
val[0]
|
|
1702
|
+
end
|
|
1703
|
+
|
|
1704
|
+
end # class BlockParser
|
|
1705
|
+
|
|
1706
|
+
end
|