cybrid_api_organization_ruby 0.73.1 → 0.73.6
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 +127 -83
- 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,561 @@
|
|
1
|
+
#--
|
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
|
+
#++
|
12
|
+
|
13
|
+
require 'racc'
|
14
|
+
require 'racc/compat'
|
15
|
+
require 'racc/grammar'
|
16
|
+
require 'racc/parserfilegenerator'
|
17
|
+
require 'racc/sourcetext'
|
18
|
+
require 'stringio'
|
19
|
+
|
20
|
+
module Racc
|
21
|
+
|
22
|
+
grammar = Grammar.define {
|
23
|
+
g = self
|
24
|
+
|
25
|
+
g.class = seq(:CLASS, :cname, many(:param), :RULE, :rules, option(:END))
|
26
|
+
|
27
|
+
g.cname = seq(:rubyconst) {|name|
|
28
|
+
@result.params.classname = name
|
29
|
+
}\
|
30
|
+
| seq(:rubyconst, "<", :rubyconst) {|c, _, s|
|
31
|
+
@result.params.classname = c
|
32
|
+
@result.params.superclass = s
|
33
|
+
}
|
34
|
+
|
35
|
+
g.rubyconst = separated_by1(:colon2, :SYMBOL) {|syms|
|
36
|
+
syms.map {|s| s.to_s }.join('::')
|
37
|
+
}
|
38
|
+
|
39
|
+
g.colon2 = seq(':', ':')
|
40
|
+
|
41
|
+
g.param = seq(:CONV, many1(:convdef), :END) {|*|
|
42
|
+
#@grammar.end_convert_block # FIXME
|
43
|
+
}\
|
44
|
+
| seq(:PRECHIGH, many1(:precdef), :PRECLOW) {|*|
|
45
|
+
@grammar.end_precedence_declaration true
|
46
|
+
}\
|
47
|
+
| seq(:PRECLOW, many1(:precdef), :PRECHIGH) {|*|
|
48
|
+
@grammar.end_precedence_declaration false
|
49
|
+
}\
|
50
|
+
| seq(:START, :symbol) {|_, sym|
|
51
|
+
@grammar.start_symbol = sym
|
52
|
+
}\
|
53
|
+
| seq(:TOKEN, :symbols) {|_, syms|
|
54
|
+
syms.each do |s|
|
55
|
+
s.should_terminal
|
56
|
+
end
|
57
|
+
}\
|
58
|
+
| seq(:OPTION, :options) {|_, syms|
|
59
|
+
syms.each do |opt|
|
60
|
+
case opt
|
61
|
+
when 'result_var'
|
62
|
+
@result.params.result_var = true
|
63
|
+
when 'no_result_var'
|
64
|
+
@result.params.result_var = false
|
65
|
+
when 'omit_action_call'
|
66
|
+
@result.params.omit_action_call = true
|
67
|
+
when 'no_omit_action_call'
|
68
|
+
@result.params.omit_action_call = false
|
69
|
+
else
|
70
|
+
raise CompileError, "unknown option: #{opt}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
}\
|
74
|
+
| seq(:EXPECT, :DIGIT) {|_, num|
|
75
|
+
if @grammar.n_expected_srconflicts
|
76
|
+
raise CompileError, "`expect' seen twice"
|
77
|
+
end
|
78
|
+
@grammar.n_expected_srconflicts = num
|
79
|
+
}
|
80
|
+
|
81
|
+
g.convdef = seq(:symbol, :STRING) {|sym, code|
|
82
|
+
sym.serialized = code
|
83
|
+
}
|
84
|
+
|
85
|
+
g.precdef = seq(:LEFT, :symbols) {|_, syms|
|
86
|
+
@grammar.declare_precedence :Left, syms
|
87
|
+
}\
|
88
|
+
| seq(:RIGHT, :symbols) {|_, syms|
|
89
|
+
@grammar.declare_precedence :Right, syms
|
90
|
+
}\
|
91
|
+
| seq(:NONASSOC, :symbols) {|_, syms|
|
92
|
+
@grammar.declare_precedence :Nonassoc, syms
|
93
|
+
}
|
94
|
+
|
95
|
+
g.symbols = seq(:symbol) {|sym|
|
96
|
+
[sym]
|
97
|
+
}\
|
98
|
+
| seq(:symbols, :symbol) {|list, sym|
|
99
|
+
list.push sym
|
100
|
+
list
|
101
|
+
}\
|
102
|
+
| seq(:symbols, "|")
|
103
|
+
|
104
|
+
g.symbol = seq(:SYMBOL) {|sym| @grammar.intern(sym) }\
|
105
|
+
| seq(:STRING) {|str| @grammar.intern(str) }
|
106
|
+
|
107
|
+
g.options = many(:SYMBOL) {|syms| syms.map {|s| s.to_s } }
|
108
|
+
|
109
|
+
g.rules = option(:rules_core) {|list|
|
110
|
+
add_rule_block list unless list.empty?
|
111
|
+
nil
|
112
|
+
}
|
113
|
+
|
114
|
+
g.rules_core = seq(:symbol) {|sym|
|
115
|
+
[sym]
|
116
|
+
}\
|
117
|
+
| seq(:rules_core, :rule_item) {|list, i|
|
118
|
+
list.push i
|
119
|
+
list
|
120
|
+
}\
|
121
|
+
| seq(:rules_core, ';') {|list, *|
|
122
|
+
add_rule_block list unless list.empty?
|
123
|
+
list.clear
|
124
|
+
list
|
125
|
+
}\
|
126
|
+
| seq(:rules_core, ':') {|list, *|
|
127
|
+
next_target = list.pop
|
128
|
+
add_rule_block list unless list.empty?
|
129
|
+
[next_target]
|
130
|
+
}
|
131
|
+
|
132
|
+
g.rule_item = seq(:symbol)\
|
133
|
+
| seq("|") {|*|
|
134
|
+
OrMark.new(@scanner.lineno)
|
135
|
+
}\
|
136
|
+
| seq("=", :symbol) {|_, sym|
|
137
|
+
Prec.new(sym, @scanner.lineno)
|
138
|
+
}\
|
139
|
+
| seq(:ACTION) {|src|
|
140
|
+
UserAction.source_text(src)
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
GrammarFileParser = grammar.parser_class
|
145
|
+
|
146
|
+
if grammar.states.srconflict_exist?
|
147
|
+
raise 'Racc boot script fatal: S/R conflict in build'
|
148
|
+
end
|
149
|
+
if grammar.states.rrconflict_exist?
|
150
|
+
raise 'Racc boot script fatal: R/R conflict in build'
|
151
|
+
end
|
152
|
+
|
153
|
+
class GrammarFileParser # reopen
|
154
|
+
|
155
|
+
class Result
|
156
|
+
def initialize(grammar)
|
157
|
+
@grammar = grammar
|
158
|
+
@params = ParserFileGenerator::Params.new
|
159
|
+
end
|
160
|
+
|
161
|
+
attr_reader :grammar
|
162
|
+
attr_reader :params
|
163
|
+
end
|
164
|
+
|
165
|
+
def GrammarFileParser.parse_file(filename)
|
166
|
+
parse(File.read(filename), filename, 1)
|
167
|
+
end
|
168
|
+
|
169
|
+
def GrammarFileParser.parse(src, filename = '-', lineno = 1)
|
170
|
+
new().parse(src, filename, lineno)
|
171
|
+
end
|
172
|
+
|
173
|
+
def initialize(debug_flags = DebugFlags.new)
|
174
|
+
@yydebug = debug_flags.parse
|
175
|
+
end
|
176
|
+
|
177
|
+
def parse(src, filename = '-', lineno = 1)
|
178
|
+
@filename = filename
|
179
|
+
@lineno = lineno
|
180
|
+
@scanner = GrammarFileScanner.new(src, @filename)
|
181
|
+
@scanner.debug = @yydebug
|
182
|
+
@grammar = Grammar.new
|
183
|
+
@result = Result.new(@grammar)
|
184
|
+
@embedded_action_seq = 0
|
185
|
+
yyparse @scanner, :yylex
|
186
|
+
parse_user_code
|
187
|
+
@result.grammar.init
|
188
|
+
@result
|
189
|
+
end
|
190
|
+
|
191
|
+
private
|
192
|
+
|
193
|
+
def next_token
|
194
|
+
@scanner.scan
|
195
|
+
end
|
196
|
+
|
197
|
+
def on_error(tok, val, _values)
|
198
|
+
if val.respond_to?(:id2name)
|
199
|
+
v = val.id2name
|
200
|
+
elsif val.kind_of?(String)
|
201
|
+
v = val
|
202
|
+
else
|
203
|
+
v = val.inspect
|
204
|
+
end
|
205
|
+
raise CompileError, "#{location()}: unexpected token '#{v}'"
|
206
|
+
end
|
207
|
+
|
208
|
+
def location
|
209
|
+
"#{@filename}:#{@lineno - 1 + @scanner.lineno}"
|
210
|
+
end
|
211
|
+
|
212
|
+
def add_rule_block(list)
|
213
|
+
sprec = nil
|
214
|
+
target = list.shift
|
215
|
+
case target
|
216
|
+
when OrMark, UserAction, Prec
|
217
|
+
raise CompileError, "#{target.lineno}: unexpected symbol #{target.name}"
|
218
|
+
end
|
219
|
+
curr = []
|
220
|
+
list.each do |i|
|
221
|
+
case i
|
222
|
+
when OrMark
|
223
|
+
add_rule target, curr, sprec
|
224
|
+
curr = []
|
225
|
+
sprec = nil
|
226
|
+
when Prec
|
227
|
+
raise CompileError, "'=<prec>' used twice in one rule" if sprec
|
228
|
+
sprec = i.symbol
|
229
|
+
else
|
230
|
+
curr.push i
|
231
|
+
end
|
232
|
+
end
|
233
|
+
add_rule target, curr, sprec
|
234
|
+
end
|
235
|
+
|
236
|
+
def add_rule(target, list, sprec)
|
237
|
+
if list.last.kind_of?(UserAction)
|
238
|
+
act = list.pop
|
239
|
+
else
|
240
|
+
act = UserAction.empty
|
241
|
+
end
|
242
|
+
list.map! {|s| s.kind_of?(UserAction) ? embedded_action(s) : s }
|
243
|
+
rule = Rule.new(target, list, act)
|
244
|
+
rule.specified_prec = sprec
|
245
|
+
@grammar.add rule
|
246
|
+
end
|
247
|
+
|
248
|
+
def embedded_action(act)
|
249
|
+
sym = @grammar.intern("@#{@embedded_action_seq += 1}".intern, true)
|
250
|
+
@grammar.add Rule.new(sym, [], act)
|
251
|
+
sym
|
252
|
+
end
|
253
|
+
|
254
|
+
#
|
255
|
+
# User Code Block
|
256
|
+
#
|
257
|
+
|
258
|
+
def parse_user_code
|
259
|
+
line = @scanner.lineno
|
260
|
+
_, *blocks = *@scanner.epilogue.split(/^----/)
|
261
|
+
blocks.each do |block|
|
262
|
+
header, *body = block.lines.to_a
|
263
|
+
label0, paths = *header.sub(/\A-+/, '').split('=', 2)
|
264
|
+
label = canonical_label(label0)
|
265
|
+
(paths ? paths.strip.split(' ') : []).each do |path|
|
266
|
+
add_user_code label, SourceText.new(File.read(path), path, 1)
|
267
|
+
end
|
268
|
+
add_user_code label, SourceText.new(body.join(''), @filename, line + 1)
|
269
|
+
line += (1 + body.size)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
USER_CODE_LABELS = {
|
274
|
+
'header' => :header,
|
275
|
+
'prepare' => :header, # obsolete
|
276
|
+
'inner' => :inner,
|
277
|
+
'footer' => :footer,
|
278
|
+
'driver' => :footer # obsolete
|
279
|
+
}
|
280
|
+
|
281
|
+
def canonical_label(src)
|
282
|
+
label = src.to_s.strip.downcase.slice(/\w+/)
|
283
|
+
unless USER_CODE_LABELS.key?(label)
|
284
|
+
raise CompileError, "unknown user code type: #{label.inspect}"
|
285
|
+
end
|
286
|
+
label
|
287
|
+
end
|
288
|
+
|
289
|
+
def add_user_code(label, src)
|
290
|
+
@result.params.public_send(USER_CODE_LABELS[label]).push src
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
294
|
+
|
295
|
+
|
296
|
+
class GrammarFileScanner
|
297
|
+
|
298
|
+
def initialize(str, filename = '-')
|
299
|
+
@lines = str.b.split(/\n|\r\n|\r/)
|
300
|
+
@filename = filename
|
301
|
+
@lineno = -1
|
302
|
+
@line_head = true
|
303
|
+
@in_rule_blk = false
|
304
|
+
@in_conv_blk = false
|
305
|
+
@in_block = nil
|
306
|
+
@epilogue = ''
|
307
|
+
@debug = false
|
308
|
+
next_line
|
309
|
+
end
|
310
|
+
|
311
|
+
attr_reader :epilogue
|
312
|
+
|
313
|
+
def lineno
|
314
|
+
@lineno + 1
|
315
|
+
end
|
316
|
+
|
317
|
+
attr_accessor :debug
|
318
|
+
|
319
|
+
def yylex(&block)
|
320
|
+
unless @debug
|
321
|
+
yylex0(&block)
|
322
|
+
else
|
323
|
+
yylex0 do |sym, tok|
|
324
|
+
$stderr.printf "%7d %-10s %s\n", lineno(), sym.inspect, tok.inspect
|
325
|
+
yield [sym, tok]
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
private
|
331
|
+
|
332
|
+
def yylex0
|
333
|
+
begin
|
334
|
+
until @line.empty?
|
335
|
+
@line.sub!(/\A\s+/, '')
|
336
|
+
if /\A\#/ =~ @line
|
337
|
+
break
|
338
|
+
elsif /\A\/\*/ =~ @line
|
339
|
+
skip_comment
|
340
|
+
elsif s = reads(/\A[a-zA-Z_]\w*/)
|
341
|
+
yield [atom_symbol(s), s.intern]
|
342
|
+
elsif s = reads(/\A\d+/)
|
343
|
+
yield [:DIGIT, s.to_i]
|
344
|
+
elsif ch = reads(/\A./)
|
345
|
+
case ch
|
346
|
+
when '"', "'"
|
347
|
+
yield [:STRING, eval(scan_quoted(ch))]
|
348
|
+
when '{'
|
349
|
+
lineno = lineno()
|
350
|
+
yield [:ACTION, SourceText.new(scan_action(), @filename, lineno)]
|
351
|
+
else
|
352
|
+
if ch == '|'
|
353
|
+
@line_head = false
|
354
|
+
end
|
355
|
+
yield [ch, ch]
|
356
|
+
end
|
357
|
+
else
|
358
|
+
end
|
359
|
+
end
|
360
|
+
end while next_line()
|
361
|
+
yield nil
|
362
|
+
end
|
363
|
+
|
364
|
+
def next_line
|
365
|
+
@lineno += 1
|
366
|
+
@line = @lines[@lineno]
|
367
|
+
if not @line or /\A----/ =~ @line
|
368
|
+
@epilogue = @lines.join("\n")
|
369
|
+
@lines.clear
|
370
|
+
@line = nil
|
371
|
+
if @in_block
|
372
|
+
@lineno -= 1
|
373
|
+
scan_error! sprintf('unterminated %s', @in_block)
|
374
|
+
end
|
375
|
+
false
|
376
|
+
else
|
377
|
+
@line.sub!(/(?:\n|\r\n|\r)\z/, '')
|
378
|
+
@line_head = true
|
379
|
+
true
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
ReservedWord = {
|
384
|
+
'right' => :RIGHT,
|
385
|
+
'left' => :LEFT,
|
386
|
+
'nonassoc' => :NONASSOC,
|
387
|
+
'preclow' => :PRECLOW,
|
388
|
+
'prechigh' => :PRECHIGH,
|
389
|
+
'token' => :TOKEN,
|
390
|
+
'convert' => :CONV,
|
391
|
+
'options' => :OPTION,
|
392
|
+
'start' => :START,
|
393
|
+
'expect' => :EXPECT,
|
394
|
+
'class' => :CLASS,
|
395
|
+
'rule' => :RULE,
|
396
|
+
'end' => :END
|
397
|
+
}
|
398
|
+
|
399
|
+
def atom_symbol(token)
|
400
|
+
if token == 'end'
|
401
|
+
symbol = :END
|
402
|
+
@in_conv_blk = false
|
403
|
+
@in_rule_blk = false
|
404
|
+
else
|
405
|
+
if @line_head and not @in_conv_blk and not @in_rule_blk
|
406
|
+
symbol = ReservedWord[token] || :SYMBOL
|
407
|
+
else
|
408
|
+
symbol = :SYMBOL
|
409
|
+
end
|
410
|
+
case symbol
|
411
|
+
when :RULE then @in_rule_blk = true
|
412
|
+
when :CONV then @in_conv_blk = true
|
413
|
+
end
|
414
|
+
end
|
415
|
+
@line_head = false
|
416
|
+
symbol
|
417
|
+
end
|
418
|
+
|
419
|
+
def skip_comment
|
420
|
+
@in_block = 'comment'
|
421
|
+
until m = /\*\//.match(@line)
|
422
|
+
next_line
|
423
|
+
end
|
424
|
+
@line = m.post_match
|
425
|
+
@in_block = nil
|
426
|
+
end
|
427
|
+
|
428
|
+
$raccs_print_type = false
|
429
|
+
|
430
|
+
def scan_action
|
431
|
+
buf = String.new
|
432
|
+
nest = 1
|
433
|
+
pre = nil
|
434
|
+
@in_block = 'action'
|
435
|
+
begin
|
436
|
+
pre = nil
|
437
|
+
if s = reads(/\A\s+/)
|
438
|
+
# does not set 'pre'
|
439
|
+
buf << s
|
440
|
+
end
|
441
|
+
until @line.empty?
|
442
|
+
if s = reads(/\A[^'"`{}%#\/\$]+/)
|
443
|
+
buf << (pre = s)
|
444
|
+
next
|
445
|
+
end
|
446
|
+
case ch = read(1)
|
447
|
+
when '{'
|
448
|
+
nest += 1
|
449
|
+
buf << (pre = ch)
|
450
|
+
when '}'
|
451
|
+
nest -= 1
|
452
|
+
if nest == 0
|
453
|
+
@in_block = nil
|
454
|
+
buf.sub!(/[ \t\f]+\z/, '')
|
455
|
+
return buf
|
456
|
+
end
|
457
|
+
buf << (pre = ch)
|
458
|
+
when '#' # comment
|
459
|
+
buf << ch << @line
|
460
|
+
break
|
461
|
+
when "'", '"', '`'
|
462
|
+
buf << (pre = scan_quoted(ch))
|
463
|
+
when '%'
|
464
|
+
if literal_head? pre, @line
|
465
|
+
# % string, regexp, array
|
466
|
+
buf << ch
|
467
|
+
case ch = read(1)
|
468
|
+
when /[qQx]/n
|
469
|
+
buf << ch << (pre = scan_quoted(read(1), '%string'))
|
470
|
+
when /wW/n
|
471
|
+
buf << ch << (pre = scan_quoted(read(1), '%array'))
|
472
|
+
when /s/n
|
473
|
+
buf << ch << (pre = scan_quoted(read(1), '%symbol'))
|
474
|
+
when /r/n
|
475
|
+
buf << ch << (pre = scan_quoted(read(1), '%regexp'))
|
476
|
+
when /[a-zA-Z0-9= ]/n # does not include "_"
|
477
|
+
scan_error! "unknown type of % literal '%#{ch}'"
|
478
|
+
else
|
479
|
+
buf << (pre = scan_quoted(ch, '%string'))
|
480
|
+
end
|
481
|
+
else
|
482
|
+
# operator
|
483
|
+
buf << '||op->' if $raccs_print_type
|
484
|
+
buf << (pre = ch)
|
485
|
+
end
|
486
|
+
when '/'
|
487
|
+
if literal_head? pre, @line
|
488
|
+
# regexp
|
489
|
+
buf << (pre = scan_quoted(ch, 'regexp'))
|
490
|
+
else
|
491
|
+
# operator
|
492
|
+
buf << '||op->' if $raccs_print_type
|
493
|
+
buf << (pre = ch)
|
494
|
+
end
|
495
|
+
when '$' # gvar
|
496
|
+
buf << ch << (pre = read(1))
|
497
|
+
else
|
498
|
+
raise 'racc: fatal: must not happen'
|
499
|
+
end
|
500
|
+
end
|
501
|
+
buf << "\n"
|
502
|
+
end while next_line()
|
503
|
+
raise 'racc: fatal: scan finished before parser finished'
|
504
|
+
end
|
505
|
+
|
506
|
+
def literal_head?(pre, post)
|
507
|
+
(!pre || /[a-zA-Z_0-9]/n !~ pre[-1,1]) &&
|
508
|
+
!post.empty? && /\A[\s\=]/n !~ post
|
509
|
+
end
|
510
|
+
|
511
|
+
def read(len)
|
512
|
+
s = @line[0, len]
|
513
|
+
@line = @line[len .. -1]
|
514
|
+
s
|
515
|
+
end
|
516
|
+
|
517
|
+
def reads(re)
|
518
|
+
m = re.match(@line) or return nil
|
519
|
+
@line = m.post_match
|
520
|
+
m[0]
|
521
|
+
end
|
522
|
+
|
523
|
+
def scan_quoted(left, tag = 'string')
|
524
|
+
buf = left.dup
|
525
|
+
buf = "||#{tag}->" + buf if $raccs_print_type
|
526
|
+
re = get_quoted_re(left)
|
527
|
+
sv, @in_block = @in_block, tag
|
528
|
+
begin
|
529
|
+
if s = reads(re)
|
530
|
+
buf << s
|
531
|
+
break
|
532
|
+
else
|
533
|
+
buf << @line
|
534
|
+
end
|
535
|
+
end while next_line()
|
536
|
+
@in_block = sv
|
537
|
+
buf << "<-#{tag}||" if $raccs_print_type
|
538
|
+
buf
|
539
|
+
end
|
540
|
+
|
541
|
+
LEFT_TO_RIGHT = {
|
542
|
+
'(' => ')',
|
543
|
+
'{' => '}',
|
544
|
+
'[' => ']',
|
545
|
+
'<' => '>'
|
546
|
+
}
|
547
|
+
|
548
|
+
CACHE = {}
|
549
|
+
|
550
|
+
def get_quoted_re(left)
|
551
|
+
term = Regexp.quote(LEFT_TO_RIGHT[left] || left)
|
552
|
+
CACHE[left] ||= /\A[^#{term}\\]*(?:\\.[^\\#{term}]*)*#{term}/
|
553
|
+
end
|
554
|
+
|
555
|
+
def scan_error!(msg)
|
556
|
+
raise CompileError, "#{lineno()}: #{msg}"
|
557
|
+
end
|
558
|
+
|
559
|
+
end
|
560
|
+
|
561
|
+
end # module Racc
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#--
|
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
|
+
#++
|
12
|
+
|
13
|
+
module Racc
|
14
|
+
VERSION = '1.7.0'
|
15
|
+
Version = VERSION
|
16
|
+
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
17
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#--
|
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
|
+
#++
|
12
|
+
|
13
|
+
module Racc
|
14
|
+
|
15
|
+
# An "indexed" set. All items must respond to :ident.
|
16
|
+
class ISet
|
17
|
+
|
18
|
+
def initialize(a = [])
|
19
|
+
@set = a
|
20
|
+
end
|
21
|
+
|
22
|
+
attr_reader :set
|
23
|
+
|
24
|
+
def add(i)
|
25
|
+
@set[i.ident] = i
|
26
|
+
end
|
27
|
+
|
28
|
+
def [](key)
|
29
|
+
@set[key.ident]
|
30
|
+
end
|
31
|
+
|
32
|
+
def []=(key, val)
|
33
|
+
@set[key.ident] = val
|
34
|
+
end
|
35
|
+
|
36
|
+
alias include? []
|
37
|
+
alias key? []
|
38
|
+
|
39
|
+
def update(other)
|
40
|
+
s = @set
|
41
|
+
o = other.set
|
42
|
+
o.each_index do |idx|
|
43
|
+
if t = o[idx]
|
44
|
+
s[idx] = t
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def update_a(a)
|
50
|
+
s = @set
|
51
|
+
a.each {|i| s[i.ident] = i }
|
52
|
+
end
|
53
|
+
|
54
|
+
def delete(key)
|
55
|
+
i = @set[key.ident]
|
56
|
+
@set[key.ident] = nil
|
57
|
+
i
|
58
|
+
end
|
59
|
+
|
60
|
+
def each(&block)
|
61
|
+
@set.compact.each(&block)
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_a
|
65
|
+
@set.compact
|
66
|
+
end
|
67
|
+
|
68
|
+
def to_s
|
69
|
+
"[#{@set.compact.join(' ')}]"
|
70
|
+
end
|
71
|
+
|
72
|
+
alias inspect to_s
|
73
|
+
|
74
|
+
def size
|
75
|
+
@set.nitems
|
76
|
+
end
|
77
|
+
|
78
|
+
def empty?
|
79
|
+
@set.nitems == 0
|
80
|
+
end
|
81
|
+
|
82
|
+
def clear
|
83
|
+
@set.clear
|
84
|
+
end
|
85
|
+
|
86
|
+
def dup
|
87
|
+
ISet.new(@set.dup)
|
88
|
+
end
|
89
|
+
|
90
|
+
end # class ISet
|
91
|
+
|
92
|
+
end # module Racc
|