cybrid_api_bank_ruby 0.73.1 → 0.73.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -2
  3. data/README.md +5 -5
  4. data/cybrid_api_bank_ruby.gemspec +1 -1
  5. data/docs/ExternalBankAccountsBankApi.md +3 -1
  6. data/docs/ExternalWalletBankModel.md +2 -0
  7. data/docs/ExternalWalletsBankApi.md +2 -2
  8. data/docs/PostExternalWalletBankModel.md +1 -1
  9. data/lib/cybrid_api_bank_ruby/api/accounts_bank_api.rb +1 -1
  10. data/lib/cybrid_api_bank_ruby/api/assets_bank_api.rb +1 -1
  11. data/lib/cybrid_api_bank_ruby/api/banks_bank_api.rb +1 -1
  12. data/lib/cybrid_api_bank_ruby/api/customers_bank_api.rb +1 -1
  13. data/lib/cybrid_api_bank_ruby/api/deposit_addresses_bank_api.rb +1 -1
  14. data/lib/cybrid_api_bank_ruby/api/external_bank_accounts_bank_api.rb +4 -1
  15. data/lib/cybrid_api_bank_ruby/api/external_wallets_bank_api.rb +3 -3
  16. data/lib/cybrid_api_bank_ruby/api/identity_verifications_bank_api.rb +1 -1
  17. data/lib/cybrid_api_bank_ruby/api/prices_bank_api.rb +1 -1
  18. data/lib/cybrid_api_bank_ruby/api/quotes_bank_api.rb +1 -1
  19. data/lib/cybrid_api_bank_ruby/api/rewards_bank_api.rb +1 -1
  20. data/lib/cybrid_api_bank_ruby/api/symbols_bank_api.rb +1 -1
  21. data/lib/cybrid_api_bank_ruby/api/trades_bank_api.rb +1 -1
  22. data/lib/cybrid_api_bank_ruby/api/transfers_bank_api.rb +1 -1
  23. data/lib/cybrid_api_bank_ruby/api/workflows_bank_api.rb +1 -1
  24. data/lib/cybrid_api_bank_ruby/api_client.rb +1 -1
  25. data/lib/cybrid_api_bank_ruby/api_error.rb +1 -1
  26. data/lib/cybrid_api_bank_ruby/configuration.rb +1 -1
  27. data/lib/cybrid_api_bank_ruby/models/account_bank_model.rb +1 -1
  28. data/lib/cybrid_api_bank_ruby/models/account_list_bank_model.rb +1 -1
  29. data/lib/cybrid_api_bank_ruby/models/asset_bank_model.rb +1 -1
  30. data/lib/cybrid_api_bank_ruby/models/asset_list_bank_model.rb +1 -1
  31. data/lib/cybrid_api_bank_ruby/models/bank_bank_model.rb +1 -1
  32. data/lib/cybrid_api_bank_ruby/models/bank_list_bank_model.rb +1 -1
  33. data/lib/cybrid_api_bank_ruby/models/customer_bank_model.rb +1 -1
  34. data/lib/cybrid_api_bank_ruby/models/customer_list_bank_model.rb +1 -1
  35. data/lib/cybrid_api_bank_ruby/models/deposit_address_bank_model.rb +1 -1
  36. data/lib/cybrid_api_bank_ruby/models/deposit_address_list_bank_model.rb +1 -1
  37. data/lib/cybrid_api_bank_ruby/models/error_response_bank_model.rb +1 -1
  38. data/lib/cybrid_api_bank_ruby/models/external_bank_account_bank_model.rb +1 -1
  39. data/lib/cybrid_api_bank_ruby/models/external_bank_account_list_bank_model.rb +1 -1
  40. data/lib/cybrid_api_bank_ruby/models/external_wallet_bank_model.rb +36 -2
  41. data/lib/cybrid_api_bank_ruby/models/external_wallet_list_bank_model.rb +1 -1
  42. data/lib/cybrid_api_bank_ruby/models/identity_verification_bank_model.rb +1 -1
  43. data/lib/cybrid_api_bank_ruby/models/identity_verification_list_bank_model.rb +1 -1
  44. data/lib/cybrid_api_bank_ruby/models/identity_verification_with_details_all_of_bank_model.rb +1 -1
  45. data/lib/cybrid_api_bank_ruby/models/identity_verification_with_details_bank_model.rb +1 -1
  46. data/lib/cybrid_api_bank_ruby/models/patch_bank_bank_model.rb +1 -1
  47. data/lib/cybrid_api_bank_ruby/models/patch_external_bank_account_bank_model.rb +1 -1
  48. data/lib/cybrid_api_bank_ruby/models/post_account_bank_model.rb +1 -1
  49. data/lib/cybrid_api_bank_ruby/models/post_bank_bank_model.rb +1 -1
  50. data/lib/cybrid_api_bank_ruby/models/post_customer_address_bank_model.rb +1 -1
  51. data/lib/cybrid_api_bank_ruby/models/post_customer_bank_model.rb +1 -1
  52. data/lib/cybrid_api_bank_ruby/models/post_customer_name_bank_model.rb +1 -1
  53. data/lib/cybrid_api_bank_ruby/models/post_deposit_address_bank_model.rb +1 -1
  54. data/lib/cybrid_api_bank_ruby/models/post_external_bank_account_bank_model.rb +1 -1
  55. data/lib/cybrid_api_bank_ruby/models/post_external_wallet_bank_model.rb +7 -7
  56. data/lib/cybrid_api_bank_ruby/models/post_identification_number_bank_model.rb +1 -1
  57. data/lib/cybrid_api_bank_ruby/models/post_identity_verification_address_bank_model.rb +1 -1
  58. data/lib/cybrid_api_bank_ruby/models/post_identity_verification_bank_model.rb +1 -1
  59. data/lib/cybrid_api_bank_ruby/models/post_identity_verification_name_bank_model.rb +1 -1
  60. data/lib/cybrid_api_bank_ruby/models/post_one_time_address_bank_model.rb +1 -1
  61. data/lib/cybrid_api_bank_ruby/models/post_quote_bank_model.rb +1 -1
  62. data/lib/cybrid_api_bank_ruby/models/post_reward_bank_model.rb +1 -1
  63. data/lib/cybrid_api_bank_ruby/models/post_trade_bank_model.rb +1 -1
  64. data/lib/cybrid_api_bank_ruby/models/post_transfer_bank_model.rb +1 -1
  65. data/lib/cybrid_api_bank_ruby/models/post_verification_key_bank_model.rb +1 -1
  66. data/lib/cybrid_api_bank_ruby/models/post_workflow_bank_model.rb +1 -1
  67. data/lib/cybrid_api_bank_ruby/models/quote_bank_model.rb +1 -1
  68. data/lib/cybrid_api_bank_ruby/models/quote_list_bank_model.rb +1 -1
  69. data/lib/cybrid_api_bank_ruby/models/reward_bank_model.rb +1 -1
  70. data/lib/cybrid_api_bank_ruby/models/reward_list_bank_model.rb +1 -1
  71. data/lib/cybrid_api_bank_ruby/models/symbol_price_bank_model.rb +1 -1
  72. data/lib/cybrid_api_bank_ruby/models/trade_bank_model.rb +1 -1
  73. data/lib/cybrid_api_bank_ruby/models/trade_list_bank_model.rb +1 -1
  74. data/lib/cybrid_api_bank_ruby/models/transfer_bank_model.rb +1 -1
  75. data/lib/cybrid_api_bank_ruby/models/transfer_list_bank_model.rb +1 -1
  76. data/lib/cybrid_api_bank_ruby/models/verification_key_bank_model.rb +1 -1
  77. data/lib/cybrid_api_bank_ruby/models/verification_key_list_bank_model.rb +1 -1
  78. data/lib/cybrid_api_bank_ruby/models/workflow_bank_model.rb +1 -1
  79. data/lib/cybrid_api_bank_ruby/models/workflow_with_details_all_of_bank_model.rb +1 -1
  80. data/lib/cybrid_api_bank_ruby/models/workflow_with_details_bank_model.rb +1 -1
  81. data/lib/cybrid_api_bank_ruby/models/workflows_list_bank_model.rb +1 -1
  82. data/lib/cybrid_api_bank_ruby/version.rb +2 -2
  83. data/lib/cybrid_api_bank_ruby.rb +1 -1
  84. data/spec/api/accounts_bank_api_spec.rb +1 -1
  85. data/spec/api/assets_bank_api_spec.rb +1 -1
  86. data/spec/api/banks_bank_api_spec.rb +1 -1
  87. data/spec/api/customers_bank_api_spec.rb +1 -1
  88. data/spec/api/deposit_addresses_bank_api_spec.rb +1 -1
  89. data/spec/api/external_bank_accounts_bank_api_spec.rb +2 -1
  90. data/spec/api/external_wallets_bank_api_spec.rb +2 -2
  91. data/spec/api/identity_verifications_bank_api_spec.rb +1 -1
  92. data/spec/api/prices_bank_api_spec.rb +1 -1
  93. data/spec/api/quotes_bank_api_spec.rb +1 -1
  94. data/spec/api/rewards_bank_api_spec.rb +1 -1
  95. data/spec/api/symbols_bank_api_spec.rb +1 -1
  96. data/spec/api/trades_bank_api_spec.rb +1 -1
  97. data/spec/api/transfers_bank_api_spec.rb +1 -1
  98. data/spec/api/workflows_bank_api_spec.rb +1 -1
  99. data/spec/api_client_spec.rb +1 -1
  100. data/spec/configuration_spec.rb +1 -1
  101. data/spec/models/account_bank_model_spec.rb +1 -1
  102. data/spec/models/account_list_bank_model_spec.rb +1 -1
  103. data/spec/models/asset_bank_model_spec.rb +1 -1
  104. data/spec/models/asset_list_bank_model_spec.rb +1 -1
  105. data/spec/models/bank_bank_model_spec.rb +1 -1
  106. data/spec/models/bank_list_bank_model_spec.rb +1 -1
  107. data/spec/models/customer_bank_model_spec.rb +1 -1
  108. data/spec/models/customer_list_bank_model_spec.rb +1 -1
  109. data/spec/models/deposit_address_bank_model_spec.rb +1 -1
  110. data/spec/models/deposit_address_list_bank_model_spec.rb +1 -1
  111. data/spec/models/error_response_bank_model_spec.rb +1 -1
  112. data/spec/models/external_bank_account_bank_model_spec.rb +1 -1
  113. data/spec/models/external_bank_account_list_bank_model_spec.rb +1 -1
  114. data/spec/models/external_wallet_bank_model_spec.rb +7 -1
  115. data/spec/models/external_wallet_list_bank_model_spec.rb +1 -1
  116. data/spec/models/identity_verification_bank_model_spec.rb +1 -1
  117. data/spec/models/identity_verification_list_bank_model_spec.rb +1 -1
  118. data/spec/models/identity_verification_with_details_all_of_bank_model_spec.rb +1 -1
  119. data/spec/models/identity_verification_with_details_bank_model_spec.rb +1 -1
  120. data/spec/models/patch_bank_bank_model_spec.rb +1 -1
  121. data/spec/models/patch_external_bank_account_bank_model_spec.rb +1 -1
  122. data/spec/models/post_account_bank_model_spec.rb +1 -1
  123. data/spec/models/post_bank_bank_model_spec.rb +1 -1
  124. data/spec/models/post_customer_address_bank_model_spec.rb +1 -1
  125. data/spec/models/post_customer_bank_model_spec.rb +1 -1
  126. data/spec/models/post_customer_name_bank_model_spec.rb +1 -1
  127. data/spec/models/post_deposit_address_bank_model_spec.rb +1 -1
  128. data/spec/models/post_external_bank_account_bank_model_spec.rb +1 -1
  129. data/spec/models/post_external_wallet_bank_model_spec.rb +1 -1
  130. data/spec/models/post_identification_number_bank_model_spec.rb +1 -1
  131. data/spec/models/post_identity_verification_address_bank_model_spec.rb +1 -1
  132. data/spec/models/post_identity_verification_bank_model_spec.rb +1 -1
  133. data/spec/models/post_identity_verification_name_bank_model_spec.rb +1 -1
  134. data/spec/models/post_one_time_address_bank_model_spec.rb +1 -1
  135. data/spec/models/post_quote_bank_model_spec.rb +1 -1
  136. data/spec/models/post_reward_bank_model_spec.rb +1 -1
  137. data/spec/models/post_trade_bank_model_spec.rb +1 -1
  138. data/spec/models/post_transfer_bank_model_spec.rb +1 -1
  139. data/spec/models/post_verification_key_bank_model_spec.rb +1 -1
  140. data/spec/models/post_workflow_bank_model_spec.rb +1 -1
  141. data/spec/models/quote_bank_model_spec.rb +1 -1
  142. data/spec/models/quote_list_bank_model_spec.rb +1 -1
  143. data/spec/models/reward_bank_model_spec.rb +1 -1
  144. data/spec/models/reward_list_bank_model_spec.rb +1 -1
  145. data/spec/models/symbol_price_bank_model_spec.rb +1 -1
  146. data/spec/models/trade_bank_model_spec.rb +1 -1
  147. data/spec/models/trade_list_bank_model_spec.rb +1 -1
  148. data/spec/models/transfer_bank_model_spec.rb +1 -1
  149. data/spec/models/transfer_list_bank_model_spec.rb +1 -1
  150. data/spec/models/verification_key_bank_model_spec.rb +1 -1
  151. data/spec/models/verification_key_list_bank_model_spec.rb +1 -1
  152. data/spec/models/workflow_bank_model_spec.rb +1 -1
  153. data/spec/models/workflow_with_details_all_of_bank_model_spec.rb +1 -1
  154. data/spec/models/workflow_with_details_bank_model_spec.rb +1 -1
  155. data/spec/models/workflows_list_bank_model_spec.rb +1 -1
  156. data/spec/spec_helper.rb +1 -1
  157. data/vendor/bundle/ruby/3.2.0/bin/racc +29 -0
  158. data/vendor/bundle/ruby/3.2.0/cache/parser-3.2.2.3.gem +0 -0
  159. data/vendor/bundle/ruby/3.2.0/cache/racc-1.7.0.gem +0 -0
  160. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
  161. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.15.5/gem_make.out +5 -5
  162. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  163. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.0/gem_make.out +5 -5
  164. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/gem.build_complete +0 -0
  165. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/gem_make.out +28 -0
  166. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/mkmf.log +57 -0
  167. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.0/racc/cparse.so +0 -0
  168. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.7/gem_make.out +5 -5
  169. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/macruby.rb +3 -1
  170. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby18.rb +3 -1
  171. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby19.rb +3 -1
  172. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby20.rb +3 -1
  173. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby21.rb +3 -1
  174. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby22.rb +3 -1
  175. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby23.rb +3 -1
  176. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby24.rb +3 -1
  177. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby25.rb +3 -1
  178. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby26.rb +3 -1
  179. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby27.rb +3 -1
  180. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby30.rb +3 -1
  181. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby31.rb +3 -1
  182. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby32.rb +3 -1
  183. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby33.rb +3 -1
  184. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/rubymotion.rb +3 -1
  185. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/version.rb +1 -1
  186. data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/parser.gemspec +1 -1
  187. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/COPYING +22 -0
  188. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ChangeLog +846 -0
  189. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/README.ja.rdoc +94 -0
  190. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/README.rdoc +79 -0
  191. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/TODO +5 -0
  192. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/bin/racc +320 -0
  193. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/en/NEWS.en.rdoc +282 -0
  194. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/en/grammar.en.rdoc +226 -0
  195. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/en/grammar2.en.rdoc +219 -0
  196. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/NEWS.ja.rdoc +307 -0
  197. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/command.ja.html +94 -0
  198. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/debug.ja.rdoc +36 -0
  199. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/grammar.ja.rdoc +348 -0
  200. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/index.ja.html +10 -0
  201. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/parser.ja.rdoc +125 -0
  202. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/doc/ja/usage.ja.html +414 -0
  203. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/MANIFEST +4 -0
  204. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/cparse/Makefile +269 -0
  205. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/cparse/cparse.c +861 -0
  206. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/ext/racc/cparse/extconf.rb +9 -0
  207. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/compat.rb +33 -0
  208. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/cparse.so +0 -0
  209. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/debugflags.rb +60 -0
  210. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/exception.rb +16 -0
  211. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/grammar.rb +1114 -0
  212. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/grammarfileparser.rb +561 -0
  213. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/info.rb +17 -0
  214. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/iset.rb +92 -0
  215. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/logfilegenerator.rb +212 -0
  216. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/parser-text.rb +658 -0
  217. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/parser.rb +632 -0
  218. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/parserfilegenerator.rb +470 -0
  219. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/sourcetext.rb +35 -0
  220. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/state.rb +972 -0
  221. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/statetransitiontable.rb +311 -0
  222. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc/static.rb +5 -0
  223. data/vendor/bundle/ruby/3.2.0/gems/racc-1.7.0/lib/racc.rb +6 -0
  224. data/vendor/bundle/ruby/3.2.0/specifications/{parser-3.2.2.1.gemspec → parser-3.2.2.3.gemspec} +5 -5
  225. data/vendor/bundle/ruby/3.2.0/specifications/racc-1.7.0.gemspec +27 -0
  226. metadata +126 -82
  227. data/vendor/bundle/ruby/3.2.0/cache/parser-3.2.2.1.gem +0 -0
  228. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/LICENSE.txt +0 -0
  229. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/bin/ruby-parse +0 -0
  230. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/bin/ruby-rewrite +0 -0
  231. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/gauntlet_parser.rb +0 -0
  232. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/all.rb +0 -0
  233. /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
  234. /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
  235. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/base.rb +0 -0
  236. /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
  237. /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
  238. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/color.rb +0 -0
  239. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/context.rb +0 -0
  240. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/current.rb +0 -0
  241. /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
  242. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/deprecation.rb +0 -0
  243. /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
  244. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/diagnostic.rb +0 -0
  245. /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
  246. /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
  247. /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
  248. /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
  249. /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
  250. /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
  251. /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
  252. /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
  253. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/messages.rb +0 -0
  254. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/meta.rb +0 -0
  255. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/rewriter.rb +0 -0
  256. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/ruby28.rb +0 -0
  257. /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
  258. /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
  259. /data/vendor/bundle/ruby/3.2.0/gems/{parser-3.2.2.1 → parser-3.2.2.3}/lib/parser/runner.rb +0 -0
  260. /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
  261. /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
  262. /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
  263. /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
  264. /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
  265. /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
  266. /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
  267. /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
  268. /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
  269. /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
  270. /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
  271. /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
  272. /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
  273. /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
  274. /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
  275. /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
  276. /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
  277. /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
  278. /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
  279. /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
  280. /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
  281. /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
  282. /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
  283. /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
  284. /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
  285. /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
  286. /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
  287. /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
  288. /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,5 @@
1
+ * check 'error' token handling.
2
+ * interactive transition table monitor.
3
+ * support backtracking.
4
+ * output Ruby extention library?
5
+ * LL(k)? (But it should not be called Racc)
@@ -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