enclave 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (739) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +182 -0
  3. data/Rakefile +30 -0
  4. data/ext/enclave/enclave.c +390 -0
  5. data/ext/enclave/extconf.rb +33 -0
  6. data/ext/enclave/mruby/Makefile +63 -0
  7. data/ext/enclave/mruby/Rakefile +102 -0
  8. data/ext/enclave/mruby/benchmark/bm_ao_render.rb +309 -0
  9. data/ext/enclave/mruby/benchmark/bm_app_lc_fizzbuzz.rb +51 -0
  10. data/ext/enclave/mruby/benchmark/bm_fib.rb +6 -0
  11. data/ext/enclave/mruby/benchmark/bm_mandel_term.rb +34 -0
  12. data/ext/enclave/mruby/benchmark/bm_so_lists.rb +49 -0
  13. data/ext/enclave/mruby/benchmark/bm_so_mandelbrot.rb +65 -0
  14. data/ext/enclave/mruby/benchmark/vm_dispatch_bench.c +197 -0
  15. data/ext/enclave/mruby/benchmark/vm_optimization_bench.rb +513 -0
  16. data/ext/enclave/mruby/build/host/include/mrbconf.h +230 -0
  17. data/ext/enclave/mruby/build/host/include/mruby/array.h +303 -0
  18. data/ext/enclave/mruby/build/host/include/mruby/boxing_nan.h +169 -0
  19. data/ext/enclave/mruby/build/host/include/mruby/boxing_no.h +59 -0
  20. data/ext/enclave/mruby/build/host/include/mruby/boxing_word.h +248 -0
  21. data/ext/enclave/mruby/build/host/include/mruby/class.h +157 -0
  22. data/ext/enclave/mruby/build/host/include/mruby/common.h +127 -0
  23. data/ext/enclave/mruby/build/host/include/mruby/compile.h +187 -0
  24. data/ext/enclave/mruby/build/host/include/mruby/data.h +76 -0
  25. data/ext/enclave/mruby/build/host/include/mruby/debug.h +75 -0
  26. data/ext/enclave/mruby/build/host/include/mruby/dump.h +159 -0
  27. data/ext/enclave/mruby/build/host/include/mruby/endian.h +44 -0
  28. data/ext/enclave/mruby/build/host/include/mruby/error.h +168 -0
  29. data/ext/enclave/mruby/build/host/include/mruby/gc.h +77 -0
  30. data/ext/enclave/mruby/build/host/include/mruby/hash.h +234 -0
  31. data/ext/enclave/mruby/build/host/include/mruby/internal.h +278 -0
  32. data/ext/enclave/mruby/build/host/include/mruby/irep.h +142 -0
  33. data/ext/enclave/mruby/build/host/include/mruby/istruct.h +50 -0
  34. data/ext/enclave/mruby/build/host/include/mruby/khash.h +455 -0
  35. data/ext/enclave/mruby/build/host/include/mruby/mempool.h +19 -0
  36. data/ext/enclave/mruby/build/host/include/mruby/numeric.h +174 -0
  37. data/ext/enclave/mruby/build/host/include/mruby/object.h +44 -0
  38. data/ext/enclave/mruby/build/host/include/mruby/opcode.h +73 -0
  39. data/ext/enclave/mruby/build/host/include/mruby/ops.h +133 -0
  40. data/ext/enclave/mruby/build/host/include/mruby/presym/id.h +895 -0
  41. data/ext/enclave/mruby/build/host/include/mruby/presym/scanning.h +82 -0
  42. data/ext/enclave/mruby/build/host/include/mruby/presym/table.h +1787 -0
  43. data/ext/enclave/mruby/build/host/include/mruby/presym.h +65 -0
  44. data/ext/enclave/mruby/build/host/include/mruby/proc.h +184 -0
  45. data/ext/enclave/mruby/build/host/include/mruby/range.h +77 -0
  46. data/ext/enclave/mruby/build/host/include/mruby/re.h +16 -0
  47. data/ext/enclave/mruby/build/host/include/mruby/string.h +428 -0
  48. data/ext/enclave/mruby/build/host/include/mruby/throw.h +81 -0
  49. data/ext/enclave/mruby/build/host/include/mruby/value.h +471 -0
  50. data/ext/enclave/mruby/build/host/include/mruby/variable.h +108 -0
  51. data/ext/enclave/mruby/build/host/include/mruby/version.h +143 -0
  52. data/ext/enclave/mruby/build/host/include/mruby.h +1632 -0
  53. data/ext/enclave/mruby/build/host/mrbc/include/mruby/presym/id.h +281 -0
  54. data/ext/enclave/mruby/build/host/mrbc/include/mruby/presym/table.h +559 -0
  55. data/ext/enclave/mruby/build/host/mrbgems/gem_init.c +164 -0
  56. data/ext/enclave/mruby/build/host/mrbgems/mruby-array-ext/gem_init.c +650 -0
  57. data/ext/enclave/mruby/build/host/mrbgems/mruby-binding/gem_init.c +21 -0
  58. data/ext/enclave/mruby/build/host/mrbgems/mruby-catch/gem_init.c +86 -0
  59. data/ext/enclave/mruby/build/host/mrbgems/mruby-class-ext/gem_init.c +21 -0
  60. data/ext/enclave/mruby/build/host/mrbgems/mruby-compar-ext/gem_init.c +99 -0
  61. data/ext/enclave/mruby/build/host/mrbgems/mruby-complex/gem_init.c +362 -0
  62. data/ext/enclave/mruby/build/host/mrbgems/mruby-data/gem_init.c +21 -0
  63. data/ext/enclave/mruby/build/host/mrbgems/mruby-enum-chain/gem_init.c +229 -0
  64. data/ext/enclave/mruby/build/host/mrbgems/mruby-enum-ext/gem_init.c +1420 -0
  65. data/ext/enclave/mruby/build/host/mrbgems/mruby-enum-lazy/gem_init.c +602 -0
  66. data/ext/enclave/mruby/build/host/mrbgems/mruby-enumerator/gem_init.c +822 -0
  67. data/ext/enclave/mruby/build/host/mrbgems/mruby-eval/gem_init.c +21 -0
  68. data/ext/enclave/mruby/build/host/mrbgems/mruby-fiber/gem_init.c +21 -0
  69. data/ext/enclave/mruby/build/host/mrbgems/mruby-hash-ext/gem_init.c +591 -0
  70. data/ext/enclave/mruby/build/host/mrbgems/mruby-kernel-ext/gem_init.c +21 -0
  71. data/ext/enclave/mruby/build/host/mrbgems/mruby-math/gem_init.c +21 -0
  72. data/ext/enclave/mruby/build/host/mrbgems/mruby-metaprog/gem_init.c +21 -0
  73. data/ext/enclave/mruby/build/host/mrbgems/mruby-method/gem_init.c +153 -0
  74. data/ext/enclave/mruby/build/host/mrbgems/mruby-numeric-ext/gem_init.c +211 -0
  75. data/ext/enclave/mruby/build/host/mrbgems/mruby-object-ext/gem_init.c +94 -0
  76. data/ext/enclave/mruby/build/host/mrbgems/mruby-objectspace/gem_init.c +21 -0
  77. data/ext/enclave/mruby/build/host/mrbgems/mruby-pack/gem_init.c +21 -0
  78. data/ext/enclave/mruby/build/host/mrbgems/mruby-proc-binding/gem_init.c +21 -0
  79. data/ext/enclave/mruby/build/host/mrbgems/mruby-proc-ext/gem_init.c +237 -0
  80. data/ext/enclave/mruby/build/host/mrbgems/mruby-random/gem_init.c +21 -0
  81. data/ext/enclave/mruby/build/host/mrbgems/mruby-range-ext/gem_init.c +205 -0
  82. data/ext/enclave/mruby/build/host/mrbgems/mruby-rational/gem_init.c +147 -0
  83. data/ext/enclave/mruby/build/host/mrbgems/mruby-set/gem_init.c +487 -0
  84. data/ext/enclave/mruby/build/host/mrbgems/mruby-sprintf/gem_init.c +83 -0
  85. data/ext/enclave/mruby/build/host/mrbgems/mruby-string-ext/gem_init.c +220 -0
  86. data/ext/enclave/mruby/build/host/mrbgems/mruby-struct/gem_init.c +175 -0
  87. data/ext/enclave/mruby/build/host/mrbgems/mruby-symbol-ext/gem_init.c +153 -0
  88. data/ext/enclave/mruby/build/host/mrbgems/mruby-time/gem_init.c +21 -0
  89. data/ext/enclave/mruby/build/host/mrbgems/mruby-toplevel-ext/gem_init.c +78 -0
  90. data/ext/enclave/mruby/build/host/mrblib/mrblib.c +1758 -0
  91. data/ext/enclave/mruby/build_config/ArduinoDue.rb +72 -0
  92. data/ext/enclave/mruby/build_config/IntelEdison.rb +69 -0
  93. data/ext/enclave/mruby/build_config/IntelGalileo.rb +88 -0
  94. data/ext/enclave/mruby/build_config/RX630.rb +63 -0
  95. data/ext/enclave/mruby/build_config/android_arm64_v8a.rb +11 -0
  96. data/ext/enclave/mruby/build_config/android_armeabi_v7a_neon_hard.rb +13 -0
  97. data/ext/enclave/mruby/build_config/bench.rb +11 -0
  98. data/ext/enclave/mruby/build_config/boxing.rb +19 -0
  99. data/ext/enclave/mruby/build_config/chipKITMax32.rb +68 -0
  100. data/ext/enclave/mruby/build_config/ci/gcc-clang.rb +40 -0
  101. data/ext/enclave/mruby/build_config/ci/msvc.rb +20 -0
  102. data/ext/enclave/mruby/build_config/clang-asan.rb +11 -0
  103. data/ext/enclave/mruby/build_config/cosmopolitan.rb +86 -0
  104. data/ext/enclave/mruby/build_config/cross-32bit.rb +14 -0
  105. data/ext/enclave/mruby/build_config/cross-mingw-winetest.rb +90 -0
  106. data/ext/enclave/mruby/build_config/cross-mingw.rb +14 -0
  107. data/ext/enclave/mruby/build_config/default.rb +83 -0
  108. data/ext/enclave/mruby/build_config/dreamcast_shelf.rb +81 -0
  109. data/ext/enclave/mruby/build_config/emscripten-cxx.rb +12 -0
  110. data/ext/enclave/mruby/build_config/emscripten.rb +10 -0
  111. data/ext/enclave/mruby/build_config/gameboyadvance.rb +72 -0
  112. data/ext/enclave/mruby/build_config/helpers/wine_runner.rb +71 -0
  113. data/ext/enclave/mruby/build_config/host-cxx.rb +12 -0
  114. data/ext/enclave/mruby/build_config/host-debug.rb +20 -0
  115. data/ext/enclave/mruby/build_config/host-f32.rb +14 -0
  116. data/ext/enclave/mruby/build_config/host-gprof.rb +14 -0
  117. data/ext/enclave/mruby/build_config/host-m32.rb +15 -0
  118. data/ext/enclave/mruby/build_config/host-nofloat.rb +22 -0
  119. data/ext/enclave/mruby/build_config/host-shared.rb +36 -0
  120. data/ext/enclave/mruby/build_config/i586-pc-msdosdjgpp.rb +76 -0
  121. data/ext/enclave/mruby/build_config/luckfox_pico.rb +106 -0
  122. data/ext/enclave/mruby/build_config/milkv_duo.rb +106 -0
  123. data/ext/enclave/mruby/build_config/minimal.rb +4 -0
  124. data/ext/enclave/mruby/build_config/mrbc.rb +10 -0
  125. data/ext/enclave/mruby/build_config/nintendo_switch.rb +73 -0
  126. data/ext/enclave/mruby/build_config/nintendo_wii.rb +95 -0
  127. data/ext/enclave/mruby/build_config/no-float.rb +17 -0
  128. data/ext/enclave/mruby/build_config/playstationportable.rb +78 -0
  129. data/ext/enclave/mruby/build_config/serenity.rb +26 -0
  130. data/ext/enclave/mruby/build_config.rb +9 -0
  131. data/ext/enclave/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +5 -0
  132. data/ext/enclave/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +23 -0
  133. data/ext/enclave/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb +7 -0
  134. data/ext/enclave/mruby/examples/mrbgems/c_extension_example/src/example.c +23 -0
  135. data/ext/enclave/mruby/examples/mrbgems/c_extension_example/test/example.c +7 -0
  136. data/ext/enclave/mruby/examples/mrbgems/c_extension_example/test/example.rb +3 -0
  137. data/ext/enclave/mruby/examples/mrbgems/cdata_extension_example/src/example.c +77 -0
  138. data/ext/enclave/mruby/examples/mrbgems/cdata_extension_example/test/example.c +7 -0
  139. data/ext/enclave/mruby/examples/mrbgems/mruby-YOUR-bigint/core/bigint.c +70 -0
  140. data/ext/enclave/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +5 -0
  141. data/ext/enclave/mruby/examples/mrbgems/ruby_extension_example/test/example.rb +3 -0
  142. data/ext/enclave/mruby/include/mrbconf.h +230 -0
  143. data/ext/enclave/mruby/include/mruby/array.h +303 -0
  144. data/ext/enclave/mruby/include/mruby/boxing_nan.h +169 -0
  145. data/ext/enclave/mruby/include/mruby/boxing_no.h +59 -0
  146. data/ext/enclave/mruby/include/mruby/boxing_word.h +248 -0
  147. data/ext/enclave/mruby/include/mruby/class.h +157 -0
  148. data/ext/enclave/mruby/include/mruby/common.h +127 -0
  149. data/ext/enclave/mruby/include/mruby/compile.h +187 -0
  150. data/ext/enclave/mruby/include/mruby/data.h +76 -0
  151. data/ext/enclave/mruby/include/mruby/debug.h +75 -0
  152. data/ext/enclave/mruby/include/mruby/dump.h +159 -0
  153. data/ext/enclave/mruby/include/mruby/endian.h +44 -0
  154. data/ext/enclave/mruby/include/mruby/error.h +168 -0
  155. data/ext/enclave/mruby/include/mruby/gc.h +77 -0
  156. data/ext/enclave/mruby/include/mruby/hash.h +234 -0
  157. data/ext/enclave/mruby/include/mruby/internal.h +278 -0
  158. data/ext/enclave/mruby/include/mruby/irep.h +142 -0
  159. data/ext/enclave/mruby/include/mruby/istruct.h +50 -0
  160. data/ext/enclave/mruby/include/mruby/khash.h +455 -0
  161. data/ext/enclave/mruby/include/mruby/mempool.h +19 -0
  162. data/ext/enclave/mruby/include/mruby/numeric.h +174 -0
  163. data/ext/enclave/mruby/include/mruby/object.h +44 -0
  164. data/ext/enclave/mruby/include/mruby/opcode.h +73 -0
  165. data/ext/enclave/mruby/include/mruby/ops.h +133 -0
  166. data/ext/enclave/mruby/include/mruby/presym/scanning.h +82 -0
  167. data/ext/enclave/mruby/include/mruby/presym.h +65 -0
  168. data/ext/enclave/mruby/include/mruby/proc.h +184 -0
  169. data/ext/enclave/mruby/include/mruby/range.h +77 -0
  170. data/ext/enclave/mruby/include/mruby/re.h +16 -0
  171. data/ext/enclave/mruby/include/mruby/string.h +428 -0
  172. data/ext/enclave/mruby/include/mruby/throw.h +81 -0
  173. data/ext/enclave/mruby/include/mruby/value.h +471 -0
  174. data/ext/enclave/mruby/include/mruby/variable.h +108 -0
  175. data/ext/enclave/mruby/include/mruby/version.h +143 -0
  176. data/ext/enclave/mruby/include/mruby.h +1632 -0
  177. data/ext/enclave/mruby/lib/mruby/amalgam.rb +568 -0
  178. data/ext/enclave/mruby/lib/mruby/build/command.rb +383 -0
  179. data/ext/enclave/mruby/lib/mruby/build/load_gems.rb +383 -0
  180. data/ext/enclave/mruby/lib/mruby/build.rb +616 -0
  181. data/ext/enclave/mruby/lib/mruby/core_ext.rb +61 -0
  182. data/ext/enclave/mruby/lib/mruby/doc.rb +51 -0
  183. data/ext/enclave/mruby/lib/mruby/gem.rb +585 -0
  184. data/ext/enclave/mruby/lib/mruby/lockfile.rb +81 -0
  185. data/ext/enclave/mruby/lib/mruby/presym.rb +167 -0
  186. data/ext/enclave/mruby/lib/mruby/source.rb +32 -0
  187. data/ext/enclave/mruby/mrbgems/default-no-fpu.gembox +3 -0
  188. data/ext/enclave/mruby/mrbgems/default-no-stdio.gembox +4 -0
  189. data/ext/enclave/mruby/mrbgems/default.gembox +25 -0
  190. data/ext/enclave/mruby/mrbgems/full-core.gembox +6 -0
  191. data/ext/enclave/mruby/mrbgems/hal-posix-dir/mrbgem.rake +7 -0
  192. data/ext/enclave/mruby/mrbgems/hal-posix-dir/src/dir_hal.c +193 -0
  193. data/ext/enclave/mruby/mrbgems/hal-posix-io/mrbgem.rake +8 -0
  194. data/ext/enclave/mruby/mrbgems/hal-posix-io/src/io_hal.c +602 -0
  195. data/ext/enclave/mruby/mrbgems/hal-posix-socket/mrbgem.rake +8 -0
  196. data/ext/enclave/mruby/mrbgems/hal-posix-socket/src/socket_hal.c +158 -0
  197. data/ext/enclave/mruby/mrbgems/hal-posix-task/README.md +102 -0
  198. data/ext/enclave/mruby/mrbgems/hal-posix-task/mrbgem.rake +8 -0
  199. data/ext/enclave/mruby/mrbgems/hal-posix-task/src/task_hal.c +252 -0
  200. data/ext/enclave/mruby/mrbgems/hal-win-dir/mrbgem.rake +7 -0
  201. data/ext/enclave/mruby/mrbgems/hal-win-dir/src/dir_hal.c +249 -0
  202. data/ext/enclave/mruby/mrbgems/hal-win-io/mrbgem.rake +11 -0
  203. data/ext/enclave/mruby/mrbgems/hal-win-io/src/io_hal.c +646 -0
  204. data/ext/enclave/mruby/mrbgems/hal-win-socket/mrbgem.rake +12 -0
  205. data/ext/enclave/mruby/mrbgems/hal-win-socket/src/socket_hal.c +177 -0
  206. data/ext/enclave/mruby/mrbgems/hal-win-task/README.md +109 -0
  207. data/ext/enclave/mruby/mrbgems/hal-win-task/mrbgem.rake +11 -0
  208. data/ext/enclave/mruby/mrbgems/hal-win-task/src/task_hal.c +187 -0
  209. data/ext/enclave/mruby/mrbgems/math.gembox +12 -0
  210. data/ext/enclave/mruby/mrbgems/metaprog.gembox +21 -0
  211. data/ext/enclave/mruby/mrbgems/mruby-array-ext/README.md +87 -0
  212. data/ext/enclave/mruby/mrbgems/mruby-array-ext/mrbgem.rake +5 -0
  213. data/ext/enclave/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +784 -0
  214. data/ext/enclave/mruby/mrbgems/mruby-array-ext/src/array.c +1583 -0
  215. data/ext/enclave/mruby/mrbgems/mruby-array-ext/test/array.rb +849 -0
  216. data/ext/enclave/mruby/mrbgems/mruby-benchmark/README.md +257 -0
  217. data/ext/enclave/mruby/mrbgems/mruby-benchmark/mrbgem.rake +10 -0
  218. data/ext/enclave/mruby/mrbgems/mruby-benchmark/mrblib/benchmark.rb +131 -0
  219. data/ext/enclave/mruby/mrbgems/mruby-benchmark/test/benchmark.rb +244 -0
  220. data/ext/enclave/mruby/mrbgems/mruby-bigint/README-fgmp.md +154 -0
  221. data/ext/enclave/mruby/mrbgems/mruby-bigint/README.md +44 -0
  222. data/ext/enclave/mruby/mrbgems/mruby-bigint/core/bigint.c +6335 -0
  223. data/ext/enclave/mruby/mrbgems/mruby-bigint/core/bigint.h +117 -0
  224. data/ext/enclave/mruby/mrbgems/mruby-bigint/mrbgem.rake +10 -0
  225. data/ext/enclave/mruby/mrbgems/mruby-bigint/test/bigint.rb +157 -0
  226. data/ext/enclave/mruby/mrbgems/mruby-bin-config/README.md +46 -0
  227. data/ext/enclave/mruby/mrbgems/mruby-bin-config/mrbgem.rake +49 -0
  228. data/ext/enclave/mruby/mrbgems/mruby-bin-config/mruby-config +46 -0
  229. data/ext/enclave/mruby/mrbgems/mruby-bin-config/mruby-config.bat +92 -0
  230. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/README.md +63 -0
  231. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/bintest/mrdb.rb +283 -0
  232. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/bintest/print.rb +703 -0
  233. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/mrbgem.rake +10 -0
  234. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +523 -0
  235. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h +26 -0
  236. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c +238 -0
  237. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.h +14 -0
  238. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +88 -0
  239. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.h +13 -0
  240. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apistring.c +34 -0
  241. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h +14 -0
  242. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c +436 -0
  243. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c +509 -0
  244. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +71 -0
  245. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c +64 -0
  246. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +768 -0
  247. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +159 -0
  248. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +24 -0
  249. data/ext/enclave/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdberror.h +19 -0
  250. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/README.md +94 -0
  251. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/bintest/mirb.rb +58 -0
  252. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +7 -0
  253. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +808 -0
  254. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_buffer.c +1035 -0
  255. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_buffer.h +185 -0
  256. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_completion.c +797 -0
  257. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_completion.h +132 -0
  258. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_editor.c +1118 -0
  259. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_editor.h +153 -0
  260. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_highlight.c +516 -0
  261. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_highlight.h +95 -0
  262. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_history.c +185 -0
  263. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_history.h +76 -0
  264. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_term.c +491 -0
  265. data/ext/enclave/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb_term.h +137 -0
  266. data/ext/enclave/mruby/mrbgems/mruby-bin-mrbc/README.md +58 -0
  267. data/ext/enclave/mruby/mrbgems/mruby-bin-mrbc/bintest/mrbc.rb +30 -0
  268. data/ext/enclave/mruby/mrbgems/mruby-bin-mrbc/mrbgem.rake +15 -0
  269. data/ext/enclave/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +362 -0
  270. data/ext/enclave/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/stub.c +104 -0
  271. data/ext/enclave/mruby/mrbgems/mruby-bin-mruby/README.md +47 -0
  272. data/ext/enclave/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +178 -0
  273. data/ext/enclave/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +7 -0
  274. data/ext/enclave/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +380 -0
  275. data/ext/enclave/mruby/mrbgems/mruby-bin-strip/README.md +38 -0
  276. data/ext/enclave/mruby/mrbgems/mruby-bin-strip/bintest/mruby_strip.rb +73 -0
  277. data/ext/enclave/mruby/mrbgems/mruby-bin-strip/mrbgem.rake +7 -0
  278. data/ext/enclave/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby_strip.c +139 -0
  279. data/ext/enclave/mruby/mrbgems/mruby-binding/README.md +256 -0
  280. data/ext/enclave/mruby/mrbgems/mruby-binding/mrbgem.rake +7 -0
  281. data/ext/enclave/mruby/mrbgems/mruby-binding/src/binding.c +518 -0
  282. data/ext/enclave/mruby/mrbgems/mruby-binding/test/binding.c +14 -0
  283. data/ext/enclave/mruby/mrbgems/mruby-binding/test/binding.rb +64 -0
  284. data/ext/enclave/mruby/mrbgems/mruby-catch/README.md +94 -0
  285. data/ext/enclave/mruby/mrbgems/mruby-catch/mrbgem.rake +5 -0
  286. data/ext/enclave/mruby/mrbgems/mruby-catch/mrblib/catch.rb +29 -0
  287. data/ext/enclave/mruby/mrbgems/mruby-catch/src/catch.c +149 -0
  288. data/ext/enclave/mruby/mrbgems/mruby-catch/test/catch.rb +86 -0
  289. data/ext/enclave/mruby/mrbgems/mruby-class-ext/README.md +81 -0
  290. data/ext/enclave/mruby/mrbgems/mruby-class-ext/mrbgem.rake +5 -0
  291. data/ext/enclave/mruby/mrbgems/mruby-class-ext/src/class.c +377 -0
  292. data/ext/enclave/mruby/mrbgems/mruby-class-ext/test/class.rb +46 -0
  293. data/ext/enclave/mruby/mrbgems/mruby-class-ext/test/module.rb +109 -0
  294. data/ext/enclave/mruby/mrbgems/mruby-cmath/README.md +45 -0
  295. data/ext/enclave/mruby/mrbgems/mruby-cmath/mrbgem.rake +8 -0
  296. data/ext/enclave/mruby/mrbgems/mruby-cmath/src/cmath.c +426 -0
  297. data/ext/enclave/mruby/mrbgems/mruby-cmath/test/cmath.rb +41 -0
  298. data/ext/enclave/mruby/mrbgems/mruby-compar-ext/README.md +65 -0
  299. data/ext/enclave/mruby/mrbgems/mruby-compar-ext/mrbgem.rake +5 -0
  300. data/ext/enclave/mruby/mrbgems/mruby-compar-ext/mrblib/compar.rb +75 -0
  301. data/ext/enclave/mruby/mrbgems/mruby-compar-ext/test/compar.rb +21 -0
  302. data/ext/enclave/mruby/mrbgems/mruby-compiler/README.md +28 -0
  303. data/ext/enclave/mruby/mrbgems/mruby-compiler/core/codegen.c +7316 -0
  304. data/ext/enclave/mruby/mrbgems/mruby-compiler/core/keywords +52 -0
  305. data/ext/enclave/mruby/mrbgems/mruby-compiler/core/lex.def +207 -0
  306. data/ext/enclave/mruby/mrbgems/mruby-compiler/core/node.h +784 -0
  307. data/ext/enclave/mruby/mrbgems/mruby-compiler/core/parse.y +8977 -0
  308. data/ext/enclave/mruby/mrbgems/mruby-compiler/core/y.tab.c +16136 -0
  309. data/ext/enclave/mruby/mrbgems/mruby-compiler/mrbgem.rake +42 -0
  310. data/ext/enclave/mruby/mrbgems/mruby-complex/README.md +55 -0
  311. data/ext/enclave/mruby/mrbgems/mruby-complex/mrbgem.rake +7 -0
  312. data/ext/enclave/mruby/mrbgems/mruby-complex/mrblib/complex.rb +259 -0
  313. data/ext/enclave/mruby/mrbgems/mruby-complex/src/complex.c +597 -0
  314. data/ext/enclave/mruby/mrbgems/mruby-complex/test/complex.rb +174 -0
  315. data/ext/enclave/mruby/mrbgems/mruby-data/README.md +126 -0
  316. data/ext/enclave/mruby/mrbgems/mruby-data/mrbgem.rake +5 -0
  317. data/ext/enclave/mruby/mrbgems/mruby-data/src/data.c +550 -0
  318. data/ext/enclave/mruby/mrbgems/mruby-data/test/data.rb +76 -0
  319. data/ext/enclave/mruby/mrbgems/mruby-dir/README.md +53 -0
  320. data/ext/enclave/mruby/mrbgems/mruby-dir/include/dir_hal.h +79 -0
  321. data/ext/enclave/mruby/mrbgems/mruby-dir/mrbgem.rake +35 -0
  322. data/ext/enclave/mruby/mrbgems/mruby-dir/mrblib/dir.rb +124 -0
  323. data/ext/enclave/mruby/mrbgems/mruby-dir/src/dir.c +493 -0
  324. data/ext/enclave/mruby/mrbgems/mruby-dir/test/dir.rb +138 -0
  325. data/ext/enclave/mruby/mrbgems/mruby-dir/test/dirtest.c +125 -0
  326. data/ext/enclave/mruby/mrbgems/mruby-encoding/README.md +96 -0
  327. data/ext/enclave/mruby/mrbgems/mruby-encoding/mrbgem.rake +8 -0
  328. data/ext/enclave/mruby/mrbgems/mruby-encoding/src/encoding.c +128 -0
  329. data/ext/enclave/mruby/mrbgems/mruby-encoding/test/numeric.rb +27 -0
  330. data/ext/enclave/mruby/mrbgems/mruby-encoding/test/string.rb +30 -0
  331. data/ext/enclave/mruby/mrbgems/mruby-enum-chain/README.md +80 -0
  332. data/ext/enclave/mruby/mrbgems/mruby-enum-chain/mrbgem.rake +6 -0
  333. data/ext/enclave/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +149 -0
  334. data/ext/enclave/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +108 -0
  335. data/ext/enclave/mruby/mrbgems/mruby-enum-ext/README.md +487 -0
  336. data/ext/enclave/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +5 -0
  337. data/ext/enclave/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +938 -0
  338. data/ext/enclave/mruby/mrbgems/mruby-enum-ext/test/enum.rb +223 -0
  339. data/ext/enclave/mruby/mrbgems/mruby-enum-lazy/README.md +91 -0
  340. data/ext/enclave/mruby/mrbgems/mruby-enum-lazy/mrbgem.rake +7 -0
  341. data/ext/enclave/mruby/mrbgems/mruby-enum-lazy/mrblib/lazy.rb +363 -0
  342. data/ext/enclave/mruby/mrbgems/mruby-enum-lazy/test/lazy.rb +59 -0
  343. data/ext/enclave/mruby/mrbgems/mruby-enumerator/README.md +89 -0
  344. data/ext/enclave/mruby/mrbgems/mruby-enumerator/mrbgem.rake +6 -0
  345. data/ext/enclave/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +861 -0
  346. data/ext/enclave/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +664 -0
  347. data/ext/enclave/mruby/mrbgems/mruby-errno/README.md +83 -0
  348. data/ext/enclave/mruby/mrbgems/mruby-errno/mrbgem.rake +5 -0
  349. data/ext/enclave/mruby/mrbgems/mruby-errno/mrblib/errno.rb +50 -0
  350. data/ext/enclave/mruby/mrbgems/mruby-errno/src/errno.c +335 -0
  351. data/ext/enclave/mruby/mrbgems/mruby-errno/src/gen.rb +18 -0
  352. data/ext/enclave/mruby/mrbgems/mruby-errno/src/known_errors.def +156 -0
  353. data/ext/enclave/mruby/mrbgems/mruby-errno/src/known_errors_def.cstub +780 -0
  354. data/ext/enclave/mruby/mrbgems/mruby-errno/test/errno.rb +57 -0
  355. data/ext/enclave/mruby/mrbgems/mruby-error/README.md +103 -0
  356. data/ext/enclave/mruby/mrbgems/mruby-error/mrbgem.rake +5 -0
  357. data/ext/enclave/mruby/mrbgems/mruby-error/src/exception.c +143 -0
  358. data/ext/enclave/mruby/mrbgems/mruby-error/test/exception.c +60 -0
  359. data/ext/enclave/mruby/mrbgems/mruby-error/test/exception.rb +55 -0
  360. data/ext/enclave/mruby/mrbgems/mruby-eval/README.md +26 -0
  361. data/ext/enclave/mruby/mrbgems/mruby-eval/mrbgem.rake +10 -0
  362. data/ext/enclave/mruby/mrbgems/mruby-eval/src/eval.c +437 -0
  363. data/ext/enclave/mruby/mrbgems/mruby-eval/test/binding.rb +81 -0
  364. data/ext/enclave/mruby/mrbgems/mruby-eval/test/eval.rb +185 -0
  365. data/ext/enclave/mruby/mrbgems/mruby-exit/mrbgem.rake +5 -0
  366. data/ext/enclave/mruby/mrbgems/mruby-exit/src/mruby_exit.c +83 -0
  367. data/ext/enclave/mruby/mrbgems/mruby-fiber/mrbgem.rake +5 -0
  368. data/ext/enclave/mruby/mrbgems/mruby-fiber/src/fiber.c +575 -0
  369. data/ext/enclave/mruby/mrbgems/mruby-fiber/test/fiber.rb +210 -0
  370. data/ext/enclave/mruby/mrbgems/mruby-fiber/test/fiber2.rb +155 -0
  371. data/ext/enclave/mruby/mrbgems/mruby-fiber/test/fibertest.c +87 -0
  372. data/ext/enclave/mruby/mrbgems/mruby-hash-ext/README.md +392 -0
  373. data/ext/enclave/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +6 -0
  374. data/ext/enclave/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +408 -0
  375. data/ext/enclave/mruby/mrbgems/mruby-hash-ext/src/hash_ext.c +392 -0
  376. data/ext/enclave/mruby/mrbgems/mruby-hash-ext/test/hash.rb +317 -0
  377. data/ext/enclave/mruby/mrbgems/mruby-io/README.md +198 -0
  378. data/ext/enclave/mruby/mrbgems/mruby-io/include/io_hal.h +451 -0
  379. data/ext/enclave/mruby/mrbgems/mruby-io/include/mruby/io.h +76 -0
  380. data/ext/enclave/mruby/mrbgems/mruby-io/mrbgem.rake +34 -0
  381. data/ext/enclave/mruby/mrbgems/mruby-io/mrblib/file.rb +109 -0
  382. data/ext/enclave/mruby/mrbgems/mruby-io/mrblib/file_constants.rb +24 -0
  383. data/ext/enclave/mruby/mrbgems/mruby-io/mrblib/io.rb +303 -0
  384. data/ext/enclave/mruby/mrbgems/mruby-io/mrblib/kernel.rb +175 -0
  385. data/ext/enclave/mruby/mrbgems/mruby-io/src/file.c +1192 -0
  386. data/ext/enclave/mruby/mrbgems/mruby-io/src/file_test.c +403 -0
  387. data/ext/enclave/mruby/mrbgems/mruby-io/src/io.c +2260 -0
  388. data/ext/enclave/mruby/mrbgems/mruby-io/src/mruby_io_gem.c +21 -0
  389. data/ext/enclave/mruby/mrbgems/mruby-io/test/file.rb +415 -0
  390. data/ext/enclave/mruby/mrbgems/mruby-io/test/file_test.rb +112 -0
  391. data/ext/enclave/mruby/mrbgems/mruby-io/test/io.rb +668 -0
  392. data/ext/enclave/mruby/mrbgems/mruby-io/test/mruby_io_test.c +293 -0
  393. data/ext/enclave/mruby/mrbgems/mruby-kernel-ext/README.md +165 -0
  394. data/ext/enclave/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +5 -0
  395. data/ext/enclave/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +316 -0
  396. data/ext/enclave/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +134 -0
  397. data/ext/enclave/mruby/mrbgems/mruby-math/README.md +77 -0
  398. data/ext/enclave/mruby/mrbgems/mruby-math/mrbgem.rake +5 -0
  399. data/ext/enclave/mruby/mrbgems/mruby-math/src/math.c +753 -0
  400. data/ext/enclave/mruby/mrbgems/mruby-math/test/math.rb +201 -0
  401. data/ext/enclave/mruby/mrbgems/mruby-metaprog/README.md +123 -0
  402. data/ext/enclave/mruby/mrbgems/mruby-metaprog/mrbgem.rake +5 -0
  403. data/ext/enclave/mruby/mrbgems/mruby-metaprog/src/metaprog.c +739 -0
  404. data/ext/enclave/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +465 -0
  405. data/ext/enclave/mruby/mrbgems/mruby-method/README.md +66 -0
  406. data/ext/enclave/mruby/mrbgems/mruby-method/mrbgem.rake +7 -0
  407. data/ext/enclave/mruby/mrbgems/mruby-method/mrblib/method.rb +73 -0
  408. data/ext/enclave/mruby/mrbgems/mruby-method/src/method.c +890 -0
  409. data/ext/enclave/mruby/mrbgems/mruby-method/test/method.rb +514 -0
  410. data/ext/enclave/mruby/mrbgems/mruby-numeric-ext/README.md +78 -0
  411. data/ext/enclave/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +5 -0
  412. data/ext/enclave/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +125 -0
  413. data/ext/enclave/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +527 -0
  414. data/ext/enclave/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +137 -0
  415. data/ext/enclave/mruby/mrbgems/mruby-object-ext/README.md +144 -0
  416. data/ext/enclave/mruby/mrbgems/mruby-object-ext/mrbgem.rake +5 -0
  417. data/ext/enclave/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +33 -0
  418. data/ext/enclave/mruby/mrbgems/mruby-object-ext/src/object.c +128 -0
  419. data/ext/enclave/mruby/mrbgems/mruby-object-ext/test/nil.rb +16 -0
  420. data/ext/enclave/mruby/mrbgems/mruby-object-ext/test/object.rb +67 -0
  421. data/ext/enclave/mruby/mrbgems/mruby-object-ext/test/object_ext.c +17 -0
  422. data/ext/enclave/mruby/mrbgems/mruby-objectspace/README.md +59 -0
  423. data/ext/enclave/mruby/mrbgems/mruby-objectspace/mrbgem.rake +5 -0
  424. data/ext/enclave/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +188 -0
  425. data/ext/enclave/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +60 -0
  426. data/ext/enclave/mruby/mrbgems/mruby-os-memsize/README.md +75 -0
  427. data/ext/enclave/mruby/mrbgems/mruby-os-memsize/mrbgem.rake +10 -0
  428. data/ext/enclave/mruby/mrbgems/mruby-os-memsize/src/memsize.c +271 -0
  429. data/ext/enclave/mruby/mrbgems/mruby-os-memsize/test/memsize.rb +63 -0
  430. data/ext/enclave/mruby/mrbgems/mruby-pack/README.md +140 -0
  431. data/ext/enclave/mruby/mrbgems/mruby-pack/mrbgem.rake +5 -0
  432. data/ext/enclave/mruby/mrbgems/mruby-pack/src/pack.c +2129 -0
  433. data/ext/enclave/mruby/mrbgems/mruby-pack/test/pack.rb +202 -0
  434. data/ext/enclave/mruby/mrbgems/mruby-proc-binding/README.md +140 -0
  435. data/ext/enclave/mruby/mrbgems/mruby-proc-binding/mrbgem.rake +10 -0
  436. data/ext/enclave/mruby/mrbgems/mruby-proc-binding/src/proc_binding.c +76 -0
  437. data/ext/enclave/mruby/mrbgems/mruby-proc-binding/test/proc_binding.c +14 -0
  438. data/ext/enclave/mruby/mrbgems/mruby-proc-binding/test/proc_binding.rb +22 -0
  439. data/ext/enclave/mruby/mrbgems/mruby-proc-ext/README.md +107 -0
  440. data/ext/enclave/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +5 -0
  441. data/ext/enclave/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +130 -0
  442. data/ext/enclave/mruby/mrbgems/mruby-proc-ext/src/proc.c +267 -0
  443. data/ext/enclave/mruby/mrbgems/mruby-proc-ext/test/proc.c +62 -0
  444. data/ext/enclave/mruby/mrbgems/mruby-proc-ext/test/proc.rb +130 -0
  445. data/ext/enclave/mruby/mrbgems/mruby-random/README.md +272 -0
  446. data/ext/enclave/mruby/mrbgems/mruby-random/mrbgem.rake +5 -0
  447. data/ext/enclave/mruby/mrbgems/mruby-random/src/random.c +608 -0
  448. data/ext/enclave/mruby/mrbgems/mruby-random/test/random.rb +151 -0
  449. data/ext/enclave/mruby/mrbgems/mruby-range-ext/README.md +93 -0
  450. data/ext/enclave/mruby/mrbgems/mruby-range-ext/mrbgem.rake +5 -0
  451. data/ext/enclave/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +155 -0
  452. data/ext/enclave/mruby/mrbgems/mruby-range-ext/src/range.c +236 -0
  453. data/ext/enclave/mruby/mrbgems/mruby-range-ext/test/range.rb +211 -0
  454. data/ext/enclave/mruby/mrbgems/mruby-rational/README.md +61 -0
  455. data/ext/enclave/mruby/mrbgems/mruby-rational/mrbgem.rake +7 -0
  456. data/ext/enclave/mruby/mrbgems/mruby-rational/mrblib/rational.rb +66 -0
  457. data/ext/enclave/mruby/mrbgems/mruby-rational/src/rational.c +1269 -0
  458. data/ext/enclave/mruby/mrbgems/mruby-rational/test/rational.rb +316 -0
  459. data/ext/enclave/mruby/mrbgems/mruby-set/LICENSE +24 -0
  460. data/ext/enclave/mruby/mrbgems/mruby-set/README.md +260 -0
  461. data/ext/enclave/mruby/mrbgems/mruby-set/mrbgem.rake +9 -0
  462. data/ext/enclave/mruby/mrbgems/mruby-set/mrblib/set.rb +325 -0
  463. data/ext/enclave/mruby/mrbgems/mruby-set/mruby-set.gem +6 -0
  464. data/ext/enclave/mruby/mrbgems/mruby-set/src/set.c +1535 -0
  465. data/ext/enclave/mruby/mrbgems/mruby-set/test/set.rb +764 -0
  466. data/ext/enclave/mruby/mrbgems/mruby-sleep/README.md +29 -0
  467. data/ext/enclave/mruby/mrbgems/mruby-sleep/example/sleep.rb +2 -0
  468. data/ext/enclave/mruby/mrbgems/mruby-sleep/mrbgem.rake +5 -0
  469. data/ext/enclave/mruby/mrbgems/mruby-sleep/src/sleep.c +187 -0
  470. data/ext/enclave/mruby/mrbgems/mruby-sleep/test/sleep_test.rb +29 -0
  471. data/ext/enclave/mruby/mrbgems/mruby-socket/README.md +56 -0
  472. data/ext/enclave/mruby/mrbgems/mruby-socket/include/socket_hal.h +83 -0
  473. data/ext/enclave/mruby/mrbgems/mruby-socket/mrbgem.rake +37 -0
  474. data/ext/enclave/mruby/mrbgems/mruby-socket/mrblib/socket.rb +1131 -0
  475. data/ext/enclave/mruby/mrbgems/mruby-socket/src/const.cstub +480 -0
  476. data/ext/enclave/mruby/mrbgems/mruby-socket/src/const.def +172 -0
  477. data/ext/enclave/mruby/mrbgems/mruby-socket/src/gen.rb +17 -0
  478. data/ext/enclave/mruby/mrbgems/mruby-socket/src/socket.c +1374 -0
  479. data/ext/enclave/mruby/mrbgems/mruby-socket/test/addrinfo.rb +91 -0
  480. data/ext/enclave/mruby/mrbgems/mruby-socket/test/basicsocket.rb +17 -0
  481. data/ext/enclave/mruby/mrbgems/mruby-socket/test/ipsocket.rb +44 -0
  482. data/ext/enclave/mruby/mrbgems/mruby-socket/test/socket.rb +38 -0
  483. data/ext/enclave/mruby/mrbgems/mruby-socket/test/sockettest.c +84 -0
  484. data/ext/enclave/mruby/mrbgems/mruby-socket/test/tcpsocket.rb +4 -0
  485. data/ext/enclave/mruby/mrbgems/mruby-socket/test/udpsocket.rb +16 -0
  486. data/ext/enclave/mruby/mrbgems/mruby-socket/test/unix.rb +130 -0
  487. data/ext/enclave/mruby/mrbgems/mruby-sprintf/README.md +235 -0
  488. data/ext/enclave/mruby/mrbgems/mruby-sprintf/mrbgem.rake +5 -0
  489. data/ext/enclave/mruby/mrbgems/mruby-sprintf/mrblib/string.rb +24 -0
  490. data/ext/enclave/mruby/mrbgems/mruby-sprintf/src/sprintf.c +1195 -0
  491. data/ext/enclave/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +92 -0
  492. data/ext/enclave/mruby/mrbgems/mruby-strftime/README.md +140 -0
  493. data/ext/enclave/mruby/mrbgems/mruby-strftime/mrbgem.rake +7 -0
  494. data/ext/enclave/mruby/mrbgems/mruby-strftime/src/strftime.c +119 -0
  495. data/ext/enclave/mruby/mrbgems/mruby-strftime/test/strftime.rb +152 -0
  496. data/ext/enclave/mruby/mrbgems/mruby-string-ext/README.md +886 -0
  497. data/ext/enclave/mruby/mrbgems/mruby-string-ext/mrbgem.rake +5 -0
  498. data/ext/enclave/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +166 -0
  499. data/ext/enclave/mruby/mrbgems/mruby-string-ext/src/string.c +2290 -0
  500. data/ext/enclave/mruby/mrbgems/mruby-string-ext/test/numeric.rb +27 -0
  501. data/ext/enclave/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
  502. data/ext/enclave/mruby/mrbgems/mruby-string-ext/test/string.rb +765 -0
  503. data/ext/enclave/mruby/mrbgems/mruby-struct/README.md +105 -0
  504. data/ext/enclave/mruby/mrbgems/mruby-struct/mrbgem.rake +5 -0
  505. data/ext/enclave/mruby/mrbgems/mruby-struct/mrblib/struct.rb +69 -0
  506. data/ext/enclave/mruby/mrbgems/mruby-struct/src/struct.c +812 -0
  507. data/ext/enclave/mruby/mrbgems/mruby-struct/test/struct.rb +303 -0
  508. data/ext/enclave/mruby/mrbgems/mruby-symbol-ext/README.md +50 -0
  509. data/ext/enclave/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +5 -0
  510. data/ext/enclave/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +72 -0
  511. data/ext/enclave/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +79 -0
  512. data/ext/enclave/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +55 -0
  513. data/ext/enclave/mruby/mrbgems/mruby-task/README.md +770 -0
  514. data/ext/enclave/mruby/mrbgems/mruby-task/examples/inspection.rb +65 -0
  515. data/ext/enclave/mruby/mrbgems/mruby-task/examples/priority.rb +41 -0
  516. data/ext/enclave/mruby/mrbgems/mruby-task/examples/producer_consumer.rb +58 -0
  517. data/ext/enclave/mruby/mrbgems/mruby-task/examples/simple.rb +27 -0
  518. data/ext/enclave/mruby/mrbgems/mruby-task/examples/statistics.rb +59 -0
  519. data/ext/enclave/mruby/mrbgems/mruby-task/examples/suspend_resume.rb +47 -0
  520. data/ext/enclave/mruby/mrbgems/mruby-task/examples/task_pass.rb +21 -0
  521. data/ext/enclave/mruby/mrbgems/mruby-task/include/task.h +143 -0
  522. data/ext/enclave/mruby/mrbgems/mruby-task/include/task_hal.h +162 -0
  523. data/ext/enclave/mruby/mrbgems/mruby-task/mrbgem.rake +36 -0
  524. data/ext/enclave/mruby/mrbgems/mruby-task/src/task.c +1573 -0
  525. data/ext/enclave/mruby/mrbgems/mruby-task/test/task.rb +185 -0
  526. data/ext/enclave/mruby/mrbgems/mruby-test/README.md +7 -0
  527. data/ext/enclave/mruby/mrbgems/mruby-test/driver.c +315 -0
  528. data/ext/enclave/mruby/mrbgems/mruby-test/mrbgem.rake +173 -0
  529. data/ext/enclave/mruby/mrbgems/mruby-test/vformat.c +151 -0
  530. data/ext/enclave/mruby/mrbgems/mruby-test-inline-struct/mrbgem.rake +5 -0
  531. data/ext/enclave/mruby/mrbgems/mruby-test-inline-struct/test/inline.c +92 -0
  532. data/ext/enclave/mruby/mrbgems/mruby-test-inline-struct/test/inline.rb +118 -0
  533. data/ext/enclave/mruby/mrbgems/mruby-time/README.md +102 -0
  534. data/ext/enclave/mruby/mrbgems/mruby-time/include/mruby/time.h +27 -0
  535. data/ext/enclave/mruby/mrbgems/mruby-time/mrbgem.rake +5 -0
  536. data/ext/enclave/mruby/mrbgems/mruby-time/src/time.c +1739 -0
  537. data/ext/enclave/mruby/mrbgems/mruby-time/test/time.rb +313 -0
  538. data/ext/enclave/mruby/mrbgems/mruby-toplevel-ext/README.md +32 -0
  539. data/ext/enclave/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +5 -0
  540. data/ext/enclave/mruby/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +24 -0
  541. data/ext/enclave/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +23 -0
  542. data/ext/enclave/mruby/mrbgems/stdlib-ext.gembox +21 -0
  543. data/ext/enclave/mruby/mrbgems/stdlib-io.gembox +15 -0
  544. data/ext/enclave/mruby/mrbgems/stdlib.gembox +63 -0
  545. data/ext/enclave/mruby/mrblib/10error.rb +23 -0
  546. data/ext/enclave/mruby/mrblib/array.rb +102 -0
  547. data/ext/enclave/mruby/mrblib/compar.rb +102 -0
  548. data/ext/enclave/mruby/mrblib/enum.rb +358 -0
  549. data/ext/enclave/mruby/mrblib/hash.rb +276 -0
  550. data/ext/enclave/mruby/mrblib/kernel.rb +45 -0
  551. data/ext/enclave/mruby/mrblib/numeric.rb +160 -0
  552. data/ext/enclave/mruby/mrblib/range.rb +98 -0
  553. data/ext/enclave/mruby/mrblib/string.rb +173 -0
  554. data/ext/enclave/mruby/mrblib/symbol.rb +8 -0
  555. data/ext/enclave/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
  556. data/ext/enclave/mruby/oss-fuzz/proto_to_ruby.h +55 -0
  557. data/ext/enclave/mruby/src/allocf.c +37 -0
  558. data/ext/enclave/mruby/src/array.c +2302 -0
  559. data/ext/enclave/mruby/src/backtrace.c +294 -0
  560. data/ext/enclave/mruby/src/cdump.c +498 -0
  561. data/ext/enclave/mruby/src/class.c +4394 -0
  562. data/ext/enclave/mruby/src/codedump.c +693 -0
  563. data/ext/enclave/mruby/src/debug.c +290 -0
  564. data/ext/enclave/mruby/src/dump.c +998 -0
  565. data/ext/enclave/mruby/src/enum.c +30 -0
  566. data/ext/enclave/mruby/src/error.c +937 -0
  567. data/ext/enclave/mruby/src/etc.c +421 -0
  568. data/ext/enclave/mruby/src/fmt_fp.c +372 -0
  569. data/ext/enclave/mruby/src/gc.c +1610 -0
  570. data/ext/enclave/mruby/src/hash.c +2355 -0
  571. data/ext/enclave/mruby/src/init.c +50 -0
  572. data/ext/enclave/mruby/src/kernel.c +718 -0
  573. data/ext/enclave/mruby/src/load.c +760 -0
  574. data/ext/enclave/mruby/src/mempool.c +225 -0
  575. data/ext/enclave/mruby/src/numeric.c +2420 -0
  576. data/ext/enclave/mruby/src/numops.c +112 -0
  577. data/ext/enclave/mruby/src/object.c +883 -0
  578. data/ext/enclave/mruby/src/print.c +136 -0
  579. data/ext/enclave/mruby/src/proc.c +572 -0
  580. data/ext/enclave/mruby/src/range.c +597 -0
  581. data/ext/enclave/mruby/src/readfloat.c +228 -0
  582. data/ext/enclave/mruby/src/readint.c +27 -0
  583. data/ext/enclave/mruby/src/readnum.c +43 -0
  584. data/ext/enclave/mruby/src/state.c +247 -0
  585. data/ext/enclave/mruby/src/string.c +3577 -0
  586. data/ext/enclave/mruby/src/symbol.c +1023 -0
  587. data/ext/enclave/mruby/src/value_array.h +28 -0
  588. data/ext/enclave/mruby/src/variable.c +1475 -0
  589. data/ext/enclave/mruby/src/version.c +17 -0
  590. data/ext/enclave/mruby/src/vm.c +3696 -0
  591. data/ext/enclave/mruby/tasks/amalgam.rake +34 -0
  592. data/ext/enclave/mruby/tasks/benchmark.rake +93 -0
  593. data/ext/enclave/mruby/tasks/bin.rake +23 -0
  594. data/ext/enclave/mruby/tasks/core.rake +12 -0
  595. data/ext/enclave/mruby/tasks/doc.rake +118 -0
  596. data/ext/enclave/mruby/tasks/install.rake +40 -0
  597. data/ext/enclave/mruby/tasks/libmruby.rake +90 -0
  598. data/ext/enclave/mruby/tasks/mrbgems.rake +152 -0
  599. data/ext/enclave/mruby/tasks/mrblib.rake +29 -0
  600. data/ext/enclave/mruby/tasks/presym.rake +57 -0
  601. data/ext/enclave/mruby/tasks/test.rake +84 -0
  602. data/ext/enclave/mruby/tasks/toolchains/android.rake +228 -0
  603. data/ext/enclave/mruby/tasks/toolchains/clang.rake +8 -0
  604. data/ext/enclave/mruby/tasks/toolchains/emscripten.rake +57 -0
  605. data/ext/enclave/mruby/tasks/toolchains/gcc.rake +74 -0
  606. data/ext/enclave/mruby/tasks/toolchains/openwrt.rake +32 -0
  607. data/ext/enclave/mruby/tasks/toolchains/visualcpp.rake +48 -0
  608. data/ext/enclave/mruby/test/assert.rb +404 -0
  609. data/ext/enclave/mruby/test/bintest.rb +55 -0
  610. data/ext/enclave/mruby/test/t/argumenterror.rb +37 -0
  611. data/ext/enclave/mruby/test/t/array.rb +478 -0
  612. data/ext/enclave/mruby/test/t/basicobject.rb +10 -0
  613. data/ext/enclave/mruby/test/t/bs_block.rb +621 -0
  614. data/ext/enclave/mruby/test/t/bs_literal.rb +38 -0
  615. data/ext/enclave/mruby/test/t/class.rb +505 -0
  616. data/ext/enclave/mruby/test/t/codegen.rb +196 -0
  617. data/ext/enclave/mruby/test/t/comparable.rb +79 -0
  618. data/ext/enclave/mruby/test/t/ensure.rb +36 -0
  619. data/ext/enclave/mruby/test/t/enumerable.rb +134 -0
  620. data/ext/enclave/mruby/test/t/exception.rb +425 -0
  621. data/ext/enclave/mruby/test/t/false.rb +31 -0
  622. data/ext/enclave/mruby/test/t/float.rb +296 -0
  623. data/ext/enclave/mruby/test/t/gc.rb +45 -0
  624. data/ext/enclave/mruby/test/t/hash.rb +976 -0
  625. data/ext/enclave/mruby/test/t/indexerror.rb +6 -0
  626. data/ext/enclave/mruby/test/t/integer.rb +247 -0
  627. data/ext/enclave/mruby/test/t/iterations.rb +61 -0
  628. data/ext/enclave/mruby/test/t/kernel.rb +462 -0
  629. data/ext/enclave/mruby/test/t/lang.rb +74 -0
  630. data/ext/enclave/mruby/test/t/literals.rb +386 -0
  631. data/ext/enclave/mruby/test/t/localjumperror.rb +13 -0
  632. data/ext/enclave/mruby/test/t/methods.rb +138 -0
  633. data/ext/enclave/mruby/test/t/module.rb +931 -0
  634. data/ext/enclave/mruby/test/t/nameerror.rb +28 -0
  635. data/ext/enclave/mruby/test/t/nil.rb +39 -0
  636. data/ext/enclave/mruby/test/t/nomethoderror.rb +22 -0
  637. data/ext/enclave/mruby/test/t/numeric.rb +114 -0
  638. data/ext/enclave/mruby/test/t/object.rb +10 -0
  639. data/ext/enclave/mruby/test/t/proc.rb +198 -0
  640. data/ext/enclave/mruby/test/t/range.rb +194 -0
  641. data/ext/enclave/mruby/test/t/rangeerror.rb +6 -0
  642. data/ext/enclave/mruby/test/t/regexperror.rb +4 -0
  643. data/ext/enclave/mruby/test/t/runtimeerror.rb +6 -0
  644. data/ext/enclave/mruby/test/t/standarderror.rb +6 -0
  645. data/ext/enclave/mruby/test/t/string.rb +981 -0
  646. data/ext/enclave/mruby/test/t/superclass.rb +46 -0
  647. data/ext/enclave/mruby/test/t/symbol.rb +30 -0
  648. data/ext/enclave/mruby/test/t/syntax.rb +1296 -0
  649. data/ext/enclave/mruby/test/t/true.rb +31 -0
  650. data/ext/enclave/mruby/test/t/typeerror.rb +6 -0
  651. data/ext/enclave/mruby/test/t/unicode.rb +39 -0
  652. data/ext/enclave/mruby/test/t/vformat.rb +57 -0
  653. data/ext/enclave/mruby/tools/lrama/LEGAL.md +12 -0
  654. data/ext/enclave/mruby/tools/lrama/MIT +21 -0
  655. data/ext/enclave/mruby/tools/lrama/NEWS.md +696 -0
  656. data/ext/enclave/mruby/tools/lrama/exe/lrama +7 -0
  657. data/ext/enclave/mruby/tools/lrama/lib/lrama/bitmap.rb +34 -0
  658. data/ext/enclave/mruby/tools/lrama/lib/lrama/command.rb +68 -0
  659. data/ext/enclave/mruby/tools/lrama/lib/lrama/context.rb +499 -0
  660. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/derivation.rb +66 -0
  661. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/example.rb +129 -0
  662. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/path.rb +29 -0
  663. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/production_path.rb +19 -0
  664. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/start_path.rb +23 -0
  665. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/state_item.rb +8 -0
  666. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/transition_path.rb +19 -0
  667. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples/triple.rb +23 -0
  668. data/ext/enclave/mruby/tools/lrama/lib/lrama/counterexamples.rb +298 -0
  669. data/ext/enclave/mruby/tools/lrama/lib/lrama/diagnostics.rb +36 -0
  670. data/ext/enclave/mruby/tools/lrama/lib/lrama/digraph.rb +83 -0
  671. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/auxiliary.rb +9 -0
  672. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/binding.rb +67 -0
  673. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/code/destructor_code.rb +42 -0
  674. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/code/initial_action_code.rb +36 -0
  675. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/code/no_reference_code.rb +30 -0
  676. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/code/printer_code.rb +42 -0
  677. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/code/rule_action.rb +92 -0
  678. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/code.rb +53 -0
  679. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/counter.rb +17 -0
  680. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/destructor.rb +11 -0
  681. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/error_token.rb +11 -0
  682. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/parameterizing_rule/resolver.rb +62 -0
  683. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/parameterizing_rule/rhs.rb +40 -0
  684. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/parameterizing_rule/rule.rb +24 -0
  685. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/parameterizing_rule.rb +5 -0
  686. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/percent_code.rb +14 -0
  687. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/precedence.rb +13 -0
  688. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/printer.rb +11 -0
  689. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/reference.rb +16 -0
  690. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/rule.rb +75 -0
  691. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/rule_builder.rb +255 -0
  692. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/stdlib.y +122 -0
  693. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/symbol.rb +105 -0
  694. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/symbols/resolver.rb +301 -0
  695. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/symbols.rb +3 -0
  696. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/type.rb +20 -0
  697. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar/union.rb +12 -0
  698. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar.rb +407 -0
  699. data/ext/enclave/mruby/tools/lrama/lib/lrama/grammar_validator.rb +37 -0
  700. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/grammar_file.rb +40 -0
  701. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/location.rb +115 -0
  702. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/token/char.rb +11 -0
  703. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/token/ident.rb +11 -0
  704. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/token/instantiate_rule.rb +30 -0
  705. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/token/tag.rb +16 -0
  706. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/token/user_code.rb +83 -0
  707. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer/token.rb +70 -0
  708. data/ext/enclave/mruby/tools/lrama/lib/lrama/lexer.rb +191 -0
  709. data/ext/enclave/mruby/tools/lrama/lib/lrama/logger.rb +21 -0
  710. data/ext/enclave/mruby/tools/lrama/lib/lrama/option_parser.rb +169 -0
  711. data/ext/enclave/mruby/tools/lrama/lib/lrama/options.rb +28 -0
  712. data/ext/enclave/mruby/tools/lrama/lib/lrama/output.rb +459 -0
  713. data/ext/enclave/mruby/tools/lrama/lib/lrama/parser.rb +2144 -0
  714. data/ext/enclave/mruby/tools/lrama/lib/lrama/report/duration.rb +27 -0
  715. data/ext/enclave/mruby/tools/lrama/lib/lrama/report/profile.rb +16 -0
  716. data/ext/enclave/mruby/tools/lrama/lib/lrama/report.rb +4 -0
  717. data/ext/enclave/mruby/tools/lrama/lib/lrama/state/reduce.rb +37 -0
  718. data/ext/enclave/mruby/tools/lrama/lib/lrama/state/reduce_reduce_conflict.rb +11 -0
  719. data/ext/enclave/mruby/tools/lrama/lib/lrama/state/resolved_conflict.rb +31 -0
  720. data/ext/enclave/mruby/tools/lrama/lib/lrama/state/shift.rb +15 -0
  721. data/ext/enclave/mruby/tools/lrama/lib/lrama/state/shift_reduce_conflict.rb +11 -0
  722. data/ext/enclave/mruby/tools/lrama/lib/lrama/state.rb +433 -0
  723. data/ext/enclave/mruby/tools/lrama/lib/lrama/states/item.rb +91 -0
  724. data/ext/enclave/mruby/tools/lrama/lib/lrama/states.rb +595 -0
  725. data/ext/enclave/mruby/tools/lrama/lib/lrama/states_reporter.rb +362 -0
  726. data/ext/enclave/mruby/tools/lrama/lib/lrama/trace_reporter.rb +45 -0
  727. data/ext/enclave/mruby/tools/lrama/lib/lrama/version.rb +5 -0
  728. data/ext/enclave/mruby/tools/lrama/lib/lrama.rb +22 -0
  729. data/ext/enclave/mruby/tools/lrama/template/bison/_yacc.h +71 -0
  730. data/ext/enclave/mruby/tools/lrama/template/bison/yacc.c +2068 -0
  731. data/ext/enclave/mruby/tools/lrama/template/bison/yacc.h +40 -0
  732. data/ext/enclave/sandbox_build_config.rb +15 -0
  733. data/ext/enclave/sandbox_core.c +722 -0
  734. data/ext/enclave/sandbox_core.h +87 -0
  735. data/lib/enclave/result.rb +29 -0
  736. data/lib/enclave/tool.rb +38 -0
  737. data/lib/enclave/version.rb +3 -0
  738. data/lib/enclave.rb +73 -0
  739. metadata +819 -0
