webruby 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 (1364) hide show
  1. checksums.yaml +7 -0
  2. data/bin/webruby +36 -0
  3. data/driver/driver.c +50 -0
  4. data/driver/main.c +40 -0
  5. data/lib/webruby/app.rb +13 -0
  6. data/lib/webruby/config.rb +61 -0
  7. data/lib/webruby/environment.rb +32 -0
  8. data/lib/webruby/rake/files.rake +66 -0
  9. data/lib/webruby/rake/general.rake +22 -0
  10. data/lib/webruby/rake/mruby.rake +44 -0
  11. data/lib/webruby/utility.rb +132 -0
  12. data/lib/webruby.rb +10 -0
  13. data/modules/emscripten/AUTHORS +89 -0
  14. data/modules/emscripten/LICENSE +68 -0
  15. data/modules/emscripten/README.markdown +14 -0
  16. data/modules/emscripten/cmake/Platform/Emscripten.cmake +61 -0
  17. data/modules/emscripten/cmake/Platform/Emscripten_unix.cmake +24 -0
  18. data/modules/emscripten/em++ +12 -0
  19. data/modules/emscripten/em++.bat +2 -0
  20. data/modules/emscripten/em-config +24 -0
  21. data/modules/emscripten/em-config.bat +2 -0
  22. data/modules/emscripten/emar +24 -0
  23. data/modules/emscripten/emar.bat +2 -0
  24. data/modules/emscripten/emcc +1744 -0
  25. data/modules/emscripten/emcc.bat +2 -0
  26. data/modules/emscripten/emcc.py +5 -0
  27. data/modules/emscripten/emconfigure +27 -0
  28. data/modules/emscripten/emconfigure.bat +2 -0
  29. data/modules/emscripten/emlibtool +11 -0
  30. data/modules/emscripten/emlibtool.bat +2 -0
  31. data/modules/emscripten/emlink.py +293 -0
  32. data/modules/emscripten/emmake +29 -0
  33. data/modules/emscripten/emmake.bat +2 -0
  34. data/modules/emscripten/emranlib +9 -0
  35. data/modules/emscripten/emranlib.bat +2 -0
  36. data/modules/emscripten/emscons +20 -0
  37. data/modules/emscripten/emscripten.py +835 -0
  38. data/modules/emscripten/patches/README +4 -0
  39. data/modules/emscripten/patches/series +2 -0
  40. data/modules/emscripten/scons-tools/closure.py +28 -0
  41. data/modules/emscripten/scons-tools/emscripten.py +359 -0
  42. data/modules/emscripten/scons-tools/llvm.py +33 -0
  43. data/modules/emscripten/src/analyzer.js +1695 -0
  44. data/modules/emscripten/src/compiler.html +48 -0
  45. data/modules/emscripten/src/compiler.js +298 -0
  46. data/modules/emscripten/src/corruptionCheck.js +98 -0
  47. data/modules/emscripten/src/determinstic.js +20 -0
  48. data/modules/emscripten/src/embind/embind.js +1677 -0
  49. data/modules/emscripten/src/embind/emval.js +283 -0
  50. data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +97 -0
  51. data/modules/emscripten/src/experimental/batching.diff +44 -0
  52. data/modules/emscripten/src/experimental/functypeopt.diff +113 -0
  53. data/modules/emscripten/src/experimental/multiple_heaps.diff +175 -0
  54. data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +197 -0
  55. data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +124 -0
  56. data/modules/emscripten/src/experimental/remove__label__s.diff +140 -0
  57. data/modules/emscripten/src/experimental/renderer_cache_hash.diff +99 -0
  58. data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +57 -0
  59. data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +336 -0
  60. data/modules/emscripten/src/experimental/stringCache.diff +147 -0
  61. data/modules/emscripten/src/fastLong.js +299 -0
  62. data/modules/emscripten/src/framework.js +257 -0
  63. data/modules/emscripten/src/gl-matrix.js +1952 -0
  64. data/modules/emscripten/src/headless.js +904 -0
  65. data/modules/emscripten/src/intertyper.js +1050 -0
  66. data/modules/emscripten/src/jsifier.js +1827 -0
  67. data/modules/emscripten/src/library.js +8270 -0
  68. data/modules/emscripten/src/library_browser.js +911 -0
  69. data/modules/emscripten/src/library_egl.js +491 -0
  70. data/modules/emscripten/src/library_gc.js +236 -0
  71. data/modules/emscripten/src/library_gl.js +4452 -0
  72. data/modules/emscripten/src/library_glfw.js +576 -0
  73. data/modules/emscripten/src/library_glut.js +449 -0
  74. data/modules/emscripten/src/library_jansson.js +320 -0
  75. data/modules/emscripten/src/library_openal.js +602 -0
  76. data/modules/emscripten/src/library_sdl.js +2024 -0
  77. data/modules/emscripten/src/library_strtok_r.c +97 -0
  78. data/modules/emscripten/src/library_xlib.js +23 -0
  79. data/modules/emscripten/src/long.js +1609 -0
  80. data/modules/emscripten/src/modules.js +491 -0
  81. data/modules/emscripten/src/parseTools.js +2474 -0
  82. data/modules/emscripten/src/postamble.js +170 -0
  83. data/modules/emscripten/src/postamble_sharedlib.js +16 -0
  84. data/modules/emscripten/src/preamble.js +914 -0
  85. data/modules/emscripten/src/preamble_sharedlib.js +25 -0
  86. data/modules/emscripten/src/relooper/README.markdown +14 -0
  87. data/modules/emscripten/src/relooper/Relooper.cpp +1236 -0
  88. data/modules/emscripten/src/relooper/Relooper.h +250 -0
  89. data/modules/emscripten/src/relooper/doit.sh +70 -0
  90. data/modules/emscripten/src/relooper/emscripten/glue.js +57 -0
  91. data/modules/emscripten/src/relooper/emscripten/test.js +44 -0
  92. data/modules/emscripten/src/relooper/fuzzer.py +116 -0
  93. data/modules/emscripten/src/relooper/ministring.h +35 -0
  94. data/modules/emscripten/src/relooper/paper.pdf +0 -0
  95. data/modules/emscripten/src/relooper/test.cpp +262 -0
  96. data/modules/emscripten/src/relooper/test.txt +155 -0
  97. data/modules/emscripten/src/relooper/test2.c +44 -0
  98. data/modules/emscripten/src/relooper/test2.txt +12 -0
  99. data/modules/emscripten/src/relooper/test3.c +42 -0
  100. data/modules/emscripten/src/relooper/test3.txt +27 -0
  101. data/modules/emscripten/src/relooper/test4.cpp +40 -0
  102. data/modules/emscripten/src/relooper/test4.txt +23 -0
  103. data/modules/emscripten/src/relooper/test5.cpp +40 -0
  104. data/modules/emscripten/src/relooper/test5.txt +32 -0
  105. data/modules/emscripten/src/relooper/test6.cpp +31 -0
  106. data/modules/emscripten/src/relooper/test6.txt +12 -0
  107. data/modules/emscripten/src/relooper/test_dead.cpp +28 -0
  108. data/modules/emscripten/src/relooper/test_dead.txt +9 -0
  109. data/modules/emscripten/src/relooper/test_debug.cpp +30 -0
  110. data/modules/emscripten/src/relooper/test_debug.txt +128 -0
  111. data/modules/emscripten/src/relooper/test_fuzz1.cpp +52 -0
  112. data/modules/emscripten/src/relooper/test_fuzz1.txt +32 -0
  113. data/modules/emscripten/src/relooper/test_fuzz2.cpp +34 -0
  114. data/modules/emscripten/src/relooper/test_fuzz2.txt +13 -0
  115. data/modules/emscripten/src/relooper/test_fuzz3.cpp +36 -0
  116. data/modules/emscripten/src/relooper/test_fuzz3.txt +9 -0
  117. data/modules/emscripten/src/relooper/test_fuzz4.cpp +38 -0
  118. data/modules/emscripten/src/relooper/test_fuzz4.txt +19 -0
  119. data/modules/emscripten/src/relooper/test_fuzz5.cpp +57 -0
  120. data/modules/emscripten/src/relooper/test_fuzz5.txt +52 -0
  121. data/modules/emscripten/src/relooper/test_fuzz6.cpp +322 -0
  122. data/modules/emscripten/src/relooper/test_fuzz6.txt +108 -0
  123. data/modules/emscripten/src/relooper/test_inf.cpp +813 -0
  124. data/modules/emscripten/src/relooper/test_inf.txt +385 -0
  125. data/modules/emscripten/src/relooper/testit.sh +62 -0
  126. data/modules/emscripten/src/relooper/updateit.sh +17 -0
  127. data/modules/emscripten/src/relooper.js +11516 -0
  128. data/modules/emscripten/src/relooper.js.raw.js +11511 -0
  129. data/modules/emscripten/src/runtime.js +546 -0
  130. data/modules/emscripten/src/settings.js +1284 -0
  131. data/modules/emscripten/src/shell.html +92 -0
  132. data/modules/emscripten/src/shell.js +153 -0
  133. data/modules/emscripten/src/shell_sharedlib.js +12 -0
  134. data/modules/emscripten/src/socket.io.js +3870 -0
  135. data/modules/emscripten/src/utility.js +379 -0
  136. data/modules/emscripten/src/wrtcp.js +821 -0
  137. data/modules/emscripten/system/include/AL/al.h +172 -0
  138. data/modules/emscripten/system/include/AL/alc.h +84 -0
  139. data/modules/emscripten/system/include/EGL/egl.h +329 -0
  140. data/modules/emscripten/system/include/EGL/eglext.h +398 -0
  141. data/modules/emscripten/system/include/EGL/eglplatform.h +141 -0
  142. data/modules/emscripten/system/include/GL/freeglut_std.h +628 -0
  143. data/modules/emscripten/system/include/GL/gl.h +2241 -0
  144. data/modules/emscripten/system/include/GL/glew.h +6 -0
  145. data/modules/emscripten/system/include/GL/glext.h +11127 -0
  146. data/modules/emscripten/system/include/GL/glfw.h +518 -0
  147. data/modules/emscripten/system/include/GL/glu.h +353 -0
  148. data/modules/emscripten/system/include/GL/glut.h +21 -0
  149. data/modules/emscripten/system/include/GLES/gl.h +770 -0
  150. data/modules/emscripten/system/include/GLES/glext.h +1278 -0
  151. data/modules/emscripten/system/include/GLES/glplatform.h +30 -0
  152. data/modules/emscripten/system/include/GLES2/gl2.h +621 -0
  153. data/modules/emscripten/system/include/GLES2/gl2ext.h +803 -0
  154. data/modules/emscripten/system/include/GLES2/gl2platform.h +30 -0
  155. data/modules/emscripten/system/include/KHR/khrplatform.h +277 -0
  156. data/modules/emscripten/system/include/SDL/COPYING +19 -0
  157. data/modules/emscripten/system/include/SDL/SDL.h +162 -0
  158. data/modules/emscripten/system/include/SDL/SDL_assert.h +241 -0
  159. data/modules/emscripten/system/include/SDL/SDL_atomic.h +318 -0
  160. data/modules/emscripten/system/include/SDL/SDL_audio.h +509 -0
  161. data/modules/emscripten/system/include/SDL/SDL_blendmode.h +60 -0
  162. data/modules/emscripten/system/include/SDL/SDL_clipboard.h +75 -0
  163. data/modules/emscripten/system/include/SDL/SDL_compat.h +365 -0
  164. data/modules/emscripten/system/include/SDL/SDL_config.h +48 -0
  165. data/modules/emscripten/system/include/SDL/SDL_config.h.in +297 -0
  166. data/modules/emscripten/system/include/SDL/SDL_config_android.h +133 -0
  167. data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +148 -0
  168. data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +172 -0
  169. data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +74 -0
  170. data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +129 -0
  171. data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +125 -0
  172. data/modules/emscripten/system/include/SDL/SDL_config_windows.h +207 -0
  173. data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +119 -0
  174. data/modules/emscripten/system/include/SDL/SDL_copying.h +20 -0
  175. data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +150 -0
  176. data/modules/emscripten/system/include/SDL/SDL_endian.h +248 -0
  177. data/modules/emscripten/system/include/SDL/SDL_error.h +77 -0
  178. data/modules/emscripten/system/include/SDL/SDL_events.h +639 -0
  179. data/modules/emscripten/system/include/SDL/SDL_gesture.h +91 -0
  180. data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +246 -0
  181. data/modules/emscripten/system/include/SDL/SDL_haptic.h +1200 -0
  182. data/modules/emscripten/system/include/SDL/SDL_hints.h +206 -0
  183. data/modules/emscripten/system/include/SDL/SDL_image.h +138 -0
  184. data/modules/emscripten/system/include/SDL/SDL_input.h +87 -0
  185. data/modules/emscripten/system/include/SDL/SDL_joystick.h +208 -0
  186. data/modules/emscripten/system/include/SDL/SDL_keyboard.h +169 -0
  187. data/modules/emscripten/system/include/SDL/SDL_keycode.h +344 -0
  188. data/modules/emscripten/system/include/SDL/SDL_loadso.h +85 -0
  189. data/modules/emscripten/system/include/SDL/SDL_log.h +211 -0
  190. data/modules/emscripten/system/include/SDL/SDL_main.h +98 -0
  191. data/modules/emscripten/system/include/SDL/SDL_mixer.h +634 -0
  192. data/modules/emscripten/system/include/SDL/SDL_mouse.h +213 -0
  193. data/modules/emscripten/system/include/SDL/SDL_mutex.h +248 -0
  194. data/modules/emscripten/system/include/SDL/SDL_name.h +11 -0
  195. data/modules/emscripten/system/include/SDL/SDL_opengl.h +11116 -0
  196. data/modules/emscripten/system/include/SDL/SDL_opengles.h +38 -0
  197. data/modules/emscripten/system/include/SDL/SDL_opengles2.h +38 -0
  198. data/modules/emscripten/system/include/SDL/SDL_pixels.h +423 -0
  199. data/modules/emscripten/system/include/SDL/SDL_platform.h +160 -0
  200. data/modules/emscripten/system/include/SDL/SDL_power.h +79 -0
  201. data/modules/emscripten/system/include/SDL/SDL_quit.h +58 -0
  202. data/modules/emscripten/system/include/SDL/SDL_rect.h +136 -0
  203. data/modules/emscripten/system/include/SDL/SDL_render.h +615 -0
  204. data/modules/emscripten/system/include/SDL/SDL_revision.h +2 -0
  205. data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +2 -0
  206. data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +123 -0
  207. data/modules/emscripten/system/include/SDL/SDL_rwops.h +220 -0
  208. data/modules/emscripten/system/include/SDL/SDL_scancode.h +398 -0
  209. data/modules/emscripten/system/include/SDL/SDL_shape.h +147 -0
  210. data/modules/emscripten/system/include/SDL/SDL_stdinc.h +764 -0
  211. data/modules/emscripten/system/include/SDL/SDL_surface.h +499 -0
  212. data/modules/emscripten/system/include/SDL/SDL_syswm.h +241 -0
  213. data/modules/emscripten/system/include/SDL/SDL_thread.h +182 -0
  214. data/modules/emscripten/system/include/SDL/SDL_timer.h +108 -0
  215. data/modules/emscripten/system/include/SDL/SDL_touch.h +124 -0
  216. data/modules/emscripten/system/include/SDL/SDL_ttf.h +249 -0
  217. data/modules/emscripten/system/include/SDL/SDL_types.h +29 -0
  218. data/modules/emscripten/system/include/SDL/SDL_version.h +166 -0
  219. data/modules/emscripten/system/include/SDL/SDL_video.h +820 -0
  220. data/modules/emscripten/system/include/SDL/begin_code.h +135 -0
  221. data/modules/emscripten/system/include/SDL/close_code.h +37 -0
  222. data/modules/emscripten/system/include/X11/X.h +717 -0
  223. data/modules/emscripten/system/include/X11/Xatom.h +79 -0
  224. data/modules/emscripten/system/include/X11/Xfuncproto.h +127 -0
  225. data/modules/emscripten/system/include/X11/Xlib.h +4023 -0
  226. data/modules/emscripten/system/include/X11/Xosdefs.h +116 -0
  227. data/modules/emscripten/system/include/X11/Xutil.h +826 -0
  228. data/modules/emscripten/system/include/X11/keysym.h +73 -0
  229. data/modules/emscripten/system/include/X11/keysymdef.h +2389 -0
  230. data/modules/emscripten/system/include/bsd/float.h +91 -0
  231. data/modules/emscripten/system/include/bsd/readme.txt +2 -0
  232. data/modules/emscripten/system/include/bsd/sys/mman.h +180 -0
  233. data/modules/emscripten/system/include/bsd/sys/utsname.h +70 -0
  234. data/modules/emscripten/system/include/dlfcn.h +31 -0
  235. data/modules/emscripten/system/include/emscripten/bind.h +1210 -0
  236. data/modules/emscripten/system/include/emscripten/emscripten.h +388 -0
  237. data/modules/emscripten/system/include/emscripten/val.h +311 -0
  238. data/modules/emscripten/system/include/emscripten/wire.h +393 -0
  239. data/modules/emscripten/system/include/err.h +95 -0
  240. data/modules/emscripten/system/include/execinfo.h +44 -0
  241. data/modules/emscripten/system/include/features.h +3 -0
  242. data/modules/emscripten/system/include/gc.h +70 -0
  243. data/modules/emscripten/system/include/gfx/png.h +3798 -0
  244. data/modules/emscripten/system/include/gfx/pngconf.h +1665 -0
  245. data/modules/emscripten/system/include/gfx/tiff.h +654 -0
  246. data/modules/emscripten/system/include/gfx/tiffconf.h +104 -0
  247. data/modules/emscripten/system/include/gfx/tiffio.h +526 -0
  248. data/modules/emscripten/system/include/gfx/tiffvers.h +9 -0
  249. data/modules/emscripten/system/include/jansson.h +323 -0
  250. data/modules/emscripten/system/include/jansson_config.h +54 -0
  251. data/modules/emscripten/system/include/libc/_ansi.h +135 -0
  252. data/modules/emscripten/system/include/libc/_syslist.h +40 -0
  253. data/modules/emscripten/system/include/libc/alloca.h +21 -0
  254. data/modules/emscripten/system/include/libc/ar.h +69 -0
  255. data/modules/emscripten/system/include/libc/argz.h +33 -0
  256. data/modules/emscripten/system/include/libc/assert.h +46 -0
  257. data/modules/emscripten/system/include/libc/complex.h +124 -0
  258. data/modules/emscripten/system/include/libc/ctype.h +196 -0
  259. data/modules/emscripten/system/include/libc/dirent.h +16 -0
  260. data/modules/emscripten/system/include/libc/endian.h +3 -0
  261. data/modules/emscripten/system/include/libc/envlock.h +15 -0
  262. data/modules/emscripten/system/include/libc/envz.h +16 -0
  263. data/modules/emscripten/system/include/libc/errno.h +11 -0
  264. data/modules/emscripten/system/include/libc/fastmath.h +13 -0
  265. data/modules/emscripten/system/include/libc/fcntl.h +1 -0
  266. data/modules/emscripten/system/include/libc/fnmatch.h +55 -0
  267. data/modules/emscripten/system/include/libc/getopt.h +196 -0
  268. data/modules/emscripten/system/include/libc/glob.h +89 -0
  269. data/modules/emscripten/system/include/libc/grp.h +94 -0
  270. data/modules/emscripten/system/include/libc/iconv.h +62 -0
  271. data/modules/emscripten/system/include/libc/ieeefp.h +256 -0
  272. data/modules/emscripten/system/include/libc/ifaddrs.h +64 -0
  273. data/modules/emscripten/system/include/libc/inttypes.h +290 -0
  274. data/modules/emscripten/system/include/libc/iso646.h +43 -0
  275. data/modules/emscripten/system/include/libc/langinfo.h +316 -0
  276. data/modules/emscripten/system/include/libc/libgen.h +23 -0
  277. data/modules/emscripten/system/include/libc/limits.h +155 -0
  278. data/modules/emscripten/system/include/libc/locale.h +80 -0
  279. data/modules/emscripten/system/include/libc/machine/_default_types.h +121 -0
  280. data/modules/emscripten/system/include/libc/machine/_types.h +8 -0
  281. data/modules/emscripten/system/include/libc/machine/ansi.h +1 -0
  282. data/modules/emscripten/system/include/libc/machine/endian.h +31 -0
  283. data/modules/emscripten/system/include/libc/machine/fastmath.h +100 -0
  284. data/modules/emscripten/system/include/libc/machine/ieeefp.h +376 -0
  285. data/modules/emscripten/system/include/libc/machine/malloc.h +8 -0
  286. data/modules/emscripten/system/include/libc/machine/param.h +1 -0
  287. data/modules/emscripten/system/include/libc/machine/setjmp-dj.h +43 -0
  288. data/modules/emscripten/system/include/libc/machine/setjmp.h +361 -0
  289. data/modules/emscripten/system/include/libc/machine/stdlib.h +8 -0
  290. data/modules/emscripten/system/include/libc/machine/termios.h +1 -0
  291. data/modules/emscripten/system/include/libc/machine/time.h +19 -0
  292. data/modules/emscripten/system/include/libc/machine/types.h +30 -0
  293. data/modules/emscripten/system/include/libc/malloc.h +169 -0
  294. data/modules/emscripten/system/include/libc/math.h +594 -0
  295. data/modules/emscripten/system/include/libc/newlib.h +2 -0
  296. data/modules/emscripten/system/include/libc/paths.h +7 -0
  297. data/modules/emscripten/system/include/libc/process.h +44 -0
  298. data/modules/emscripten/system/include/libc/pthread.h +362 -0
  299. data/modules/emscripten/system/include/libc/pwd.h +78 -0
  300. data/modules/emscripten/system/include/libc/readme.txt +3 -0
  301. data/modules/emscripten/system/include/libc/reent.h +183 -0
  302. data/modules/emscripten/system/include/libc/regdef.h +7 -0
  303. data/modules/emscripten/system/include/libc/regex.h +102 -0
  304. data/modules/emscripten/system/include/libc/sched.h +97 -0
  305. data/modules/emscripten/system/include/libc/search.h +59 -0
  306. data/modules/emscripten/system/include/libc/setjmp.h +20 -0
  307. data/modules/emscripten/system/include/libc/signal.h +30 -0
  308. data/modules/emscripten/system/include/libc/stdarg.h +50 -0
  309. data/modules/emscripten/system/include/libc/stddef.h +64 -0
  310. data/modules/emscripten/system/include/libc/stdint.h +493 -0
  311. data/modules/emscripten/system/include/libc/stdio.h +694 -0
  312. data/modules/emscripten/system/include/libc/stdlib.h +230 -0
  313. data/modules/emscripten/system/include/libc/string.h +105 -0
  314. data/modules/emscripten/system/include/libc/strings.h +35 -0
  315. data/modules/emscripten/system/include/libc/sys/_default_fcntl.h +223 -0
  316. data/modules/emscripten/system/include/libc/sys/_types.h +93 -0
  317. data/modules/emscripten/system/include/libc/sys/cdefs.h +123 -0
  318. data/modules/emscripten/system/include/libc/sys/config.h +255 -0
  319. data/modules/emscripten/system/include/libc/sys/custom_file.h +2 -0
  320. data/modules/emscripten/system/include/libc/sys/dir.h +10 -0
  321. data/modules/emscripten/system/include/libc/sys/dirent.h +58 -0
  322. data/modules/emscripten/system/include/libc/sys/errno.h +190 -0
  323. data/modules/emscripten/system/include/libc/sys/fcntl.h +4 -0
  324. data/modules/emscripten/system/include/libc/sys/features.h +212 -0
  325. data/modules/emscripten/system/include/libc/sys/file.h +2 -0
  326. data/modules/emscripten/system/include/libc/sys/iconvnls.h +77 -0
  327. data/modules/emscripten/system/include/libc/sys/lock.h +24 -0
  328. data/modules/emscripten/system/include/libc/sys/param.h +25 -0
  329. data/modules/emscripten/system/include/libc/sys/queue.h +471 -0
  330. data/modules/emscripten/system/include/libc/sys/reent.h +843 -0
  331. data/modules/emscripten/system/include/libc/sys/resource.h +59 -0
  332. data/modules/emscripten/system/include/libc/sys/sched.h +67 -0
  333. data/modules/emscripten/system/include/libc/sys/signal.h +314 -0
  334. data/modules/emscripten/system/include/libc/sys/stat.h +222 -0
  335. data/modules/emscripten/system/include/libc/sys/stdio.h +27 -0
  336. data/modules/emscripten/system/include/libc/sys/string.h +2 -0
  337. data/modules/emscripten/system/include/libc/sys/syslimits.h +65 -0
  338. data/modules/emscripten/system/include/libc/sys/termios.h +280 -0
  339. data/modules/emscripten/system/include/libc/sys/time.h +85 -0
  340. data/modules/emscripten/system/include/libc/sys/timeb.h +39 -0
  341. data/modules/emscripten/system/include/libc/sys/times.h +28 -0
  342. data/modules/emscripten/system/include/libc/sys/ttydefaults.h +97 -0
  343. data/modules/emscripten/system/include/libc/sys/types.h +481 -0
  344. data/modules/emscripten/system/include/libc/sys/unistd.h +514 -0
  345. data/modules/emscripten/system/include/libc/sys/utime.h +26 -0
  346. data/modules/emscripten/system/include/libc/sys/wait.h +40 -0
  347. data/modules/emscripten/system/include/libc/tar.h +39 -0
  348. data/modules/emscripten/system/include/libc/termios.h +7 -0
  349. data/modules/emscripten/system/include/libc/time.h +273 -0
  350. data/modules/emscripten/system/include/libc/unctrl.h +46 -0
  351. data/modules/emscripten/system/include/libc/unistd.h +6 -0
  352. data/modules/emscripten/system/include/libc/utime.h +12 -0
  353. data/modules/emscripten/system/include/libc/utmp.h +8 -0
  354. data/modules/emscripten/system/include/libc/wchar.h +194 -0
  355. data/modules/emscripten/system/include/libc/wctype.h +47 -0
  356. data/modules/emscripten/system/include/libc/wordexp.h +53 -0
  357. data/modules/emscripten/system/include/libcxx/CREDITS.TXT +91 -0
  358. data/modules/emscripten/system/include/libcxx/LICENSE.txt +76 -0
  359. data/modules/emscripten/system/include/libcxx/__bit_reference +1268 -0
  360. data/modules/emscripten/system/include/libcxx/__config +485 -0
  361. data/modules/emscripten/system/include/libcxx/__debug +193 -0
  362. data/modules/emscripten/system/include/libcxx/__functional_03 +2130 -0
  363. data/modules/emscripten/system/include/libcxx/__functional_base +437 -0
  364. data/modules/emscripten/system/include/libcxx/__functional_base_03 +1087 -0
  365. data/modules/emscripten/system/include/libcxx/__hash_table +1945 -0
  366. data/modules/emscripten/system/include/libcxx/__locale +1435 -0
  367. data/modules/emscripten/system/include/libcxx/__mutex_base +438 -0
  368. data/modules/emscripten/system/include/libcxx/__split_buffer +654 -0
  369. data/modules/emscripten/system/include/libcxx/__sso_allocator +77 -0
  370. data/modules/emscripten/system/include/libcxx/__std_stream +317 -0
  371. data/modules/emscripten/system/include/libcxx/__tree +2293 -0
  372. data/modules/emscripten/system/include/libcxx/__tuple +305 -0
  373. data/modules/emscripten/system/include/libcxx/__tuple_03 +27 -0
  374. data/modules/emscripten/system/include/libcxx/__undef_min_max +19 -0
  375. data/modules/emscripten/system/include/libcxx/algorithm +5458 -0
  376. data/modules/emscripten/system/include/libcxx/array +341 -0
  377. data/modules/emscripten/system/include/libcxx/atomic +1521 -0
  378. data/modules/emscripten/system/include/libcxx/bitset +1081 -0
  379. data/modules/emscripten/system/include/libcxx/cassert +25 -0
  380. data/modules/emscripten/system/include/libcxx/ccomplex +29 -0
  381. data/modules/emscripten/system/include/libcxx/cctype +164 -0
  382. data/modules/emscripten/system/include/libcxx/cerrno +393 -0
  383. data/modules/emscripten/system/include/libcxx/cfenv +82 -0
  384. data/modules/emscripten/system/include/libcxx/cfloat +78 -0
  385. data/modules/emscripten/system/include/libcxx/chrono +898 -0
  386. data/modules/emscripten/system/include/libcxx/cinttypes +259 -0
  387. data/modules/emscripten/system/include/libcxx/ciso646 +25 -0
  388. data/modules/emscripten/system/include/libcxx/climits +48 -0
  389. data/modules/emscripten/system/include/libcxx/clocale +53 -0
  390. data/modules/emscripten/system/include/libcxx/cmath +1683 -0
  391. data/modules/emscripten/system/include/libcxx/codecvt +547 -0
  392. data/modules/emscripten/system/include/libcxx/complex +1526 -0
  393. data/modules/emscripten/system/include/libcxx/complex.h +35 -0
  394. data/modules/emscripten/system/include/libcxx/condition_variable +256 -0
  395. data/modules/emscripten/system/include/libcxx/csetjmp +52 -0
  396. data/modules/emscripten/system/include/libcxx/csignal +58 -0
  397. data/modules/emscripten/system/include/libcxx/cstdarg +48 -0
  398. data/modules/emscripten/system/include/libcxx/cstdbool +32 -0
  399. data/modules/emscripten/system/include/libcxx/cstddef +103 -0
  400. data/modules/emscripten/system/include/libcxx/cstdint +191 -0
  401. data/modules/emscripten/system/include/libcxx/cstdio +175 -0
  402. data/modules/emscripten/system/include/libcxx/cstdlib +172 -0
  403. data/modules/emscripten/system/include/libcxx/cstring +112 -0
  404. data/modules/emscripten/system/include/libcxx/ctgmath +29 -0
  405. data/modules/emscripten/system/include/libcxx/ctime +72 -0
  406. data/modules/emscripten/system/include/libcxx/cwchar +208 -0
  407. data/modules/emscripten/system/include/libcxx/cwctype +213 -0
  408. data/modules/emscripten/system/include/libcxx/deque +2846 -0
  409. data/modules/emscripten/system/include/libcxx/exception +250 -0
  410. data/modules/emscripten/system/include/libcxx/ext/__hash +46 -0
  411. data/modules/emscripten/system/include/libcxx/ext/hash_map +1003 -0
  412. data/modules/emscripten/system/include/libcxx/ext/hash_set +657 -0
  413. data/modules/emscripten/system/include/libcxx/forward_list +1636 -0
  414. data/modules/emscripten/system/include/libcxx/fstream +1415 -0
  415. data/modules/emscripten/system/include/libcxx/functional +2063 -0
  416. data/modules/emscripten/system/include/libcxx/future +2505 -0
  417. data/modules/emscripten/system/include/libcxx/initializer_list +105 -0
  418. data/modules/emscripten/system/include/libcxx/iomanip +504 -0
  419. data/modules/emscripten/system/include/libcxx/ios +988 -0
  420. data/modules/emscripten/system/include/libcxx/iosfwd +194 -0
  421. data/modules/emscripten/system/include/libcxx/iostream +60 -0
  422. data/modules/emscripten/system/include/libcxx/istream +1713 -0
  423. data/modules/emscripten/system/include/libcxx/iterator +1869 -0
  424. data/modules/emscripten/system/include/libcxx/limits +809 -0
  425. data/modules/emscripten/system/include/libcxx/list +2275 -0
  426. data/modules/emscripten/system/include/libcxx/locale +4591 -0
  427. data/modules/emscripten/system/include/libcxx/map +1924 -0
  428. data/modules/emscripten/system/include/libcxx/memory +5437 -0
  429. data/modules/emscripten/system/include/libcxx/mutex +566 -0
  430. data/modules/emscripten/system/include/libcxx/new +117 -0
  431. data/modules/emscripten/system/include/libcxx/numeric +197 -0
  432. data/modules/emscripten/system/include/libcxx/ostream +1286 -0
  433. data/modules/emscripten/system/include/libcxx/queue +717 -0
  434. data/modules/emscripten/system/include/libcxx/random +6750 -0
  435. data/modules/emscripten/system/include/libcxx/ratio +487 -0
  436. data/modules/emscripten/system/include/libcxx/readme.txt +1 -0
  437. data/modules/emscripten/system/include/libcxx/regex +6439 -0
  438. data/modules/emscripten/system/include/libcxx/scoped_allocator +578 -0
  439. data/modules/emscripten/system/include/libcxx/set +1025 -0
  440. data/modules/emscripten/system/include/libcxx/sstream +888 -0
  441. data/modules/emscripten/system/include/libcxx/stack +292 -0
  442. data/modules/emscripten/system/include/libcxx/stdexcept +162 -0
  443. data/modules/emscripten/system/include/libcxx/streambuf +564 -0
  444. data/modules/emscripten/system/include/libcxx/string +3987 -0
  445. data/modules/emscripten/system/include/libcxx/strstream +400 -0
  446. data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +5 -0
  447. data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +38 -0
  448. data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +146 -0
  449. data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +79 -0
  450. data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +116 -0
  451. data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +113 -0
  452. data/modules/emscripten/system/include/libcxx/support/win32/support.h +115 -0
  453. data/modules/emscripten/system/include/libcxx/system_error +636 -0
  454. data/modules/emscripten/system/include/libcxx/tgmath.h +29 -0
  455. data/modules/emscripten/system/include/libcxx/thread +459 -0
  456. data/modules/emscripten/system/include/libcxx/tuple +1092 -0
  457. data/modules/emscripten/system/include/libcxx/type_traits +3040 -0
  458. data/modules/emscripten/system/include/libcxx/typeindex +103 -0
  459. data/modules/emscripten/system/include/libcxx/typeinfo +124 -0
  460. data/modules/emscripten/system/include/libcxx/unordered_map +1864 -0
  461. data/modules/emscripten/system/include/libcxx/unordered_set +1144 -0
  462. data/modules/emscripten/system/include/libcxx/utility +583 -0
  463. data/modules/emscripten/system/include/libcxx/valarray +4779 -0
  464. data/modules/emscripten/system/include/libcxx/vector +3228 -0
  465. data/modules/emscripten/system/include/memory.h +10 -0
  466. data/modules/emscripten/system/include/mntent.h +23 -0
  467. data/modules/emscripten/system/include/net/arpa/inet.h +32 -0
  468. data/modules/emscripten/system/include/net/arpa/nameser.h +535 -0
  469. data/modules/emscripten/system/include/net/arpa/nameser_compat.h +187 -0
  470. data/modules/emscripten/system/include/net/if.h +87 -0
  471. data/modules/emscripten/system/include/net/netinet/in.h +166 -0
  472. data/modules/emscripten/system/include/net/netinet/tcp.h +246 -0
  473. data/modules/emscripten/system/include/net/resolv.h +389 -0
  474. data/modules/emscripten/system/include/netdb.h +94 -0
  475. data/modules/emscripten/system/include/nl_types.h +19 -0
  476. data/modules/emscripten/system/include/poll.h +3 -0
  477. data/modules/emscripten/system/include/pty.h +6 -0
  478. data/modules/emscripten/system/include/semaphore.h +31 -0
  479. data/modules/emscripten/system/include/spawn.h +105 -0
  480. data/modules/emscripten/system/include/stdbool.h +16 -0
  481. data/modules/emscripten/system/include/sys/bitypes.h +3 -0
  482. data/modules/emscripten/system/include/sys/io.h +14 -0
  483. data/modules/emscripten/system/include/sys/ioctl.h +26 -0
  484. data/modules/emscripten/system/include/sys/poll.h +31 -0
  485. data/modules/emscripten/system/include/sys/select.h +14 -0
  486. data/modules/emscripten/system/include/sys/socket.h +101 -0
  487. data/modules/emscripten/system/include/sys/socketvar.h +3 -0
  488. data/modules/emscripten/system/include/sys/statvfs.h +32 -0
  489. data/modules/emscripten/system/include/sys/sysctl.h +14 -0
  490. data/modules/emscripten/system/include/sys/uio.h +22 -0
  491. data/modules/emscripten/system/include/sys/un.h +66 -0
  492. data/modules/emscripten/system/include/sysexits.h +108 -0
  493. data/modules/emscripten/system/include/unwind.h +154 -0
  494. data/modules/emscripten/system/include/xlocale.h +47 -0
  495. data/modules/emscripten/system/include/zconf.h +428 -0
  496. data/modules/emscripten/system/include/zlib.h +1613 -0
  497. data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +97 -0
  498. data/modules/emscripten/system/lib/compiler-rt/divdi3.c +47 -0
  499. data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +116 -0
  500. data/modules/emscripten/system/lib/compiler-rt/int_lib.h +46 -0
  501. data/modules/emscripten/system/lib/compiler-rt/int_math.h +67 -0
  502. data/modules/emscripten/system/lib/compiler-rt/int_types.h +140 -0
  503. data/modules/emscripten/system/lib/compiler-rt/int_util.h +29 -0
  504. data/modules/emscripten/system/lib/compiler-rt/muldi3.c +56 -0
  505. data/modules/emscripten/system/lib/compiler-rt/readme.txt +20 -0
  506. data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +36 -0
  507. data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +251 -0
  508. data/modules/emscripten/system/lib/debugging.cpp +24 -0
  509. data/modules/emscripten/system/lib/dlmalloc.c +6299 -0
  510. data/modules/emscripten/system/lib/embind/bind.cpp +63 -0
  511. data/modules/emscripten/system/lib/libc/gen/err.c +49 -0
  512. data/modules/emscripten/system/lib/libc/gen/errx.c +49 -0
  513. data/modules/emscripten/system/lib/libc/gen/verr.c +58 -0
  514. data/modules/emscripten/system/lib/libc/gen/verrx.c +51 -0
  515. data/modules/emscripten/system/lib/libc/gen/vwarn.c +55 -0
  516. data/modules/emscripten/system/lib/libc/gen/vwarnx.c +48 -0
  517. data/modules/emscripten/system/lib/libc/gen/warn.c +49 -0
  518. data/modules/emscripten/system/lib/libc/gen/warnx.c +49 -0
  519. data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +92 -0
  520. data/modules/emscripten/system/lib/libc/musl/readme.txt +1 -0
  521. data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +125 -0
  522. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +7 -0
  523. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +14 -0
  524. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +8 -0
  525. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +10 -0
  526. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +63 -0
  527. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +9 -0
  528. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +7 -0
  529. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +6 -0
  530. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +19 -0
  531. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +12 -0
  532. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +19 -0
  533. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +6 -0
  534. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +7 -0
  535. data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +62 -0
  536. data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +109 -0
  537. data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +268 -0
  538. data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +8 -0
  539. data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +16 -0
  540. data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +29 -0
  541. data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +42 -0
  542. data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +22 -0
  543. data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +71 -0
  544. data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +7 -0
  545. data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +38 -0
  546. data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +22 -0
  547. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +17 -0
  548. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +18 -0
  549. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +57 -0
  550. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +17 -0
  551. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +65 -0
  552. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +100 -0
  553. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +7 -0
  554. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +53 -0
  555. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +38 -0
  556. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +52 -0
  557. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +58 -0
  558. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +7 -0
  559. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +8 -0
  560. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +18 -0
  561. data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +6 -0
  562. data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +6 -0
  563. data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +7 -0
  564. data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +6 -0
  565. data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +7 -0
  566. data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +8 -0
  567. data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +7 -0
  568. data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +8 -0
  569. data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +10 -0
  570. data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +11 -0
  571. data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +8 -0
  572. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +9 -0
  573. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +6 -0
  574. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +10 -0
  575. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +7 -0
  576. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +9 -0
  577. data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +8 -0
  578. data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +7 -0
  579. data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +8 -0
  580. data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +8 -0
  581. data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +108 -0
  582. data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +12 -0
  583. data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +6 -0
  584. data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +8 -0
  585. data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +8 -0
  586. data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +9 -0
  587. data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +12 -0
  588. data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +9 -0
  589. data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +511 -0
  590. data/modules/emscripten/system/lib/libc/stdlib/strtod.c +305 -0
  591. data/modules/emscripten/system/lib/libc.symbols +81 -0
  592. data/modules/emscripten/system/lib/libcextra.symbols +61 -0
  593. data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +91 -0
  594. data/modules/emscripten/system/lib/libcxx/LICENSE.txt +76 -0
  595. data/modules/emscripten/system/lib/libcxx/algorithm.cpp +83 -0
  596. data/modules/emscripten/system/lib/libcxx/bind.cpp +30 -0
  597. data/modules/emscripten/system/lib/libcxx/chrono.cpp +132 -0
  598. data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +81 -0
  599. data/modules/emscripten/system/lib/libcxx/debug.cpp +504 -0
  600. data/modules/emscripten/system/lib/libcxx/exception.cpp +226 -0
  601. data/modules/emscripten/system/lib/libcxx/future.cpp +285 -0
  602. data/modules/emscripten/system/lib/libcxx/hash.cpp +564 -0
  603. data/modules/emscripten/system/lib/libcxx/ios.cpp +455 -0
  604. data/modules/emscripten/system/lib/libcxx/iostream.cpp +68 -0
  605. data/modules/emscripten/system/lib/libcxx/locale.cpp +6093 -0
  606. data/modules/emscripten/system/lib/libcxx/memory.cpp +223 -0
  607. data/modules/emscripten/system/lib/libcxx/mutex.cpp +250 -0
  608. data/modules/emscripten/system/lib/libcxx/new.cpp +205 -0
  609. data/modules/emscripten/system/lib/libcxx/random.cpp +48 -0
  610. data/modules/emscripten/system/lib/libcxx/readme.txt +1 -0
  611. data/modules/emscripten/system/lib/libcxx/regex.cpp +325 -0
  612. data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +196 -0
  613. data/modules/emscripten/system/lib/libcxx/string.cpp +687 -0
  614. data/modules/emscripten/system/lib/libcxx/strstream.cpp +329 -0
  615. data/modules/emscripten/system/lib/libcxx/support/solaris/README +4 -0
  616. data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +76 -0
  617. data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +93 -0
  618. data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +245 -0
  619. data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +94 -0
  620. data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +70 -0
  621. data/modules/emscripten/system/lib/libcxx/symbols +2927 -0
  622. data/modules/emscripten/system/lib/libcxx/system_error.cpp +201 -0
  623. data/modules/emscripten/system/lib/libcxx/thread.cpp +208 -0
  624. data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +60 -0
  625. data/modules/emscripten/system/lib/libcxx/utility.cpp +17 -0
  626. data/modules/emscripten/system/lib/libcxx/valarray.cpp +54 -0
  627. data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +38 -0
  628. data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +76 -0
  629. data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +167 -0
  630. data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +175 -0
  631. data/modules/emscripten/system/lib/libcxxabi/lib/buildit +99 -0
  632. data/modules/emscripten/system/lib/libcxxabi/readme.txt +1 -0
  633. data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +50 -0
  634. data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +33 -0
  635. data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +34 -0
  636. data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +11036 -0
  637. data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +622 -0
  638. data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +123 -0
  639. data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +91 -0
  640. data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +231 -0
  641. data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +125 -0
  642. data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +54 -0
  643. data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +242 -0
  644. data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +1055 -0
  645. data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +27 -0
  646. data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +367 -0
  647. data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +31 -0
  648. data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +41 -0
  649. data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +174 -0
  650. data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +1146 -0
  651. data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +248 -0
  652. data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +169 -0
  653. data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +53 -0
  654. data/modules/emscripten/system/lib/libcxxabi/symbols +236 -0
  655. data/modules/emscripten/system/lib/sdl.cpp +13 -0
  656. data/modules/emscripten/system/lib/sdl.symbols +1 -0
  657. data/modules/emscripten/tests/hello_world.js +92 -0
  658. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +2347 -0
  659. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +4 -0
  660. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +657 -0
  661. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +147 -0
  662. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +74 -0
  663. data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +249 -0
  664. data/modules/emscripten/third_party/CppHeaderParser/README.html +544 -0
  665. data/modules/emscripten/third_party/CppHeaderParser/README.txt +226 -0
  666. data/modules/emscripten/third_party/CppHeaderParser/setup.py +43 -0
  667. data/modules/emscripten/third_party/ansidecl.h +371 -0
  668. data/modules/emscripten/third_party/closure-compiler/COPYING +202 -0
  669. data/modules/emscripten/third_party/closure-compiler/README +292 -0
  670. data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
  671. data/modules/emscripten/third_party/closure-compiler/readme.txt +3 -0
  672. data/modules/emscripten/third_party/cp-demangle.h +161 -0
  673. data/modules/emscripten/third_party/demangle.h +549 -0
  674. data/modules/emscripten/third_party/demangler.py +49 -0
  675. data/modules/emscripten/third_party/gcc_demangler.c +4226 -0
  676. data/modules/emscripten/third_party/gcc_demangler.js +21282 -0
  677. data/modules/emscripten/third_party/jni/emjvm.cpp +133 -0
  678. data/modules/emscripten/third_party/jni/emjvm.h +8 -0
  679. data/modules/emscripten/third_party/jni/emjvm.js +185 -0
  680. data/modules/emscripten/third_party/jni/jni.h +1154 -0
  681. data/modules/emscripten/third_party/libiberty.h +634 -0
  682. data/modules/emscripten/third_party/lzma.js/README.markdown +37 -0
  683. data/modules/emscripten/third_party/lzma.js/doit.sh +37 -0
  684. data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +7 -0
  685. data/modules/emscripten/third_party/lzma.js/lzip/COPYING +676 -0
  686. data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +201 -0
  687. data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +56 -0
  688. data/modules/emscripten/third_party/lzma.js/lzip/Makefile +160 -0
  689. data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +138 -0
  690. data/modules/emscripten/third_party/lzma.js/lzip/NEWS +22 -0
  691. data/modules/emscripten/third_party/lzma.js/lzip/README +77 -0
  692. data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +204 -0
  693. data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +106 -0
  694. data/modules/emscripten/third_party/lzma.js/lzip/configure +192 -0
  695. data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +252 -0
  696. data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +268 -0
  697. data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +643 -0
  698. data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +582 -0
  699. data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +378 -0
  700. data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +171 -0
  701. data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +264 -0
  702. data/modules/emscripten/third_party/lzma.js/lzip/main.cc +545 -0
  703. data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +27 -0
  704. data/modules/emscripten/third_party/lzma.js/lzma-full.js +27 -0
  705. data/modules/emscripten/third_party/lzma.js/native_test.sh +5 -0
  706. data/modules/emscripten/third_party/lzma.js/post.js +13 -0
  707. data/modules/emscripten/third_party/lzma.js/pre.js +13 -0
  708. data/modules/emscripten/third_party/lzma.js/test-decoder.js +39 -0
  709. data/modules/emscripten/third_party/lzma.js/test-full.html +9 -0
  710. data/modules/emscripten/third_party/lzma.js/test-full.js +78 -0
  711. data/modules/emscripten/third_party/ply/ANNOUNCE +40 -0
  712. data/modules/emscripten/third_party/ply/CHANGES +1093 -0
  713. data/modules/emscripten/third_party/ply/PKG-INFO +22 -0
  714. data/modules/emscripten/third_party/ply/README +271 -0
  715. data/modules/emscripten/third_party/ply/TODO +16 -0
  716. data/modules/emscripten/third_party/ply/doc/internal.html +874 -0
  717. data/modules/emscripten/third_party/ply/doc/makedoc.py +194 -0
  718. data/modules/emscripten/third_party/ply/doc/ply.html +3262 -0
  719. data/modules/emscripten/third_party/ply/example/BASIC/README +79 -0
  720. data/modules/emscripten/third_party/ply/example/BASIC/basic.py +71 -0
  721. data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +74 -0
  722. data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +79 -0
  723. data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +441 -0
  724. data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +424 -0
  725. data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +14 -0
  726. data/modules/emscripten/third_party/ply/example/BASIC/func.bas +5 -0
  727. data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +22 -0
  728. data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +13 -0
  729. data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +4 -0
  730. data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +17 -0
  731. data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +12 -0
  732. data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +13 -0
  733. data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +4 -0
  734. data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +20 -0
  735. data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +18 -0
  736. data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +5 -0
  737. data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +4 -0
  738. data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +709 -0
  739. data/modules/emscripten/third_party/ply/example/GardenSnake/README +5 -0
  740. data/modules/emscripten/third_party/ply/example/README +10 -0
  741. data/modules/emscripten/third_party/ply/example/ansic/README +2 -0
  742. data/modules/emscripten/third_party/ply/example/ansic/clex.py +164 -0
  743. data/modules/emscripten/third_party/ply/example/ansic/cparse.py +863 -0
  744. data/modules/emscripten/third_party/ply/example/calc/calc.py +107 -0
  745. data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +113 -0
  746. data/modules/emscripten/third_party/ply/example/classcalc/calc.py +157 -0
  747. data/modules/emscripten/third_party/ply/example/cleanup.sh +2 -0
  748. data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +130 -0
  749. data/modules/emscripten/third_party/ply/example/hedit/hedit.py +48 -0
  750. data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +160 -0
  751. data/modules/emscripten/third_party/ply/example/optcalc/README +9 -0
  752. data/modules/emscripten/third_party/ply/example/optcalc/calc.py +119 -0
  753. data/modules/emscripten/third_party/ply/example/unicalc/calc.py +117 -0
  754. data/modules/emscripten/third_party/ply/example/yply/README +41 -0
  755. data/modules/emscripten/third_party/ply/example/yply/ylex.py +112 -0
  756. data/modules/emscripten/third_party/ply/example/yply/yparse.py +217 -0
  757. data/modules/emscripten/third_party/ply/example/yply/yply.py +53 -0
  758. data/modules/emscripten/third_party/ply/ply/__init__.py +4 -0
  759. data/modules/emscripten/third_party/ply/ply/cpp.py +898 -0
  760. data/modules/emscripten/third_party/ply/ply/ctokens.py +133 -0
  761. data/modules/emscripten/third_party/ply/ply/lex.py +1058 -0
  762. data/modules/emscripten/third_party/ply/ply/yacc.py +3276 -0
  763. data/modules/emscripten/third_party/ply/setup.py +31 -0
  764. data/modules/emscripten/third_party/ply/test/README +7 -0
  765. data/modules/emscripten/third_party/ply/test/calclex.py +49 -0
  766. data/modules/emscripten/third_party/ply/test/cleanup.sh +4 -0
  767. data/modules/emscripten/third_party/ply/test/lex_closure.py +54 -0
  768. data/modules/emscripten/third_party/ply/test/lex_doc1.py +26 -0
  769. data/modules/emscripten/third_party/ply/test/lex_dup1.py +29 -0
  770. data/modules/emscripten/third_party/ply/test/lex_dup2.py +33 -0
  771. data/modules/emscripten/third_party/ply/test/lex_dup3.py +31 -0
  772. data/modules/emscripten/third_party/ply/test/lex_empty.py +20 -0
  773. data/modules/emscripten/third_party/ply/test/lex_error1.py +24 -0
  774. data/modules/emscripten/third_party/ply/test/lex_error2.py +26 -0
  775. data/modules/emscripten/third_party/ply/test/lex_error3.py +27 -0
  776. data/modules/emscripten/third_party/ply/test/lex_error4.py +27 -0
  777. data/modules/emscripten/third_party/ply/test/lex_hedit.py +47 -0
  778. data/modules/emscripten/third_party/ply/test/lex_ignore.py +31 -0
  779. data/modules/emscripten/third_party/ply/test/lex_ignore2.py +29 -0
  780. data/modules/emscripten/third_party/ply/test/lex_literal1.py +25 -0
  781. data/modules/emscripten/third_party/ply/test/lex_literal2.py +25 -0
  782. data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +27 -0
  783. data/modules/emscripten/third_party/ply/test/lex_module.py +10 -0
  784. data/modules/emscripten/third_party/ply/test/lex_module_import.py +42 -0
  785. data/modules/emscripten/third_party/ply/test/lex_object.py +55 -0
  786. data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +54 -0
  787. data/modules/emscripten/third_party/ply/test/lex_optimize.py +50 -0
  788. data/modules/emscripten/third_party/ply/test/lex_optimize2.py +50 -0
  789. data/modules/emscripten/third_party/ply/test/lex_optimize3.py +52 -0
  790. data/modules/emscripten/third_party/ply/test/lex_re1.py +27 -0
  791. data/modules/emscripten/third_party/ply/test/lex_re2.py +27 -0
  792. data/modules/emscripten/third_party/ply/test/lex_re3.py +29 -0
  793. data/modules/emscripten/third_party/ply/test/lex_rule1.py +27 -0
  794. data/modules/emscripten/third_party/ply/test/lex_rule2.py +29 -0
  795. data/modules/emscripten/third_party/ply/test/lex_rule3.py +27 -0
  796. data/modules/emscripten/third_party/ply/test/lex_state1.py +40 -0
  797. data/modules/emscripten/third_party/ply/test/lex_state2.py +40 -0
  798. data/modules/emscripten/third_party/ply/test/lex_state3.py +42 -0
  799. data/modules/emscripten/third_party/ply/test/lex_state4.py +41 -0
  800. data/modules/emscripten/third_party/ply/test/lex_state5.py +40 -0
  801. data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +39 -0
  802. data/modules/emscripten/third_party/ply/test/lex_state_norule.py +40 -0
  803. data/modules/emscripten/third_party/ply/test/lex_state_try.py +45 -0
  804. data/modules/emscripten/third_party/ply/test/lex_token1.py +19 -0
  805. data/modules/emscripten/third_party/ply/test/lex_token2.py +22 -0
  806. data/modules/emscripten/third_party/ply/test/lex_token3.py +24 -0
  807. data/modules/emscripten/third_party/ply/test/lex_token4.py +26 -0
  808. data/modules/emscripten/third_party/ply/test/lex_token5.py +31 -0
  809. data/modules/emscripten/third_party/ply/test/lex_token_dup.py +29 -0
  810. data/modules/emscripten/third_party/ply/test/testlex.py +606 -0
  811. data/modules/emscripten/third_party/ply/test/testyacc.py +347 -0
  812. data/modules/emscripten/third_party/ply/test/yacc_badargs.py +68 -0
  813. data/modules/emscripten/third_party/ply/test/yacc_badid.py +77 -0
  814. data/modules/emscripten/third_party/ply/test/yacc_badprec.py +64 -0
  815. data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +68 -0
  816. data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +68 -0
  817. data/modules/emscripten/third_party/ply/test/yacc_badrule.py +68 -0
  818. data/modules/emscripten/third_party/ply/test/yacc_badtok.py +68 -0
  819. data/modules/emscripten/third_party/ply/test/yacc_dup.py +68 -0
  820. data/modules/emscripten/third_party/ply/test/yacc_error1.py +68 -0
  821. data/modules/emscripten/third_party/ply/test/yacc_error2.py +68 -0
  822. data/modules/emscripten/third_party/ply/test/yacc_error3.py +67 -0
  823. data/modules/emscripten/third_party/ply/test/yacc_error4.py +72 -0
  824. data/modules/emscripten/third_party/ply/test/yacc_inf.py +56 -0
  825. data/modules/emscripten/third_party/ply/test/yacc_literal.py +69 -0
  826. data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +68 -0
  827. data/modules/emscripten/third_party/ply/test/yacc_missing1.py +68 -0
  828. data/modules/emscripten/third_party/ply/test/yacc_nested.py +33 -0
  829. data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +67 -0
  830. data/modules/emscripten/third_party/ply/test/yacc_noerror.py +66 -0
  831. data/modules/emscripten/third_party/ply/test/yacc_nop.py +68 -0
  832. data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +66 -0
  833. data/modules/emscripten/third_party/ply/test/yacc_notok.py +67 -0
  834. data/modules/emscripten/third_party/ply/test/yacc_prec1.py +68 -0
  835. data/modules/emscripten/third_party/ply/test/yacc_rr.py +72 -0
  836. data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +30 -0
  837. data/modules/emscripten/third_party/ply/test/yacc_simple.py +68 -0
  838. data/modules/emscripten/third_party/ply/test/yacc_sr.py +63 -0
  839. data/modules/emscripten/third_party/ply/test/yacc_term1.py +68 -0
  840. data/modules/emscripten/third_party/ply/test/yacc_unused.py +77 -0
  841. data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +72 -0
  842. data/modules/emscripten/third_party/ply/test/yacc_uprec.py +63 -0
  843. data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +63 -0
  844. data/modules/emscripten/third_party/readme.txt +7 -0
  845. data/modules/emscripten/third_party/websockify/CHANGES.txt +23 -0
  846. data/modules/emscripten/third_party/websockify/LICENSE.txt +16 -0
  847. data/modules/emscripten/third_party/websockify/MANIFEST.in +1 -0
  848. data/modules/emscripten/third_party/websockify/Makefile +11 -0
  849. data/modules/emscripten/third_party/websockify/README.md +168 -0
  850. data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +39 -0
  851. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +24 -0
  852. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +61 -0
  853. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +19 -0
  854. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +129 -0
  855. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +36 -0
  856. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +37 -0
  857. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +41 -0
  858. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +75 -0
  859. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +20 -0
  860. data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +621 -0
  861. data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +165 -0
  862. data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +373 -0
  863. data/modules/emscripten/third_party/websockify/docs/TODO +9 -0
  864. data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +4 -0
  865. data/modules/emscripten/third_party/websockify/docs/latency_results.txt +114 -0
  866. data/modules/emscripten/third_party/websockify/docs/notes +17 -0
  867. data/modules/emscripten/third_party/websockify/docs/release.txt +9 -0
  868. data/modules/emscripten/third_party/websockify/docs/websockify.1 +110 -0
  869. data/modules/emscripten/third_party/websockify/include/VT100.js +919 -0
  870. data/modules/emscripten/third_party/websockify/include/base64.js +114 -0
  871. data/modules/emscripten/third_party/websockify/include/keysym.js +99 -0
  872. data/modules/emscripten/third_party/websockify/include/util.js +359 -0
  873. data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +109 -0
  874. data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
  875. data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +4 -0
  876. data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +391 -0
  877. data/modules/emscripten/third_party/websockify/include/websock.js +422 -0
  878. data/modules/emscripten/third_party/websockify/include/webutil.js +216 -0
  879. data/modules/emscripten/third_party/websockify/include/wsirc.js +235 -0
  880. data/modules/emscripten/third_party/websockify/include/wstelnet.js +335 -0
  881. data/modules/emscripten/third_party/websockify/other/Makefile +14 -0
  882. data/modules/emscripten/third_party/websockify/other/README.md +51 -0
  883. data/modules/emscripten/third_party/websockify/other/launch.sh +108 -0
  884. data/modules/emscripten/third_party/websockify/other/project.clj +13 -0
  885. data/modules/emscripten/third_party/websockify/other/websocket.c +802 -0
  886. data/modules/emscripten/third_party/websockify/other/websocket.h +84 -0
  887. data/modules/emscripten/third_party/websockify/other/websocket.rb +456 -0
  888. data/modules/emscripten/third_party/websockify/other/websockify.c +385 -0
  889. data/modules/emscripten/third_party/websockify/other/websockify.clj +233 -0
  890. data/modules/emscripten/third_party/websockify/other/websockify.js +196 -0
  891. data/modules/emscripten/third_party/websockify/other/websockify.rb +171 -0
  892. data/modules/emscripten/third_party/websockify/other/wswrap +22 -0
  893. data/modules/emscripten/third_party/websockify/rebind +18 -0
  894. data/modules/emscripten/third_party/websockify/rebind.c +94 -0
  895. data/modules/emscripten/third_party/websockify/run +5 -0
  896. data/modules/emscripten/third_party/websockify/setup.py +30 -0
  897. data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +29 -0
  898. data/modules/emscripten/third_party/websockify/tests/base64.html +91 -0
  899. data/modules/emscripten/third_party/websockify/tests/base64.js +12 -0
  900. data/modules/emscripten/third_party/websockify/tests/echo.html +148 -0
  901. data/modules/emscripten/third_party/websockify/tests/echo.py +75 -0
  902. data/modules/emscripten/third_party/websockify/tests/echo.rb +62 -0
  903. data/modules/emscripten/third_party/websockify/tests/latency.html +290 -0
  904. data/modules/emscripten/third_party/websockify/tests/latency.py +75 -0
  905. data/modules/emscripten/third_party/websockify/tests/load.html +250 -0
  906. data/modules/emscripten/third_party/websockify/tests/load.py +167 -0
  907. data/modules/emscripten/third_party/websockify/tests/plain_echo.html +168 -0
  908. data/modules/emscripten/third_party/websockify/tests/simple.html +68 -0
  909. data/modules/emscripten/third_party/websockify/tests/utf8-list.py +22 -0
  910. data/modules/emscripten/third_party/websockify/websockify/__init__.py +2 -0
  911. data/modules/emscripten/third_party/websockify/websockify/websocket.py +982 -0
  912. data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +393 -0
  913. data/modules/emscripten/third_party/websockify/websockify.py +5 -0
  914. data/modules/emscripten/third_party/websockify/wsirc.html +99 -0
  915. data/modules/emscripten/third_party/websockify/wstelnet.html +74 -0
  916. data/modules/emscripten/tools/__init__.py +0 -0
  917. data/modules/emscripten/tools/__init__.pyc +0 -0
  918. data/modules/emscripten/tools/autodebugger.py +289 -0
  919. data/modules/emscripten/tools/autodebugger_c.py +37 -0
  920. data/modules/emscripten/tools/autodebugger_indenter.py +18 -0
  921. data/modules/emscripten/tools/autodebugger_js.py +47 -0
  922. data/modules/emscripten/tools/autodediffer.py +60 -0
  923. data/modules/emscripten/tools/bindings_generator.py +832 -0
  924. data/modules/emscripten/tools/bisect_pair.py +88 -0
  925. data/modules/emscripten/tools/cache.py +198 -0
  926. data/modules/emscripten/tools/cache.pyc +0 -0
  927. data/modules/emscripten/tools/clean_webconsole.py +34 -0
  928. data/modules/emscripten/tools/crunch-worker.js +124 -0
  929. data/modules/emscripten/tools/diff_autodebugger.py +15 -0
  930. data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +5129 -0
  931. data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +6861 -0
  932. data/modules/emscripten/tools/eliminator/eliminator-test-output.js +6122 -0
  933. data/modules/emscripten/tools/eliminator/eliminator-test.js +8856 -0
  934. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +888 -0
  935. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +463 -0
  936. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +317 -0
  937. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +75 -0
  938. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +75 -0
  939. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +1363 -0
  940. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +2005 -0
  941. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +51 -0
  942. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +22 -0
  943. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +28 -0
  944. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +402 -0
  945. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
  946. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
  947. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
  948. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
  949. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
  950. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
  951. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
  952. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
  953. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
  954. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
  955. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
  956. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
  957. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
  958. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
  959. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
  960. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
  961. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
  962. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
  963. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
  964. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
  965. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
  966. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
  967. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
  968. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
  969. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
  970. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
  971. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
  972. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
  973. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
  974. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
  975. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
  976. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
  977. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
  978. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
  979. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
  980. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
  981. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
  982. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
  983. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
  984. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
  985. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
  986. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
  987. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
  988. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
  989. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
  990. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
  991. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
  992. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
  993. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
  994. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
  995. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
  996. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
  997. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
  998. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
  999. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
  1000. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
  1001. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
  1002. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
  1003. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
  1004. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
  1005. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
  1006. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
  1007. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
  1008. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
  1009. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
  1010. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
  1011. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
  1012. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
  1013. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
  1014. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
  1015. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
  1016. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
  1017. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
  1018. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
  1019. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
  1020. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
  1021. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +55 -0
  1022. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +33 -0
  1023. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +97 -0
  1024. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +138 -0
  1025. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +16 -0
  1026. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +17 -0
  1027. data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +85 -0
  1028. data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +103 -0
  1029. data/modules/emscripten/tools/emconfiguren.py +19 -0
  1030. data/modules/emscripten/tools/emmaken.py +230 -0
  1031. data/modules/emscripten/tools/emmakenxx.py +18 -0
  1032. data/modules/emscripten/tools/exec_llvm.py +50 -0
  1033. data/modules/emscripten/tools/file2json.py +49 -0
  1034. data/modules/emscripten/tools/file_packager.py +649 -0
  1035. data/modules/emscripten/tools/find_bigfuncs.py +23 -0
  1036. data/modules/emscripten/tools/find_bigis.py +18 -0
  1037. data/modules/emscripten/tools/fix_closure.py +88 -0
  1038. data/modules/emscripten/tools/ie7_fix.py +14 -0
  1039. data/modules/emscripten/tools/js-optimizer.js +3440 -0
  1040. data/modules/emscripten/tools/js_optimizer.py +341 -0
  1041. data/modules/emscripten/tools/js_optimizer.pyc +0 -0
  1042. data/modules/emscripten/tools/jsrun.py +27 -0
  1043. data/modules/emscripten/tools/jsrun.pyc +0 -0
  1044. data/modules/emscripten/tools/ll-strip.py +56 -0
  1045. data/modules/emscripten/tools/make_file.py +19 -0
  1046. data/modules/emscripten/tools/make_minigzip.py +13 -0
  1047. data/modules/emscripten/tools/namespacer.py +95 -0
  1048. data/modules/emscripten/tools/nativize_llvm.py +34 -0
  1049. data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +58 -0
  1050. data/modules/emscripten/tools/node_modules/source-map/LICENSE +28 -0
  1051. data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +166 -0
  1052. data/modules/emscripten/tools/node_modules/source-map/README.md +347 -0
  1053. data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +56 -0
  1054. data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +152 -0
  1055. data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  1056. data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +18 -0
  1057. data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +8 -0
  1058. data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  1059. data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +21 -0
  1060. data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +8 -0
  1061. data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +3 -0
  1062. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +96 -0
  1063. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  1064. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +42 -0
  1065. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  1066. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +430 -0
  1067. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +381 -0
  1068. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +353 -0
  1069. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +117 -0
  1070. data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +8 -0
  1071. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  1072. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +119 -0
  1073. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  1074. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +33 -0
  1075. data/modules/emscripten/tools/node_modules/source-map/package.json +74 -0
  1076. data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +73 -0
  1077. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +26 -0
  1078. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +71 -0
  1079. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  1080. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +35 -0
  1081. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  1082. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  1083. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +306 -0
  1084. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +391 -0
  1085. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +282 -0
  1086. data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +152 -0
  1087. data/modules/emscripten/tools/reproduceriter.js +216 -0
  1088. data/modules/emscripten/tools/reproduceriter.py +160 -0
  1089. data/modules/emscripten/tools/response_file.py +28 -0
  1090. data/modules/emscripten/tools/response_file.pyc +0 -0
  1091. data/modules/emscripten/tools/scan_js.py +20 -0
  1092. data/modules/emscripten/tools/scan_ll.py +18 -0
  1093. data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +3 -0
  1094. data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +46 -0
  1095. data/modules/emscripten/tools/settings_template_readonly.py +47 -0
  1096. data/modules/emscripten/tools/shared.py +1437 -0
  1097. data/modules/emscripten/tools/shared.pyc +0 -0
  1098. data/modules/emscripten/tools/source-maps/sourcemap2json.js +15 -0
  1099. data/modules/emscripten/tools/source-maps/sourcemapper.js +177 -0
  1100. data/modules/emscripten/tools/split.py +97 -0
  1101. data/modules/emscripten/tools/tempfiles.py +40 -0
  1102. data/modules/emscripten/tools/tempfiles.pyc +0 -0
  1103. data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +75 -0
  1104. data/modules/emscripten/tools/test-js-optimizer-asm-last.js +91 -0
  1105. data/modules/emscripten/tools/test-js-optimizer-asm-outline-output.js +570 -0
  1106. data/modules/emscripten/tools/test-js-optimizer-asm-outline.js +606 -0
  1107. data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +540 -0
  1108. data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +550 -0
  1109. data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +36 -0
  1110. data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +37 -0
  1111. data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +106 -0
  1112. data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +110 -0
  1113. data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +9 -0
  1114. data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +12 -0
  1115. data/modules/emscripten/tools/test-js-optimizer-output.js +291 -0
  1116. data/modules/emscripten/tools/test-js-optimizer-regs-output.js +232 -0
  1117. data/modules/emscripten/tools/test-js-optimizer-regs.js +237 -0
  1118. data/modules/emscripten/tools/test-js-optimizer-t2-output.js +91 -0
  1119. data/modules/emscripten/tools/test-js-optimizer-t2.js +92 -0
  1120. data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +17 -0
  1121. data/modules/emscripten/tools/test-js-optimizer-t2c.js +18 -0
  1122. data/modules/emscripten/tools/test-js-optimizer-t3-output.js +49 -0
  1123. data/modules/emscripten/tools/test-js-optimizer-t3.js +50 -0
  1124. data/modules/emscripten/tools/test-js-optimizer.js +401 -0
  1125. data/modules/mruby/AUTHORS +18 -0
  1126. data/modules/mruby/CONTRIBUTING.md +65 -0
  1127. data/modules/mruby/ChangeLog +15 -0
  1128. data/modules/mruby/INSTALL +29 -0
  1129. data/modules/mruby/LEGAL +6 -0
  1130. data/modules/mruby/MITL +20 -0
  1131. data/modules/mruby/Makefile +18 -0
  1132. data/modules/mruby/NEWS +13 -0
  1133. data/modules/mruby/README.md +116 -0
  1134. data/modules/mruby/Rakefile +114 -0
  1135. data/modules/mruby/TODO +11 -0
  1136. data/modules/mruby/benchmark/ao-render.rb +315 -0
  1137. data/modules/mruby/benchmark/bm_so_lists.rb +47 -0
  1138. data/modules/mruby/benchmark/fib39.rb +8 -0
  1139. data/modules/mruby/build_config.rb +88 -0
  1140. data/modules/mruby/doc/compile/README.md +376 -0
  1141. data/modules/mruby/doc/mrbgems/README.md +254 -0
  1142. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md +4 -0
  1143. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +23 -0
  1144. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +5 -0
  1145. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +20 -0
  1146. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb +7 -0
  1147. data/modules/mruby/examples/mrbgems/c_extension_example/README.md +4 -0
  1148. data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +23 -0
  1149. data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +20 -0
  1150. data/modules/mruby/examples/mrbgems/c_extension_example/test/example.c +7 -0
  1151. data/modules/mruby/examples/mrbgems/c_extension_example/test/example.rb +3 -0
  1152. data/modules/mruby/examples/mrbgems/ruby_extension_example/README.md +4 -0
  1153. data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +23 -0
  1154. data/modules/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +5 -0
  1155. data/modules/mruby/examples/mrbgems/ruby_extension_example/test/example.rb +3 -0
  1156. data/modules/mruby/examples/targets/ArduinoDue.rb +65 -0
  1157. data/modules/mruby/examples/targets/chipKitMax32.rb +68 -0
  1158. data/modules/mruby/include/mrbconf.h +87 -0
  1159. data/modules/mruby/include/mruby/array.h +63 -0
  1160. data/modules/mruby/include/mruby/class.h +75 -0
  1161. data/modules/mruby/include/mruby/compile.h +176 -0
  1162. data/modules/mruby/include/mruby/data.h +53 -0
  1163. data/modules/mruby/include/mruby/dump.h +151 -0
  1164. data/modules/mruby/include/mruby/gc.h +17 -0
  1165. data/modules/mruby/include/mruby/hash.h +54 -0
  1166. data/modules/mruby/include/mruby/irep.h +40 -0
  1167. data/modules/mruby/include/mruby/khash.h +257 -0
  1168. data/modules/mruby/include/mruby/numeric.h +32 -0
  1169. data/modules/mruby/include/mruby/proc.h +62 -0
  1170. data/modules/mruby/include/mruby/range.h +35 -0
  1171. data/modules/mruby/include/mruby/string.h +78 -0
  1172. data/modules/mruby/include/mruby/value.h +483 -0
  1173. data/modules/mruby/include/mruby/variable.h +78 -0
  1174. data/modules/mruby/include/mruby.h +388 -0
  1175. data/modules/mruby/minirake +477 -0
  1176. data/modules/mruby/mrbgems/default.gembox +61 -0
  1177. data/modules/mruby/mrbgems/full-core.gembox +9 -0
  1178. data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +4 -0
  1179. data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +204 -0
  1180. data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +140 -0
  1181. data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +109 -0
  1182. data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +5 -0
  1183. data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +365 -0
  1184. data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +5 -0
  1185. data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +243 -0
  1186. data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +4 -0
  1187. data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +164 -0
  1188. data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +44 -0
  1189. data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +4 -0
  1190. data/modules/mruby/mrbgems/mruby-eval/src/eval.c +23 -0
  1191. data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +4 -0
  1192. data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +251 -0
  1193. data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +64 -0
  1194. data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +4 -0
  1195. data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +13 -0
  1196. data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +62 -0
  1197. data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +26 -0
  1198. data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +4 -0
  1199. data/modules/mruby/mrbgems/mruby-math/src/math.c +685 -0
  1200. data/modules/mruby/mrbgems/mruby-math/test/math.rb +136 -0
  1201. data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +4 -0
  1202. data/modules/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +31 -0
  1203. data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +10 -0
  1204. data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +4 -0
  1205. data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +108 -0
  1206. data/modules/mruby/mrbgems/mruby-object-ext/test/nil.rb +11 -0
  1207. data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +9 -0
  1208. data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +4 -0
  1209. data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +117 -0
  1210. data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +38 -0
  1211. data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +4 -0
  1212. data/modules/mruby/mrbgems/mruby-print/mrblib/print.rb +64 -0
  1213. data/modules/mruby/mrbgems/mruby-print/src/print.c +44 -0
  1214. data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +4 -0
  1215. data/modules/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +40 -0
  1216. data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +97 -0
  1217. data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +41 -0
  1218. data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +4 -0
  1219. data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +193 -0
  1220. data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +48 -0
  1221. data/modules/mruby/mrbgems/mruby-random/src/random.c +231 -0
  1222. data/modules/mruby/mrbgems/mruby-random/src/random.h +12 -0
  1223. data/modules/mruby/mrbgems/mruby-random/test/random.rb +32 -0
  1224. data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +4 -0
  1225. data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +141 -0
  1226. data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +20 -0
  1227. data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +4 -0
  1228. data/modules/mruby/mrbgems/mruby-sprintf/src/kernel.c +30 -0
  1229. data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +1102 -0
  1230. data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +3 -0
  1231. data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +4 -0
  1232. data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +52 -0
  1233. data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +175 -0
  1234. data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +112 -0
  1235. data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +4 -0
  1236. data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +50 -0
  1237. data/modules/mruby/mrbgems/mruby-struct/src/struct.c +818 -0
  1238. data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +77 -0
  1239. data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +4 -0
  1240. data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +9 -0
  1241. data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +55 -0
  1242. data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +12 -0
  1243. data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +4 -0
  1244. data/modules/mruby/mrbgems/mruby-time/src/time.c +749 -0
  1245. data/modules/mruby/mrbgems/mruby-time/test/time.rb +201 -0
  1246. data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +4 -0
  1247. data/modules/mruby/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +11 -0
  1248. data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +24 -0
  1249. data/modules/mruby/mrblib/array.rb +111 -0
  1250. data/modules/mruby/mrblib/class.rb +26 -0
  1251. data/modules/mruby/mrblib/compar.rb +104 -0
  1252. data/modules/mruby/mrblib/enum.rb +398 -0
  1253. data/modules/mruby/mrblib/error.rb +66 -0
  1254. data/modules/mruby/mrblib/hash.rb +193 -0
  1255. data/modules/mruby/mrblib/init_mrblib.c +14 -0
  1256. data/modules/mruby/mrblib/kernel.rb +46 -0
  1257. data/modules/mruby/mrblib/mrblib.rake +18 -0
  1258. data/modules/mruby/mrblib/numeric.rb +101 -0
  1259. data/modules/mruby/mrblib/print.rb +18 -0
  1260. data/modules/mruby/mrblib/range.rb +40 -0
  1261. data/modules/mruby/mrblib/string.rb +145 -0
  1262. data/modules/mruby/src/array.c +1150 -0
  1263. data/modules/mruby/src/backtrace.c +73 -0
  1264. data/modules/mruby/src/class.c +1942 -0
  1265. data/modules/mruby/src/codegen.c +2864 -0
  1266. data/modules/mruby/src/compar.c +13 -0
  1267. data/modules/mruby/src/crc.c +38 -0
  1268. data/modules/mruby/src/dump.c +542 -0
  1269. data/modules/mruby/src/enum.c +14 -0
  1270. data/modules/mruby/src/error.c +454 -0
  1271. data/modules/mruby/src/error.h +18 -0
  1272. data/modules/mruby/src/etc.c +204 -0
  1273. data/modules/mruby/src/gc.c +1542 -0
  1274. data/modules/mruby/src/hash.c +1261 -0
  1275. data/modules/mruby/src/init.c +62 -0
  1276. data/modules/mruby/src/kernel.c +1105 -0
  1277. data/modules/mruby/src/keywords +50 -0
  1278. data/modules/mruby/src/lex.def +212 -0
  1279. data/modules/mruby/src/load.c +629 -0
  1280. data/modules/mruby/src/mruby_core.rake +28 -0
  1281. data/modules/mruby/src/node.h +117 -0
  1282. data/modules/mruby/src/numeric.c +1418 -0
  1283. data/modules/mruby/src/object.c +593 -0
  1284. data/modules/mruby/src/opcode.h +160 -0
  1285. data/modules/mruby/src/parse.y +6050 -0
  1286. data/modules/mruby/src/pool.c +190 -0
  1287. data/modules/mruby/src/print.c +71 -0
  1288. data/modules/mruby/src/proc.c +209 -0
  1289. data/modules/mruby/src/range.c +442 -0
  1290. data/modules/mruby/src/re.h +13 -0
  1291. data/modules/mruby/src/state.c +200 -0
  1292. data/modules/mruby/src/string.c +2580 -0
  1293. data/modules/mruby/src/symbol.c +456 -0
  1294. data/modules/mruby/src/value_array.h +27 -0
  1295. data/modules/mruby/src/variable.c +1147 -0
  1296. data/modules/mruby/src/vm.c +2129 -0
  1297. data/modules/mruby/tasks/libmruby.rake +18 -0
  1298. data/modules/mruby/tasks/mrbgem_spec.rake +297 -0
  1299. data/modules/mruby/tasks/mrbgems.rake +85 -0
  1300. data/modules/mruby/tasks/mrbgems_test.rake +88 -0
  1301. data/modules/mruby/tasks/mruby_build.rake +211 -0
  1302. data/modules/mruby/tasks/mruby_build_commands.rake +287 -0
  1303. data/modules/mruby/tasks/mruby_build_gem.rake +67 -0
  1304. data/modules/mruby/tasks/ruby_ext.rake +70 -0
  1305. data/modules/mruby/tasks/toolchains/androideabi.rake +126 -0
  1306. data/modules/mruby/tasks/toolchains/clang.rake +8 -0
  1307. data/modules/mruby/tasks/toolchains/gcc.rake +21 -0
  1308. data/modules/mruby/tasks/toolchains/vs2010.rake +3 -0
  1309. data/modules/mruby/tasks/toolchains/vs2012.rake +44 -0
  1310. data/modules/mruby/test/README.md +7 -0
  1311. data/modules/mruby/test/assert.rb +238 -0
  1312. data/modules/mruby/test/driver.c +118 -0
  1313. data/modules/mruby/test/init_mrbtest.c +24 -0
  1314. data/modules/mruby/test/mrbtest.rake +47 -0
  1315. data/modules/mruby/test/report.rb +4 -0
  1316. data/modules/mruby/test/t/argumenterror.rb +21 -0
  1317. data/modules/mruby/test/t/array.rb +309 -0
  1318. data/modules/mruby/test/t/basicobject.rb +11 -0
  1319. data/modules/mruby/test/t/bs_block.rb +489 -0
  1320. data/modules/mruby/test/t/bs_literal.rb +38 -0
  1321. data/modules/mruby/test/t/class.rb +219 -0
  1322. data/modules/mruby/test/t/comparable.rb +72 -0
  1323. data/modules/mruby/test/t/enumerable.rb +108 -0
  1324. data/modules/mruby/test/t/exception.rb +337 -0
  1325. data/modules/mruby/test/t/false.rb +33 -0
  1326. data/modules/mruby/test/t/float.rb +145 -0
  1327. data/modules/mruby/test/t/gc.rb +45 -0
  1328. data/modules/mruby/test/t/hash.rb +310 -0
  1329. data/modules/mruby/test/t/indexerror.rb +10 -0
  1330. data/modules/mruby/test/t/integer.rb +222 -0
  1331. data/modules/mruby/test/t/kernel.rb +425 -0
  1332. data/modules/mruby/test/t/literals.rb +287 -0
  1333. data/modules/mruby/test/t/localjumperror.rb +13 -0
  1334. data/modules/mruby/test/t/methods.rb +109 -0
  1335. data/modules/mruby/test/t/module.rb +344 -0
  1336. data/modules/mruby/test/t/nameerror.rb +32 -0
  1337. data/modules/mruby/test/t/nil.rb +29 -0
  1338. data/modules/mruby/test/t/nomethoderror.rb +13 -0
  1339. data/modules/mruby/test/t/numeric.rb +29 -0
  1340. data/modules/mruby/test/t/object.rb +11 -0
  1341. data/modules/mruby/test/t/proc.rb +56 -0
  1342. data/modules/mruby/test/t/range.rb +82 -0
  1343. data/modules/mruby/test/t/rangeerror.rb +10 -0
  1344. data/modules/mruby/test/t/regexperror.rb +4 -0
  1345. data/modules/mruby/test/t/runtimeerror.rb +6 -0
  1346. data/modules/mruby/test/t/standarderror.rb +10 -0
  1347. data/modules/mruby/test/t/string.rb +483 -0
  1348. data/modules/mruby/test/t/symbol.rb +27 -0
  1349. data/modules/mruby/test/t/syntax.rb +67 -0
  1350. data/modules/mruby/test/t/true.rb +33 -0
  1351. data/modules/mruby/test/t/typeerror.rb +11 -0
  1352. data/modules/mruby/tools/mrbc/mrbc.c +318 -0
  1353. data/modules/mruby/tools/mrbc/mrbc.rake +14 -0
  1354. data/modules/mruby/travis_config.rb +6 -0
  1355. data/modules/mrubymix/LICENSE +21 -0
  1356. data/modules/mrubymix/README.md +6 -0
  1357. data/modules/mrubymix/bin/mrubymix +29 -0
  1358. data/modules/mrubymix/lib/mrubymix.rb +93 -0
  1359. data/modules/mrubymix/mrubymix.gemspec +13 -0
  1360. data/scripts/gen_gems_config.rb +185 -0
  1361. data/scripts/gen_post.rb +104 -0
  1362. data/templates/minimal/Rakefile +36 -0
  1363. data/templates/minimal/app/app.rb +3 -0
  1364. metadata +1408 -0
