cybrid_api_organization_ruby 0.73.1 → 0.73.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -2
- data/README.md +5 -5
- data/cybrid_api_organization_ruby.gemspec +1 -1
- data/lib/cybrid_api_organization_ruby/api/organizations_organization_api.rb +1 -1
- data/lib/cybrid_api_organization_ruby/api_client.rb +1 -1
- data/lib/cybrid_api_organization_ruby/api_error.rb +1 -1
- data/lib/cybrid_api_organization_ruby/configuration.rb +1 -1
- data/lib/cybrid_api_organization_ruby/models/error_response_organization_model.rb +1 -1
- data/lib/cybrid_api_organization_ruby/models/organization_organization_model.rb +1 -1
- data/lib/cybrid_api_organization_ruby/models/patch_organization_organization_model.rb +1 -1
- data/lib/cybrid_api_organization_ruby/version.rb +2 -2
- data/lib/cybrid_api_organization_ruby.rb +1 -1
- data/spec/api/organizations_organization_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/error_response_organization_model_spec.rb +1 -1
- data/spec/models/organization_organization_model_spec.rb +1 -1
- data/spec/models/patch_organization_organization_model_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/bin/racc +29 -0
- data/vendor/bundle/ruby/3.2.0/cache/parser-3.2.2.3.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/racc-1.7.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.15.5/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/gem.build_complete +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/gem_make.out +28 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/mkmf.log +57 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.7/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/macruby.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby18.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby19.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby20.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby21.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby22.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby23.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby24.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby25.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby26.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby27.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby30.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby31.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby32.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby33.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/rubymotion.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/version.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/parser.gemspec +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/COPYING +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ChangeLog +846 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/README.ja.rdoc +94 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/README.rdoc +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/TODO +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/bin/racc +320 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/en/NEWS.en.rdoc +282 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/en/grammar.en.rdoc +226 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/en/grammar2.en.rdoc +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/NEWS.ja.rdoc +307 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/command.ja.html +94 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/debug.ja.rdoc +36 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/grammar.ja.rdoc +348 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/index.ja.html +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/parser.ja.rdoc +125 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/usage.ja.html +414 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/MANIFEST +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/cparse/Makefile +269 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/cparse/cparse.c +861 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/cparse/extconf.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/compat.rb +33 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/debugflags.rb +60 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/exception.rb +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/grammar.rb +1114 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/grammarfileparser.rb +561 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/info.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/iset.rb +92 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/logfilegenerator.rb +212 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/parser-text.rb +658 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/parser.rb +632 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/parserfilegenerator.rb +470 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/sourcetext.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/state.rb +972 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/statetransitiontable.rb +311 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/static.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{parser-3.2.2.1.gemspec → parser-3.2.2.3.gemspec} +5 -5
- data/vendor/bundle/ruby/3.2.0/specifications/racc-1.7.0.gemspec +27 -0
- metadata +126 -82
- data/vendor/bundle/ruby/3.2.0/cache/parser-3.2.2.1.gem +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/bin/ruby-parse +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/bin/ruby-rewrite +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/gauntlet_parser.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/all.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ast/node.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ast/processor.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/base.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/builders/default.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/clobbering_error.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/color.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/context.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/current.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/current_arg_stack.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/deprecation.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/diagnostic/engine.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/diagnostic.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer/dedenter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer/explanation.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer/literal.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer/stack_state.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer-F0.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer-F1.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/lexer-strings.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/max_numparam_stack.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/messages.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/meta.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/rewriter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby28.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/runner/ruby_parse.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/runner/ruby_rewrite.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/runner.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/buffer.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/comment/associator.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/comment.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/collection.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/condition.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/constant.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/definition.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/for.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/heredoc.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/index.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/keyword.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/method_definition.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/objc_kwarg.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/operator.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/rescue_body.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/send.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/ternary.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map/variable.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/map.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/range.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/rewriter/action.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/rewriter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/tree_rewriter/action.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/source/tree_rewriter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/static_environment.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/syntax_error.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/tree_rewriter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/variables_stack.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser.rb +0 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
= Racc
|
2
|
+
|
3
|
+
* http://i.loveruby.net/en/projects/racc/
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Racc は LALR(1) パーサジェネレータです。
|
8
|
+
yacc の Ruby 版に相当します。
|
9
|
+
|
10
|
+
NOTE:
|
11
|
+
Ruby 1.8.0 からは Racc のランタイムが標準添付されているので、
|
12
|
+
Racc で生成したパーサを安心して配布できます。また Ruby 1.6 系に
|
13
|
+
対応させたい場合は racc -E で生成してください。
|
14
|
+
|
15
|
+
|
16
|
+
== 必要環境
|
17
|
+
|
18
|
+
* Ruby 1.8 以降
|
19
|
+
(*) C コンパイラと make
|
20
|
+
|
21
|
+
|
22
|
+
== インストール
|
23
|
+
|
24
|
+
gem インストール:
|
25
|
+
|
26
|
+
$ gem install racc
|
27
|
+
|
28
|
+
setup.rb インストル:
|
29
|
+
|
30
|
+
パッケージのトップディレクトリで次のように入力してください。
|
31
|
+
($ は通常ユーザ、# はルートのプロンプトです)
|
32
|
+
|
33
|
+
$ ruby setup.rb config
|
34
|
+
$ ruby setup.rb setup
|
35
|
+
($ su)
|
36
|
+
# ruby setup.rb install
|
37
|
+
|
38
|
+
これで通常のパスに Racc がインストールされます。自分の好き
|
39
|
+
なディレクトリにインストールしたいときは、setup.rb config に
|
40
|
+
各種オプションをつけて実行してください。オプションのリストは
|
41
|
+
|
42
|
+
$ ruby setup.rb --help
|
43
|
+
|
44
|
+
で見られます。
|
45
|
+
|
46
|
+
|
47
|
+
コンパイラがない場合
|
48
|
+
--------------------
|
49
|
+
|
50
|
+
config を以下のようにすれば、拡張モジュールなしで
|
51
|
+
インストールできます。
|
52
|
+
|
53
|
+
$ ruby setup.rb config --without-ext
|
54
|
+
|
55
|
+
|
56
|
+
== テスト
|
57
|
+
|
58
|
+
sample/ 以下にいくつか Racc の文法ファイルのサンプルが用意
|
59
|
+
してあります。動くのも動かないのもありますが、少なくとも
|
60
|
+
calc-ja.y は動くのでこれを処理してみましょう。Racc をインス
|
61
|
+
トールしたあと
|
62
|
+
|
63
|
+
$ racc -ocalc.rb calc-ja.y
|
64
|
+
|
65
|
+
として下さい。処理は一瞬から数秒で終わるので、
|
66
|
+
|
67
|
+
$ ruby calc.rb
|
68
|
+
|
69
|
+
を実行してください。ちゃんと動いてますか?
|
70
|
+
|
71
|
+
Racc の文法など詳しいことは doc.ja/ ディレクトリ以下の HTML を
|
72
|
+
見てください。
|
73
|
+
|
74
|
+
|
75
|
+
== ライセンス
|
76
|
+
|
77
|
+
このパッケージに付属するファイルの著作権は青木峰郎が保持します。
|
78
|
+
ライセンスは Ruby ライセンスです。ただしユーザが書いた規則
|
79
|
+
ファイルや、Racc がそこから生成した Ruby スクリプトはその対象
|
80
|
+
外です。好きなライセンスで配布してください。
|
81
|
+
|
82
|
+
|
83
|
+
== バグなど
|
84
|
+
|
85
|
+
Racc を使っていてバグらしき現象に遭遇したら、下記のアドレスまで
|
86
|
+
メールをください。作者にはバグを修正する義務はありませんがその
|
87
|
+
意思はあります。また、そのときはできるだけバグを再現できる文法
|
88
|
+
ファイルを付けてください。
|
89
|
+
|
90
|
+
|
91
|
+
青木峰郎(あおきみねろう)
|
92
|
+
aamine@loveruby.net
|
93
|
+
http://i.loveruby.net
|
94
|
+
|
@@ -0,0 +1,79 @@
|
|
1
|
+
= Racc
|
2
|
+
|
3
|
+
* https://github.com/ruby/racc
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Racc is a LALR(1) parser generator.
|
8
|
+
It is written in Ruby itself, and generates Ruby program.
|
9
|
+
|
10
|
+
== Requirement
|
11
|
+
|
12
|
+
* Ruby 2.5 or later.
|
13
|
+
|
14
|
+
== Installation
|
15
|
+
|
16
|
+
gem install:
|
17
|
+
|
18
|
+
$ gem install racc
|
19
|
+
|
20
|
+
setup.rb install:
|
21
|
+
|
22
|
+
Type this in the top directory of the extracted archive:
|
23
|
+
|
24
|
+
$ ruby setup.rb config
|
25
|
+
$ ruby setup.rb setup
|
26
|
+
($ su)
|
27
|
+
# ruby setup.rb install
|
28
|
+
|
29
|
+
You can install Racc into your favorite directory by giving
|
30
|
+
options to setup.rb. e.g.
|
31
|
+
|
32
|
+
$ ruby setup.rb config --prefix=/usr
|
33
|
+
|
34
|
+
For details, try "ruby setup.rb --help".
|
35
|
+
|
36
|
+
|
37
|
+
If you don't have C Compiler
|
38
|
+
----------------------------
|
39
|
+
|
40
|
+
You can install Racc without C compilers. Type following
|
41
|
+
command in config phase.
|
42
|
+
|
43
|
+
$ ruby setup.rb config --without-ext
|
44
|
+
|
45
|
+
|
46
|
+
== Testing Racc
|
47
|
+
|
48
|
+
Racc comes with simple calculator. To compile this, on shell:
|
49
|
+
|
50
|
+
$ racc -o calc calc.y
|
51
|
+
|
52
|
+
This process costs few seconds (or less). Then type:
|
53
|
+
|
54
|
+
$ ruby calc
|
55
|
+
|
56
|
+
... Does it work?
|
57
|
+
For details of Racc, see HTML documents placed under 'doc/en/'
|
58
|
+
and sample grammar files under 'sample/'.
|
59
|
+
|
60
|
+
|
61
|
+
== License
|
62
|
+
|
63
|
+
Racc is distributed under the same terms of ruby.
|
64
|
+
(see the file COPYING). Note that you do NOT need to follow
|
65
|
+
ruby license for your own parser (racc outputs).
|
66
|
+
You can distribute those files under any licenses you want.
|
67
|
+
|
68
|
+
|
69
|
+
== Bug Reports
|
70
|
+
|
71
|
+
Any kind of bug report is welcome.
|
72
|
+
If you find a bug of Racc, please report an issue at
|
73
|
+
https://github.com/ruby/racc/issues. Your grammar file,
|
74
|
+
debug output generated by "racc -g", are helpful.
|
75
|
+
|
76
|
+
|
77
|
+
Minero Aoki
|
78
|
+
aamine@loveruby.net
|
79
|
+
http://i.loveruby.net
|
@@ -0,0 +1,320 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
#
|
4
|
+
#
|
5
|
+
# Copyright (c) 1999-2006 Minero Aoki
|
6
|
+
#
|
7
|
+
# This program is free software.
|
8
|
+
# You can distribute/modify this program under the same terms of ruby.
|
9
|
+
# see the file "COPYING".
|
10
|
+
|
11
|
+
require 'racc/static'
|
12
|
+
require 'optparse'
|
13
|
+
|
14
|
+
def main
|
15
|
+
output = nil
|
16
|
+
debug_parser = false
|
17
|
+
make_logfile = false
|
18
|
+
logfilename = nil
|
19
|
+
make_executable = false
|
20
|
+
rubypath = nil
|
21
|
+
embed_runtime = false
|
22
|
+
debug_flags = Racc::DebugFlags.new
|
23
|
+
line_convert = true
|
24
|
+
line_convert_all = false
|
25
|
+
omit_action_call = true
|
26
|
+
superclass = nil
|
27
|
+
check_only = false
|
28
|
+
verbose = false
|
29
|
+
profiler = RaccProfiler.new(false)
|
30
|
+
|
31
|
+
parser = OptionParser.new
|
32
|
+
parser.banner = "Usage: #{File.basename($0)} [options] <input>"
|
33
|
+
parser.on('-o', '--output-file=PATH',
|
34
|
+
'output file name [<input>.tab.rb]') {|name|
|
35
|
+
output = name
|
36
|
+
}
|
37
|
+
parser.on('-t', '--debug', 'Outputs debugging parser.') {|fl|
|
38
|
+
debug_parser = fl
|
39
|
+
}
|
40
|
+
parser.on('-g', 'Equivalent to -t (obsolete).') {|fl|
|
41
|
+
$stderr.puts "racc -g is obsolete. Use racc -t instead." if $VERBOSE
|
42
|
+
debug_parser = fl
|
43
|
+
}
|
44
|
+
parser.on('-v', '--verbose',
|
45
|
+
'Creates <filename>.output log file.') {|fl|
|
46
|
+
make_logfile = fl
|
47
|
+
}
|
48
|
+
parser.on('-O', '--log-file=PATH',
|
49
|
+
'Log file name [<input>.output]') {|path|
|
50
|
+
make_logfile = true
|
51
|
+
logfilename = path
|
52
|
+
}
|
53
|
+
parser.on('-e', '--executable [RUBYPATH]', 'Makes executable parser.') {|path|
|
54
|
+
make_executable = true
|
55
|
+
rubypath = (path == 'ruby' ? nil : path)
|
56
|
+
}
|
57
|
+
parser.on('-E', '--embedded', "Embeds Racc runtime in output.") {
|
58
|
+
embed_runtime = true
|
59
|
+
}
|
60
|
+
parser.on('--line-convert-all', 'Converts line numbers of user codes.') {
|
61
|
+
line_convert_all = true
|
62
|
+
}
|
63
|
+
parser.on('-l', '--no-line-convert', 'Never convert line numbers.') {
|
64
|
+
line_convert = false
|
65
|
+
line_convert_all = false
|
66
|
+
}
|
67
|
+
parser.on('-a', '--no-omit-actions', 'Never omit actions.') {
|
68
|
+
omit_action_call = false
|
69
|
+
}
|
70
|
+
parser.on('--superclass=CLASSNAME',
|
71
|
+
'Uses CLASSNAME instead of Racc::Parser.') {|name|
|
72
|
+
superclass = name
|
73
|
+
}
|
74
|
+
parser.on('-C', '--check-only', 'Checks syntax and quit immediately.') {|fl|
|
75
|
+
check_only = fl
|
76
|
+
}
|
77
|
+
parser.on('-S', '--output-status', 'Outputs internal status time to time.') {
|
78
|
+
verbose = true
|
79
|
+
}
|
80
|
+
parser.on('-P', 'Enables generator profile') {
|
81
|
+
profiler = RaccProfiler.new(true)
|
82
|
+
}
|
83
|
+
parser.on('-D flags', "Flags for Racc debugging (do not use).") {|flags|
|
84
|
+
debug_flags = Racc::DebugFlags.parse_option_string(flags)
|
85
|
+
}
|
86
|
+
#parser.on('--no-extensions', 'Run Racc without any Ruby extension.') {
|
87
|
+
# Racc.const_set :Racc_No_Extensions, true
|
88
|
+
#}
|
89
|
+
parser.on('--version', 'Prints version and quit.') {
|
90
|
+
puts "racc version #{Racc::Version}"
|
91
|
+
exit 0
|
92
|
+
}
|
93
|
+
parser.on('--runtime-version', 'Prints runtime version and quit.') {
|
94
|
+
printf "racc runtime version %s; %s\n",
|
95
|
+
Racc::Parser::Racc_Runtime_Version,
|
96
|
+
if Racc::Parser.racc_runtime_type == 'ruby'
|
97
|
+
sprintf('ruby core version %s',
|
98
|
+
Racc::Parser::Racc_Runtime_Core_Version_R)
|
99
|
+
else
|
100
|
+
sprintf('c core version %s',
|
101
|
+
Racc::Parser::Racc_Runtime_Core_Version_C)
|
102
|
+
end
|
103
|
+
exit 0
|
104
|
+
}
|
105
|
+
parser.on('--copyright', 'Prints copyright and quit.') {
|
106
|
+
puts Racc::Copyright
|
107
|
+
exit 0
|
108
|
+
}
|
109
|
+
parser.on('--help', 'Prints this message and quit.') {
|
110
|
+
puts parser.help
|
111
|
+
exit 1
|
112
|
+
}
|
113
|
+
begin
|
114
|
+
parser.parse!
|
115
|
+
rescue OptionParser::ParseError => err
|
116
|
+
$stderr.puts err.message
|
117
|
+
$stderr.puts parser.help
|
118
|
+
exit 1
|
119
|
+
end
|
120
|
+
if ARGV.empty?
|
121
|
+
$stderr.puts 'no input'
|
122
|
+
exit 1
|
123
|
+
end
|
124
|
+
if ARGV.size > 1
|
125
|
+
$stderr.puts 'too many input'
|
126
|
+
exit 1
|
127
|
+
end
|
128
|
+
input = ARGV[0]
|
129
|
+
|
130
|
+
begin
|
131
|
+
$stderr.puts 'Parsing grammar file...' if verbose
|
132
|
+
result = profiler.section('parse') {
|
133
|
+
parser = Racc::GrammarFileParser.new(debug_flags)
|
134
|
+
parser.parse(File.read(input), File.basename(input))
|
135
|
+
}
|
136
|
+
if check_only
|
137
|
+
$stderr.puts 'syntax ok'
|
138
|
+
exit 0
|
139
|
+
end
|
140
|
+
|
141
|
+
$stderr.puts 'Generating LALR states...' if verbose
|
142
|
+
states = profiler.section('nfa') {
|
143
|
+
Racc::States.new(result.grammar).nfa
|
144
|
+
}
|
145
|
+
|
146
|
+
$stderr.puts "Resolving #{states.size} states..." if verbose
|
147
|
+
profiler.section('dfa') {
|
148
|
+
states.dfa
|
149
|
+
}
|
150
|
+
|
151
|
+
$stderr.puts 'Creating parser file...' if verbose
|
152
|
+
params = result.params.dup
|
153
|
+
# Overwrites parameters given by a grammar file with command line options.
|
154
|
+
params.superclass = superclass if superclass
|
155
|
+
params.omit_action_call = true if omit_action_call
|
156
|
+
# From command line option
|
157
|
+
if make_executable
|
158
|
+
params.make_executable = true
|
159
|
+
params.interpreter = rubypath
|
160
|
+
end
|
161
|
+
params.debug_parser = debug_parser
|
162
|
+
params.convert_line = line_convert
|
163
|
+
params.convert_line_all = line_convert_all
|
164
|
+
params.embed_runtime = embed_runtime
|
165
|
+
profiler.section('generation') {
|
166
|
+
generator = Racc::ParserFileGenerator.new(states, params)
|
167
|
+
generator.generate_parser_file(output || make_filename(input, '.tab.rb'))
|
168
|
+
}
|
169
|
+
|
170
|
+
if make_logfile
|
171
|
+
profiler.section('logging') {
|
172
|
+
$stderr.puts 'Creating log file...' if verbose
|
173
|
+
logfilename ||= make_filename(output || File.basename(input), '.output')
|
174
|
+
File.open(logfilename, 'w') {|f|
|
175
|
+
Racc::LogFileGenerator.new(states, debug_flags).output f
|
176
|
+
}
|
177
|
+
}
|
178
|
+
end
|
179
|
+
if debug_flags.status_logging
|
180
|
+
log_useless states.grammar
|
181
|
+
log_conflict states
|
182
|
+
else
|
183
|
+
has_useless = report_useless states.grammar
|
184
|
+
has_conflicts = report_conflict states
|
185
|
+
if has_useless || has_conflicts
|
186
|
+
preamble = make_logfile ? 'C' : 'Turn on logging with "-v" and c'
|
187
|
+
$stderr.puts %Q{#{preamble}heck ".output" file for details}
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
profiler.report
|
192
|
+
rescue Racc::Error, Errno::ENOENT, Errno::EPERM => err
|
193
|
+
raise if $DEBUG or debug_flags.any?
|
194
|
+
lineno = err.message.slice(/\A\d+:/).to_s
|
195
|
+
$stderr.puts "#{File.basename $0}: #{input}:#{lineno} #{err.message.strip}"
|
196
|
+
exit 1
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
def make_filename(path, suffix)
|
201
|
+
path.sub(/(?:\..*?)?\z/, suffix)
|
202
|
+
end
|
203
|
+
|
204
|
+
LIST_LIMIT = 10
|
205
|
+
def report_list(enum, label)
|
206
|
+
c = enum.count
|
207
|
+
if c > 0
|
208
|
+
$stderr.puts "#{c} #{label}:"
|
209
|
+
enum.first(LIST_LIMIT).each do |item|
|
210
|
+
$stderr.puts " #{yield item}"
|
211
|
+
end
|
212
|
+
$stderr.puts " ..." if c > LIST_LIMIT
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# @return [Boolean] if anything was reported
|
217
|
+
def report_conflict(states)
|
218
|
+
if states.should_report_srconflict?
|
219
|
+
reported = true
|
220
|
+
$stderr.puts "#{states.n_srconflicts} shift/reduce conflicts"
|
221
|
+
end
|
222
|
+
if states.rrconflict_exist?
|
223
|
+
reported = true
|
224
|
+
$stderr.puts "#{states.n_rrconflicts} reduce/reduce conflicts"
|
225
|
+
end
|
226
|
+
reported
|
227
|
+
end
|
228
|
+
|
229
|
+
def log_conflict(states)
|
230
|
+
logging('w') {|f|
|
231
|
+
f.puts "ex#{states.grammar.n_expected_srconflicts}"
|
232
|
+
if states.should_report_srconflict?
|
233
|
+
f.puts "sr#{states.n_srconflicts}"
|
234
|
+
end
|
235
|
+
if states.rrconflict_exist?
|
236
|
+
f.puts "rr#{states.n_rrconflicts}"
|
237
|
+
end
|
238
|
+
}
|
239
|
+
end
|
240
|
+
|
241
|
+
# @return [Boolean] if anything was reported
|
242
|
+
def report_useless(grammar)
|
243
|
+
reported = report_list(grammar.each_useless_nonterminal, 'useless nonterminals', &:to_s)
|
244
|
+
|
245
|
+
reported ||= report_list(grammar.each_useless_rule, 'useless rules') { |r| "##{r.ident} (#{r.target})" }
|
246
|
+
|
247
|
+
if grammar.start.useless?
|
248
|
+
$stderr.puts 'fatal: start symbol does not derive any sentence'
|
249
|
+
reported = true
|
250
|
+
end
|
251
|
+
reported
|
252
|
+
end
|
253
|
+
|
254
|
+
def log_useless(grammar)
|
255
|
+
logging('a') {|f|
|
256
|
+
if grammar.useless_nonterminal_exist?
|
257
|
+
f.puts "un#{grammar.n_useless_nonterminals}"
|
258
|
+
end
|
259
|
+
if grammar.useless_rule_exist?
|
260
|
+
f.puts "ur#{grammar.n_useless_rules}"
|
261
|
+
end
|
262
|
+
}
|
263
|
+
end
|
264
|
+
|
265
|
+
def logging(mode, &block)
|
266
|
+
File.open("log/#{File.basename(ARGV[0])}", mode, &block)
|
267
|
+
end
|
268
|
+
|
269
|
+
class RaccProfiler
|
270
|
+
def initialize(really)
|
271
|
+
@really = really
|
272
|
+
@log = []
|
273
|
+
unless ::Process.respond_to?(:times)
|
274
|
+
# Ruby 1.6
|
275
|
+
@class = ::Time
|
276
|
+
else
|
277
|
+
@class = ::Process
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
def section(name)
|
282
|
+
if @really
|
283
|
+
t1 = @class.times.utime
|
284
|
+
result = yield
|
285
|
+
t2 = @class.times.utime
|
286
|
+
@log.push [name, t2 - t1]
|
287
|
+
result
|
288
|
+
else
|
289
|
+
yield
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
def report
|
294
|
+
return unless @really
|
295
|
+
f = $stderr
|
296
|
+
total = cumulative_time()
|
297
|
+
f.puts '--task-----------+--sec------+---%-'
|
298
|
+
@log.each do |name, time|
|
299
|
+
f.printf "%-19s %s %3d%%\n", name, pjust(time,4,4), (time/total*100).to_i
|
300
|
+
end
|
301
|
+
f.puts '-----------------+-----------+-----'
|
302
|
+
f.printf "%-20s%s\n", 'total', pjust(total,4,4)
|
303
|
+
end
|
304
|
+
|
305
|
+
private
|
306
|
+
|
307
|
+
def cumulative_time
|
308
|
+
t = @log.inject(0) {|sum, (name, time)| sum + time }
|
309
|
+
t == 0 ? 0.01 : t
|
310
|
+
end
|
311
|
+
|
312
|
+
def pjust(num, i, j)
|
313
|
+
m = /(\d+)(\.\d+)?/.match(num.to_s)
|
314
|
+
str = m[1].rjust(i)
|
315
|
+
str.concat m[2].ljust(j+1)[0,j+1] if m[2]
|
316
|
+
str
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
main
|