@@ -0,0 +1,2068 @@
1
+ <%# b4_generated_by -%>
2
+ /* A Bison parser, made by Lrama <%= Lrama::VERSION %>. */
3
+
4
+ <%# b4_copyright -%>
5
+ /* Bison implementation for Yacc-like parsers in C
6
+
7
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
8
+ Inc.
9
+
10
+ This program is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU General Public License for more details.
19
+
20
+ You should have received a copy of the GNU General Public License
21
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
22
+
23
+ /* As a special exception, you may create a larger work that contains
24
+ part or all of the Bison parser skeleton and distribute that work
25
+ under terms of your choice, so long as that work isn't itself a
26
+ parser generator using the skeleton or a modified version thereof
27
+ as a parser skeleton. Alternatively, if you modify or redistribute
28
+ the parser skeleton itself, you may (at your option) remove this
29
+ special exception, which will cause the skeleton and the resulting
30
+ Bison output files to be licensed under the GNU General Public
31
+ License without this special exception.
32
+
33
+ This special exception was added by the Free Software Foundation in
34
+ version 2.2 of Bison. */
35
+
36
+ /* C LALR(1) parser skeleton written by Richard Stallman, by
37
+ simplifying the original so-called "semantic" parser. */
38
+
39
+ <%# b4_disclaimer -%>
40
+ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
41
+ especially those whose name start with YY_ or yy_. They are
42
+ private implementation details that can be changed or removed. */
43
+
44
+ /* All symbols defined below should begin with yy or YY, to avoid
45
+ infringing on user name space. This should be done even for local
46
+ variables, as they might otherwise be expanded by user macros.
47
+ There are some unavoidable exceptions within include files to
48
+ define necessary library symbols; they are noted "INFRINGES ON
49
+ USER NAME SPACE" below. */
50
+
51
+ <%# b4_identification -%>
52
+ /* Identify Bison output, and Bison version. */
53
+ #define YYBISON 30802
54
+
55
+ /* Bison version string. */
56
+ #define YYBISON_VERSION "3.8.2"
57
+
58
+ /* Skeleton name. */
59
+ #define YYSKELETON_NAME "<%= output.template_basename %>"
60
+
61
+ /* Pure parsers. */
62
+ #define YYPURE 1
63
+
64
+ /* Push parsers. */
65
+ #define YYPUSH 0
66
+
67
+ /* Pull parsers. */
68
+ #define YYPULL 1
69
+
70
+
71
+ <%# b4_user_pre_prologue -%>
72
+ <%- if output.aux.prologue -%>
73
+ /* First part of user prologue. */
74
+ #line <%= output.aux.prologue_first_lineno %> "<%= output.grammar_file_path %>"
75
+ <%= output.aux.prologue %>
76
+ #line [@oline@] [@ofile@]
77
+ <%- end -%>
78
+
79
+ <%# b4_cast_define -%>
80
+ # ifndef YY_CAST
81
+ # ifdef __cplusplus
82
+ # define YY_CAST(Type, Val) static_cast<Type> (Val)
83
+ # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
84
+ # else
85
+ # define YY_CAST(Type, Val) ((Type) (Val))
86
+ # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
87
+ # endif
88
+ # endif
89
+ <%# b4_null_define -%>
90
+ # ifndef YY_NULLPTR
91
+ # if defined __cplusplus
92
+ # if 201103L <= __cplusplus
93
+ # define YY_NULLPTR nullptr
94
+ # else
95
+ # define YY_NULLPTR 0
96
+ # endif
97
+ # else
98
+ # define YY_NULLPTR ((void*)0)
99
+ # endif
100
+ # endif
101
+
102
+ <%# b4_header_include_if -%>
103
+ <%- if output.include_header -%>
104
+ #include "<%= output.include_header %>"
105
+ <%- else -%>
106
+ /* Use api.header.include to #include this header
107
+ instead of duplicating it here. */
108
+ <%= output.render_partial("bison/_yacc.h") %>
109
+ <%- end -%>
110
+ <%# b4_declare_symbol_enum -%>
111
+ /* Symbol kind. */
112
+ enum yysymbol_kind_t
113
+ {
114
+ <%= output.symbol_enum -%>
115
+ };
116
+ typedef enum yysymbol_kind_t yysymbol_kind_t;
117
+
118
+
119
+
120
+
121
+ <%# b4_user_post_prologue -%>
122
+ <%# b4_c99_int_type_define -%>
123
+ #ifdef short
124
+ # undef short
125
+ #endif
126
+
127
+ /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
128
+ <limits.h> and (if available) <stdint.h> are included
129
+ so that the code can choose integer types of a good width. */
130
+
131
+ #ifndef __PTRDIFF_MAX__
132
+ # include <limits.h> /* INFRINGES ON USER NAME SPACE */
133
+ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
134
+ # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
135
+ # define YY_STDINT_H
136
+ # endif
137
+ #endif
138
+
139
+ /* Narrow types that promote to a signed type and that can represent a
140
+ signed or unsigned integer of at least N bits. In tables they can
141
+ save space and decrease cache pressure. Promoting to a signed type
142
+ helps avoid bugs in integer arithmetic. */
143
+
144
+ #ifdef __INT_LEAST8_MAX__
145
+ typedef __INT_LEAST8_TYPE__ yytype_int8;
146
+ #elif defined YY_STDINT_H
147
+ typedef int_least8_t yytype_int8;
148
+ #else
149
+ typedef signed char yytype_int8;
150
+ #endif
151
+
152
+ #ifdef __INT_LEAST16_MAX__
153
+ typedef __INT_LEAST16_TYPE__ yytype_int16;
154
+ #elif defined YY_STDINT_H
155
+ typedef int_least16_t yytype_int16;
156
+ #else
157
+ typedef short yytype_int16;
158
+ #endif
159
+
160
+ /* Work around bug in HP-UX 11.23, which defines these macros
161
+ incorrectly for preprocessor constants. This workaround can likely
162
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
163
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
164
+ <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
165
+ #ifdef __hpux
166
+ # undef UINT_LEAST8_MAX
167
+ # undef UINT_LEAST16_MAX
168
+ # define UINT_LEAST8_MAX 255
169
+ # define UINT_LEAST16_MAX 65535
170
+ #endif
171
+
172
+ #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
173
+ typedef __UINT_LEAST8_TYPE__ yytype_uint8;
174
+ #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
175
+ && UINT_LEAST8_MAX <= INT_MAX)
176
+ typedef uint_least8_t yytype_uint8;
177
+ #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
178
+ typedef unsigned char yytype_uint8;
179
+ #else
180
+ typedef short yytype_uint8;
181
+ #endif
182
+
183
+ #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
184
+ typedef __UINT_LEAST16_TYPE__ yytype_uint16;
185
+ #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
186
+ && UINT_LEAST16_MAX <= INT_MAX)
187
+ typedef uint_least16_t yytype_uint16;
188
+ #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
189
+ typedef unsigned short yytype_uint16;
190
+ #else
191
+ typedef int yytype_uint16;
192
+ #endif
193
+
194
+ <%# b4_sizes_types_define -%>
195
+ #ifndef YYPTRDIFF_T
196
+ # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
197
+ # define YYPTRDIFF_T __PTRDIFF_TYPE__
198
+ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
199
+ # elif defined PTRDIFF_MAX
200
+ # ifndef ptrdiff_t
201
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
202
+ # endif
203
+ # define YYPTRDIFF_T ptrdiff_t
204
+ # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
205
+ # else
206
+ # define YYPTRDIFF_T long
207
+ # define YYPTRDIFF_MAXIMUM LONG_MAX
208
+ # endif
209
+ #endif
210
+
211
+ #ifndef YYSIZE_T
212
+ # ifdef __SIZE_TYPE__
213
+ # define YYSIZE_T __SIZE_TYPE__
214
+ # elif defined size_t
215
+ # define YYSIZE_T size_t
216
+ # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
217
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
218
+ # define YYSIZE_T size_t
219
+ # else
220
+ # define YYSIZE_T unsigned
221
+ # endif
222
+ #endif
223
+
224
+ #define YYSIZE_MAXIMUM \
225
+ YY_CAST (YYPTRDIFF_T, \
226
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
227
+ ? YYPTRDIFF_MAXIMUM \
228
+ : YY_CAST (YYSIZE_T, -1)))
229
+
230
+ #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
231
+
232
+
233
+ /* Stored state numbers (used for stacks). */
234
+ typedef <%= output.int_type_for([output.yynstates - 1]) %> yy_state_t;
235
+
236
+ /* State numbers in computations. */
237
+ typedef int yy_state_fast_t;
238
+
239
+ #ifndef YY_
240
+ # if defined YYENABLE_NLS && YYENABLE_NLS
241
+ # if ENABLE_NLS
242
+ # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
243
+ # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
244
+ # endif
245
+ # endif
246
+ # ifndef YY_
247
+ # define YY_(Msgid) Msgid
248
+ # endif
249
+ #endif
250
+
251
+
252
+ <%# b4_attribute_define -%>
253
+ #ifndef YY_ATTRIBUTE_PURE
254
+ # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
255
+ # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
256
+ # else
257
+ # define YY_ATTRIBUTE_PURE
258
+ # endif
259
+ #endif
260
+
261
+ #ifndef YY_ATTRIBUTE_UNUSED
262
+ # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
263
+ # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
264
+ # else
265
+ # define YY_ATTRIBUTE_UNUSED
266
+ # endif
267
+ #endif
268
+
269
+ /* Suppress unused-variable warnings by "using" E. */
270
+ #if ! defined lint || defined __GNUC__
271
+ # define YY_USE(E) ((void) (E))
272
+ #else
273
+ # define YY_USE(E) /* empty */
274
+ #endif
275
+
276
+ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
277
+ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
278
+ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
279
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
280
+ _Pragma ("GCC diagnostic push") \
281
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
282
+ # else
283
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
284
+ _Pragma ("GCC diagnostic push") \
285
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
286
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
287
+ # endif
288
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
289
+ _Pragma ("GCC diagnostic pop")
290
+ #else
291
+ # define YY_INITIAL_VALUE(Value) Value
292
+ #endif
293
+ #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
294
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
295
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END
296
+ #endif
297
+ #ifndef YY_INITIAL_VALUE
298
+ # define YY_INITIAL_VALUE(Value) /* Nothing. */
299
+ #endif
300
+
301
+ #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
302
+ # define YY_IGNORE_USELESS_CAST_BEGIN \
303
+ _Pragma ("GCC diagnostic push") \
304
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
305
+ # define YY_IGNORE_USELESS_CAST_END \
306
+ _Pragma ("GCC diagnostic pop")
307
+ #endif
308
+ #ifndef YY_IGNORE_USELESS_CAST_BEGIN
309
+ # define YY_IGNORE_USELESS_CAST_BEGIN
310
+ # define YY_IGNORE_USELESS_CAST_END
311
+ #endif
312
+
313
+
314
+ #define YY_ASSERT(E) ((void) (0 && (E)))
315
+
316
+ #if 1
317
+
318
+ /* The parser invokes alloca or malloc; define the necessary symbols. */
319
+
320
+ # ifdef YYSTACK_USE_ALLOCA
321
+ # if YYSTACK_USE_ALLOCA
322
+ # ifdef __GNUC__
323
+ # define YYSTACK_ALLOC __builtin_alloca
324
+ # elif defined __BUILTIN_VA_ARG_INCR
325
+ # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
326
+ # elif defined _AIX
327
+ # define YYSTACK_ALLOC __alloca
328
+ # elif defined _MSC_VER
329
+ # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
330
+ # define alloca _alloca
331
+ # else
332
+ # define YYSTACK_ALLOC alloca
333
+ # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
334
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
335
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
336
+ # ifndef EXIT_SUCCESS
337
+ # define EXIT_SUCCESS 0
338
+ # endif
339
+ # endif
340
+ # endif
341
+ # endif
342
+ # endif
343
+
344
+ # ifdef YYSTACK_ALLOC
345
+ /* Pacify GCC's 'empty if-body' warning. */
346
+ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
347
+ # ifndef YYSTACK_ALLOC_MAXIMUM
348
+ /* The OS might guarantee only one guard page at the bottom of the stack,
349
+ and a page size can be as small as 4096 bytes. So we cannot safely
350
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
351
+ to allow for a few compiler-allocated temporary stack slots. */
352
+ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
353
+ # endif
354
+ # else
355
+ # define YYSTACK_ALLOC YYMALLOC
356
+ # define YYSTACK_FREE YYFREE
357
+ # ifndef YYSTACK_ALLOC_MAXIMUM
358
+ # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
359
+ # endif
360
+ # if (defined __cplusplus && ! defined EXIT_SUCCESS \
361
+ && ! ((defined YYMALLOC || defined malloc) \
362
+ && (defined YYFREE || defined free)))
363
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
364
+ # ifndef EXIT_SUCCESS
365
+ # define EXIT_SUCCESS 0
366
+ # endif
367
+ # endif
368
+ # ifndef YYMALLOC
369
+ # define YYMALLOC malloc
370
+ # if ! defined malloc && ! defined EXIT_SUCCESS
371
+ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
372
+ # endif
373
+ # endif
374
+ # ifndef YYFREE
375
+ # define YYFREE free
376
+ # if ! defined free && ! defined EXIT_SUCCESS
377
+ void free (void *); /* INFRINGES ON USER NAME SPACE */
378
+ # endif
379
+ # endif
380
+ # endif
381
+ #endif /* 1 */
382
+
383
+ #if (! defined yyoverflow \
384
+ && (! defined __cplusplus \
385
+ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
386
+ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
387
+
388
+ /* A type that is properly aligned for any stack member. */
389
+ union yyalloc
390
+ {
391
+ yy_state_t yyss_alloc;
392
+ YYSTYPE yyvs_alloc;
393
+ YYLTYPE yyls_alloc;
394
+ };
395
+
396
+ /* The size of the maximum gap between one aligned stack and the next. */
397
+ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
398
+
399
+ /* The size of an array large to enough to hold all stacks, each with
400
+ N elements. */
401
+ # define YYSTACK_BYTES(N) \
402
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
403
+ + YYSIZEOF (YYLTYPE)) \
404
+ + 2 * YYSTACK_GAP_MAXIMUM)
405
+
406
+ # define YYCOPY_NEEDED 1
407
+
408
+ /* Relocate STACK from its old location to the new one. The
409
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
410
+ elements in the stack, and YYPTR gives the new location of the
411
+ stack. Advance YYPTR to a properly aligned location for the next
412
+ stack. */
413
+ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
414
+ do \
415
+ { \
416
+ YYPTRDIFF_T yynewbytes; \
417
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
418
+ Stack = &yyptr->Stack_alloc; \
419
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
420
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
421
+ } \
422
+ while (0)
423
+
424
+ #endif
425
+
426
+ #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
427
+ /* Copy COUNT objects from SRC to DST. The source and destination do
428
+ not overlap. */
429
+ # ifndef YYCOPY
430
+ # if defined __GNUC__ && 1 < __GNUC__
431
+ # define YYCOPY(Dst, Src, Count) \
432
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
433
+ # else
434
+ # define YYCOPY(Dst, Src, Count) \
435
+ do \
436
+ { \
437
+ YYPTRDIFF_T yyi; \
438
+ for (yyi = 0; yyi < (Count); yyi++) \
439
+ (Dst)[yyi] = (Src)[yyi]; \
440
+ } \
441
+ while (0)
442
+ # endif
443
+ # endif
444
+ #endif /* !YYCOPY_NEEDED */
445
+
446
+ /* YYFINAL -- State number of the termination state. */
447
+ #define YYFINAL <%= output.yyfinal %>
448
+ /* YYLAST -- Last index in YYTABLE. */
449
+ #define YYLAST <%= output.yylast %>
450
+
451
+ /* YYNTOKENS -- Number of terminals. */
452
+ #define YYNTOKENS <%= output.yyntokens %>
453
+ /* YYNNTS -- Number of nonterminals. */
454
+ #define YYNNTS <%= output.yynnts %>
455
+ /* YYNRULES -- Number of rules. */
456
+ #define YYNRULES <%= output.yynrules %>
457
+ /* YYNSTATES -- Number of states. */
458
+ #define YYNSTATES <%= output.yynstates %>
459
+
460
+ /* YYMAXUTOK -- Last valid token kind. */
461
+ #define YYMAXUTOK <%= output.yymaxutok %>
462
+
463
+
464
+ /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
465
+ as returned by yylex, with out-of-bounds checking. */
466
+ #define YYTRANSLATE(YYX) \
467
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
468
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
469
+ : YYSYMBOL_YYUNDEF)
470
+
471
+ /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
472
+ as returned by yylex. */
473
+ static const <%= output.int_type_for(output.context.yytranslate) %> yytranslate[] =
474
+ {
475
+ <%= output.yytranslate %>
476
+ };
477
+
478
+ <%- if output.error_recovery -%>
479
+ /* YYTRANSLATE_INVERTED[SYMBOL-NUM] -- Token number corresponding to SYMBOL-NUM */
480
+ static const <%= output.int_type_for(output.context.yytranslate_inverted) %> yytranslate_inverted[] =
481
+ {
482
+ <%= output.yytranslate_inverted %>
483
+ };
484
+ <%- end -%>
485
+ #if YYDEBUG
486
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
487
+ static const <%= output.int_type_for(output.context.yyrline) %> yyrline[] =
488
+ {
489
+ <%= output.yyrline %>
490
+ };
491
+ #endif
492
+
493
+ /** Accessing symbol of state STATE. */
494
+ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
495
+
496
+ #if 1
497
+ /* The user-facing name of the symbol whose (internal) number is
498
+ YYSYMBOL. No bounds checking. */
499
+ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
500
+
501
+ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
502
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
503
+ static const char *const yytname[] =
504
+ {
505
+ <%= output.yytname %>
506
+ };
507
+
508
+ static const char *
509
+ yysymbol_name (yysymbol_kind_t yysymbol)
510
+ {
511
+ return yytname[yysymbol];
512
+ }
513
+ #endif
514
+
515
+ #define YYPACT_NINF (<%= output.yypact_ninf %>)
516
+
517
+ #define yypact_value_is_default(Yyn) \
518
+ <%= output.table_value_equals(output.context.yypact, "Yyn", output.yypact_ninf, "YYPACT_NINF") %>
519
+
520
+ #define YYTABLE_NINF (<%= output.yytable_ninf %>)
521
+
522
+ #define yytable_value_is_error(Yyn) \
523
+ <%= output.table_value_equals(output.context.yytable, "Yyn", output.yytable_ninf, "YYTABLE_NINF") %>
524
+
525
+ <%# b4_parser_tables_define -%>
526
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
527
+ STATE-NUM. */
528
+ static const <%= output.int_type_for(output.context.yypact) %> yypact[] =
529
+ {
530
+ <%= output.int_array_to_string(output.context.yypact) %>
531
+ };
532
+
533
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
534
+ Performed when YYTABLE does not specify something else to do. Zero
535
+ means the default is an error. */
536
+ static const <%= output.int_type_for(output.context.yydefact) %> yydefact[] =
537
+ {
538
+ <%= output.int_array_to_string(output.context.yydefact) %>
539
+ };
540
+
541
+ /* YYPGOTO[NTERM-NUM]. */
542
+ static const <%= output.int_type_for(output.context.yypgoto) %> yypgoto[] =
543
+ {
544
+ <%= output.int_array_to_string(output.context.yypgoto) %>
545
+ };
546
+
547
+ /* YYDEFGOTO[NTERM-NUM]. */
548
+ static const <%= output.int_type_for(output.context.yydefgoto) %> yydefgoto[] =
549
+ {
550
+ <%= output.int_array_to_string(output.context.yydefgoto) %>
551
+ };
552
+
553
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
554
+ positive, shift that token. If negative, reduce the rule whose
555
+ number is the opposite. If YYTABLE_NINF, syntax error. */
556
+ static const <%= output.int_type_for(output.context.yytable) %> yytable[] =
557
+ {
558
+ <%= output.int_array_to_string(output.context.yytable) %>
559
+ };
560
+
561
+ static const <%= output.int_type_for(output.context.yycheck) %> yycheck[] =
562
+ {
563
+ <%= output.int_array_to_string(output.context.yycheck) %>
564
+ };
565
+
566
+ /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
567
+ state STATE-NUM. */
568
+ static const <%= output.int_type_for(output.context.yystos) %> yystos[] =
569
+ {
570
+ <%= output.int_array_to_string(output.context.yystos) %>
571
+ };
572
+
573
+ /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
574
+ static const <%= output.int_type_for(output.context.yyr1) %> yyr1[] =
575
+ {
576
+ <%= output.int_array_to_string(output.context.yyr1) %>
577
+ };
578
+
579
+ /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
580
+ static const <%= output.int_type_for(output.context.yyr2) %> yyr2[] =
581
+ {
582
+ <%= output.int_array_to_string(output.context.yyr2) %>
583
+ };
584
+
585
+
586
+ enum { YYENOMEM = -2 };
587
+
588
+ #define yyerrok (yyerrstatus = 0)
589
+ #define yyclearin (yychar = YYEMPTY)
590
+
591
+ #define YYACCEPT goto yyacceptlab
592
+ #define YYABORT goto yyabortlab
593
+ #define YYERROR goto yyerrorlab
594
+ #define YYNOMEM goto yyexhaustedlab
595
+
596
+
597
+ #define YYRECOVERING() (!!yyerrstatus)
598
+
599
+ #define YYBACKUP(Token, Value) \
600
+ do \
601
+ if (yychar == YYEMPTY) \
602
+ { \
603
+ yychar = (Token); \
604
+ yylval = (Value); \
605
+ YYPOPSTACK (yylen); \
606
+ yystate = *yyssp; \
607
+ goto yybackup; \
608
+ } \
609
+ else \
610
+ { \
611
+ yyerror (<%= output.yyerror_args %>, YY_("syntax error: cannot back up")); \
612
+ YYERROR; \
613
+ } \
614
+ while (0)
615
+
616
+ /* Backward compatibility with an undocumented macro.
617
+ Use YYerror or YYUNDEF. */
618
+ #define YYERRCODE YYUNDEF
619
+
620
+ <%# b4_yylloc_default_define -%>
621
+ /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
622
+ If N is 0, then set CURRENT to the empty location which ends
623
+ the previous symbol: RHS[0] (always defined). */
624
+
625
+ #ifndef YYLLOC_DEFAULT
626
+ # define YYLLOC_DEFAULT(Current, Rhs, N) \
627
+ do \
628
+ if (N) \
629
+ { \
630
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
631
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
632
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
633
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
634
+ } \
635
+ else \
636
+ { \
637
+ (Current).first_line = (Current).last_line = \
638
+ YYRHSLOC (Rhs, 0).last_line; \
639
+ (Current).first_column = (Current).last_column = \
640
+ YYRHSLOC (Rhs, 0).last_column; \
641
+ } \
642
+ while (0)
643
+ #endif
644
+
645
+ #define YYRHSLOC(Rhs, K) ((Rhs)[K])
646
+
647
+
648
+ /* Enable debugging if requested. */
649
+ #if YYDEBUG
650
+
651
+ # ifndef YYFPRINTF
652
+ # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
653
+ # define YYFPRINTF fprintf
654
+ # endif
655
+
656
+ # define YYDPRINTF(Args) \
657
+ do { \
658
+ if (yydebug) \
659
+ YYFPRINTF Args; \
660
+ } while (0)
661
+
662
+
663
+ <%# b4_yylocation_print_define -%>
664
+ /* YYLOCATION_PRINT -- Print the location on the stream.
665
+ This macro was not mandated originally: define only if we know
666
+ we won't break user code: when these are the locations we know. */
667
+
668
+ # ifndef YYLOCATION_PRINT
669
+
670
+ # if defined YY_LOCATION_PRINT
671
+
672
+ /* Temporary convenience wrapper in case some people defined the
673
+ undocumented and private YY_LOCATION_PRINT macros. */
674
+ # define YYLOCATION_PRINT(File, Loc<%= output.user_args %>) YY_LOCATION_PRINT(File, *(Loc)<%= output.user_args %>)
675
+
676
+ # elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
677
+
678
+ /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
679
+
680
+ YY_ATTRIBUTE_UNUSED
681
+ static int
682
+ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
683
+ {
684
+ int res = 0;
685
+ int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
686
+ if (0 <= yylocp->first_line)
687
+ {
688
+ res += YYFPRINTF (yyo, "%d", yylocp->first_line);
689
+ if (0 <= yylocp->first_column)
690
+ res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
691
+ }
692
+ if (0 <= yylocp->last_line)
693
+ {
694
+ if (yylocp->first_line < yylocp->last_line)
695
+ {
696
+ res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
697
+ if (0 <= end_col)
698
+ res += YYFPRINTF (yyo, ".%d", end_col);
699
+ }
700
+ else if (0 <= end_col && yylocp->first_column < end_col)
701
+ res += YYFPRINTF (yyo, "-%d", end_col);
702
+ }
703
+ return res;
704
+ }
705
+
706
+ # define YYLOCATION_PRINT yy_location_print_
707
+
708
+ /* Temporary convenience wrapper in case some people defined the
709
+ undocumented and private YY_LOCATION_PRINT macros. */
710
+ # define YY_LOCATION_PRINT(File, Loc<%= output.user_args %>) YYLOCATION_PRINT(File, &(Loc)<%= output.user_args %>)
711
+
712
+ # else
713
+
714
+ # define YYLOCATION_PRINT(File, Loc<%= output.user_args %>) ((void) 0)
715
+ /* Temporary convenience wrapper in case some people defined the
716
+ undocumented and private YY_LOCATION_PRINT macros. */
717
+ # define YY_LOCATION_PRINT YYLOCATION_PRINT
718
+
719
+ # endif
720
+ # endif /* !defined YYLOCATION_PRINT */
721
+
722
+
723
+ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location<%= output.user_args %>) \
724
+ do { \
725
+ if (yydebug) \
726
+ { \
727
+ YYFPRINTF (stderr, "%s ", Title); \
728
+ yy_symbol_print (stderr, \
729
+ Kind, Value, Location<%= output.user_args %>); \
730
+ YYFPRINTF (stderr, "\n"); \
731
+ } \
732
+ } while (0)
733
+
734
+
735
+ <%# b4_yy_symbol_print_define -%>
736
+ /*-----------------------------------.
737
+ | Print this symbol's value on YYO. |
738
+ `-----------------------------------*/
739
+
740
+ static void
741
+ yy_symbol_value_print (FILE *yyo,
742
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp<%= output.user_formals %>)
743
+ {
744
+ FILE *yyoutput = yyo;
745
+ <%= output.parse_param_use("yyoutput", "yylocationp") %>
746
+ if (!yyvaluep)
747
+ return;
748
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
749
+ <%# b4_symbol_actions(printer) -%>
750
+ switch (yykind)
751
+ {
752
+ <%= output.symbol_actions_for_printer -%>
753
+ default:
754
+ break;
755
+ }
756
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
757
+ }
758
+
759
+
760
+ /*---------------------------.
761
+ | Print this symbol on YYO. |
762
+ `---------------------------*/
763
+
764
+ static void
765
+ yy_symbol_print (FILE *yyo,
766
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp<%= output.user_formals %>)
767
+ {
768
+ YYFPRINTF (yyo, "%s %s (",
769
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
770
+
771
+ YYLOCATION_PRINT (yyo, yylocationp<%= output.user_args %>);
772
+ YYFPRINTF (yyo, ": ");
773
+ yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp<%= output.user_args %>);
774
+ YYFPRINTF (yyo, ")");
775
+ }
776
+
777
+ /*------------------------------------------------------------------.
778
+ | yy_stack_print -- Print the state stack from its BOTTOM up to its |
779
+ | TOP (included). |
780
+ `------------------------------------------------------------------*/
781
+
782
+ static void
783
+ yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop<%= output.user_formals %>)
784
+ {
785
+ YYFPRINTF (stderr, "Stack now");
786
+ for (; yybottom <= yytop; yybottom++)
787
+ {
788
+ int yybot = *yybottom;
789
+ YYFPRINTF (stderr, " %d", yybot);
790
+ }
791
+ YYFPRINTF (stderr, "\n");
792
+ }
793
+
794
+ # define YY_STACK_PRINT(Bottom, Top<%= output.user_args %>) \
795
+ do { \
796
+ if (yydebug) \
797
+ yy_stack_print ((Bottom), (Top)<%= output.user_args %>); \
798
+ } while (0)
799
+
800
+
801
+ /*------------------------------------------------.
802
+ | Report that the YYRULE is going to be reduced. |
803
+ `------------------------------------------------*/
804
+
805
+ static void
806
+ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
807
+ int yyrule<%= output.user_formals %>)
808
+ {
809
+ int yylno = yyrline[yyrule];
810
+ int yynrhs = yyr2[yyrule];
811
+ int yyi;
812
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
813
+ yyrule - 1, yylno);
814
+ /* The symbols being reduced. */
815
+ for (yyi = 0; yyi < yynrhs; yyi++)
816
+ {
817
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
818
+ yy_symbol_print (stderr,
819
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
820
+ &yyvsp[(yyi + 1) - (yynrhs)],
821
+ &(yylsp[(yyi + 1) - (yynrhs)])<%= output.user_args %>);
822
+ YYFPRINTF (stderr, "\n");
823
+ }
824
+ }
825
+
826
+ # define YY_REDUCE_PRINT(Rule<%= output.user_args %>) \
827
+ do { \
828
+ if (yydebug) \
829
+ yy_reduce_print (yyssp, yyvsp, yylsp, Rule<%= output.user_args %>); \
830
+ } while (0)
831
+
832
+ /* Nonzero means print parse trace. It is left uninitialized so that
833
+ multiple parsers can coexist. */
834
+ #ifndef yydebug
835
+ int yydebug;
836
+ #endif
837
+ #else /* !YYDEBUG */
838
+ # define YYDPRINTF(Args) ((void) 0)
839
+ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location<%= output.user_args %>)
840
+ # define YY_STACK_PRINT(Bottom, Top<%= output.user_args %>)
841
+ # define YY_REDUCE_PRINT(Rule<%= output.user_args %>)
842
+ #endif /* !YYDEBUG */
843
+
844
+
845
+ /* YYINITDEPTH -- initial size of the parser's stacks. */
846
+ #ifndef YYINITDEPTH
847
+ # define YYINITDEPTH 200
848
+ #endif
849
+
850
+ /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
851
+ if the built-in stack extension method is used).
852
+
853
+ Do not make this value too large; the results are undefined if
854
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
855
+ evaluated with infinite-precision integer arithmetic. */
856
+
857
+ #ifndef YYMAXDEPTH
858
+ # define YYMAXDEPTH 10000
859
+ #endif
860
+
861
+
862
+ /* Context of a parse error. */
863
+ typedef struct
864
+ {
865
+ yy_state_t *yyssp;
866
+ yysymbol_kind_t yytoken;
867
+ YYLTYPE *yylloc;
868
+ } yypcontext_t;
869
+
870
+ /* Put in YYARG at most YYARGN of the expected tokens given the
871
+ current YYCTX, and return the number of tokens stored in YYARG. If
872
+ YYARG is null, return the number of expected tokens (guaranteed to
873
+ be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
874
+ Return 0 if there are more than YYARGN expected tokens, yet fill
875
+ YYARG up to YYARGN. */
876
+ static int
877
+ yypcontext_expected_tokens (const yypcontext_t *yyctx,
878
+ yysymbol_kind_t yyarg[], int yyargn)
879
+ {
880
+ /* Actual size of YYARG. */
881
+ int yycount = 0;
882
+ int yyn = yypact[+*yyctx->yyssp];
883
+ if (!yypact_value_is_default (yyn))
884
+ {
885
+ /* Start YYX at -YYN if negative to avoid negative indexes in
886
+ YYCHECK. In other words, skip the first -YYN actions for
887
+ this state because they are default actions. */
888
+ int yyxbegin = yyn < 0 ? -yyn : 0;
889
+ /* Stay within bounds of both yycheck and yytname. */
890
+ int yychecklim = YYLAST - yyn + 1;
891
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
892
+ int yyx;
893
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
894
+ if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
895
+ && !yytable_value_is_error (yytable[yyx + yyn]))
896
+ {
897
+ if (!yyarg)
898
+ ++yycount;
899
+ else if (yycount == yyargn)
900
+ return 0;
901
+ else
902
+ yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
903
+ }
904
+ }
905
+ if (yyarg && yycount == 0 && 0 < yyargn)
906
+ yyarg[0] = YYSYMBOL_YYEMPTY;
907
+ return yycount;
908
+ }
909
+
910
+
911
+
912
+
913
+ #ifndef yystrlen
914
+ # if defined __GLIBC__ && defined _STRING_H
915
+ # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
916
+ # else
917
+ /* Return the length of YYSTR. */
918
+ static YYPTRDIFF_T
919
+ yystrlen (const char *yystr)
920
+ {
921
+ YYPTRDIFF_T yylen;
922
+ for (yylen = 0; yystr[yylen]; yylen++)
923
+ continue;
924
+ return yylen;
925
+ }
926
+ # endif
927
+ #endif
928
+
929
+ #ifndef yystpcpy
930
+ # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
931
+ # define yystpcpy stpcpy
932
+ # else
933
+ /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
934
+ YYDEST. */
935
+ static char *
936
+ yystpcpy (char *yydest, const char *yysrc)
937
+ {
938
+ char *yyd = yydest;
939
+ const char *yys = yysrc;
940
+
941
+ while ((*yyd++ = *yys++) != '\0')
942
+ continue;
943
+
944
+ return yyd - 1;
945
+ }
946
+ # endif
947
+ #endif
948
+
949
+ #ifndef yytnamerr
950
+ /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
951
+ quotes and backslashes, so that it's suitable for yyerror. The
952
+ heuristic is that double-quoting is unnecessary unless the string
953
+ contains an apostrophe, a comma, or backslash (other than
954
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
955
+ null, do not copy; instead, return the length of what the result
956
+ would have been. */
957
+ static YYPTRDIFF_T
958
+ yytnamerr (char *yyres, const char *yystr)
959
+ {
960
+ if (*yystr == '"')
961
+ {
962
+ YYPTRDIFF_T yyn = 0;
963
+ char const *yyp = yystr;
964
+ for (;;)
965
+ switch (*++yyp)
966
+ {
967
+ case '\'':
968
+ case ',':
969
+ goto do_not_strip_quotes;
970
+
971
+ case '\\':
972
+ if (*++yyp != '\\')
973
+ goto do_not_strip_quotes;
974
+ else
975
+ goto append;
976
+
977
+ append:
978
+ default:
979
+ if (yyres)
980
+ yyres[yyn] = *yyp;
981
+ yyn++;
982
+ break;
983
+
984
+ case '"':
985
+ if (yyres)
986
+ yyres[yyn] = '\0';
987
+ return yyn;
988
+ }
989
+ do_not_strip_quotes: ;
990
+ }
991
+
992
+ if (yyres)
993
+ return yystpcpy (yyres, yystr) - yyres;
994
+ else
995
+ return yystrlen (yystr);
996
+ }
997
+ #endif
998
+
999
+
1000
+ static int
1001
+ yy_syntax_error_arguments (const yypcontext_t *yyctx,
1002
+ yysymbol_kind_t yyarg[], int yyargn)
1003
+ {
1004
+ /* Actual size of YYARG. */
1005
+ int yycount = 0;
1006
+ /* There are many possibilities here to consider:
1007
+ - If this state is a consistent state with a default action, then
1008
+ the only way this function was invoked is if the default action
1009
+ is an error action. In that case, don't check for expected
1010
+ tokens because there are none.
1011
+ - The only way there can be no lookahead present (in yychar) is if
1012
+ this state is a consistent state with a default action. Thus,
1013
+ detecting the absence of a lookahead is sufficient to determine
1014
+ that there is no unexpected or expected token to report. In that
1015
+ case, just report a simple "syntax error".
1016
+ - Don't assume there isn't a lookahead just because this state is a
1017
+ consistent state with a default action. There might have been a
1018
+ previous inconsistent state, consistent state with a non-default
1019
+ action, or user semantic action that manipulated yychar.
1020
+ - Of course, the expected token list depends on states to have
1021
+ correct lookahead information, and it depends on the parser not
1022
+ to perform extra reductions after fetching a lookahead from the
1023
+ scanner and before detecting a syntax error. Thus, state merging
1024
+ (from LALR or IELR) and default reductions corrupt the expected
1025
+ token list. However, the list is correct for canonical LR with
1026
+ one exception: it will still contain any token that will not be
1027
+ accepted due to an error action in a later state.
1028
+ */
1029
+ if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1030
+ {
1031
+ int yyn;
1032
+ if (yyarg)
1033
+ yyarg[yycount] = yyctx->yytoken;
1034
+ ++yycount;
1035
+ yyn = yypcontext_expected_tokens (yyctx,
1036
+ yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1037
+ if (yyn == YYENOMEM)
1038
+ return YYENOMEM;
1039
+ else
1040
+ yycount += yyn;
1041
+ }
1042
+ return yycount;
1043
+ }
1044
+
1045
+ /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1046
+ about the unexpected token YYTOKEN for the state stack whose top is
1047
+ YYSSP.
1048
+
1049
+ Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1050
+ not large enough to hold the message. In that case, also set
1051
+ *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1052
+ required number of bytes is too large to store. */
1053
+ static int
1054
+ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1055
+ const yypcontext_t *yyctx<%= output.user_formals %>)
1056
+ {
1057
+ enum { YYARGS_MAX = 5 };
1058
+ /* Internationalized format string. */
1059
+ const char *yyformat = YY_NULLPTR;
1060
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
1061
+ one per "expected"). */
1062
+ yysymbol_kind_t yyarg[YYARGS_MAX];
1063
+ /* Cumulated lengths of YYARG. */
1064
+ YYPTRDIFF_T yysize = 0;
1065
+
1066
+ /* Actual size of YYARG. */
1067
+ int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1068
+ if (yycount == YYENOMEM)
1069
+ return YYENOMEM;
1070
+
1071
+ switch (yycount)
1072
+ {
1073
+ #define YYCASE_(N, S) \
1074
+ case N: \
1075
+ yyformat = S; \
1076
+ break
1077
+ default: /* Avoid compiler warnings. */
1078
+ YYCASE_(0, YY_("syntax error"));
1079
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
1080
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1081
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1082
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1083
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1084
+ #undef YYCASE_
1085
+ }
1086
+
1087
+ /* Compute error message size. Don't count the "%s"s, but reserve
1088
+ room for the terminator. */
1089
+ yysize = yystrlen (yyformat) - 2 * yycount + 1;
1090
+ {
1091
+ int yyi;
1092
+ for (yyi = 0; yyi < yycount; ++yyi)
1093
+ {
1094
+ YYPTRDIFF_T yysize1
1095
+ = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1096
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1097
+ yysize = yysize1;
1098
+ else
1099
+ return YYENOMEM;
1100
+ }
1101
+ }
1102
+
1103
+ if (*yymsg_alloc < yysize)
1104
+ {
1105
+ *yymsg_alloc = 2 * yysize;
1106
+ if (! (yysize <= *yymsg_alloc
1107
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1108
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1109
+ return -1;
1110
+ }
1111
+
1112
+ /* Avoid sprintf, as that infringes on the user's name space.
1113
+ Don't have undefined behavior even if the translation
1114
+ produced a string with the wrong number of "%s"s. */
1115
+ {
1116
+ char *yyp = *yymsg;
1117
+ int yyi = 0;
1118
+ while ((*yyp = *yyformat) != '\0')
1119
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1120
+ {
1121
+ yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1122
+ yyformat += 2;
1123
+ }
1124
+ else
1125
+ {
1126
+ ++yyp;
1127
+ ++yyformat;
1128
+ }
1129
+ }
1130
+ return 0;
1131
+ }
1132
+
1133
+ <%# b4_yydestruct_define %>
1134
+ /*-----------------------------------------------.
1135
+ | Release the memory associated to this symbol. |
1136
+ `-----------------------------------------------*/
1137
+
1138
+ static void
1139
+ yydestruct (const char *yymsg,
1140
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp<%= output.user_formals %>)
1141
+ {
1142
+ <%= output.parse_param_use("yyvaluep", "yylocationp") %>
1143
+ if (!yymsg)
1144
+ yymsg = "Deleting";
1145
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp<%= output.user_args %>);
1146
+
1147
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1148
+ switch (yykind)
1149
+ {
1150
+ <%= output.symbol_actions_for_destructor -%>
1151
+ default:
1152
+ break;
1153
+ }
1154
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1155
+ }
1156
+
1157
+
1158
+
1159
+ <%- if output.error_recovery -%>
1160
+ #ifndef YYMAXREPAIR
1161
+ # define YYMAXREPAIR(<%= output.parse_param_name %>) (3)
1162
+ #endif
1163
+
1164
+ #ifndef YYERROR_RECOVERY_ENABLED
1165
+ # define YYERROR_RECOVERY_ENABLED(<%= output.parse_param_name %>) (1)
1166
+ #endif
1167
+
1168
+ enum yy_repair_type {
1169
+ inserting,
1170
+ deleting,
1171
+ shifting,
1172
+ };
1173
+
1174
+ struct yy_repair {
1175
+ enum yy_repair_type type;
1176
+ yysymbol_kind_t term;
1177
+ };
1178
+ typedef struct yy_repair yy_repair;
1179
+
1180
+ struct yy_repairs {
1181
+ /* For debug */
1182
+ int id;
1183
+ /* For breadth-first traversing */
1184
+ struct yy_repairs *next;
1185
+ YYPTRDIFF_T stack_length;
1186
+ /* Bottom of states */
1187
+ yy_state_t *states;
1188
+ /* Top of states */
1189
+ yy_state_t *state;
1190
+ /* repair length */
1191
+ int repair_length;
1192
+ /* */
1193
+ struct yy_repairs *prev_repair;
1194
+ struct yy_repair repair;
1195
+ };
1196
+ typedef struct yy_repairs yy_repairs;
1197
+
1198
+ struct yy_term {
1199
+ yysymbol_kind_t kind;
1200
+ YYSTYPE value;
1201
+ YYLTYPE location;
1202
+ };
1203
+ typedef struct yy_term yy_term;
1204
+
1205
+ struct yy_repair_terms {
1206
+ int id;
1207
+ int length;
1208
+ yy_term terms[];
1209
+ };
1210
+ typedef struct yy_repair_terms yy_repair_terms;
1211
+
1212
+ static void
1213
+ yy_error_token_initialize (yysymbol_kind_t yykind, YYSTYPE * const yyvaluep, YYLTYPE * const yylocationp<%= output.user_formals %>)
1214
+ {
1215
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1216
+ switch (yykind)
1217
+ {
1218
+ <%= output.symbol_actions_for_error_token -%>
1219
+ default:
1220
+ break;
1221
+ }
1222
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1223
+ }
1224
+
1225
+ static yy_repair_terms *
1226
+ yy_create_repair_terms(yy_repairs *reps<%= output.user_formals %>)
1227
+ {
1228
+ yy_repairs *r = reps;
1229
+ yy_repair_terms *rep_terms;
1230
+ int count = 0;
1231
+
1232
+ while (r->prev_repair)
1233
+ {
1234
+ count++;
1235
+ r = r->prev_repair;
1236
+ }
1237
+
1238
+ rep_terms = (yy_repair_terms *) YYMALLOC (sizeof (yy_repair_terms) + sizeof (yy_term) * count);
1239
+ rep_terms->id = reps->id;
1240
+ rep_terms->length = count;
1241
+
1242
+ r = reps;
1243
+ while (r->prev_repair)
1244
+ {
1245
+ rep_terms->terms[count-1].kind = r->repair.term;
1246
+ count--;
1247
+ r = r->prev_repair;
1248
+ }
1249
+
1250
+ return rep_terms;
1251
+ }
1252
+
1253
+ static void
1254
+ yy_print_repairs(yy_repairs *reps<%= output.user_formals %>)
1255
+ {
1256
+ yy_repairs *r = reps;
1257
+
1258
+ YYDPRINTF ((stderr,
1259
+ "id: %d, repair_length: %d, repair_state: %d, prev_repair_id: %d\n",
1260
+ reps->id, reps->repair_length, *reps->state, reps->prev_repair->id));
1261
+
1262
+ while (r->prev_repair)
1263
+ {
1264
+ YYDPRINTF ((stderr, "%s ", yysymbol_name (r->repair.term)));
1265
+ r = r->prev_repair;
1266
+ }
1267
+
1268
+ YYDPRINTF ((stderr, "\n"));
1269
+ }
1270
+
1271
+ static void
1272
+ yy_print_repair_terms(yy_repair_terms *rep_terms<%= output.user_formals %>)
1273
+ {
1274
+ for (int i = 0; i < rep_terms->length; i++)
1275
+ YYDPRINTF ((stderr, "%s ", yysymbol_name (rep_terms->terms[i].kind)));
1276
+
1277
+ YYDPRINTF ((stderr, "\n"));
1278
+ }
1279
+
1280
+ static void
1281
+ yy_free_repairs(yy_repairs *reps<%= output.user_formals %>)
1282
+ {
1283
+ while (reps)
1284
+ {
1285
+ yy_repairs *r = reps;
1286
+ reps = reps->next;
1287
+ YYFREE (r->states);
1288
+ YYFREE (r);
1289
+ }
1290
+ }
1291
+
1292
+ static int
1293
+ yy_process_repairs(yy_repairs *reps, yysymbol_kind_t token)
1294
+ {
1295
+ int yyn;
1296
+ int yystate = *reps->state;
1297
+ int yylen = 0;
1298
+ yysymbol_kind_t yytoken = token;
1299
+
1300
+ goto yyrecover_backup;
1301
+
1302
+ yyrecover_newstate:
1303
+ // TODO: check reps->stack_length
1304
+ reps->state += 1;
1305
+ *reps->state = (yy_state_t) yystate;
1306
+
1307
+
1308
+ yyrecover_backup:
1309
+ yyn = yypact[yystate];
1310
+ if (yypact_value_is_default (yyn))
1311
+ goto yyrecover_default;
1312
+
1313
+ /* "Reading a token" */
1314
+ if (yytoken == YYSYMBOL_YYEMPTY)
1315
+ return 1;
1316
+
1317
+ yyn += yytoken;
1318
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1319
+ goto yyrecover_default;
1320
+ yyn = yytable[yyn];
1321
+ if (yyn <= 0)
1322
+ {
1323
+ if (yytable_value_is_error (yyn))
1324
+ goto yyrecover_errlab;
1325
+ yyn = -yyn;
1326
+ goto yyrecover_reduce;
1327
+ }
1328
+
1329
+ /* shift */
1330
+ yystate = yyn;
1331
+ yytoken = YYSYMBOL_YYEMPTY;
1332
+ goto yyrecover_newstate;
1333
+
1334
+
1335
+ yyrecover_default:
1336
+ yyn = yydefact[yystate];
1337
+ if (yyn == 0)
1338
+ goto yyrecover_errlab;
1339
+ goto yyrecover_reduce;
1340
+
1341
+
1342
+ yyrecover_reduce:
1343
+ yylen = yyr2[yyn];
1344
+ /* YYPOPSTACK */
1345
+ reps->state -= yylen;
1346
+ yylen = 0;
1347
+
1348
+ {
1349
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
1350
+ const int yyi = yypgoto[yylhs] + *reps->state;
1351
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *reps->state
1352
+ ? yytable[yyi]
1353
+ : yydefgoto[yylhs]);
1354
+ }
1355
+
1356
+ goto yyrecover_newstate;
1357
+
1358
+ yyrecover_errlab:
1359
+ return 0;
1360
+ }
1361
+
1362
+ static yy_repair_terms *
1363
+ yyrecover(yy_state_t *yyss, yy_state_t *yyssp, int yychar<%= output.user_formals %>)
1364
+ {
1365
+ yysymbol_kind_t yytoken = YYTRANSLATE (yychar);
1366
+ yy_repair_terms *rep_terms = YY_NULLPTR;
1367
+ int count = 0;
1368
+
1369
+ yy_repairs *head = (yy_repairs *) YYMALLOC (sizeof (yy_repairs));
1370
+ yy_repairs *current = head;
1371
+ yy_repairs *tail = head;
1372
+ YYPTRDIFF_T stack_length = yyssp - yyss + 1;
1373
+
1374
+ head->id = count;
1375
+ head->next = 0;
1376
+ head->stack_length = stack_length;
1377
+ head->states = (yy_state_t *) YYMALLOC (sizeof (yy_state_t) * (stack_length));
1378
+ head->state = head->states + (yyssp - yyss);
1379
+ YYCOPY (head->states, yyss, stack_length);
1380
+ head->repair_length = 0;
1381
+ head->prev_repair = 0;
1382
+
1383
+ stack_length = (stack_length * 2 > 100) ? (stack_length * 2) : 100;
1384
+ count++;
1385
+
1386
+ while (current)
1387
+ {
1388
+ int yystate = *current->state;
1389
+ int yyn = yypact[yystate];
1390
+ /* See also: yypcontext_expected_tokens */
1391
+ if (!yypact_value_is_default (yyn))
1392
+ {
1393
+ int yyxbegin = yyn < 0 ? -yyn : 0;
1394
+ int yychecklim = YYLAST - yyn + 1;
1395
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1396
+ int yyx;
1397
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1398
+ {
1399
+ if (yyx != YYSYMBOL_YYerror)
1400
+ {
1401
+ if (current->repair_length + 1 > YYMAXREPAIR(<%= output.parse_param_name %>))
1402
+ continue;
1403
+
1404
+ yy_repairs *reps = (yy_repairs *) YYMALLOC (sizeof (yy_repairs));
1405
+ reps->id = count;
1406
+ reps->next = 0;
1407
+ reps->stack_length = stack_length;
1408
+ reps->states = (yy_state_t *) YYMALLOC (sizeof (yy_state_t) * (stack_length));
1409
+ reps->state = reps->states + (current->state - current->states);
1410
+ YYCOPY (reps->states, current->states, current->state - current->states + 1);
1411
+ reps->repair_length = current->repair_length + 1;
1412
+ reps->prev_repair = current;
1413
+ reps->repair.type = inserting;
1414
+ reps->repair.term = (yysymbol_kind_t) yyx;
1415
+
1416
+ /* Process PDA assuming next token is yyx */
1417
+ if (! yy_process_repairs (reps, (yysymbol_kind_t)yyx))
1418
+ {
1419
+ YYFREE (reps);
1420
+ continue;
1421
+ }
1422
+
1423
+ tail->next = reps;
1424
+ tail = reps;
1425
+ count++;
1426
+
1427
+ if (yyx == yytoken)
1428
+ {
1429
+ rep_terms = yy_create_repair_terms (current<%= output.user_args %>);
1430
+ YYDPRINTF ((stderr, "repair_terms found. id: %d, length: %d\n", rep_terms->id, rep_terms->length));
1431
+ yy_print_repairs (current<%= output.user_args %>);
1432
+ yy_print_repair_terms (rep_terms<%= output.user_args %>);
1433
+
1434
+ goto done;
1435
+ }
1436
+
1437
+ YYDPRINTF ((stderr,
1438
+ "New repairs is enqueued. count: %d, yystate: %d, yyx: %d\n",
1439
+ count, yystate, yyx));
1440
+ yy_print_repairs (reps<%= output.user_args %>);
1441
+ }
1442
+ }
1443
+ }
1444
+
1445
+ current = current->next;
1446
+ }
1447
+
1448
+ done:
1449
+
1450
+ yy_free_repairs(head<%= output.user_args %>);
1451
+
1452
+ if (!rep_terms)
1453
+ {
1454
+ YYDPRINTF ((stderr, "repair_terms not found\n"));
1455
+ }
1456
+
1457
+ return rep_terms;
1458
+ }
1459
+ <%- end -%>
1460
+
1461
+
1462
+
1463
+ /*----------.
1464
+ | yyparse. |
1465
+ `----------*/
1466
+
1467
+ int
1468
+ yyparse (<%= output.parse_param %>)
1469
+ {
1470
+ <%# b4_declare_scanner_communication_variables -%>
1471
+ /* Lookahead token kind. */
1472
+ int yychar;
1473
+
1474
+
1475
+ /* The semantic value of the lookahead symbol. */
1476
+ /* Default value used for initialization, for pacifying older GCCs
1477
+ or non-GCC compilers. */
1478
+ #ifdef __cplusplus
1479
+ static const YYSTYPE yyval_default = {};
1480
+ (void) yyval_default;
1481
+ #else
1482
+ YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
1483
+ #endif
1484
+ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1485
+
1486
+ /* Location data for the lookahead symbol. */
1487
+ static const YYLTYPE yyloc_default
1488
+ # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1489
+ = { 1, 1, 1, 1 }
1490
+ # endif
1491
+ ;
1492
+ YYLTYPE yylloc = yyloc_default;
1493
+
1494
+ <%# b4_declare_parser_state_variables -%>
1495
+ /* Number of syntax errors so far. */
1496
+ int yynerrs = 0;
1497
+ YY_USE (yynerrs); /* Silence compiler warning. */
1498
+
1499
+ yy_state_fast_t yystate = 0;
1500
+ /* Number of tokens to shift before error messages enabled. */
1501
+ int yyerrstatus = 0;
1502
+
1503
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
1504
+ to reallocate them elsewhere. */
1505
+
1506
+ /* Their size. */
1507
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
1508
+
1509
+ /* The state stack: array, bottom, top. */
1510
+ yy_state_t yyssa[YYINITDEPTH];
1511
+ yy_state_t *yyss = yyssa;
1512
+ yy_state_t *yyssp = yyss;
1513
+
1514
+ /* The semantic value stack: array, bottom, top. */
1515
+ YYSTYPE yyvsa[YYINITDEPTH];
1516
+ YYSTYPE *yyvs = yyvsa;
1517
+ YYSTYPE *yyvsp = yyvs;
1518
+
1519
+ /* The location stack: array, bottom, top. */
1520
+ YYLTYPE yylsa[YYINITDEPTH];
1521
+ YYLTYPE *yyls = yylsa;
1522
+ YYLTYPE *yylsp = yyls;
1523
+
1524
+ int yyn;
1525
+ /* The return value of yyparse. */
1526
+ int yyresult;
1527
+ /* Lookahead symbol kind. */
1528
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1529
+ /* The variables used to return semantic value and location from the
1530
+ action routines. */
1531
+ YYSTYPE yyval;
1532
+ YYLTYPE yyloc;
1533
+
1534
+ /* The locations where the error started and ended. */
1535
+ YYLTYPE yyerror_range[3];
1536
+ <%- if output.error_recovery -%>
1537
+ yy_repair_terms *rep_terms = 0;
1538
+ yy_term term_backup;
1539
+ int rep_terms_index;
1540
+ int yychar_backup;
1541
+ <%- end -%>
1542
+
1543
+ /* Buffer for error messages, and its allocated size. */
1544
+ char yymsgbuf[128];
1545
+ char *yymsg = yymsgbuf;
1546
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1547
+
1548
+ #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1549
+
1550
+ /* The number of symbols on the RHS of the reduced rule.
1551
+ Keep to zero when no symbol should be popped. */
1552
+ int yylen = 0;
1553
+
1554
+ YYDPRINTF ((stderr, "Starting parse\n"));
1555
+
1556
+ yychar = YYEMPTY; /* Cause a token to be read. */
1557
+
1558
+
1559
+ <%# b4_user_initial_action -%>
1560
+ <%= output.user_initial_action("/* User initialization code. */") %>
1561
+ #line [@oline@] [@ofile@]
1562
+
1563
+ yylsp[0] = yylloc;
1564
+ goto yysetstate;
1565
+
1566
+
1567
+ /*------------------------------------------------------------.
1568
+ | yynewstate -- push a new state, which is found in yystate. |
1569
+ `------------------------------------------------------------*/
1570
+ yynewstate:
1571
+ /* In all cases, when you get here, the value and location stacks
1572
+ have just been pushed. So pushing a state here evens the stacks. */
1573
+ yyssp++;
1574
+
1575
+
1576
+ /*--------------------------------------------------------------------.
1577
+ | yysetstate -- set current state (the top of the stack) to yystate. |
1578
+ `--------------------------------------------------------------------*/
1579
+ yysetstate:
1580
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1581
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1582
+ YY_IGNORE_USELESS_CAST_BEGIN
1583
+ *yyssp = YY_CAST (yy_state_t, yystate);
1584
+ YY_IGNORE_USELESS_CAST_END
1585
+ YY_STACK_PRINT (yyss, yyssp<%= output.user_args %>);
1586
+
1587
+ if (yyss + yystacksize - 1 <= yyssp)
1588
+ #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1589
+ YYNOMEM;
1590
+ #else
1591
+ {
1592
+ /* Get the current used size of the three stacks, in elements. */
1593
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
1594
+
1595
+ # if defined yyoverflow
1596
+ {
1597
+ /* Give user a chance to reallocate the stack. Use copies of
1598
+ these so that the &'s don't force the real ones into
1599
+ memory. */
1600
+ yy_state_t *yyss1 = yyss;
1601
+ YYSTYPE *yyvs1 = yyvs;
1602
+ YYLTYPE *yyls1 = yyls;
1603
+
1604
+ /* Each stack pointer address is followed by the size of the
1605
+ data in use in that stack, in bytes. This used to be a
1606
+ conditional around just the two extra args, but that might
1607
+ be undefined if yyoverflow is a macro. */
1608
+ yyoverflow (YY_("memory exhausted"),
1609
+ &yyss1, yysize * YYSIZEOF (*yyssp),
1610
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
1611
+ &yyls1, yysize * YYSIZEOF (*yylsp),
1612
+ &yystacksize);
1613
+ yyss = yyss1;
1614
+ yyvs = yyvs1;
1615
+ yyls = yyls1;
1616
+ }
1617
+ # else /* defined YYSTACK_RELOCATE */
1618
+ /* Extend the stack our own way. */
1619
+ if (YYMAXDEPTH <= yystacksize)
1620
+ YYNOMEM;
1621
+ yystacksize *= 2;
1622
+ if (YYMAXDEPTH < yystacksize)
1623
+ yystacksize = YYMAXDEPTH;
1624
+
1625
+ {
1626
+ yy_state_t *yyss1 = yyss;
1627
+ union yyalloc *yyptr =
1628
+ YY_CAST (union yyalloc *,
1629
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1630
+ if (! yyptr)
1631
+ YYNOMEM;
1632
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
1633
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1634
+ YYSTACK_RELOCATE (yyls_alloc, yyls);
1635
+ # undef YYSTACK_RELOCATE
1636
+ if (yyss1 != yyssa)
1637
+ YYSTACK_FREE (yyss1);
1638
+ }
1639
+ # endif
1640
+
1641
+ yyssp = yyss + yysize - 1;
1642
+ yyvsp = yyvs + yysize - 1;
1643
+ yylsp = yyls + yysize - 1;
1644
+
1645
+ YY_IGNORE_USELESS_CAST_BEGIN
1646
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1647
+ YY_CAST (long, yystacksize)));
1648
+ YY_IGNORE_USELESS_CAST_END
1649
+
1650
+ if (yyss + yystacksize - 1 <= yyssp)
1651
+ YYABORT;
1652
+ }
1653
+ #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1654
+
1655
+
1656
+ if (yystate == YYFINAL)
1657
+ YYACCEPT;
1658
+
1659
+ goto yybackup;
1660
+
1661
+
1662
+ /*-----------.
1663
+ | yybackup. |
1664
+ `-----------*/
1665
+ yybackup:
1666
+ /* Do appropriate processing given the current state. Read a
1667
+ lookahead token if we need one and don't already have one. */
1668
+
1669
+ /* First try to decide what to do without reference to lookahead token. */
1670
+ yyn = yypact[yystate];
1671
+ if (yypact_value_is_default (yyn))
1672
+ goto yydefault;
1673
+
1674
+ /* Not known => get a lookahead token if don't already have one. */
1675
+
1676
+ <%- if output.error_recovery -%>
1677
+ if (YYERROR_RECOVERY_ENABLED(<%= output.parse_param_name %>))
1678
+ {
1679
+ if (yychar == YYEMPTY && rep_terms)
1680
+ {
1681
+
1682
+ if (rep_terms_index < rep_terms->length)
1683
+ {
1684
+ YYDPRINTF ((stderr, "An error recovery token is used\n"));
1685
+ yy_term term = rep_terms->terms[rep_terms_index];
1686
+ yytoken = term.kind;
1687
+ yylval = term.value;
1688
+ yylloc = term.location;
1689
+ yychar = yytranslate_inverted[yytoken];
1690
+ YY_SYMBOL_PRINT ("Next error recovery token is", yytoken, &yylval, &yylloc<%= output.user_args %>);
1691
+ rep_terms_index++;
1692
+ }
1693
+ else
1694
+ {
1695
+ YYDPRINTF ((stderr, "Error recovery is completed\n"));
1696
+ yytoken = term_backup.kind;
1697
+ yylval = term_backup.value;
1698
+ yylloc = term_backup.location;
1699
+ yychar = yychar_backup;
1700
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc<%= output.user_args %>);
1701
+
1702
+ YYFREE (rep_terms);
1703
+ rep_terms = 0;
1704
+ yychar_backup = 0;
1705
+ }
1706
+ }
1707
+ }
1708
+ <%- end -%>
1709
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1710
+ if (yychar == YYEMPTY)
1711
+ {
1712
+ YYDPRINTF ((stderr, "Reading a token\n"));
1713
+ yychar = yylex <%= output.yylex_formals %>;
1714
+ }
1715
+
1716
+ if (yychar <= <%= output.eof_symbol.id.s_value %>)
1717
+ {
1718
+ yychar = <%= output.eof_symbol.id.s_value %>;
1719
+ yytoken = <%= output.eof_symbol.enum_name %>;
1720
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
1721
+ }
1722
+ else if (yychar == <%= output.error_symbol.id.s_value %>)
1723
+ {
1724
+ /* The scanner already issued an error message, process directly
1725
+ to error recovery. But do not keep the error token as
1726
+ lookahead, it is too special and may lead us to an endless
1727
+ loop in error recovery. */
1728
+ yychar = <%= output.undef_symbol.id.s_value %>;
1729
+ yytoken = <%= output.error_symbol.enum_name %>;
1730
+ yyerror_range[1] = yylloc;
1731
+ goto yyerrlab1;
1732
+ }
1733
+ else
1734
+ {
1735
+ yytoken = YYTRANSLATE (yychar);
1736
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc<%= output.user_args %>);
1737
+ }
1738
+
1739
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
1740
+ detect an error, take that action. */
1741
+ yyn += yytoken;
1742
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1743
+ goto yydefault;
1744
+ yyn = yytable[yyn];
1745
+ if (yyn <= 0)
1746
+ {
1747
+ if (yytable_value_is_error (yyn))
1748
+ goto yyerrlab;
1749
+ yyn = -yyn;
1750
+ goto yyreduce;
1751
+ }
1752
+
1753
+ /* Count tokens shifted since error; after three, turn off error
1754
+ status. */
1755
+ if (yyerrstatus)
1756
+ yyerrstatus--;
1757
+
1758
+ /* Shift the lookahead token. */
1759
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc<%= output.user_args %>);
1760
+ yystate = yyn;
1761
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1762
+ *++yyvsp = yylval;
1763
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1764
+ *++yylsp = yylloc;
1765
+ <%= output.after_shift_function("/* %after-shift code. */") %>
1766
+
1767
+ /* Discard the shifted token. */
1768
+ yychar = YYEMPTY;
1769
+ goto yynewstate;
1770
+
1771
+
1772
+ /*-----------------------------------------------------------.
1773
+ | yydefault -- do the default action for the current state. |
1774
+ `-----------------------------------------------------------*/
1775
+ yydefault:
1776
+ yyn = yydefact[yystate];
1777
+ if (yyn == 0)
1778
+ goto yyerrlab;
1779
+ goto yyreduce;
1780
+
1781
+
1782
+ /*-----------------------------.
1783
+ | yyreduce -- do a reduction. |
1784
+ `-----------------------------*/
1785
+ yyreduce:
1786
+ /* yyn is the number of a rule to reduce with. */
1787
+ yylen = yyr2[yyn];
1788
+
1789
+ /* If YYLEN is nonzero, implement the default value of the action:
1790
+ '$$ = $1'.
1791
+
1792
+ Otherwise, the following line sets YYVAL to garbage.
1793
+ This behavior is undocumented and Bison
1794
+ users should not rely upon it. Assigning to YYVAL
1795
+ unconditionally makes the parser a bit smaller, and it avoids a
1796
+ GCC warning that YYVAL may be used uninitialized. */
1797
+ yyval = yyvsp[1-yylen];
1798
+ <%= output.before_reduce_function("/* %before-reduce function. */") %>
1799
+
1800
+ /* Default location. */
1801
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1802
+ yyerror_range[1] = yyloc;
1803
+ YY_REDUCE_PRINT (yyn<%= output.user_args %>);
1804
+ switch (yyn)
1805
+ {
1806
+ <%= output.user_actions -%>
1807
+
1808
+ default: break;
1809
+ }
1810
+ /* User semantic actions sometimes alter yychar, and that requires
1811
+ that yytoken be updated with the new translation. We take the
1812
+ approach of translating immediately before every use of yytoken.
1813
+ One alternative is translating here after every semantic action,
1814
+ but that translation would be missed if the semantic action invokes
1815
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1816
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1817
+ incorrect destructor might then be invoked immediately. In the
1818
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
1819
+ to an incorrect destructor call or verbose syntax error message
1820
+ before the lookahead is translated. */
1821
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc<%= output.user_args %>);
1822
+
1823
+ YYPOPSTACK (yylen);
1824
+ <%= output.after_reduce_function("/* %after-reduce function. */") %>
1825
+ yylen = 0;
1826
+
1827
+ *++yyvsp = yyval;
1828
+ *++yylsp = yyloc;
1829
+
1830
+ /* Now 'shift' the result of the reduction. Determine what state
1831
+ that goes to, based on the state we popped back to and the rule
1832
+ number reduced by. */
1833
+ {
1834
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
1835
+ const int yyi = yypgoto[yylhs] + *yyssp;
1836
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1837
+ ? yytable[yyi]
1838
+ : yydefgoto[yylhs]);
1839
+ }
1840
+
1841
+ goto yynewstate;
1842
+
1843
+
1844
+ /*--------------------------------------.
1845
+ | yyerrlab -- here on detecting error. |
1846
+ `--------------------------------------*/
1847
+ yyerrlab:
1848
+ /* Make sure we have latest lookahead translation. See comments at
1849
+ user semantic actions for why this is necessary. */
1850
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1851
+ /* If not already recovering from an error, report this error. */
1852
+ if (!yyerrstatus)
1853
+ {
1854
+ ++yynerrs;
1855
+ {
1856
+ yypcontext_t yyctx
1857
+ = {yyssp, yytoken, &yylloc};
1858
+ char const *yymsgp = YY_("syntax error");
1859
+ int yysyntax_error_status;
1860
+ yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx<%= output.user_args %>);
1861
+ if (yysyntax_error_status == 0)
1862
+ yymsgp = yymsg;
1863
+ else if (yysyntax_error_status == -1)
1864
+ {
1865
+ if (yymsg != yymsgbuf)
1866
+ YYSTACK_FREE (yymsg);
1867
+ yymsg = YY_CAST (char *,
1868
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1869
+ if (yymsg)
1870
+ {
1871
+ yysyntax_error_status
1872
+ = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx<%= output.user_args %>);
1873
+ yymsgp = yymsg;
1874
+ }
1875
+ else
1876
+ {
1877
+ yymsg = yymsgbuf;
1878
+ yymsg_alloc = sizeof yymsgbuf;
1879
+ yysyntax_error_status = YYENOMEM;
1880
+ }
1881
+ }
1882
+ yyerror (<%= output.yyerror_args %>, yymsgp);
1883
+ if (yysyntax_error_status == YYENOMEM)
1884
+ YYNOMEM;
1885
+ }
1886
+ }
1887
+
1888
+ yyerror_range[1] = yylloc;
1889
+ if (yyerrstatus == 3)
1890
+ {
1891
+ /* If just tried and failed to reuse lookahead token after an
1892
+ error, discard it. */
1893
+
1894
+ if (yychar <= <%= output.eof_symbol.id.s_value %>)
1895
+ {
1896
+ /* Return failure if at end of input. */
1897
+ if (yychar == <%= output.eof_symbol.id.s_value %>)
1898
+ YYABORT;
1899
+ }
1900
+ else
1901
+ {
1902
+ yydestruct ("Error: discarding",
1903
+ yytoken, &yylval, &yylloc<%= output.user_args %>);
1904
+ yychar = YYEMPTY;
1905
+ }
1906
+ }
1907
+
1908
+ /* Else will try to reuse lookahead token after shifting the error
1909
+ token. */
1910
+ goto yyerrlab1;
1911
+
1912
+
1913
+ /*---------------------------------------------------.
1914
+ | yyerrorlab -- error raised explicitly by YYERROR. |
1915
+ `---------------------------------------------------*/
1916
+ yyerrorlab:
1917
+ /* Pacify compilers when the user code never invokes YYERROR and the
1918
+ label yyerrorlab therefore never appears in user code. */
1919
+ if (0)
1920
+ YYERROR;
1921
+ ++yynerrs;
1922
+
1923
+ /* Do not reclaim the symbols of the rule whose action triggered
1924
+ this YYERROR. */
1925
+ YYPOPSTACK (yylen);
1926
+ <%= output.after_pop_stack_function("yylen", "/* %after-pop-stack function. */") %>
1927
+ yylen = 0;
1928
+ YY_STACK_PRINT (yyss, yyssp<%= output.user_args %>);
1929
+ yystate = *yyssp;
1930
+ goto yyerrlab1;
1931
+
1932
+
1933
+ /*-------------------------------------------------------------.
1934
+ | yyerrlab1 -- common code for both syntax error and YYERROR. |
1935
+ `-------------------------------------------------------------*/
1936
+ yyerrlab1:
1937
+ <%- if output.error_recovery -%>
1938
+ if (YYERROR_RECOVERY_ENABLED(<%= output.parse_param_name %>))
1939
+ {
1940
+ rep_terms = yyrecover (yyss, yyssp, yychar<%= output.user_args %>);
1941
+ if (rep_terms)
1942
+ {
1943
+ for (int i = 0; i < rep_terms->length; i++)
1944
+ {
1945
+ yy_term *term = &rep_terms->terms[i];
1946
+ yy_error_token_initialize (term->kind, &term->value, &term->location<%= output.user_args %>);
1947
+ }
1948
+
1949
+ yychar_backup = yychar;
1950
+ /* Can be packed into (the tail of) rep_terms? */
1951
+ term_backup.kind = yytoken;
1952
+ term_backup.value = yylval;
1953
+ term_backup.location = yylloc;
1954
+ rep_terms_index = 0;
1955
+ yychar = YYEMPTY;
1956
+
1957
+ goto yybackup;
1958
+ }
1959
+ }
1960
+ <%- end -%>
1961
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
1962
+
1963
+ /* Pop stack until we find a state that shifts the error token. */
1964
+ for (;;)
1965
+ {
1966
+ yyn = yypact[yystate];
1967
+ if (!yypact_value_is_default (yyn))
1968
+ {
1969
+ yyn += YYSYMBOL_YYerror;
1970
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1971
+ {
1972
+ yyn = yytable[yyn];
1973
+ if (0 < yyn)
1974
+ break;
1975
+ }
1976
+ }
1977
+
1978
+ /* Pop the current state because it cannot handle the error token. */
1979
+ if (yyssp == yyss)
1980
+ YYABORT;
1981
+
1982
+ yyerror_range[1] = *yylsp;
1983
+ yydestruct ("Error: popping",
1984
+ YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp<%= output.user_args %>);
1985
+ YYPOPSTACK (1);
1986
+ <%= output.after_pop_stack_function(1, "/* %after-pop-stack function. */") %>
1987
+ yystate = *yyssp;
1988
+ YY_STACK_PRINT (yyss, yyssp<%= output.user_args %>);
1989
+ }
1990
+
1991
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1992
+ *++yyvsp = yylval;
1993
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1994
+
1995
+ yyerror_range[2] = yylloc;
1996
+ ++yylsp;
1997
+ YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
1998
+
1999
+ /* Shift the error token. */
2000
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp<%= output.user_args %>);
2001
+ <%= output.after_shift_error_token_function("/* %after-shift-error-token code. */") %>
2002
+
2003
+ yystate = yyn;
2004
+ goto yynewstate;
2005
+
2006
+
2007
+ /*-------------------------------------.
2008
+ | yyacceptlab -- YYACCEPT comes here. |
2009
+ `-------------------------------------*/
2010
+ yyacceptlab:
2011
+ yyresult = 0;
2012
+ goto yyreturnlab;
2013
+
2014
+
2015
+ /*-----------------------------------.
2016
+ | yyabortlab -- YYABORT comes here. |
2017
+ `-----------------------------------*/
2018
+ yyabortlab:
2019
+ yyresult = 1;
2020
+ goto yyreturnlab;
2021
+
2022
+
2023
+ /*-----------------------------------------------------------.
2024
+ | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2025
+ `-----------------------------------------------------------*/
2026
+ yyexhaustedlab:
2027
+ yyerror (<%= output.yyerror_args %>, YY_("memory exhausted"));
2028
+ yyresult = 2;
2029
+ goto yyreturnlab;
2030
+
2031
+
2032
+ /*----------------------------------------------------------.
2033
+ | yyreturnlab -- parsing is finished, clean up and return. |
2034
+ `----------------------------------------------------------*/
2035
+ yyreturnlab:
2036
+ if (yychar != YYEMPTY)
2037
+ {
2038
+ /* Make sure we have latest lookahead translation. See comments at
2039
+ user semantic actions for why this is necessary. */
2040
+ yytoken = YYTRANSLATE (yychar);
2041
+ yydestruct ("Cleanup: discarding lookahead",
2042
+ yytoken, &yylval, &yylloc<%= output.user_args %>);
2043
+ }
2044
+ /* Do not reclaim the symbols of the rule whose action triggered
2045
+ this YYABORT or YYACCEPT. */
2046
+ YYPOPSTACK (yylen);
2047
+ YY_STACK_PRINT (yyss, yyssp<%= output.user_args %>);
2048
+ while (yyssp != yyss)
2049
+ {
2050
+ yydestruct ("Cleanup: popping",
2051
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp<%= output.user_args %>);
2052
+ YYPOPSTACK (1);
2053
+ }
2054
+ #ifndef yyoverflow
2055
+ if (yyss != yyssa)
2056
+ YYSTACK_FREE (yyss);
2057
+ #endif
2058
+ if (yymsg != yymsgbuf)
2059
+ YYSTACK_FREE (yymsg);
2060
+ return yyresult;
2061
+ }
2062
+
2063
+ <%# b4_percent_code_get([[epilogue]]) -%>
2064
+ <%- if output.aux.epilogue -%>
2065
+ #line <%= output.aux.epilogue_first_lineno - 1 %> "<%= output.grammar_file_path %>"
2066
+ <%= output.aux.epilogue -%>
2067
+ <%- end -%>
2068
+