@@ -0,0 +1,2347 @@
1
+ #!/usr/bin/python2
2
+ #
3
+ # Author: Jashua R. Cloutier (contact via sourceforge username:senexcanis)
4
+ #
5
+ # Copyright (C) 2010, Jashua R. Cloutier
6
+ # All rights reserved.
7
+ #
8
+ # Redistribution and use in source and binary forms, with or without
9
+ # modification, are permitted provided that the following conditions
10
+ # are met:
11
+ #
12
+ # * Redistributions of source code must retain the above copyright
13
+ # notice, this list of conditions and the following disclaimer.
14
+ #
15
+ # * Redistributions in binary form must reproduce the above copyright
16
+ # notice, this list of conditions and the following disclaimer in
17
+ # the documentation and/or other materials provided with the
18
+ # distribution.
19
+ #
20
+ # * Neither the name of Jashua R. Cloutier nor the names of its
21
+ # contributors may be used to endorse or promote products derived from
22
+ # this software without specific prior written permission.
23
+ #
24
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
+ # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
+ # POSSIBILITY OF SUCH DAMAGE.
36
+ #
37
+ #
38
+ # The CppHeaderParser.py script is written in Python 2.4 and released to
39
+ # the open source community for continuous improvements under the BSD
40
+ # 2.0 new license, which can be found at:
41
+ #
42
+ # http://www.opensource.org/licenses/bsd-license.php
43
+ #
44
+ """
45
+ CppHeaderParser2.0: April 2011 - August 2011
46
+ by HartsAntler
47
+ http://pyppet.blogspot.com
48
+
49
+ Quick Start - User API:
50
+ h = CppHeaderParser.CppHeader("someheader.h")
51
+ for name in h.classes:
52
+ c = h.classes[name]
53
+ for method in c['methods']['public']:
54
+ print method['name']
55
+ print dir(method) # view the rest of the API here.
56
+
57
+ ... TODO document more ...
58
+
59
+
60
+
61
+ New Features by Hart:
62
+ should be able to parse all c++ files, not just headers
63
+ parsing global typedefs with resolution
64
+ parsing global structs
65
+ fixes nested struct in class changes accessor type
66
+ parsing if class is abstract
67
+ parsing more info about variables
68
+ save ordering of classes, structs, and typedefs
69
+ handle forward decl of class in a class
70
+ handle mutable, static, and other variable types
71
+ handle 1D arrays
72
+ handle throw keyword and function prefix __attribute__((__const__))
73
+ handle nameless parameters "void method(void);"
74
+ handle simple templates, and global functions.
75
+
76
+ Internal Developer Notes:
77
+
78
+ 1. double name stacks:
79
+ . the main stack is self.nameStack, this stack is simpler and easy to get hints from
80
+ . the secondary stack is self.stack is the full name stack, required for parsing somethings
81
+ . each stack maybe cleared at different points, since they are used to detect different things
82
+ . it looks ugly but it works :)
83
+
84
+ 2. Had to make the __repr__ methods simple because some of these dicts are interlinked.
85
+ For nice printing, call something.show()
86
+
87
+ """
88
+
89
+ import ply.lex as lex
90
+ import os
91
+ import sys
92
+ import re
93
+
94
+ import inspect
95
+
96
+ def lineno():
97
+ """Returns the current line number in our program."""
98
+ return inspect.currentframe().f_back.f_lineno
99
+
100
+ version = __version__ = "1.9.9o"
101
+
102
+ tokens = [
103
+ 'NUMBER',
104
+ 'NAME',
105
+ 'OPEN_PAREN',
106
+ 'CLOSE_PAREN',
107
+ 'OPEN_BRACE',
108
+ 'CLOSE_BRACE',
109
+ 'COLON',
110
+ 'SEMI_COLON',
111
+ 'COMMA',
112
+ 'COMMENT_SINGLELINE',
113
+ 'COMMENT_MULTILINE',
114
+ 'PRECOMP_MACRO',
115
+ 'PRECOMP_MACRO_CONT',
116
+ 'ASTERISK',
117
+ 'AMPERSTAND',
118
+ 'EQUALS',
119
+ 'MINUS',
120
+ 'PLUS',
121
+ 'DIVIDE',
122
+ 'CHAR_LITERAL',
123
+ 'STRING_LITERAL',
124
+ 'OPERATOR_DIVIDE_OVERLOAD',
125
+ 'NEW_LINE',
126
+
127
+ 'OPEN_BRACKET',
128
+ 'CLOSE_BRACKET',
129
+
130
+ ]
131
+
132
+ t_OPEN_BRACKET = r'\['
133
+ t_CLOSE_BRACKET = r'\]'
134
+
135
+
136
+ #t_ignore = " \t\r[].|!?%@" # (cppheaderparser 1.9x)
137
+ #t_ignore = " \t\r[].|!?%@'^\\"
138
+ t_ignore = " \t\r.|!?%@'^\\"
139
+ t_NUMBER = r'[0-9][0-9XxA-Fa-f]*'
140
+ t_NAME = r'[<>A-Za-z_~][A-Za-z0-9_]*'
141
+ t_OPERATOR_DIVIDE_OVERLOAD = r'/='
142
+ t_OPEN_PAREN = r'\('
143
+ t_CLOSE_PAREN = r'\)'
144
+ t_OPEN_BRACE = r'{'
145
+ t_CLOSE_BRACE = r'}'
146
+ t_SEMI_COLON = r';'
147
+ t_COLON = r':'
148
+ t_COMMA = r','
149
+ t_PRECOMP_MACRO = r'\#.*'
150
+ t_PRECOMP_MACRO_CONT = r'.*\\\n'
151
+ def t_COMMENT_SINGLELINE(t):
152
+ r'\/\/.*\n'
153
+ global doxygenCommentCache
154
+ if t.value.startswith("///") or t.value.startswith("//!"):
155
+ if doxygenCommentCache:
156
+ doxygenCommentCache += "\n"
157
+ if t.value.endswith("\n"):
158
+ doxygenCommentCache += t.value[:-1]
159
+ else:
160
+ doxygenCommentCache += t.value
161
+ t_ASTERISK = r'\*'
162
+ t_MINUS = r'\-'
163
+ t_PLUS = r'\+'
164
+ t_DIVIDE = r'/[^/]' # fails to catch "/(" - method operator that overloads divide
165
+ t_AMPERSTAND = r'&'
166
+ t_EQUALS = r'='
167
+ t_CHAR_LITERAL = "'.'"
168
+ #found at http://wordaligned.org/articles/string-literals-and-regular-expressions
169
+ #TODO: This does not work with the string "bla \" bla"
170
+ t_STRING_LITERAL = r'"([^"\\]|\\.)*"'
171
+ #Found at http://ostermiller.org/findcomment.html
172
+ def t_COMMENT_MULTILINE(t):
173
+ r'/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/'
174
+ global doxygenCommentCache
175
+ if t.value.startswith("/**") or t.value.startswith("/*!"):
176
+ #not sure why, but get double new lines
177
+ v = t.value.replace("\n\n", "\n")
178
+ #strip prefixing whitespace
179
+ v = re.sub("\n[\s]+\*", "\n*", v)
180
+ doxygenCommentCache += v
181
+ def t_NEWLINE(t):
182
+ r'\n+'
183
+ t.lexer.lineno += len(t.value)
184
+
185
+ def t_error(v):
186
+ print( "Lex error: ", v )
187
+
188
+ lex.lex()
189
+ debug = 0
190
+ debug_trace = 0
191
+ def trace_print(*arg):
192
+ global debug_trace
193
+ if debug_trace: print(arg)
194
+
195
+ supportedAccessSpecifier = [
196
+ 'public',
197
+ 'protected',
198
+ 'private'
199
+ ]
200
+
201
+ enumMaintianValueFormat = False
202
+ doxygenCommentCache = ""
203
+
204
+ def is_namespace(nameStack):
205
+ """Determines if a namespace is being specified"""
206
+ if len(nameStack) == 0:
207
+ return False
208
+ if nameStack[0] == "namespace":
209
+ return True
210
+ return False
211
+
212
+ def is_enum_namestack(nameStack):
213
+ """Determines if a namestack is an enum namestack"""
214
+ if len(nameStack) == 0:
215
+ return False
216
+ if nameStack[0] == "enum":
217
+ return True
218
+ if len(nameStack) > 1 and nameStack[0] == "typedef" and nameStack[1] == "enum":
219
+ return True
220
+ return False
221
+
222
+ class CppParseError(Exception): pass
223
+
224
+
225
+ class _CppClass(dict):
226
+ def _parser_helper( self, stack ):
227
+ prev = None
228
+ prev2 = None
229
+ print('stack IN', ' '.join(stack))
230
+ for i, tok in enumerate(stack): # can not trust the first single ":" or last
231
+ if prev and prev2 and tok == ':' and prev != ':' and prev2 != ':':
232
+ break
233
+ prev = tok
234
+ prev2 = prev
235
+
236
+
237
+ a = stack[ : i+1 ]
238
+ b = stack[ i+1 : ]
239
+ while a[-1] == ':': a.pop()
240
+
241
+ print( 'HEAD', a )
242
+ print('______________')
243
+ print( 'TAIL', b )
244
+
245
+ if ''.join(stack).replace('::','_').count(':') >= 2:
246
+ if stack.count('class') == 1:
247
+ self['name'] = stack[ stack.index('class') + 1 ]
248
+ elif stack.count('struct') == 1:
249
+ self['name'] = stack[ stack.index('struct') + 1 ]
250
+ else:
251
+ self['unsafe_template'] = True
252
+ b = []
253
+
254
+ elif a[0] == 'template' and ('class' in a or 'struct' in a):
255
+ if '>' not in a:
256
+ self['name'] = a[ a.index('class') + 1 ]
257
+ self['unsafe_template'] = True
258
+
259
+ else:
260
+ copy = list( a )
261
+ last = len(a) - 1 - a[::-1].index('>')
262
+ self['template_typename'] = a[ a.index('>')-1 ]
263
+ a = a[ last+1 : ]
264
+ if not a:
265
+ a = copy[ copy.index('class')+1 : ]
266
+ x = ''.join( a )
267
+ assert '<' in x and '>' in x
268
+ self['name'] = x
269
+ self['special_template'] = True
270
+
271
+ elif 'class' in a:
272
+ self['name'] = ''.join( a[1:] )
273
+
274
+ elif 'struct' in a:
275
+ self['name'] = ''.join( a[1:] )
276
+ self['struct'] = True
277
+ self['struct_template'] = self['template_typename']
278
+ elif 'class' in b:
279
+ self['name'] = b[ b.index('class') + 1 ]
280
+ b = []
281
+ elif 'struct' in b:
282
+ self['name'] = b[ b.index('struct') + 1 ]
283
+ b = []
284
+ else:
285
+ self['unsafe_template'] = True
286
+ assert 0
287
+
288
+ elif a[0] == 'template' and b[-2] in ('class','struct'):
289
+ self['name'] = b[-1]
290
+ b = [] # b is invalid
291
+ elif a[0] == 'class':
292
+ self['name'] = ''.join( a[1:] )
293
+ elif 'class' in b:
294
+ self['name'] = b[ b.index('class') + 1 ]
295
+ b = []
296
+ elif 'struct' in b:
297
+ self['name'] = b[ b.index('struct') + 1 ]
298
+ self['struct'] = True
299
+ b = []
300
+ else:
301
+ assert 0
302
+
303
+
304
+ if b:
305
+ p = [ {'access':'public', 'class':''} ]
306
+ for x in b:
307
+ if x in 'public protected private'.split():
308
+ p[-1]['access'] = x
309
+ elif x == 'virtual':
310
+ p[-1]['virtual'] = True
311
+ elif x == ',':
312
+ p.append( {'access':'public', 'class':''} )
313
+ else:
314
+ p[-1]['class'] += x
315
+ self['inherits'] = p
316
+ else:
317
+ self['inherits'] = []
318
+
319
+ return True
320
+
321
+
322
+ class CppClass( _CppClass ):
323
+ """Takes a name stack and turns it into a class
324
+
325
+ Contains the following Keys:
326
+ self['name'] - Name of the class
327
+ self['doxygen'] - Doxygen comments associated with the class if they exist
328
+ self['inherits'] - List of Classes that this one inherits where the values
329
+ are of the form {"access": Anything in supportedAccessSpecifier
330
+ "class": Name of the class
331
+ self['methods'] - Dictionary where keys are from supportedAccessSpecifier
332
+ and values are a lists of CppMethod's
333
+ self['properties'] - Dictionary where keys are from supportedAccessSpecifier
334
+ and values are lists of CppVariable's
335
+ self['enums'] - Dictionary where keys are from supportedAccessSpecifier and
336
+ values are lists of CppEnum's
337
+ self['structs'] - Dictionary where keys are from supportedAccessSpecifier and
338
+ values are lists of nested Struct's
339
+
340
+ An example of how this could look is as follows:
341
+ #self =
342
+ {
343
+ 'name': ""
344
+ 'inherits':[]
345
+ 'methods':
346
+ {
347
+ 'public':[],
348
+ 'protected':[],
349
+ 'private':[]
350
+ },
351
+ 'properties':
352
+ {
353
+ 'public':[],
354
+ 'protected':[],
355
+ 'private':[]
356
+ },
357
+ 'enums':
358
+ {
359
+ 'public':[],
360
+ 'protected':[],
361
+ 'private':[]
362
+ }
363
+ }
364
+ """
365
+ def __repr__( self ): return self['name']
366
+
367
+ def get_all_methods(self):
368
+ r = []
369
+ for typ in 'public protected private'.split(): r += self['methods'][typ]
370
+ return r
371
+
372
+ def get_all_method_names( self ):
373
+ r = []
374
+ for typ in 'public protected private'.split(): r += self.get_method_names(typ) # returns list
375
+ return r
376
+
377
+ def get_all_pure_virtual_methods( self ):
378
+ r = {}
379
+ for typ in 'public protected private'.split(): r.update(self.get_pure_virtual_methods(typ)) # returns dict
380
+ return r
381
+
382
+
383
+ def get_method_names( self, type='public' ): return [ meth['name'] for meth in self['methods'][ type ] ]
384
+
385
+ def get_pure_virtual_methods( self, type='public' ):
386
+ r = {}
387
+ for meth in self['methods'][ type ]:
388
+ if meth['pure_virtual']: r[ meth['name'] ] = meth
389
+ return r
390
+
391
+ def __init__(self, nameStack):
392
+ self['nested_classes'] = []
393
+ self['parent'] = None
394
+ self['abstract'] = False
395
+ self['namespace'] = ""
396
+ self._public_enums = {}
397
+ self._public_structs = {}
398
+ self._public_typedefs = {}
399
+ self._public_forward_declares = []
400
+
401
+ if (debug): print( "Class: ", nameStack )
402
+ if (len(nameStack) < 2):
403
+ print( "Error detecting class" )
404
+ return
405
+ global doxygenCommentCache
406
+ if len(doxygenCommentCache):
407
+ self["doxygen"] = doxygenCommentCache
408
+ doxygenCommentCache = ""
409
+
410
+ methodAccessSpecificList = {}
411
+ propertyAccessSpecificList = {}
412
+ enumAccessSpecificList = {}
413
+ structAccessSpecificList = {}
414
+ typedefAccessSpecificList = {}
415
+ forwardAccessSpecificList = {}
416
+
417
+ for accessSpecifier in supportedAccessSpecifier:
418
+ methodAccessSpecificList[accessSpecifier] = []
419
+ propertyAccessSpecificList[accessSpecifier] = []
420
+ enumAccessSpecificList[accessSpecifier] = []
421
+ structAccessSpecificList[accessSpecifier] = []
422
+ typedefAccessSpecificList[accessSpecifier] = []
423
+ forwardAccessSpecificList[accessSpecifier] = []
424
+
425
+ self['methods'] = methodAccessSpecificList
426
+ self['properties'] = propertyAccessSpecificList
427
+ self['enums'] = enumAccessSpecificList
428
+ self['structs'] = structAccessSpecificList
429
+ self['typedefs'] = typedefAccessSpecificList
430
+ self['forward_declares'] = forwardAccessSpecificList
431
+
432
+ ok = self._parser_helper( nameStack )
433
+ if not ok: self['invalid'] = True
434
+
435
+ def show_all(self):
436
+ self.show()
437
+ for key in self.keys(): print( ' %s : %s' %(key,self[key]) )
438
+
439
+ def show(self):
440
+ """Convert class to a string"""
441
+ namespace_prefix = ""
442
+ if self["namespace"]: namespace_prefix = self["namespace"] + "::"
443
+ rtn = "class %s"%(namespace_prefix + self["name"])
444
+ if self['abstract']: rtn += ' (abstract)\n'
445
+ else: rtn += '\n'
446
+
447
+ if 'doxygen' in self.keys(): rtn += self["doxygen"] + '\n'
448
+ if 'parent' in self.keys() and self['parent']: rtn += 'parent class:' + self['parent'] + '\n'
449
+
450
+ if "inherits" in self.keys():
451
+ rtn += " Inherits: "
452
+ for inheritClass in self["inherits"]:
453
+ rtn += "%s %s, "%(inheritClass["access"], inheritClass["class"])
454
+ rtn += "\n"
455
+ rtn += " {\n"
456
+ for accessSpecifier in supportedAccessSpecifier:
457
+ rtn += " %s\n"%(accessSpecifier)
458
+ #Enums
459
+ if (len(self["enums"][accessSpecifier])):
460
+ rtn += " <Enums>\n"
461
+ for enum in self["enums"][accessSpecifier]:
462
+ rtn += " %s\n"%(repr(enum))
463
+ #Properties
464
+ if (len(self["properties"][accessSpecifier])):
465
+ rtn += " <Properties>\n"
466
+ for property in self["properties"][accessSpecifier]:
467
+ rtn += " %s\n"%(repr(property))
468
+ #Methods
469
+ if (len(self["methods"][accessSpecifier])):
470
+ rtn += " <Methods>\n"
471
+ for method in self["methods"][accessSpecifier]:
472
+ rtn += "\t\t" + method.show() + '\n'
473
+ rtn += " }\n"
474
+ print( rtn )
475
+
476
+ class _CppMethod( dict ):
477
+ def _params_helper1( self, stack ):
478
+ # new July 7th, deal with defaults that init: vec3(0,0,0)
479
+ # so that comma split still works later on parsing the parameters.
480
+
481
+ # also deal with "throw" keyword
482
+ if 'throw' in stack: stack = stack[ : stack.index('throw') ]
483
+
484
+ ## remove GCC keyword __attribute__(...) and preserve returns ##
485
+ cleaned = []
486
+ hit = False; hitOpen = 0; hitClose = 0
487
+ for a in stack:
488
+ if a == '__attribute__': hit = True
489
+ if hit:
490
+ if a == '(': hitOpen += 1
491
+ elif a == ')': hitClose += 1
492
+ if a==')' and hitOpen == hitClose:
493
+ hit = False
494
+ else:
495
+ cleaned.append( a )
496
+ stack = cleaned
497
+
498
+ # also deal with attribute((const)) function prefix #
499
+ # TODO this needs to be better #
500
+ if len(stack) > 5:
501
+ a = ''.join(stack)
502
+ if a.startswith('((__const__))'): stack = stack[ 5 : ]
503
+ elif a.startswith('__attribute__((__const__))'): stack = stack[ 6 : ]
504
+
505
+ stack = stack[stack.index('(') + 1: ]
506
+ if not stack: return []
507
+ if len(stack)>=3 and stack[0]==')' and stack[1]==':': # is this always a constructor?
508
+ self['constructor'] = True
509
+ return []
510
+
511
+ stack.reverse(); _end_ = stack.index(')'); stack.reverse()
512
+ stack = stack[ : len(stack)-(_end_+1) ]
513
+
514
+ if '(' not in stack: return stack # safe to return, no defaults that init a class
515
+ elif stack.index('(') > stack.index(')'): # deals with: "constructor(int x) : func(x) {}"
516
+ return stack[ : stack.index(')') ] # fixed july20
517
+
518
+ # transforms ['someclass', '(', '0', '0', '0', ')'] into "someclass(0,0,0)'"
519
+ r = []; hit=False
520
+ for a in stack:
521
+ if a == '(': hit=True
522
+ elif a == ')': hit=False
523
+ if hit or a == ')': r[-1] = r[-1] + a
524
+ else: r.append( a )
525
+ return r
526
+
527
+ def _params_helper2( self, params ):
528
+ for p in params:
529
+ # if param becomes unresolved - function/parent is marked with 'unresolved_parameters'
530
+ if 'function' in self: p['function'] = self
531
+ else: p['method'] = self
532
+ # force full namespace for nested items, or take method name space as our own (bad idea?)
533
+ if '::' in p['type']:
534
+ ns = p['type'].split('::')[0]
535
+ if ns not in Resolver.NAMESPACES and ns in Resolver.CLASSES:
536
+ p['type'] = self['namespace'] + p['type']
537
+ else: p['namespace'] = self[ 'namespace' ]
538
+
539
+ class CppMethod( _CppMethod ):
540
+ """Takes a name stack and turns it into a method
541
+
542
+ Contains the following Keys:
543
+ self['returns'] - Return type of the method (ex. "int")
544
+ self['name'] - Name of the method (ex. "getSize")
545
+ self['doxygen'] - Doxygen comments associated with the method if they exist
546
+ self['parameters'] - List of CppVariables
547
+ """
548
+ def show(self):
549
+ r = ['method name: %s (%s)' %(self['name'],self['debug']) ]
550
+ if self['returns']: r.append( 'returns: %s'%self['returns'] )
551
+ if self['parameters']: r.append( 'number arguments: %s' %len(self['parameters']))
552
+ if self['pure_virtual']: r.append( 'pure virtual: %s'%self['pure_virtual'] )
553
+ if self['constructor']: r.append( 'constructor' )
554
+ if self['destructor']: r.append( 'destructor' )
555
+ return '\n\t\t '.join( r )
556
+
557
+ def __init__(self, nameStack, curClass=None, methinfo={} ):
558
+ if (debug): print( "Method: ", nameStack )
559
+ global doxygenCommentCache
560
+
561
+ if not curClass: self['function'] = True
562
+
563
+ if len(doxygenCommentCache):
564
+ self["doxygen"] = doxygenCommentCache
565
+ doxygenCommentCache = ""
566
+ if "operator" in nameStack:
567
+ self["name"] = "".join(nameStack[nameStack.index('operator'):nameStack.index('(')])
568
+ else:
569
+ self["name"] = " ".join(nameStack[nameStack.index('(') - 1:nameStack.index('(')])
570
+
571
+ self.update( methinfo ) # harts hack
572
+ paramsStack = self._params_helper1( nameStack )
573
+ params = []
574
+ #See if there is a doxygen comment for the variable
575
+ doxyVarDesc = {}
576
+ #TODO: Put this into a class
577
+ if self.has_key("doxygen"):
578
+ doxyLines = self["doxygen"].split("\n")
579
+ lastParamDesc = ""
580
+ for doxyLine in doxyLines:
581
+ if " @param " in doxyLine or " \param " in doxyLine:
582
+ try:
583
+ #Strip out the param
584
+ doxyLine = doxyLine[doxyLine.find("param ") + 6:]
585
+ (var, desc) = doxyLine.split(" ", 1)
586
+ doxyVarDesc[var] = desc.strip()
587
+ lastParamDesc = var
588
+ except: pass
589
+ elif " @return " in doxyLine or " \return " in doxyLine:
590
+ lastParamDesc = ""
591
+ # not handled for now
592
+ elif lastParamDesc:
593
+ try:
594
+ doxyLine = doxyLine.strip()
595
+ if " " not in doxyLine:
596
+ lastParamDesc = ""
597
+ continue
598
+ doxyLine = doxyLine[doxyLine.find(" ") + 1:]
599
+ doxyVarDesc[lastParamDesc] += " " + doxyLine
600
+ except: pass
601
+
602
+ #Create the variable now
603
+ while (len(paramsStack)):
604
+ if (',' in paramsStack):
605
+ param = CppVariable(paramsStack[0:paramsStack.index(',')], doxyVarDesc=doxyVarDesc)
606
+ if len(param.keys()): params.append(param)
607
+ paramsStack = paramsStack[paramsStack.index(',') + 1:]
608
+ else:
609
+ param = CppVariable(paramsStack, doxyVarDesc=doxyVarDesc)
610
+ if len(param.keys()): params.append(param)
611
+ break
612
+
613
+ self["parameters"] = params
614
+ self._params_helper2( params ) # mods params inplace
615
+
616
+
617
+ class _CppVariable(dict):
618
+ def _name_stack_helper( self, stack, fullStack ):
619
+ print('V'*80); print( stack ); print(fullStack); print('_'*80)
620
+ stack = list(stack)
621
+ if stack[-1].isdigit() and '=' not in stack: # TODO refactor me - was: '=' not in stack or
622
+ # check for array[n] and deal with funny array syntax: "int myvar:99"
623
+ bits = []
624
+ while stack and stack[-1].isdigit(): bits.append( stack.pop() )
625
+ if bits:
626
+ bits.reverse()
627
+ self['bitfield'] = int(''.join(bits))
628
+ assert stack[-1] == ':'
629
+ stack.pop()
630
+
631
+ ## find and strip array def ##
632
+ if '[' in stack:
633
+ assert stack.count('[') == stack.count(']')
634
+ a = ['']; hit = 0; _stack = []
635
+ for s in stack:
636
+ if s == '[': hit += 1
637
+ elif s == ']': hit -= 1; a.append( '' )
638
+ elif hit: a[-1] += s
639
+ elif not hit: _stack.append( s )
640
+ stack = _stack
641
+
642
+ b = []
643
+ for s in a:
644
+ if s.isdigit(): b.append( int( s ) )
645
+ elif s != '': self['invalid'] = True
646
+ if not b: self['pointer'] += 1
647
+ else:
648
+ self['array'] = b[0]
649
+ self['array_dimensions'] = b
650
+ if len(b)>1: self['multidimensional'] = True
651
+
652
+ while stack and not stack[-1]: stack.pop() # can be empty?
653
+ return stack
654
+
655
+
656
+
657
+ class CppVariable( _CppVariable ):
658
+ """Takes a name stack and turns it into a method
659
+
660
+ Contains the following Keys:
661
+ self['type'] - Type for the variable (ex. "const string &")
662
+ self['raw_type'] - Type of variable without pointers or other markup (ex. "string")
663
+ self['name'] - Name of the variable (ex. "numItems")
664
+ self['namespace'] - Namespace containing the enum
665
+ self['desc'] - Description of the variable if part of a method (optional)
666
+ self['doxygen'] - Doxygen comments associated with the method if they exist
667
+ self['defalt'] - Default value of the variable, this key will only exist if there is a default value
668
+ """
669
+ Vars = []
670
+
671
+ def __init__(self, nameStack, fullStack=None, doxyVarDesc=None): # CppMethod will not pass fullStack for params
672
+ self['aliases'] = []; self['parent'] = None; self['typedef'] = None
673
+ for key in 'constant reference pointer static typedefs class fundamental unresolved mutable'.split():
674
+ self[ key ] = 0
675
+
676
+
677
+ _stack_ = nameStack
678
+ nameStack = self._name_stack_helper( nameStack, fullStack )
679
+ global doxygenCommentCache
680
+ if len(doxygenCommentCache):
681
+ self["doxygen"] = doxygenCommentCache
682
+ doxygenCommentCache = ""
683
+
684
+ if (debug): print( "Variable: ", nameStack )
685
+
686
+ if (len(nameStack) < 2):
687
+ if len(nameStack) == 1: self['type'] = nameStack[0]; self['name'] = ''
688
+ else: print(_stack_); assert 0
689
+
690
+ elif ("=" in nameStack):
691
+ self["type"] = " ".join(nameStack[:nameStack.index("=") - 1])
692
+ self["name"] = nameStack[nameStack.index("=") - 1]
693
+ self['default'] = " ".join(nameStack[nameStack.index("=") + 1:])
694
+ self['default'] = self['default'].replace(' <', '<' )
695
+ self['default'] = self['default'].replace(' >', '>' )
696
+
697
+ elif nameStack[-1] in '*&': # rare cases - function param is an unnamed pointer: "void somemethod( SomeObject* )"
698
+ self['type'] = ' '.join(nameStack)
699
+ self['name'] = ''
700
+
701
+ else: # common case
702
+ self["type"] = " ".join(nameStack[:-1])
703
+ self["name"] = nameStack[-1]
704
+
705
+ self["type"] = self["type"].replace(" :",":")
706
+ self["type"] = self["type"].replace(": ",":")
707
+ self["type"] = self["type"].replace(" <","<")
708
+ self["type"] = self["type"].replace(" >",">")
709
+ #Optional doxygen description
710
+ if doxyVarDesc and self['name'] in doxyVarDesc:
711
+ self['description'] = doxyVarDesc[ self['name'] ]
712
+
713
+ self['type'] = self['type'].strip()
714
+ a = []
715
+ for b in self['type'].split():
716
+ if b == '__const__': b = 'const'
717
+ a.append( b )
718
+
719
+ if not a:
720
+ self['invalid'] = True # void someinvalidfunction( int x, y=INVALID );
721
+ print('WARN - bad variable', self )
722
+
723
+ else:
724
+ if a[0] == 'class':
725
+ self['explicit_class'] = a[1]
726
+ a = a[1:]
727
+ elif a[0] == 'struct':
728
+ self['explicit_struct'] = a[1]
729
+ a = a[1:]
730
+ self['type'] = ' '.join( a )
731
+
732
+ if self['name'].count('<') != self['name'].count('>'): self['invalid'] = True
733
+
734
+ CppVariable.Vars.append( self ) # save and resolve later
735
+
736
+ class _CppEnum(dict):
737
+ def resolve_enum_values( self, values ):
738
+ """Evaluates the values list of dictionaries passed in and figures out what the enum value
739
+ for each enum is editing in place:
740
+
741
+ Example:
742
+ From: [{'name': 'ORANGE'},
743
+ {'name': 'RED'},
744
+ {'name': 'GREEN', 'value': '8'}]
745
+ To: [{'name': 'ORANGE', 'value': 0},
746
+ {'name': 'RED', 'value': 1},
747
+ {'name': 'GREEN', 'value': 8}]
748
+ """
749
+ t = 'int'; i = 0
750
+ names = [ v['name'] for v in values ]
751
+ for v in values:
752
+ if 'value' in v:
753
+ a = v['value'].strip()
754
+ if a.lower().startswith("0x"):
755
+ try:
756
+ i = a = int(a , 16)
757
+ except:pass
758
+ elif a.isdigit():
759
+ i = a = int( a )
760
+ elif a in names:
761
+ for other in values:
762
+ if other['name'] == a:
763
+ v['value'] = other['value']
764
+ break
765
+
766
+ elif '"' in a or "'" in a: t = 'char*' # only if there are quotes it this a string enum
767
+ else:
768
+ try:
769
+ a = i = ord(a)
770
+ except: pass
771
+ if not enumMaintianValueFormat: v['value'] = a
772
+ else: v['value'] = i
773
+ i += 1
774
+ return t
775
+
776
+ class CppEnum(_CppEnum):
777
+ """Takes a name stack and turns it into an Enum
778
+
779
+ Contains the following Keys:
780
+ self['name'] - Name of the enum (ex. "ItemState")
781
+ self['namespace'] - Namespace containing the enum
782
+ self['values'] - List of values where the values are a dictionary of the
783
+ form {"name": name of the key (ex. "PARSING_HEADER"),
784
+ "value": Specified value of the enum, this key will only exist
785
+ if a value for a given enum value was defined
786
+ }
787
+ """
788
+ def __init__(self, nameStack):
789
+ if len(nameStack) < 4 or "{" not in nameStack or "}" not in nameStack:
790
+ #Not enough stuff for an enum
791
+ return
792
+ global doxygenCommentCache
793
+ if len(doxygenCommentCache):
794
+ self["doxygen"] = doxygenCommentCache
795
+ doxygenCommentCache = ""
796
+ valueList = []
797
+ #Figure out what values it has
798
+ valueStack = nameStack[nameStack.index('{') + 1: nameStack.index('}')]
799
+ while len(valueStack):
800
+ tmpStack = []
801
+ if "," in valueStack:
802
+ tmpStack = valueStack[:valueStack.index(",")]
803
+ valueStack = valueStack[valueStack.index(",") + 1:]
804
+ else:
805
+ tmpStack = valueStack
806
+ valueStack = []
807
+ d = {}
808
+ if len(tmpStack) == 1: d["name"] = tmpStack[0]
809
+ elif len(tmpStack) >= 3 and tmpStack[1] == "=":
810
+ d["name"] = tmpStack[0]; d["value"] = " ".join(tmpStack[2:])
811
+ elif len(tmpStack) == 2 and tmpStack[1] == "=":
812
+ if (debug): print( "WARN-enum: parser missed value for %s"%tmpStack[0] )
813
+ d["name"] = tmpStack[0]
814
+
815
+ if d: valueList.append( d )
816
+
817
+ if len(valueList):
818
+ self['type'] = self.resolve_enum_values( valueList ) # returns int for standard enum
819
+ self["values"] = valueList
820
+ else:
821
+ print( 'WARN-enum: empty enum', nameStack )
822
+ return
823
+ #Figure out if it has a name
824
+ preBraceStack = nameStack[:nameStack.index("{")]
825
+ postBraceStack = nameStack[nameStack.index("}") + 1:]
826
+ if (len(preBraceStack) == 2 and "typedef" not in nameStack):
827
+ self["name"] = preBraceStack[1]
828
+ elif len(postBraceStack) and "typedef" in nameStack:
829
+ self["name"] = " ".join(postBraceStack)
830
+ else: print( 'WARN-enum: nameless enum', nameStack )
831
+ #See if there are instances of this
832
+ if "typedef" not in nameStack and len(postBraceStack):
833
+ self["instances"] = []
834
+ for var in postBraceStack:
835
+ if "," in var:
836
+ continue
837
+ self["instances"].append(var)
838
+ self["namespace"] = ""
839
+
840
+ def is_fundamental(s):
841
+ for a in s.split():
842
+ if a not in 'size_t wchar_t struct union unsigned signed bool char short int float double long void *': return False
843
+ return True
844
+
845
+ def prune_templates( stack ):
846
+ x = []; hit = 0
847
+ for a in stack:
848
+ if a == '<' or a.startswith('<'): hit += 1
849
+ elif a == '>' or a.endswith('>'): hit -= 1
850
+ elif not hit and a != 'template': x.append( a )
851
+ return x
852
+
853
+ def prune_arrays( stack ):
854
+ x = []; hit = 0
855
+ for a in stack:
856
+ if a == '[' or a.startswith('['): hit += 1
857
+ elif a == ']' or a.endswith(']'): hit -= 1
858
+ elif not hit: x.append( a )
859
+ return x
860
+
861
+
862
+ def is_method_namestack(stack):
863
+ clean = prune_templates( stack ); print('CLEAN TEMPLATES',clean)
864
+ clean = prune_arrays( clean ); print('CLEAN ARRAYS',clean)
865
+
866
+ r = False
867
+ if 'operator' in stack: r = True # allow all operators
868
+ elif not ('(' in stack or '/(' in stack): r = False
869
+ elif stack[0]=='mutable': r = False
870
+ elif clean and clean[0] in ('class', 'struct'): r = False
871
+ elif not ('(' in clean or '/(' in clean): r = False
872
+ #elif '__attribute__' in stack: r = False
873
+ #elif stack[0] == '__attribute': r = False
874
+ elif stack[0] == 'typedef': r = False # TODO deal with typedef function prototypes
875
+ elif stack[0] in 'return if else case switch throw +'.split(): print( stack ); assert 0; r = False
876
+ elif stack[0] == '}' and stack[1] in 'return if else case switch'.split(): print( stack ); assert 0; r = False
877
+ elif '=' in stack:# and stack.index('=') < stack.index('('):
878
+ #if 'template' not in stack: r = False
879
+ if '=' in clean and clean.index('=') < clean.index('('): r = False
880
+ else: r = True
881
+
882
+ elif '{' in stack and stack.index('{') < stack.index('('): r = False # struct that looks like a method/class
883
+ elif '(' in stack and ')' in stack:
884
+ if '{' in stack and '}' in stack: r = True
885
+ #elif '/' in stack: r = False
886
+ #elif '/ ' in stack: r = False
887
+ elif stack[-1] == ';': r = True
888
+ elif '{' in stack: r = True
889
+ x = ''.join(stack)
890
+ if x.endswith('(0,0,0);'): r = False
891
+ elif x.endswith('(0);'): r = False
892
+ elif x.endswith(',0);'): r = False
893
+ elif x.endswith(',1);'): r = False
894
+ elif x.endswith(',true);'): r = False
895
+ elif x.endswith(',false);'): r = False
896
+ elif x.endswith(',0xFF);'): r = False
897
+ else: r = False
898
+ print( 'is method namestack', r, stack ); print('_'*80)
899
+ return r
900
+
901
+
902
+ class CppStruct(dict):
903
+ Structs = []
904
+ def __init__(self, nameStack):
905
+ if nameStack[0] == 'template': self['template'] = True
906
+ if nameStack.index('struct')+1 < len(nameStack):
907
+ self['type'] = nameStack[ nameStack.index('struct') + 1 ]
908
+ else: self['type'] = None
909
+ self['fields'] = []
910
+ self['methods'] = []
911
+ self['parent'] = None
912
+ self.Structs.append( self )
913
+
914
+ C99_NONSTANDARD = {
915
+ 'int8' : 'signed char',
916
+ 'int16' : 'short int',
917
+ 'int32' : 'int',
918
+ 'int64' : 'int64_t', # this can be: long int (64bit), or long long int (32bit)
919
+ 'uint' : 'unsigned int',
920
+ 'uint8' : 'unsigned char',
921
+ 'uint16' : 'unsigned short int',
922
+ 'uint32' : 'unsigned int',
923
+ 'uint64' : 'uint64_t', # depends on host bits
924
+ }
925
+
926
+
927
+ def standardize_fundamental( s ):
928
+ if s in C99_NONSTANDARD: return C99_NONSTANDARD[ s ]
929
+ else: return s
930
+
931
+
932
+ class Resolver(object):
933
+ C_FUNDAMENTAL = 'size_t unsigned signed bool char wchar short int float double long void'.split()
934
+ C_FUNDAMENTAL += 'struct union enum'.split()
935
+
936
+
937
+ SubTypedefs = {} # TODO deprecate?
938
+ NAMESPACES = []
939
+ CLASSES = {}
940
+ STRUCTS = {}
941
+
942
+ def initextra(self):
943
+ self.typedefs = {}
944
+ self.typedefs_info = {}
945
+ self.typedefs_order = []
946
+ self.classes_order = []
947
+ self.template_classes = {}
948
+ self.template_typedefs = {}
949
+ self.structs = Resolver.STRUCTS
950
+ self.structs_order = []
951
+ self.namespaces = Resolver.NAMESPACES # save all namespaces
952
+ self.curStruct = None
953
+ self.stack = [] # full name stack, good idea to keep both stacks? (simple stack and full stack)
954
+ self._classes_brace_level = {} # class name : level
955
+ self._structs_brace_level = {} # struct type : level
956
+ self._method_body = None
957
+ self._forward_decls = []
958
+ self._template_typenames = [] # template<typename XXX>
959
+ self.functions = [] # free functions
960
+
961
+ def current_namespace(self): return self.cur_namespace(True)
962
+
963
+ def cur_namespace(self, add_double_colon=False):
964
+ rtn = ""
965
+ i = 0
966
+ while i < len(self.nameSpaces):
967
+ rtn += self.nameSpaces[i]
968
+ if add_double_colon or i < len(self.nameSpaces) - 1: rtn += "::"
969
+ i+=1
970
+ return rtn
971
+
972
+
973
+ def guess_ctypes_type( self, string ):
974
+ pointers = string.count('*')
975
+ string = string.replace('*','')
976
+
977
+ a = string.split()
978
+ if 'unsigned' in a: u = 'u'
979
+ else: u = ''
980
+ if 'long' in a and 'double' in a: b = 'longdouble' # there is no ctypes.c_ulongdouble (this is a 64bit float?)
981
+ elif a.count('long') == 2 and 'int' in a: b = '%sint64' %u
982
+ elif a.count('long') == 2: b = '%slonglong' %u
983
+ elif 'long' in a: b = '%slong' %u
984
+ elif 'double' in a: b = 'double' # no udouble in ctypes
985
+ elif 'short' in a: b = '%sshort' %u
986
+ elif 'char' in a:
987
+ if u: b = 'ubyte' # no ctypes.c_uchar
988
+ else: b = 'char'
989
+ elif 'wchar' in a: b = 'wchar'
990
+ elif 'bool' in a: b = 'bool'
991
+ elif 'float' in a: b = 'float'
992
+
993
+ elif 'int' in a: b = '%sint' %u
994
+ elif 'int8' in a: b = 'int8'
995
+ elif 'int16' in a: b = 'int16'
996
+ elif 'int32' in a: b = 'int32'
997
+ elif 'int64' in a: b = 'int64'
998
+
999
+ elif 'uint' in a: b = 'uint'
1000
+ elif 'uint8' in a: b = 'uint8'
1001
+ elif 'uint16' in a: b = 'uint16'
1002
+ elif 'uint32' in a: b = 'uint32'
1003
+ elif 'uint64' in a: b = 'uint64'
1004
+
1005
+ elif 'size_t' in a: b = 'size_t'
1006
+ elif 'void' in a: b = 'void_p'
1007
+
1008
+ elif string in 'struct union'.split(): b = 'void_p' # what should be done here? don't trust struct, it could be a class, no need to expose via ctypes
1009
+ else: b = 'void_p'
1010
+
1011
+ if not pointers: return 'ctypes.c_%s' %b
1012
+ else:
1013
+ x = ''
1014
+ for i in range(pointers): x += 'ctypes.POINTER('
1015
+ x += 'ctypes.c_%s' %b
1016
+ x += ')' * pointers
1017
+ return x
1018
+
1019
+ def resolve_type( self, string, result ): # recursive
1020
+ '''
1021
+ keeps track of useful things like: how many pointers, number of typedefs, is fundamental or a class, etc...
1022
+ '''
1023
+ ## be careful with templates, what is inside <something*> can be a pointer but the overall type is not a pointer
1024
+ ## these come before a template
1025
+ s = string.split('<')[0]
1026
+ if not result['constant']: result[ 'constant' ] = 'const' in s.split()
1027
+ if not result['static']: result[ 'static' ] = 'static' in s.split()
1028
+ if not result['mutable']: result[ 'mutable' ] = 'mutable' in s.split()
1029
+
1030
+ ## these come after a template
1031
+ s = string.split('>')[-1]
1032
+ result[ 'pointer' ] += s.count('*')
1033
+ result[ 'reference' ] += s.count('&')
1034
+
1035
+
1036
+ x = string; alias = False
1037
+ for a in '* & const static mutable'.split(): x = x.replace(a,'')
1038
+ for y in x.split():
1039
+ if y not in self.C_FUNDAMENTAL: alias = y; break
1040
+
1041
+ #if alias == 'class':
1042
+ # result['class'] = result['name'] # forward decl of class
1043
+ # result['forward_decl'] = True
1044
+ if alias == '__extension__': result['fundamental_extension'] = True
1045
+ elif alias:# and alias not in result['aliases']:
1046
+ if alias in result['aliases']: return #print( result ); assert 0 # G3D::SkyParameters
1047
+ result['aliases'].append( alias )
1048
+ if alias in C99_NONSTANDARD:
1049
+ result['type'] = C99_NONSTANDARD[ alias ]
1050
+ result['typedef'] = alias
1051
+ result['typedefs'] += 1
1052
+ elif alias in self.typedefs:
1053
+ result['typedefs'] += 1
1054
+ result['typedef'] = alias
1055
+ self.resolve_type( self.typedefs[alias], result )
1056
+
1057
+ elif 'namespace' in result and result['namespace']+alias in self.typedefs and '::' not in alias: # is this always safe?
1058
+ alias = result['namespace']+alias
1059
+ result['typedefs'] += 1
1060
+ result['typedef'] = alias
1061
+ self.resolve_type( self.typedefs[alias], result )
1062
+
1063
+ elif alias in self.classes:
1064
+ klass = self.classes[alias]; result['fundamental'] = False
1065
+ result['class'] = klass
1066
+ result['unresolved'] = False
1067
+ #else: result['unresolved'] = True
1068
+ else:
1069
+ result['fundamental'] = True
1070
+ #result['unresolved'] = False
1071
+
1072
+
1073
+ def finalize_vars(self):
1074
+ for s in CppStruct.Structs: # vars within structs can be ignored if they do not resolve
1075
+ for var in s['fields']: var['parent'] = s['type']
1076
+ #for c in self.classes.values():
1077
+ # for var in c.get_all_properties(): var['parent'] = c['name']
1078
+
1079
+ ## RESOLVE ##
1080
+ for var in CppVariable.Vars:
1081
+ if 'invalid' in var and var['invalid']: # rare cases where parser fails
1082
+ if 'method' in var: var['method']['unresolved_parameters'] = True
1083
+ if 'function' in var: var['function']['unresolved_parameters'] = True
1084
+
1085
+ var['unresolved'] = False # force False
1086
+ self.resolve_type( var['type'], var )
1087
+
1088
+ # then find concrete type and best guess ctypes type #
1089
+ for var in CppVariable.Vars:
1090
+ if not var['aliases']: #var['fundamental']:
1091
+ var['ctypes_type'] = self.guess_ctypes_type( var['type'] )
1092
+
1093
+ else:
1094
+
1095
+ var['unresolved'] = False # below may set to True
1096
+ if var['class']:
1097
+ var['ctypes_type'] = 'ctypes.c_void_p'
1098
+ else:
1099
+ assert var['aliases']
1100
+ tag = var['aliases'][-1] # get the last alias to resolve
1101
+
1102
+ klass = None
1103
+ nestedEnum = None
1104
+ nestedStruct = None
1105
+ nestedTypedef = None
1106
+ template = None
1107
+ if 'method' in var and 'parent' in var['method']: # if no 'parent' method of struct
1108
+ klass = var['method']['parent']
1109
+ if tag in klass._public_enums:
1110
+ nestedEnum = klass._public_enums[ tag ]
1111
+ elif tag in klass._public_structs:
1112
+ nestedStruct = klass._public_structs[ tag ]
1113
+ elif tag in klass._public_typedefs:
1114
+ nestedTypedef = klass._public_typedefs[ tag ]
1115
+ elif 'template_typename' in klass and klass['template_typename'] == tag:
1116
+ template = tag
1117
+
1118
+ ############################
1119
+ if template:
1120
+ var['raw_type'] = '(template)'
1121
+ var['template'] = template
1122
+
1123
+ elif tag in ('std::string', 'std::basic_string', 'std::basic_string<char>'):
1124
+ var['std'] = 'string'
1125
+ var['constant'] = True
1126
+ var['raw_type'] = 'char'
1127
+ var['pointer'] = 1
1128
+ var['type'] = 'const char*'
1129
+ var['ctypes_type'] = 'ctypes.c_char_p'
1130
+ var['reference'] = False # force False
1131
+ var['fundamental'] = True
1132
+
1133
+ elif '<' in tag: # should also contain '>'
1134
+ #print(var)
1135
+ T = tag.split('<')[0]#; print( self.typedefs_info.keys() )
1136
+ typename = tag.split('<')[-1].split('>')[0]
1137
+ Tclass = self.find_template_class( T )
1138
+ if not Tclass:
1139
+ var['unresolved'] = True; var['unresolved_template_class']=True; continue
1140
+
1141
+ var['raw_type'] = Tclass['namespace'] + '::' + tag.split('::')[-1]
1142
+ var['template'] = Tclass['template_typename']; var['template_class'] = T
1143
+ var['ctypes_type'] = 'ctypes.c_void_p'
1144
+
1145
+ Tdef = None
1146
+ h = Tclass['namespace'] + '::' + Tclass['name']
1147
+ if h in self.template_typedefs: Tdef = self.template_typedefs[ h ]
1148
+
1149
+ if Tclass['template_typename'] != typename:
1150
+ if Tdef and typename in Tdef:
1151
+ var['raw_type'] = Tdef[ typename ]['name'] # the typedef'ed name
1152
+ else: var['unresolved'] = True
1153
+ else:
1154
+ var['template_requires_typename'] = True
1155
+
1156
+ var['typename_fundamental'] = is_fundamental( typename )
1157
+ if not var['typename_fundamental']:
1158
+ con = self.concrete_typedef( typename )
1159
+ if con: var['template'] = con
1160
+ else: var['template_nonfundamental'] = True
1161
+
1162
+
1163
+ elif nestedEnum:
1164
+ enum = nestedEnum
1165
+ if enum['type'] == 'int':
1166
+ var['ctypes_type'] = 'ctypes.c_int'
1167
+ var['raw_type'] = 'int'
1168
+
1169
+ elif enum['type'] == 'char*':
1170
+ var['ctypes_type'] = 'ctypes.c_char_p'
1171
+ var['raw_type'] = 'char*'
1172
+
1173
+ var['enum'] = var['method']['path'] + '::' + enum['name']
1174
+ var['fundamental'] = True
1175
+
1176
+ elif nestedStruct:
1177
+ var['ctypes_type'] = 'ctypes.c_void_p'
1178
+ var['raw_type'] = var['method']['path'] + '::' + nestedStruct['type']
1179
+ var['fundamental'] = False
1180
+ var['struct'] = nestedStruct['type']
1181
+ var['nested_struct'] = True # july17th
1182
+
1183
+ elif nestedTypedef:
1184
+ var['nested_typedef'] = nestedTypedef
1185
+ var['fundamental'] = is_fundamental( nestedTypedef )
1186
+ if not var['fundamental']:
1187
+ var['raw_type'] = var['method']['path'] + '::' + tag
1188
+ var['ctypes_type'] = 'ctypes.c_void_p'
1189
+ else:
1190
+ var['raw_type'] = nestedTypedef
1191
+ var['ctypes_type'] = self.guess_ctypes_type( nestedTypedef )
1192
+
1193
+ else:
1194
+
1195
+ _tag = tag
1196
+ if '::' in tag and tag.split('::')[0] in self.namespaces: tag = '::'.join(tag.split('::')[1:]) #tag.split('::')[-1]
1197
+ con = self.concrete_typedef( _tag )
1198
+
1199
+ if not con:
1200
+ for ns in self.namespaces:
1201
+ con = self.concrete_typedef( ns + '::' + _tag )
1202
+ if con: break
1203
+
1204
+ if con:
1205
+ var['concrete_type'] = _tag
1206
+ var['type'] = con
1207
+ self.resolve_type( var['type'], var )
1208
+ var['ctypes_type'] = self.guess_ctypes_type( var['type'] )
1209
+
1210
+ elif tag in self.structs:
1211
+ trace_print( 'STRUCT', var )
1212
+ var['struct'] = tag
1213
+ var['ctypes_type'] = 'ctypes.c_void_p'
1214
+ var['raw_type'] = self.structs[tag]['namespace'] + '::' + tag
1215
+
1216
+ elif tag in self._forward_decls:
1217
+ var['forward_declared'] = tag
1218
+ var['ctypes_type'] = 'ctypes.c_void_p'
1219
+
1220
+ elif tag in self.global_enums:
1221
+ enum = self.global_enums[ tag ]
1222
+ if enum['type'] == 'int':
1223
+ var['ctypes_type'] = 'ctypes.c_int'
1224
+ var['raw_type'] = 'int'
1225
+ elif enum['type'] == 'char*':
1226
+ var['ctypes_type'] = 'ctypes.c_char_p'
1227
+ var['raw_type'] = 'char*'
1228
+ var['enum'] = enum['namespace'] + enum['name']
1229
+ var['fundamental'] = True
1230
+
1231
+
1232
+ elif var['parent']:
1233
+ print( 'WARN unresolved', _tag)
1234
+ var['ctypes_type'] = 'ctypes.c_void_p'
1235
+ var['unresolved'] = True
1236
+
1237
+
1238
+ elif tag.count('::')==1:
1239
+ trace_print( 'trying to find nested something in', tag )
1240
+ a = tag.split('::')[0]
1241
+ b = tag.split('::')[-1]
1242
+ if a in self.classes: # a::b is most likely something nested in a class
1243
+ klass = self.classes[ a ]
1244
+ if b in klass._public_enums:
1245
+ trace_print( '...found nested enum', b )
1246
+ enum = klass._public_enums[ b ]
1247
+ if enum['type'] == 'int':
1248
+ var['ctypes_type'] = 'ctypes.c_int'
1249
+ var['raw_type'] = 'int'
1250
+ elif enum['type'] == 'char*':
1251
+ var['ctypes_type'] = 'ctypes.c_char_p'
1252
+ var['raw_type'] = 'char*'
1253
+
1254
+ if klass['namespace']: var['enum'] = '::'.join( [klass['namespace'], klass['name'], enum['name']] )
1255
+ else: var['enum'] = '::'.join( [klass['name'], enum['name']] )
1256
+
1257
+ var['fundamental'] = True
1258
+
1259
+ else: var['unresolved'] = True # TODO klass._public_xxx
1260
+
1261
+ elif a in self.namespaces: # a::b can also be a nested namespace
1262
+ if b in self.global_enums:
1263
+ enum = self.global_enums[ b ]
1264
+ trace_print(enum)
1265
+ trace_print(var)
1266
+ assert 0
1267
+
1268
+ elif b in self.global_enums: # falling back, this is a big ugly
1269
+ enum = self.global_enums[ b ]
1270
+ assert a in enum['namespace'].split('::')
1271
+ if enum['type'] == 'int':
1272
+ var['ctypes_type'] = 'ctypes.c_int'
1273
+ var['raw_type'] = 'int'
1274
+ elif enum['type'] == 'char*':
1275
+ var['ctypes_type'] = 'ctypes.c_char_p'
1276
+ var['raw_type'] = 'char*'
1277
+ var['enum'] = enum['namespace'] + enum['name']
1278
+ var['fundamental'] = True
1279
+ if '::' in var['enum']:
1280
+ ns = var['enum'].split('::')[0]
1281
+ assert ns in self.namespaces
1282
+ if self.get_parent_namespace( ns ):
1283
+ var['enum'] = self.get_parent_namespace( ns ) + '::' + var['enum']
1284
+
1285
+ else: # boost::gets::crazy
1286
+ trace_print('NAMESPACES', self.namespaces)
1287
+ trace_print( a, b )
1288
+ trace_print( '---- boost gets crazy ----' )
1289
+ var['ctypes_type'] = 'ctypes.c_void_p'
1290
+ var['unresolved'] = True
1291
+
1292
+
1293
+ elif 'namespace' in var and self.concrete_typedef(var['namespace']+tag):
1294
+ #print( 'TRYING WITH NS', var['namespace'] )
1295
+ con = self.concrete_typedef( var['namespace']+tag )
1296
+ if con:
1297
+ var['typedef'] = var['namespace']+tag
1298
+ var['type'] = con
1299
+ if 'struct' in con.split():
1300
+ var['raw_type'] = var['typedef']
1301
+ var['ctypes_type'] = 'ctypes.c_void_p'
1302
+ else:
1303
+ self.resolve_type( var['type'], var )
1304
+ var['ctypes_type'] = self.guess_ctypes_type( var['type'] )
1305
+
1306
+ elif '::' in var:
1307
+ var['ctypes_type'] = 'ctypes.c_void_p'
1308
+ var['unresolved'] = True
1309
+
1310
+ elif tag in self.SubTypedefs: # TODO remove SubTypedefs
1311
+ if 'property_of_class' in var or 'property_of_struct' in var:
1312
+ trace_print( 'class:', self.SubTypedefs[ tag ], 'tag:', tag )
1313
+ var['typedef'] = self.SubTypedefs[ tag ] # class name
1314
+ var['ctypes_type'] = 'ctypes.c_void_p'
1315
+ else:
1316
+ trace_print( "WARN-this should almost never happen!" )
1317
+ trace_print( var ); trace_print('-'*80)
1318
+ var['unresolved'] = True
1319
+
1320
+ elif tag in self._template_typenames:
1321
+ var['typename'] = tag
1322
+ var['ctypes_type'] = 'ctypes.c_void_p'
1323
+ var['unresolved'] = True # TODO, how to deal with templates?
1324
+
1325
+ elif tag.startswith('_'): # assume starting with underscore is not important for wrapping
1326
+ print( 'WARN unresolved', _tag)
1327
+ var['ctypes_type'] = 'ctypes.c_void_p'
1328
+ var['unresolved'] = True
1329
+
1330
+ else:
1331
+ trace_print( 'WARN: unknown type', var )
1332
+ if not 'property_of_class' in var or not 'property_of_struct' in var: print('TODO - fixme', var['name'], var['type'])
1333
+ var['unresolved'] = True
1334
+
1335
+
1336
+ ## if not resolved and is a method param, not going to wrap these methods ##
1337
+ if var['unresolved'] and 'method' in var: var['method']['unresolved_parameters'] = True
1338
+ if var['unresolved'] and 'function' in var: var['function']['unresolved_parameters'] = True
1339
+ if 'template' in var and 'method' in var: var['method']['template'] = True
1340
+
1341
+
1342
+ # create stripped raw_type #
1343
+ p = '* & const static mutable'.split()
1344
+ for var in CppVariable.Vars:
1345
+ if 'raw_type' not in var:
1346
+ raw = []
1347
+ for x in var['type'].split():
1348
+ if x not in p: raw.append( x )
1349
+ var['raw_type'] = ' '.join( raw )
1350
+
1351
+ if var['class']:
1352
+ if '::' not in var['raw_type']:
1353
+ if not var['class']['parent']:
1354
+ var['raw_type'] = var['class']['namespace'] + '::' + var['raw_type']
1355
+ elif var['class']['parent'] in self.classes:
1356
+ parent = self.classes[ var['class']['parent'] ]
1357
+ var['raw_type'] = parent['namespace'] + '::' + var['class']['name'] + '::' + var['raw_type']
1358
+ else:
1359
+ var['unresolved'] = True
1360
+
1361
+ elif '::' in var['raw_type'] and var['raw_type'].split('::')[0] not in self.namespaces:
1362
+ var['raw_type'] = var['class']['namespace'] + '::' + var['raw_type']
1363
+ else:
1364
+ var['unresolved'] = True
1365
+
1366
+ elif 'forward_declared' in var and 'namespace' in var:
1367
+ if '::' not in var['raw_type']:
1368
+ var['raw_type'] = var['namespace'] + var['raw_type']
1369
+ elif '::' in var['raw_type'] and var['raw_type'].split('::')[0] in self.namespaces:
1370
+ pass
1371
+ else: trace_print('-'*80); trace_print(var); raise NotImplemented
1372
+
1373
+ ## need full name space for classes in raw type ##
1374
+ if var['raw_type'].startswith( '::' ):
1375
+ var['unresolved'] = True
1376
+
1377
+ if 'method' in var and var['unresolved']: var['method']['unresolved_parameters'] = True
1378
+ if 'function' in var and var['unresolved']: var['function']['unresolved_parameters'] = True
1379
+
1380
+ def concrete_typedef( self, key ):
1381
+ if key not in self.typedefs:
1382
+ #print( 'FAILED typedef', key )
1383
+ return None
1384
+ checked = []
1385
+ while key in self.typedefs and key not in checked:
1386
+ prev = key
1387
+ key = self.typedefs[ key ]
1388
+ if '<' in key or '>' in key: return prev # stop at template
1389
+ elif key.startswith('std::'): return key # stop at std lib
1390
+ checked.append( key )
1391
+ return key
1392
+
1393
+ def get_parent_namespace(self, ns):
1394
+ for p in self.namespaces:
1395
+ if ns != p and ns in p.split('::') and p.split('::')[0] != ns:
1396
+ return p.split('::')[0]
1397
+
1398
+ def find_template_class( self, T ):
1399
+ if T in self.template_classes: return self.template_classes[ T ]
1400
+ else:
1401
+ for name in self.template_classes:
1402
+ if T in name: return self.template_classes[ name ]
1403
+
1404
+
1405
+ class _CppHeader( Resolver ):
1406
+ def finalize_return( self, meth, cls=None ):
1407
+ if meth['returns'] in 'return if else + for inline case break'.split():
1408
+ meth['returns_invalid'] = True
1409
+ return # TODO more irrlicht tests
1410
+
1411
+
1412
+ if not meth['returns_fundamental'] and meth['returns'] in C99_NONSTANDARD:
1413
+ meth['returns'] = C99_NONSTANDARD[meth['returns']]
1414
+ meth['returns_fundamental'] = True
1415
+
1416
+ elif not meth['returns_fundamental']: # describe the return type
1417
+
1418
+ con = self.concrete_typedef( meth['returns'] )
1419
+ if not con and cls:
1420
+ if cls['parent'] and '::' not in meth['returns']:
1421
+ parent = self.classes[ cls['parent'] ]
1422
+ con = self.concrete_typedef( parent['namespace'] + '::' + meth['returns'] )
1423
+ elif cls['namespace'] and '::' not in meth['returns']:
1424
+ con = self.concrete_typedef( cls['namespace'] + '::' + meth['returns'] )
1425
+
1426
+ if not con:
1427
+ for ns in self.namespaces:
1428
+ con = self.concrete_typedef( ns + '::' + meth['returns'] )
1429
+ if con: break
1430
+
1431
+ if con:
1432
+ if con == 'std::size_t': con = 'size_t'
1433
+ meth['returns_typedef'] = meth['returns']
1434
+ meth['returns'] = con
1435
+ meth['returns_fundamental'] = is_fundamental( con )
1436
+ if not meth['returns_fundamental']:
1437
+ if 'typename' in con.split(): meth['returns_invalid'] = True # TODO
1438
+ elif con in self.classes: meth['returns_class'] = True
1439
+ else: meth['returns_unknown'] = True
1440
+
1441
+ elif meth['returns'] in self.classes:
1442
+ trace_print( 'meth returns class:', meth['returns'] )
1443
+ meth['returns_class'] = True
1444
+
1445
+ elif meth['returns'] in self.SubTypedefs:
1446
+ clsname = self.SubTypedefs[ meth['returns'] ]
1447
+ meth['returns_nested'] = clsname + '::' + meth['returns']
1448
+ klass = self.classes[ clsname ]
1449
+ if meth['returns'] in klass._public_typedefs:
1450
+ meth['returns'] = klass._public_typedefs[ meth['returns'] ]
1451
+ if meth['returns'] in C99_NONSTANDARD: meth['returns'] = C99_NONSTANDARD[ meth['returns'] ]
1452
+ meth['returns_fundamental'] = is_fundamental( meth['returns'] )
1453
+ if not meth['returns_fundamental']: meth['returns_class'] = True
1454
+ else:
1455
+ meth['returns_unsafe'] = True # protected or private
1456
+
1457
+ elif cls and meth['returns'] in cls._public_enums:
1458
+ enum = cls._public_enums[ meth['returns'] ]
1459
+ meth['returns_enum'] = enum['type']
1460
+ meth['returns_fundamental'] = True
1461
+ if enum['type'] == 'int': meth['returns'] = 'int'
1462
+ else: meth['returns'] = 'char*'
1463
+
1464
+ elif meth['returns'] in self.global_enums:
1465
+ enum = self.global_enums[ meth['returns'] ]
1466
+ meth['returns_enum'] = enum['type']
1467
+ meth['returns_fundamental'] = True
1468
+ if enum['type'] == 'int': meth['returns'] = 'int'
1469
+ else: meth['returns'] = 'char*'
1470
+
1471
+ elif '::' in meth['returns'] and meth['returns'].split('::')[-1] in self.global_enums:
1472
+ a = meth['returns'].split('::')[-1]
1473
+ enum = self.global_enums[ a ]
1474
+ meth['returns_enum'] = enum['type']
1475
+ meth['returns_fundamental'] = True
1476
+ if enum['type'] == 'int': meth['returns'] = 'int'
1477
+ else: meth['returns'] = 'char*'
1478
+
1479
+
1480
+ elif meth['returns'].count('::')==1:
1481
+ trace_print( meth )
1482
+ a,b = meth['returns'].split('::')
1483
+ if a in self.namespaces:
1484
+ if b in self.classes:
1485
+ klass = self.classes[ b ]
1486
+ meth['returns_class'] = a + '::' + b
1487
+
1488
+ elif '<' in b and '>' in b:
1489
+ meth['returns_unknown'] = True
1490
+ meth['returns_template'] = True
1491
+ #meth['returns_class'] = b # template returns are always classes?
1492
+
1493
+ elif b in self.global_enums:
1494
+ enum = self.global_enums[ b ]
1495
+ meth['returns_enum'] = enum['type']
1496
+ meth['returns_fundamental'] = True
1497
+ if enum['type'] == 'int': meth['returns'] = 'int'
1498
+ else: meth['returns'] = 'char*'
1499
+
1500
+ else: trace_print( a, b); trace_print( meth); meth['returns_unknown'] = True
1501
+
1502
+ elif a in self.classes:
1503
+ klass = self.classes[ a ]
1504
+ if b in klass._public_enums:
1505
+ trace_print( '...found nested enum', b )
1506
+ enum = klass._public_enums[ b ]
1507
+ meth['returns_enum'] = enum['type']
1508
+ meth['returns_fundamental'] = True
1509
+ if enum['type'] == 'int': meth['returns'] = 'int'
1510
+ else: meth['returns'] = 'char*'
1511
+
1512
+ elif b in klass._public_forward_declares:
1513
+ meth['returns_class'] = True
1514
+
1515
+ elif b in klass._public_typedefs:
1516
+ meth['returns_nested_explicit'] = True
1517
+ meth['returns_nested'] = meth['returns']
1518
+ meth['returns'] = klass._public_typedefs[ b ]
1519
+ meth['returns_fundamental'] = is_fundamental( meth['returns'] )
1520
+ if not meth['returns_fundamental']: meth['returns_class'] = True
1521
+
1522
+ else:
1523
+ trace_print( meth ) # should be a nested class, TODO fix me.
1524
+ meth['returns_unknown'] = True
1525
+
1526
+ elif '::' in meth['returns']:
1527
+ trace_print('TODO namespace or extra nested return:', meth)
1528
+ meth['returns_unknown'] = True
1529
+
1530
+ elif self.concrete_typedef( meth['namespace'].split('::')[0] + '::' + meth['returns'] ):
1531
+ con = self.concrete_typedef( meth['namespace'].split('::')[0] + '::' + meth['returns'] )
1532
+ if con == 'std::size_t': con = 'size_t'
1533
+ meth['returns_typedef'] = meth['returns']
1534
+ meth['returns'] = con
1535
+ meth['returns_fundamental'] = is_fundamental( con )
1536
+ if not meth['returns_fundamental']:
1537
+ if 'typename' in con.split(): meth['returns_invalid'] = True # TODO
1538
+ elif con in self.classes: meth['returns_class'] = True
1539
+ else: meth['returns_unknown'] = True
1540
+
1541
+
1542
+ else:
1543
+ trace_print( 'WARN: UNKNOWN RETURN', meth['name'], meth['returns'])
1544
+ #print( self.global_enums.keys() )
1545
+ meth['returns_unknown'] = True
1546
+
1547
+ if meth['returns_fundamental']: meth['returns_ctypes'] = self.guess_ctypes_type( meth['returns'] )
1548
+
1549
+ def finalize(self):
1550
+ ## finalize templates ##
1551
+ for typedef in self.typedefs_info:
1552
+ tdef = self.typedefs_info[ typedef ]
1553
+ if 'template' in tdef:
1554
+ T = self.template_typedefs[ tdef['template'] ]
1555
+ if tdef['template'] not in self.template_classes: continue # TODO fix me
1556
+
1557
+ cls = self.template_classes[ tdef['template'] ]
1558
+ for info in T.values():
1559
+ if ',' in info['typename']: continue # TODO - complex templates
1560
+
1561
+ info['fundamental'] = is_fundamental( info['typename'] )
1562
+
1563
+ if not info['fundamental']:
1564
+ tn = info['typename']
1565
+ con = self.concrete_typedef( tn )
1566
+ if not con and cls:
1567
+ if cls['parent'] and '::' not in tn:
1568
+ parent = self.classes[ cls['parent'] ]
1569
+ con = self.concrete_typedef( parent['namespace'] + '::' + tn )
1570
+ elif cls['namespace'] and '::' not in tn:
1571
+ con = self.concrete_typedef( cls['namespace'] + '::' + tn )
1572
+
1573
+ if not con:
1574
+ for ns in self.namespaces:
1575
+ #print('trying', ns + '::' + tn)
1576
+ con = self.concrete_typedef( ns + '::' + tn )
1577
+ if con: break
1578
+ if con:
1579
+ if con == 'std::size_t': con = 'size_t'
1580
+ info['type'] = info['type'].replace('<%s>'%tn, '<%s>'%con)
1581
+ info['fundamental'] = is_fundamental( con )
1582
+ info['alias'] = tn
1583
+ info['typename'] = con
1584
+ info['ctypes_type'] = self.guess_ctypes_type( con )
1585
+ cls['template_info'] = T # do not resolve structs now
1586
+
1587
+ elif tn in self.structs:
1588
+ info['fundamental'] = False
1589
+ info['struct'] = True
1590
+ info['ctypes_type'] = 'ctypes.c_void_p'
1591
+ elif '::' in tn and tn.split('::')[-1] in self.structs:
1592
+ info['fundamental'] = False
1593
+ info['struct'] = True
1594
+ info['ctypes_type'] = 'ctypes.c_void_p'
1595
+
1596
+ else: print('TODO template', tn)
1597
+
1598
+
1599
+ ## finalize variables ##
1600
+ self.finalize_vars()
1601
+
1602
+ # finalize method returns types
1603
+ for cls in self.classes.values():
1604
+ for meth in cls.get_all_methods():
1605
+ if meth['pure_virtual']: cls['abstract'] = True
1606
+ self.finalize_return( meth, cls )
1607
+
1608
+ ## finalize free function returns ##
1609
+ for func in self.functions: self.finalize_return( func )
1610
+
1611
+
1612
+ ## find pure virtuals and mark abstract classes ##
1613
+ for cls in self.classes.values():
1614
+ methnames = cls.get_all_method_names()
1615
+ pvm = cls.get_all_pure_virtual_methods()
1616
+
1617
+ for d in cls['inherits']:
1618
+ c = d['class']
1619
+ a = d['access'] # do not depend on this to be 'public'
1620
+ trace_print( 'PARENT CLASS:', c )
1621
+ if c not in self.classes: trace_print('WARN: parent class not found')
1622
+ if c in self.classes and self.classes[c]['abstract']:
1623
+ p = self.classes[ c ]
1624
+ for meth in p.get_all_methods(): #p["methods"]["public"]:
1625
+ trace_print( '\t\tmeth', meth['name'], 'pure virtual', meth['pure_virtual'] )
1626
+ if meth['pure_virtual'] and meth['name'] not in methnames: cls['abstract'] = True; break
1627
+
1628
+ print self.typedefs.keys()
1629
+ print '-------------'
1630
+ for k in self.template_typedefs.keys(): print k
1631
+ #assert 'irr::core::dimension2d<u32>' in self.typedefs
1632
+ #assert 0
1633
+
1634
+
1635
+
1636
+
1637
+ def evaluate_struct_stack(self):
1638
+ """Create a Struct out of the name stack (but not its parts)"""
1639
+ #print( 'eval struct stack', self.nameStack )
1640
+ #if self.braceDepth != len(self.nameSpaces): return
1641
+ struct = CppStruct(self.nameStack)
1642
+ struct["namespace"] = self.cur_namespace()
1643
+ self.structs_order.append( struct )
1644
+ parentStruct = self.curStruct
1645
+ self.curStruct = struct
1646
+ if not struct['type']: return # struct {} name;
1647
+
1648
+ if self.curClass:
1649
+ struct['parent'] = self.curClass
1650
+ klass = self.classes[ self.curClass ]
1651
+ klass['structs'][self.curAccessSpecifier].append( struct )
1652
+ if self.curAccessSpecifier == 'public': klass._public_structs[ struct['type'] ] = struct
1653
+ self.structs[ self.curClass + '::' + struct['type'] ] = struct
1654
+
1655
+ elif parentStruct:
1656
+ print( 'TODO - struct in struct' )
1657
+ struct['nested'] = True
1658
+ self.structs[ struct['type'] ] = struct
1659
+
1660
+ else:
1661
+ self.structs[ struct['type'] ] = struct
1662
+
1663
+ self._structs_brace_level[ struct['type'] ] = self.braceDepth
1664
+
1665
+ ## python style ##
1666
+ PYTHON_OPERATOR_MAP = {
1667
+ '()' : '__call__',
1668
+ '[]' : '__getitem__',
1669
+ '<' : '__lt__',
1670
+ '<=' : '__le__',
1671
+ '==' : '__eq__',
1672
+ '!=' : '__ne__',
1673
+ '>' : '__gt__',
1674
+ '>=' : '__ge__',
1675
+ '+' : '__add__',
1676
+ '-' : '__sub__',
1677
+ '*' : '__mul__',
1678
+ '%' : '__divmod__',
1679
+ '**' : '__pow__',
1680
+ '>>' : '__lshift__',
1681
+ '<<' : '__rshift__',
1682
+ '&' : '__and__',
1683
+ '^' : '__xor__',
1684
+ '|' : '__or__',
1685
+ '+=' : '__iadd__',
1686
+ '-=' : '__isub__',
1687
+ '*=' : '__imult__',
1688
+ '/=' : '__idiv__',
1689
+ '%=' : '__imod__',
1690
+ '**=' : '__ipow__',
1691
+ '<<=' : '__ilshift__',
1692
+ '>>=' : '__irshift__',
1693
+ '&=' : '__iand__',
1694
+ '^=' : '__ixor__',
1695
+ '|=' : '__ior__',
1696
+ #__neg__ __pos__ __abs__; what are these in c++?
1697
+ '~' : '__invert__',
1698
+ '.' : '__getattr__',
1699
+ }
1700
+ OPERATOR_MAP = { # do not use double under-scores so no conflicts with python #
1701
+ '=' : '_assignment_',
1702
+ '->' : '_select_member_',
1703
+ '++' : '_increment_',
1704
+ '--' : '_deincrement_',
1705
+ 'new' : '_new_',
1706
+ 'delete' : '_delete_',
1707
+ }
1708
+ OPERATOR_MAP.update( PYTHON_OPERATOR_MAP )
1709
+
1710
+ def parse_method_type( self, stack ):
1711
+ #print( 'meth type info', stack )
1712
+ if stack[0] in ':;': stack = stack[1:]
1713
+ info = {
1714
+ 'debug': ' '.join(stack),
1715
+ 'class':None,
1716
+ 'namespace':self.current_namespace(),
1717
+ }
1718
+ if stack[0] == 'extern':
1719
+ info['extern'] = True
1720
+ if stack[1] == '"C"': stack = stack[ 2 : ]; info['C'] = True
1721
+ elif stack[1] == '"C++"': stack = stack[ 2 : ]
1722
+ else: stack = stack[ 1 : ]
1723
+
1724
+ for tag in 'defined pure_virtual operator constructor destructor extern template virtual static explicit inline friend returns returns_pointer returns_fundamental returns_class'.split(): info[tag]=False
1725
+
1726
+ for a in ('__attribute__', '__attribute', 'throw'):
1727
+ if a in stack:
1728
+ x = []; hit=None; skip=0
1729
+ for i,b in enumerate(stack):
1730
+ if b==a: hit = i
1731
+ elif hit is not None and b=='(' and i-1 == hit:
1732
+ skip = 1
1733
+ elif hit and b=='(':
1734
+ skip += 1
1735
+ elif skip and b==')':
1736
+ skip -= 1
1737
+ if skip == 0: hit = None
1738
+ elif not hit and not skip:
1739
+ x.append( b )
1740
+ if x: stack = x
1741
+ while stack and stack[0]==')': stack.pop(0)
1742
+ # is_method can be confused by properties like: "__pthread_unwind_buf_t __attribute__((__aligned__));"
1743
+ # and ends up passing to here thinking its a method.
1744
+ if '(' not in stack: return None
1745
+ #print('AFTER------',stack)
1746
+
1747
+ assert stack.count('(') == stack.count(')')
1748
+
1749
+ header = stack[ : stack.index('(') ]
1750
+ header = ' '.join( header )
1751
+ header = header.replace(' : : ', '::' )
1752
+ header = header.replace(' < ', '<' )
1753
+ header = header.replace(' > ', '> ' )
1754
+ header = header.strip()
1755
+
1756
+ if '{' in stack:
1757
+ info['defined'] = True
1758
+ self._method_body = self.braceDepth
1759
+ print( '----------NEW METHOD WITH BODY---------', self.braceDepth )
1760
+ elif stack[-1] == ';':
1761
+ info['defined'] = False
1762
+ self._method_body = None # this is force cleared in several other places
1763
+ else: assert 0
1764
+
1765
+ if len(stack) > 3 and stack[-1] == ';' and stack[-2] == '0' and stack[-3] == '=':
1766
+ info['pure_virtual'] = True
1767
+ elif len(stack) > 2 and stack[-1] == ';' and stack[-2] == '=0':
1768
+ info['pure_virtual'] = True
1769
+ elif stack[-1] == '=0;':
1770
+ info['pure_virtual'] = True
1771
+
1772
+ r = header.split()
1773
+ name = None
1774
+ if 'operator' in stack: # rare case op overload defined outside of class
1775
+ op = stack[ stack.index('operator')+1 : stack.index('(') ]
1776
+ op = ''.join(op)
1777
+ if not op:
1778
+ trace_print( 'TODO - parse () operator' )
1779
+ return None
1780
+ else:
1781
+ info['operator'] = op
1782
+ if op in self.OPERATOR_MAP:
1783
+ name = '__operator__' + self.OPERATOR_MAP[ op ]
1784
+ a = stack[ : stack.index('operator') ]
1785
+ else:
1786
+ trace_print('ERROR - not a C++ operator', op)
1787
+ return None
1788
+
1789
+ elif r: # June 23 2011
1790
+ name = r[-1]
1791
+ a = r[ : -1 ] # strip name
1792
+
1793
+ if name is None: print('HEAD', header); assert 0 #return None
1794
+
1795
+ while a and a[0] == '}': # strip - can have multiple } }
1796
+ a = a[1:] # july3rd
1797
+
1798
+ print(name)
1799
+ if '::' in name:
1800
+ klass = name[ : name.rindex('::') ]
1801
+ name = name.split('::')[-1]
1802
+ info['class'] = klass
1803
+
1804
+ if name.startswith('~'):
1805
+ info['destructor'] = True
1806
+ name = name[1:]
1807
+ elif not a:
1808
+ info['constructor'] = True
1809
+
1810
+ info['name'] = name
1811
+
1812
+ for tag in 'virtual static friend explicit inline __explicit__ __inline__'.split():
1813
+ if tag in a: info[ tag.replace('_','') ] = True; a.remove( tag ) # inplace
1814
+
1815
+
1816
+ if 'template' in a:
1817
+ a.remove('template')
1818
+ b = ' '.join( a )
1819
+ if '>' in b:
1820
+ info['template'] = b[ : b.index('>')+1 ]
1821
+ info['returns'] = b[ b.index('>')+1 : ] # find return type, could be incorrect... TODO
1822
+ if '<typename' in info['template'].split():
1823
+ typname = info['template'].split()[-1]
1824
+ typname = typname[ : -1 ] # strip '>'
1825
+ if typname not in self._template_typenames: self._template_typenames.append( typname )
1826
+ else: info['returns'] = ' '.join( a )
1827
+ else: info['returns'] = ' '.join( a )
1828
+
1829
+ info['returns'] = info['returns'].replace(" <","<")
1830
+ info['returns'] = info['returns'].replace(" >",">")
1831
+ info['returns'] = info['returns'].strip()
1832
+
1833
+ ## be careful with templates, do not count pointers inside template
1834
+ info['returns_pointer'] = info['returns'].split('>')[-1].count('*')
1835
+ if info['returns_pointer']: info['returns'] = info['returns'].replace('*','').strip()
1836
+
1837
+ info['returns_reference'] = '&' in info['returns']
1838
+ if info['returns']: info['returns'] = info['returns'].replace('&','').strip()
1839
+
1840
+ a = []
1841
+ for b in info['returns'].split():
1842
+ if b == '__const__': info['returns_const'] = True
1843
+ elif b == 'const': info['returns_const'] = True
1844
+ else: a.append( b )
1845
+ info['returns'] = ' '.join( a )
1846
+
1847
+ info['returns_fundamental'] = is_fundamental( info['returns'] )
1848
+ return info
1849
+
1850
+ def evaluate_method_stack(self):
1851
+ """Create a method out of the name stack"""
1852
+
1853
+ stack = [] ## fixes "/("
1854
+ for a in self.stack:
1855
+ if a == '/(': stack.append( '/' ); stack.append('(')
1856
+ else: stack.append( a )
1857
+ info = self.parse_method_type( stack )
1858
+
1859
+ if info:
1860
+ if info[ 'class' ] and info['class'] in self.classes: # case where methods are defined outside of class
1861
+ klass = self.classes[ info['class'] ]
1862
+ if not info['name'] in klass.get_all_method_names(): # do not overwrite header defined method
1863
+ print('External Method:', info['name'])
1864
+ newMethod = CppMethod(self.nameStack, info['name'], info)
1865
+ klass[ 'methods' ][ 'public' ].append( newMethod ) # it could be private, how do we know this.
1866
+ newMethod['parent'] = klass
1867
+ if klass['namespace']: newMethod['path'] = klass['namespace'] + '::' + klass['name']
1868
+ else: newMethod['path'] = klass['name']
1869
+ elif info['class']: pass
1870
+ elif '::' in info['name']: print( info ); assert 0
1871
+
1872
+ elif self.curStruct: # struct is a class in c++
1873
+ print( 'Struct Method:', info )
1874
+ newMethod = CppMethod(self.nameStack, self.curStruct, info)
1875
+ self.curStruct['methods'].append( newMethod )
1876
+
1877
+ elif self.curClass: # normal case
1878
+ trace_print( 'Internal Method:', info )
1879
+ newMethod = CppMethod(self.nameStack, self.curClass, info)
1880
+ klass = self.classes[self.curClass]
1881
+ klass['methods'][self.curAccessSpecifier].append(newMethod)
1882
+ newMethod['parent'] = klass
1883
+ if klass['namespace']: newMethod['path'] = klass['namespace'] + '::' + klass['name']
1884
+ else: newMethod['path'] = klass['name']
1885
+
1886
+
1887
+ else:
1888
+ print( 'free function:', self.nameStack )
1889
+ if 'operator' in info and info['operator']:
1890
+ trace_print( 'skipping external method def with operator', info )
1891
+ else:
1892
+ func = CppMethod(self.nameStack, methinfo=info)
1893
+ self.functions.append( func )
1894
+ if func['name'] == 'setNull': print(info); assert 0
1895
+
1896
+ self.stack = []
1897
+
1898
+ def _parse_typedef( self, stack, namespace='' ):
1899
+ if not stack or 'typedef' not in stack: return
1900
+ stack = list( stack ) # copy just to be safe
1901
+ if stack[-1] == ';': stack.pop()
1902
+
1903
+ while stack and stack[-1].isdigit(): stack.pop() # throw away array size for now
1904
+
1905
+ idx = stack.index('typedef')
1906
+ name = namespace + stack[-1]
1907
+ s = ''
1908
+ for a in stack[idx+1:-1]:
1909
+ if a == '{': break
1910
+ if not s or s[-1] in ':<>' or a in ':<>': s += a # keep compact
1911
+ else: s += ' ' + a # spacing
1912
+ s = s.replace(' <', '<')
1913
+ r = {'name':name, 'raw':s, 'type':s}
1914
+ if not is_fundamental(s):
1915
+ if 'struct' in s.split(): pass # TODO is this right? "struct ns::something"
1916
+ elif '::' not in s: s = namespace + s # only add the current name space if no namespace given
1917
+ #elif '::' in s:
1918
+ # ns = s.split('::')[0]
1919
+ # if ns not in self.namespaces:
1920
+ r['type'] = s
1921
+ if '<' in s:
1922
+ r['template'] = s.split('<')[0]
1923
+ r['typename'] = s.split('<')[-1].split('>')[0]
1924
+ if s: return r
1925
+
1926
+
1927
+ def evaluate_typedef(self):
1928
+ ns = self.cur_namespace(add_double_colon=True)
1929
+ res = self._parse_typedef( self.stack, ns )
1930
+ if res:
1931
+ name = res['name']
1932
+ self.typedefs[ name ] = res['type']
1933
+ self.typedefs_info[ name ] = res
1934
+ if name not in self.typedefs_order: self.typedefs_order.append( name )
1935
+ if 'template' in res:
1936
+ T = res['template']
1937
+ if T not in self.template_typedefs: self.template_typedefs[ T ] = {}
1938
+ self.template_typedefs[ T ][ res['typename'] ] = res
1939
+
1940
+ def evaluate_property_stack(self):
1941
+ """Create a Property out of the name stack"""
1942
+ assert self.stack[-1] == ';'
1943
+ if self.nameStack[0] == 'typedef':
1944
+ if self.curClass:
1945
+ typedef = self._parse_typedef( self.stack )
1946
+ name = typedef['name']
1947
+ klass = self.classes[ self.curClass ]
1948
+ klass[ 'typedefs' ][ self.curAccessSpecifier ].append( name )
1949
+ if self.curAccessSpecifier == 'public': klass._public_typedefs[ name ] = typedef['type']
1950
+ Resolver.SubTypedefs[ name ] = self.curClass
1951
+ else: assert 0
1952
+ elif self.curStruct or self.curClass:
1953
+ newVar = CppVariable(self.nameStack, self.stack)
1954
+ newVar['namespace'] = self.current_namespace()
1955
+ if self.curStruct:
1956
+ self.curStruct[ 'fields' ].append( newVar )
1957
+ newVar['property_of_struct'] = self.curStruct
1958
+ elif self.curClass:
1959
+ klass = self.classes[self.curClass]
1960
+ klass["properties"][self.curAccessSpecifier].append(newVar)
1961
+ newVar['property_of_class'] = klass['name']
1962
+
1963
+ self.stack = [] # CLEAR STACK
1964
+
1965
+ def evaluate_class_stack(self):
1966
+ """Create a Class out of the name stack (but not its parts)"""
1967
+ parent = self.curClass
1968
+ print('NEWCLASS', ' '.join(self.nameStack))
1969
+
1970
+ if self.braceDepth > len( self.nameSpaces) and (parent or self.curStruct):
1971
+ print( 'HIT NESTED SUBCLASS' )
1972
+ elif self.braceDepth-1 != len(self.nameSpaces):
1973
+ print( 'ERROR: WRONG BRACE DEPTH', self.braceDepth, self.nameSpaces )
1974
+ assert 0
1975
+
1976
+ self._method_body = None # force clear
1977
+
1978
+ prevAccess = None
1979
+ if parent: prevAccess = self.curAccessSpecifier
1980
+ self.curAccessSpecifier = 'private' # private is default
1981
+ self._current_access.append( self.curAccessSpecifier )
1982
+
1983
+ newClass = CppClass(self.nameStack)
1984
+ if 'name' not in newClass or not newClass['name']: assert 0
1985
+ print( 'CLASS OK', newClass['name'] )
1986
+ if newClass['name'] in 'RenderQueueInvocationIterator RenderQueueInvocationList'.split(): assert 0
1987
+
1988
+ if '>' in newClass['name']: print('WARN: strange template class', newClass['name'])
1989
+
1990
+ self.classes_order.append( newClass ) # good idea to save ordering
1991
+ self.stack = [] # fixes if class declared with ';' in closing brace
1992
+
1993
+ if parent:
1994
+ newClass["namespace"] = self.classes[ parent ]['namespace'] + '::' + parent
1995
+ newClass['parent'] = parent
1996
+ self.classes[ parent ]['nested_classes'].append( newClass )
1997
+ ## supports nested classes with the same name ##
1998
+ self.curClass = key = parent+'::'+newClass['name']
1999
+ self._classes_brace_level[ key ] = self.braceDepth
2000
+ ## nested classes that are protected or private can not be exposed in a C wrapper ##
2001
+ if prevAccess and prevAccess in ('protected', 'private'): newClass['internal'] = True
2002
+ elif 'internal' in self.classes[parent]: newClass['internal'] = True
2003
+ elif 'template_typename' in self.classes[parent]: newClass['internal'] = True; newClass['nested_in_template'] = True
2004
+
2005
+ elif newClass['parent']: # nested class defined outside of parent. A::B {...}
2006
+ parent = newClass['parent']
2007
+ newClass["namespace"] = self.classes[ parent ]['namespace'] + '::' + parent
2008
+ self.classes[ parent ]['nested_classes'].append( newClass )
2009
+ ## supports nested classes with the same name ##
2010
+ self.curClass = key = parent+'::'+newClass['name']
2011
+ self._classes_brace_level[ key ] = self.braceDepth
2012
+ if 'internal' in self.classes[parent]: newClass['internal'] = True
2013
+ elif 'template_typename' in self.classes[parent]: newClass['internal'] = True; newClass['nested_in_template'] = True
2014
+
2015
+ else:
2016
+ newClass["namespace"] = self.cur_namespace()
2017
+ key = newClass['name']
2018
+ self.curClass = newClass["name"]
2019
+ self._classes_brace_level[ newClass['name'] ] = self.braceDepth
2020
+
2021
+ if newClass['namespace'] in ('std', 'boost'):
2022
+ self.curClass = key = newClass['namespace'] + '::' + key
2023
+ self._classes_brace_level[ key ] = self.braceDepth
2024
+
2025
+ if key in self.classes:
2026
+ print('WARN - name collision', key)
2027
+
2028
+ self.classes[ key ] = newClass
2029
+ if 'template_typename' in newClass:
2030
+ self.template_classes[ self.current_namespace() + key ] = newClass
2031
+ if newClass['name'] not in self.template_classes:
2032
+ self.template_classes[ newClass['name'] ] = newClass
2033
+
2034
+
2035
+ def evaluate_forward_decl(self):
2036
+ trace_print( 'FORWARD DECL', self.nameStack )
2037
+ #assert self.nameStack[0] == 'class'
2038
+ name = self.nameStack[-1]
2039
+ if self.curClass:
2040
+ klass = self.classes[ self.curClass ]
2041
+ klass['forward_declares'][self.curAccessSpecifier].append( name )
2042
+ if self.curAccessSpecifier == 'public': klass._public_forward_declares.append( name )
2043
+ else: self._forward_decls.append( name )
2044
+
2045
+ class CppHeader( _CppHeader ):
2046
+ """Parsed C++ class header
2047
+
2048
+ Variables produced:
2049
+ self.classes - Dictionary of classes found in a given header file where the
2050
+ key is the name of the class
2051
+ """
2052
+ IGNORE_NAMES = '__extension__'.split()
2053
+
2054
+ def show(self):
2055
+ for className in self.classes.keys(): self.classes[className].show()
2056
+
2057
+
2058
+ def evaluate_enum_stack(self):
2059
+ """Create an Enum out of the name stack"""
2060
+ newEnum = CppEnum(self.nameStack)
2061
+ if len(newEnum.keys()):
2062
+ if len(self.curClass):
2063
+ newEnum["namespace"] = self.cur_namespace(False)
2064
+ klass = self.classes[self.curClass]
2065
+ klass["enums"][self.curAccessSpecifier].append(newEnum)
2066
+ if self.curAccessSpecifier == 'public':
2067
+ if 'name' in newEnum and newEnum['name']:
2068
+ klass._public_enums[ newEnum['name'] ] = newEnum
2069
+ else:
2070
+ newEnum["namespace"] = self.cur_namespace(True)
2071
+ self.enums.append(newEnum)
2072
+ if 'name' in newEnum and newEnum['name']: self.global_enums[ newEnum['name'] ] = newEnum
2073
+
2074
+ #This enum has instances, turn them into properties
2075
+ if newEnum.has_key("instances"):
2076
+ instanceType = "enum"
2077
+ if newEnum.has_key("name"):
2078
+ instanceType = newEnum["name"]
2079
+ for instance in newEnum["instances"]:
2080
+ self.nameStack = [instanceType, instance]
2081
+ self.evaluate_property_stack()
2082
+ del newEnum["instances"]
2083
+
2084
+
2085
+ def __init__(self, headerFileName, argType="file", **kwargs):
2086
+ """Create the parsed C++ header file parse tree
2087
+
2088
+ headerFileName - Name of the file to parse OR actual file contents (depends on argType)
2089
+ argType - Indicates how to interpret headerFileName as a file string or file name
2090
+ kwargs - Supports the following keywords
2091
+ "enumMaintianValueFormat" - Set to true for enum values to maintain the original format ('j' will not convert to 106)
2092
+ """
2093
+ ## reset global state ##
2094
+ global doxygenCommentCache
2095
+ doxygenCommentCache = ""
2096
+ CppVariable.Vars = []
2097
+ CppStruct.Structs = []
2098
+
2099
+ if (argType == "file"):
2100
+ self.headerFileName = os.path.expandvars(headerFileName)
2101
+ self.mainClass = os.path.split(self.headerFileName)[1][:-2]
2102
+ headerFileStr = ""
2103
+ elif argType == "string":
2104
+ self.headerFileName = ""
2105
+ self.mainClass = "???"
2106
+ headerFileStr = headerFileName
2107
+ else:
2108
+ raise Exception("Arg type must be either file or string")
2109
+ self.curClass = ""
2110
+
2111
+ global enumMaintianValueFormat
2112
+ if kwargs.has_key("enumMaintianValueFormat"):
2113
+ enumMaintianValueFormat = kwargs["enumMaintianValueFormat"]
2114
+ else:
2115
+ enumMaintianValueFormat = False
2116
+
2117
+ # nested classes have parent::nested, but no extra namespace,
2118
+ # this keeps the API compatible, TODO proper namespace for everything.
2119
+ Resolver.CLASSES = {}
2120
+ self.classes = Resolver.CLASSES
2121
+
2122
+ self.enums = []
2123
+ self.global_enums = {}
2124
+ self.nameStack = []
2125
+ self.nameSpaces = []
2126
+ self.curAccessSpecifier = 'private' # private is default
2127
+ self._current_access = []
2128
+ self.initextra() # harts hack
2129
+
2130
+ if (len(self.headerFileName)):
2131
+ headerFileStr = "\n".join(open(self.headerFileName).readlines())
2132
+ self.braceDepth = 0
2133
+ lex.input(headerFileStr)
2134
+ curLine = 0
2135
+ curChar = 0
2136
+ if 1: #try:
2137
+ while True:
2138
+ tok = lex.token()
2139
+ if not tok: break
2140
+ if tok.type == 'NAME' and tok.value in self.IGNORE_NAMES: continue
2141
+ if tok.type not in ('PRECOMP_MACRO', 'PRECOMP_MACRO_CONT'): self.stack.append( tok.value )
2142
+ curLine = tok.lineno
2143
+ curChar = tok.lexpos
2144
+
2145
+ if tok.type in ('OPEN_BRACKET', 'CLOSE_BRACKET'): self.nameStack.append( tok.value )
2146
+
2147
+ elif (tok.type == 'OPEN_BRACE'):
2148
+ _brace = True
2149
+ if len(self.nameStack)>=2 and self.nameStack[0]=='extern' and self.nameStack[1]=='"C"':
2150
+ _brace = False; print( 'extern C')
2151
+ elif len(self.nameStack)>=2 and self.nameStack[0]=='extern' and self.nameStack[1]=='"C++"':
2152
+ _brace = False; print( 'extern C++' )
2153
+ if _brace: self.braceDepth += 1
2154
+
2155
+
2156
+ if len(self.nameStack) >= 2 and is_namespace(self.nameStack): # namespace {} with no name used in boost, this sets default?
2157
+ self.nameSpaces.append(self.nameStack[1])
2158
+ ns = self.cur_namespace(); self.stack = []
2159
+ if ns not in self.namespaces: self.namespaces.append( ns )
2160
+ if len(self.nameStack) and not is_enum_namestack(self.nameStack):
2161
+ self.evaluate_stack()
2162
+ else:
2163
+ self.nameStack.append(tok.value)
2164
+ if self.stack and self.stack[0] == 'class': self.stack = []
2165
+
2166
+ #if _brace: self.braceDepth += 1
2167
+
2168
+ elif (tok.type == 'CLOSE_BRACE'):
2169
+
2170
+ if self.braceDepth == 0:
2171
+ continue
2172
+ if (self.braceDepth == len(self.nameSpaces)):
2173
+ tmp = self.nameSpaces.pop()
2174
+ self.stack = [] # clear stack when namespace ends?
2175
+ if len(self.nameStack) and is_enum_namestack(self.nameStack):
2176
+ self.nameStack.append(tok.value)
2177
+ elif self.braceDepth < 10:
2178
+ self.evaluate_stack()
2179
+ else:
2180
+ self.nameStack = []
2181
+ self.braceDepth -= 1
2182
+
2183
+ if self.braceDepth < 0:
2184
+ print('---------- END OF EXTERN -----------')
2185
+ self.braceDepth = 0
2186
+
2187
+ if self.curClass and debug: print( 'CURBD', self._classes_brace_level[ self.curClass ] )
2188
+
2189
+ if (self.braceDepth == 0) or (self.curClass and self._classes_brace_level[self.curClass] > self.braceDepth):
2190
+ if self.curClass: print( '------------END OF CLASS DEF-------------', 'braceDepth:', self.braceDepth )
2191
+
2192
+ if self._current_access: self._current_access.pop()
2193
+
2194
+ if self.curClass and self.classes[ self.curClass ]['parent']:
2195
+ self.curClass = self.classes[ self.curClass ]['parent']
2196
+ if self._current_access: self.curAccessSpecifier = self._current_access[-1]
2197
+ else:
2198
+ self.curClass = ""
2199
+ self.stack = []
2200
+
2201
+ #if self.curStruct: self.curStruct = None
2202
+ if self.braceDepth==0 or (self.curStruct and not self.curStruct['type']) or (self.curStruct and self._structs_brace_level[self.curStruct['type']] > self.braceDepth):
2203
+ if self.curStruct: print( '---------END OF STRUCT DEF-------------' )
2204
+ if self.curStruct and not self.curStruct['type']: self._struct_needs_name = self.curStruct
2205
+ self.curStruct = None
2206
+
2207
+ if self._method_body and self.braceDepth < self._method_body:
2208
+ self._method_body = None; self.stack = []; self.nameStack = []; print( 'FORCE CLEAR METHBODY' )
2209
+
2210
+ if (tok.type == 'OPEN_PAREN'):
2211
+ self.nameStack.append(tok.value)
2212
+
2213
+ elif (tok.type == 'CLOSE_PAREN'):
2214
+ self.nameStack.append(tok.value)
2215
+
2216
+ elif (tok.type == 'EQUALS'):
2217
+ self.nameStack.append(tok.value)
2218
+
2219
+ elif (tok.type == 'COMMA'):
2220
+ self.nameStack.append(tok.value)
2221
+
2222
+ elif (tok.type == 'NUMBER'):
2223
+ self.nameStack.append(tok.value)
2224
+
2225
+ elif (tok.type == 'MINUS'):
2226
+ self.nameStack.append(tok.value)
2227
+ elif (tok.type == 'PLUS'):
2228
+ self.nameStack.append(tok.value)
2229
+
2230
+ elif (tok.type == 'STRING_LITERAL'):
2231
+ self.nameStack.append(tok.value)
2232
+
2233
+ elif (tok.type == 'NAME' or tok.type == 'AMPERSTAND' or tok.type == 'ASTERISK'):
2234
+ self.nameStack.append(tok.value)
2235
+
2236
+ elif (tok.type == 'COLON'):
2237
+ #Dont want colon to be first in stack
2238
+ if len(self.nameStack) == 0:
2239
+ continue
2240
+ if self.nameStack and self.nameStack[-1] in supportedAccessSpecifier:
2241
+ if self.curClass or self.curStruct:
2242
+ cas = self.nameStack[-1]
2243
+ self.curAccessSpecifier = cas; print('CURACCESS-set', cas)
2244
+ if self.curClass:
2245
+ if self._current_access: self._current_access[-1] = cas
2246
+ else: self._current_access.append( cas )
2247
+ else: print('warning - "public ::namespace"', ' '.join(self.nameStack))
2248
+
2249
+ self.stack = []; self.nameStack = [] # need to clear nameStack to so that nested structs can be found
2250
+ else:
2251
+ self.nameStack.append(tok.value)
2252
+
2253
+ elif (tok.type == 'SEMI_COLON'):
2254
+ if (self.braceDepth < 10): self.evaluate_stack( tok.type )
2255
+ if not self.stack: continue
2256
+ if self.stack[0]=='typedef' and ( '{' not in self.stack or '}' in self.stack ): self.stack = []; trace_print( "REAL CLEAR")
2257
+ elif self.stack[0] != 'typedef': self.stack = []; trace_print('CLEAR STACK')
2258
+
2259
+ #except:
2260
+ # raise CppParseError("Not able to parse %s on line %d evaluating \"%s\"\nError around: %s"
2261
+ # % (self.headerFileName, tok.lineno, tok.value, " ".join(self.nameStack)))
2262
+
2263
+ self.finalize()
2264
+
2265
+ def evaluate_stack(self, token=None):
2266
+ """Evaluates the current name stack"""
2267
+ global doxygenCommentCache
2268
+ print( "Evaluating stack %s\nBraceDepth: %s" %(self.nameStack,self.braceDepth))
2269
+ print( "Evaluating stack %s\nBraceDepth: %s" %(self.stack,self.braceDepth))
2270
+ if (len(self.curClass)):
2271
+ if (debug): print( "%s (%s) "%(self.curClass, self.curAccessSpecifier))
2272
+
2273
+ #if 'typedef' in self.nameStack: self.evaluate_typedef() # allows nested typedefs, probably a bad idea
2274
+ if not self.curClass and 'typedef' in self.nameStack:
2275
+ print('HIT TYPEDEF', self.stack)
2276
+ if token == 'SEMI_COLON' and ('{' not in self.stack or '}' in self.stack): self.evaluate_typedef()
2277
+ else: return
2278
+
2279
+ elif (len(self.nameStack) == 0):
2280
+ if (debug): print( "line ",lineno() )
2281
+ if (debug): print( "(Empty Stack)" )
2282
+ return
2283
+ elif (self.nameStack[0] == "namespace"):
2284
+ #Taken care of outside of here
2285
+ pass
2286
+ elif len(self.nameStack) >= 2 and self.nameStack[0] == 'using' and self.nameStack[1] == 'namespace': pass # TODO
2287
+
2288
+ elif is_enum_namestack(self.nameStack):
2289
+ if (debug): print( "line ",lineno() )
2290
+ self.evaluate_enum_stack()
2291
+
2292
+ elif self._method_body and self.braceDepth >= self._method_body:
2293
+ #print( 'INSIDE METHOD DEF', self.nameStack )
2294
+ self.stack = []
2295
+
2296
+ #elif is_method_namestack(self.stack) and '(' in self.nameStack: # this fails on "operator /(..."
2297
+ elif ')' in self.nameStack and is_method_namestack(self.stack):
2298
+ #print( 'eval method', self.nameStack )
2299
+ self.evaluate_method_stack()
2300
+ self.stack = []
2301
+
2302
+ elif len(self.nameStack) >= 2 and (self.nameStack[0]=='friend' and self.nameStack[1]=='class'): pass
2303
+
2304
+ elif ('class' in self.nameStack or 'struct' in self.nameStack) and self.stack[-1] == ';': self.evaluate_forward_decl()
2305
+
2306
+ elif (self.nameStack[0] == "class") or (self.nameStack[0]=='template' and 'class' in self.nameStack):
2307
+ #print('^^^^^^^^^^^^^^^^^^^^')
2308
+ self.evaluate_class_stack()
2309
+ elif (self.nameStack[0] == "struct") or (len(self.nameStack)>3 and self.stack[-1]=='{' and self.nameStack[-3]=='struct'):
2310
+ print( '------------new struct-----------' )
2311
+ self.evaluate_struct_stack()
2312
+ self.stack = []
2313
+ elif self.nameStack[0]=='template' and self.stack[-1]=='{' and 'struct' in self.nameStack:
2314
+ print( '------------new struct - unsafe?' )
2315
+ self.evaluate_struct_stack()
2316
+ self.stack = []
2317
+
2318
+ elif '(' not in self.nameStack and ')' not in self.nameStack and self.stack[-1] == ';': # catching all props?
2319
+ self.evaluate_property_stack()
2320
+
2321
+
2322
+ elif not self.curClass:
2323
+ if (debug): print( "line ",lineno() )
2324
+ if is_enum_namestack(self.nameStack): self.evaluate_enum_stack()
2325
+ elif self.curStruct and self.stack[-1] == ';': self.evaluate_property_stack() # this catches fields of global structs
2326
+ self.nameStack = []
2327
+ doxygenCommentCache = ""
2328
+ return
2329
+ elif (self.braceDepth < 1):
2330
+ if (debug): print( "line ",lineno() )
2331
+ #Ignore global stuff for now
2332
+ if (debug): print( "Global stuff: ", self.nameStack )
2333
+ self.nameStack = []
2334
+ self._method_body = None
2335
+ doxygenCommentCache = ""
2336
+ return
2337
+ elif (self.braceDepth > len(self.nameSpaces) + 1):
2338
+ if (debug): print( "line ",lineno() )
2339
+ self.nameStack = []
2340
+ doxygenCommentCache = ""
2341
+ return
2342
+
2343
+ self.nameStack = [] # some if/else above return and others not, so this may or may not be reset
2344
+ doxygenCommentCache = ""
2345
+
2346
+
2347
+