Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add jsdoc3 to tools folder

  • Loading branch information...
commit 45ef77b446d793994e89a3a774aefc069a804079 1 parent 6b72339
bholt authored
Showing with 15,310 additions and 0 deletions.
  1. +4 −0 tools/jsdoc3/.gitignore
  2. +335 −0 tools/jsdoc3/Jake/lib/mustache.js
  3. +36 −0 tools/jsdoc3/Jake/templates/package.json.tmpl
  4. +73 −0 tools/jsdoc3/Jakefile.js
  5. +136 −0 tools/jsdoc3/LICENSE.md
  6. +95 −0 tools/jsdoc3/README.md
  7. 0  tools/jsdoc3/changes.md
  8. +11 −0 tools/jsdoc3/conf.json.EXAMPLE
  9. +9 −0 tools/jsdoc3/jsdoc
  10. +296 −0 tools/jsdoc3/jsdoc.js
  11. BIN  tools/jsdoc3/lib/js.jar
  12. +36 −0 tools/jsdoc3/lib/rhino-shim.js
  13. +140 −0 tools/jsdoc3/node_modules/common/args.js
  14. +302 −0 tools/jsdoc3/node_modules/common/assert.js
  15. +71 −0 tools/jsdoc3/node_modules/common/events.js
  16. +42 −0 tools/jsdoc3/node_modules/common/query.js
  17. +55 −0 tools/jsdoc3/node_modules/common/sqlite.js
  18. +119 −0 tools/jsdoc3/node_modules/common/util.js
  19. +1,446 −0 tools/jsdoc3/node_modules/evilstreak/markdown.js
  20. +70 −0 tools/jsdoc3/node_modules/goessner/json2xml.js
  21. +383 −0 tools/jsdoc3/node_modules/pajhome/hash.js
  22. +233 −0 tools/jsdoc3/node_modules/sitepen/jsonschema.js
  23. +1,427 −0 tools/jsdoc3/node_modules/typicaljoe/taffy.js
  24. +34 −0 tools/jsdoc3/node_modules/underscore/template.js
  25. +397 −0 tools/jsdoc3/node_modules/wrench/wrench.js
  26. +36 −0 tools/jsdoc3/package.json
  27. +344 −0 tools/jsdoc3/plugins/README.md
  28. +21 −0 tools/jsdoc3/plugins/commentConvert.js
  29. +20 −0 tools/jsdoc3/plugins/escapeHtml.js
  30. +22 −0 tools/jsdoc3/plugins/markdown.js
  31. +16 −0 tools/jsdoc3/plugins/shout.js
  32. +42 −0 tools/jsdoc3/plugins/sourcetag.js
  33. +158 −0 tools/jsdoc3/rhino_modules/fs.js
  34. +122 −0 tools/jsdoc3/rhino_modules/jsdoc/augment.js
  35. +67 −0 tools/jsdoc3/rhino_modules/jsdoc/borrow.js
  36. +328 −0 tools/jsdoc3/rhino_modules/jsdoc/doclet.js
  37. +237 −0 tools/jsdoc3/rhino_modules/jsdoc/name.js
  38. +73 −0 tools/jsdoc3/rhino_modules/jsdoc/opts/parser.js
  39. +70 −0 tools/jsdoc3/rhino_modules/jsdoc/package.js
  40. +308 −0 tools/jsdoc3/rhino_modules/jsdoc/schema.js
  41. +183 −0 tools/jsdoc3/rhino_modules/jsdoc/src/handlers.js
  42. +638 −0 tools/jsdoc3/rhino_modules/jsdoc/src/parser.js
  43. +68 −0 tools/jsdoc3/rhino_modules/jsdoc/src/scanner.js
  44. +134 −0 tools/jsdoc3/rhino_modules/jsdoc/tag.js
  45. +76 −0 tools/jsdoc3/rhino_modules/jsdoc/tag/dictionary.js
  46. +640 −0 tools/jsdoc3/rhino_modules/jsdoc/tag/dictionary/definitions.js
  47. +120 −0 tools/jsdoc3/rhino_modules/jsdoc/tag/type.js
  48. +51 −0 tools/jsdoc3/rhino_modules/jsdoc/tag/validator.js
  49. +80 −0 tools/jsdoc3/rhino_modules/jsdoc/template.js
  50. +89 −0 tools/jsdoc3/rhino_modules/jsdoc/tutorial.js
  51. +126 −0 tools/jsdoc3/rhino_modules/jsdoc/tutorial/resolver.js
  52. +157 −0 tools/jsdoc3/rhino_modules/jsdoc/util/dumper.js
  53. +160 −0 tools/jsdoc3/rhino_modules/jsdoc/util/templateHelper.js
  54. +17 −0 tools/jsdoc3/rhino_modules/path.js
  55. +4 −0 tools/jsdoc3/rhino_modules/sys.js
  56. +3 −0  tools/jsdoc3/templates/default/README.md
  57. +413 −0 tools/jsdoc3/templates/default/publish.js
  58. +260 −0 tools/jsdoc3/templates/default/static/styles/jsdoc-default.css
  59. +150 −0 tools/jsdoc3/templates/default/static/styles/node-dark.css
  60. +137 −0 tools/jsdoc3/templates/default/tmpl/container.tmpl
  61. +86 −0 tools/jsdoc3/templates/default/tmpl/details.tmpl
  62. +2 −0  tools/jsdoc3/templates/default/tmpl/example.tmpl
  63. +10 −0 tools/jsdoc3/templates/default/tmpl/examples.tmpl
  64. +21 −0 tools/jsdoc3/templates/default/tmpl/exceptions.tmpl
  65. +3 −0  tools/jsdoc3/templates/default/tmpl/fires.tmpl
  66. +37 −0 tools/jsdoc3/templates/default/tmpl/layout.tmpl
  67. +22 −0 tools/jsdoc3/templates/default/tmpl/members.tmpl
  68. +64 −0 tools/jsdoc3/templates/default/tmpl/method.tmpl
  69. +113 −0 tools/jsdoc3/templates/default/tmpl/params.tmpl
  70. +112 −0 tools/jsdoc3/templates/default/tmpl/properties.tmpl
  71. +27 −0 tools/jsdoc3/templates/default/tmpl/returns.tmpl
  72. +19 −0 tools/jsdoc3/templates/default/tmpl/tutorial.tmpl
  73. +193 −0 tools/jsdoc3/templates/haruki/publish.js
  74. +3 −0  tools/jsdoc3/test/README.md
  75. +17 −0 tools/jsdoc3/test/cases/abstracttag.js
  76. +29 −0 tools/jsdoc3/test/cases/accesstag.js
  77. +13 −0 tools/jsdoc3/test/cases/alias.js
  78. +10 −0 tools/jsdoc3/test/cases/alias2.js
  79. +12 −0 tools/jsdoc3/test/cases/alias3.js
  80. +7 −0 tools/jsdoc3/test/cases/aliasglobal.js
  81. +19 −0 tools/jsdoc3/test/cases/aliasresolve.js
  82. +19 −0 tools/jsdoc3/test/cases/aliasresolve2.js
  83. +20 −0 tools/jsdoc3/test/cases/also.js
  84. +53 −0 tools/jsdoc3/test/cases/augmentstag.js
  85. +6 −0 tools/jsdoc3/test/cases/authortag.js
  86. +14 −0 tools/jsdoc3/test/cases/borrowstag.js
  87. +21 −0 tools/jsdoc3/test/cases/borrowstag2.js
  88. +12 −0 tools/jsdoc3/test/cases/classtag.js
  89. +15 −0 tools/jsdoc3/test/cases/constructortag.js
  90. +19 −0 tools/jsdoc3/test/cases/constructstag.js
  91. +16 −0 tools/jsdoc3/test/cases/constructstag2.js
  92. +26 −0 tools/jsdoc3/test/cases/constructstag3.js
  93. +24 −0 tools/jsdoc3/test/cases/constructstag4.js
  94. +14 −0 tools/jsdoc3/test/cases/constructstag5.js
  95. +6 −0 tools/jsdoc3/test/cases/copyrighttag.js
  96. +34 −0 tools/jsdoc3/test/cases/defaulttag.js
  97. +11 −0 tools/jsdoc3/test/cases/deprecatedtag.js
  98. +5 −0 tools/jsdoc3/test/cases/destructuring.js
  99. +11 −0 tools/jsdoc3/test/cases/enumtag.js
  100. +18 −0 tools/jsdoc3/test/cases/eventfirestag.js
  101. +20 −0 tools/jsdoc3/test/cases/exceptiontag.js
  102. +15 −0 tools/jsdoc3/test/cases/exports.js
  103. +20 −0 tools/jsdoc3/test/cases/exportstag.js
  104. +18 −0 tools/jsdoc3/test/cases/exportstag2.js
  105. +22 −0 tools/jsdoc3/test/cases/exportstag3.js
  106. +12 −0 tools/jsdoc3/test/cases/exportstag4.js
  107. +24 −0 tools/jsdoc3/test/cases/externals.js
  108. +7 −0 tools/jsdoc3/test/cases/file.js
  109. +16 −0 tools/jsdoc3/test/cases/globaltag.js
  110. +6 −0 tools/jsdoc3/test/cases/ignoretag.js
  111. +6 −0 tools/jsdoc3/test/cases/ignoretag2.js
  112. +2 −0  tools/jsdoc3/test/cases/inlinecomment.js
  113. +7 −0 tools/jsdoc3/test/cases/inner.js
  114. +18 −0 tools/jsdoc3/test/cases/innerscope.js
  115. +19 −0 tools/jsdoc3/test/cases/innerscope2.js
  116. +24 −0 tools/jsdoc3/test/cases/jslangnames.js
  117. +16 −0 tools/jsdoc3/test/cases/lends.js
  118. +18 −0 tools/jsdoc3/test/cases/lends2.js
  119. +14 −0 tools/jsdoc3/test/cases/lendsglobal.js
  120. +15 −0 tools/jsdoc3/test/cases/linktag.js
  121. +11 −0 tools/jsdoc3/test/cases/memberoftag.js
  122. +10 −0 tools/jsdoc3/test/cases/memberoftag2.js
  123. +19 −0 tools/jsdoc3/test/cases/memberoftag3.js
  124. +44 −0 tools/jsdoc3/test/cases/memberoftagforced.js
  125. +28 −0 tools/jsdoc3/test/cases/moduleinner.js
  126. +17 −0 tools/jsdoc3/test/cases/moduleisconstructor.js
  127. +5 −0 tools/jsdoc3/test/cases/modules/data/mod-1.js
  128. +5 −0 tools/jsdoc3/test/cases/modules/data/mod-2.js
  129. +21 −0 tools/jsdoc3/test/cases/modules/data/mod-3.js
  130. +11 −0 tools/jsdoc3/test/cases/moduletag.js
  131. +9 −0 tools/jsdoc3/test/cases/moduletag2.js
  132. +20 −0 tools/jsdoc3/test/cases/moduletag3.js
  133. +7 −0 tools/jsdoc3/test/cases/namedFuncStatement.js
  134. +7 −0 tools/jsdoc3/test/cases/namedFuncStatement2.js
  135. +9 −0 tools/jsdoc3/test/cases/namedFuncStatement3.js
  136. +8 −0 tools/jsdoc3/test/cases/objectlit.js
  137. +8 −0 tools/jsdoc3/test/cases/objectlit2.js
  138. +41 −0 tools/jsdoc3/test/cases/paramtag.js
  139. +11 −0 tools/jsdoc3/test/cases/privatetag.js
  140. +9 −0 tools/jsdoc3/test/cases/projecttag.js
  141. +19 −0 tools/jsdoc3/test/cases/propertytag.js
  142. +19 −0 tools/jsdoc3/test/cases/quotename.js
  143. +10 −0 tools/jsdoc3/test/cases/quotename2.js
  144. +10 −0 tools/jsdoc3/test/cases/readonlytag.js
  145. +12 −0 tools/jsdoc3/test/cases/requirestag.js
  146. +11 −0 tools/jsdoc3/test/cases/returnstag.js
  147. +11 −0 tools/jsdoc3/test/cases/seetag.js
  148. +6 −0 tools/jsdoc3/test/cases/sincetag.js
  149. 0  tools/jsdoc3/test/cases/src/_dir2/four.js
  150. 0  tools/jsdoc3/test/cases/src/_ignored.js
  151. 0  tools/jsdoc3/test/cases/src/dir1/three.js
  152. 0  tools/jsdoc3/test/cases/src/ignored.txt
  153. 0  tools/jsdoc3/test/cases/src/one.js
  154. 0  tools/jsdoc3/test/cases/src/two.js
  155. +12 −0 tools/jsdoc3/test/cases/starbangstar.js
  156. +12 −0 tools/jsdoc3/test/cases/this-and-objectlit.js
  157. +10 −0 tools/jsdoc3/test/cases/this.js
  158. +15 −0 tools/jsdoc3/test/cases/this2.js
  159. +5 −0 tools/jsdoc3/test/cases/this3.js
  160. +10 −0 tools/jsdoc3/test/cases/thistag.js
  161. +5 −0 tools/jsdoc3/test/cases/typedeftag.js
  162. +17 −0 tools/jsdoc3/test/cases/typekind.js
  163. +10 −0 tools/jsdoc3/test/cases/typetag.js
  164. +6 −0 tools/jsdoc3/test/cases/utf8.js
  165. +10 −0 tools/jsdoc3/test/cases/var.js
  166. +26 −0 tools/jsdoc3/test/cases/variations.js
  167. +36 −0 tools/jsdoc3/test/cases/variations2.js
  168. +15 −0 tools/jsdoc3/test/cases/variations3.js
  169. +6 −0 tools/jsdoc3/test/cases/versiontag.js
  170. +3 −0  tools/jsdoc3/test/cases/virtual.js
  171. +186 −0 tools/jsdoc3/test/runner.js
  172. +22 −0 tools/jsdoc3/test/t/cases/abstracttag.js
  173. +37 −0 tools/jsdoc3/test/t/cases/accesstag.js
  174. +18 −0 tools/jsdoc3/test/t/cases/alias.js
  175. +16 −0 tools/jsdoc3/test/t/cases/alias2.js
  176. +10 −0 tools/jsdoc3/test/t/cases/alias3.js
  177. +9 −0 tools/jsdoc3/test/t/cases/aliasglobal.js
  178. +8 −0 tools/jsdoc3/test/t/cases/aliasresolve.js
  179. +8 −0 tools/jsdoc3/test/t/cases/aliasresolve2.js
  180. +11 −0 tools/jsdoc3/test/t/cases/also.js
  181. +67 −0 tools/jsdoc3/test/t/cases/augmentstag.js
  182. +9 −0 tools/jsdoc3/test/t/cases/authortag.js
  183. +12 −0 tools/jsdoc3/test/t/cases/borrowstag.js
  184. +15 −0 tools/jsdoc3/test/t/cases/borrowstag2.js
  185. +14 −0 tools/jsdoc3/test/t/cases/classtag.js
  186. +13 −0 tools/jsdoc3/test/t/cases/constructortag.js
  187. +9 −0 tools/jsdoc3/test/t/cases/constructstag.js
  188. +10 −0 tools/jsdoc3/test/t/cases/constructstag2.js
  189. +10 −0 tools/jsdoc3/test/t/cases/constructstag3.js
  190. +17 −0 tools/jsdoc3/test/t/cases/constructstag4.js
  191. +13 −0 tools/jsdoc3/test/t/cases/constructstag5.js
  192. +9 −0 tools/jsdoc3/test/t/cases/copyrighttag.js
  193. +39 −0 tools/jsdoc3/test/t/cases/defaulttag.js
  194. +14 −0 tools/jsdoc3/test/t/cases/deprecatedtag.js
  195. +27 −0 tools/jsdoc3/test/t/cases/enumtag.js
  196. +25 −0 tools/jsdoc3/test/t/cases/eventfirestag.js
  197. +18 −0 tools/jsdoc3/test/t/cases/exceptiontag.js
  198. +11 −0 tools/jsdoc3/test/t/cases/exports.js
  199. +29 −0 tools/jsdoc3/test/t/cases/exportstag.js
  200. +24 −0 tools/jsdoc3/test/t/cases/exportstag2.js
  201. +17 −0 tools/jsdoc3/test/t/cases/exportstag3.js
  202. +17 −0 tools/jsdoc3/test/t/cases/exportstag4.js
  203. +17 −0 tools/jsdoc3/test/t/cases/file.js
  204. +26 −0 tools/jsdoc3/test/t/cases/globaltag.js
  205. +17 −0 tools/jsdoc3/test/t/cases/ignoretag.js
  206. +10 −0 tools/jsdoc3/test/t/cases/inlinecomment.js
  207. +19 −0 tools/jsdoc3/test/t/cases/inner.js
  208. +18 −0 tools/jsdoc3/test/t/cases/innerscope.js
  209. +19 −0 tools/jsdoc3/test/t/cases/innerscope2.js
  210. +12 −0 tools/jsdoc3/test/t/cases/lends.js
  211. +15 −0 tools/jsdoc3/test/t/cases/lends2.js
  212. +15 −0 tools/jsdoc3/test/t/cases/lendsglobal.js
  213. +13 −0 tools/jsdoc3/test/t/cases/memberoftag.js
  214. +21 −0 tools/jsdoc3/test/t/cases/memberoftag2.js
  215. +14 −0 tools/jsdoc3/test/t/cases/memberoftag3.js
  216. +13 −0 tools/jsdoc3/test/t/cases/memberoftagforced.js
  217. +14 −0 tools/jsdoc3/test/t/cases/moduleinner.js
  218. +18 −0 tools/jsdoc3/test/t/cases/modules/data/mod-1.js
  219. +18 −0 tools/jsdoc3/test/t/cases/modules/data/mod-2.js
  220. +18 −0 tools/jsdoc3/test/t/cases/modules/data/mod-3.js
  221. +15 −0 tools/jsdoc3/test/t/cases/moduletag.js
  222. +23 −0 tools/jsdoc3/test/t/cases/moduletag2.js
  223. +41 −0 tools/jsdoc3/test/t/cases/namedFuncStatement.js
  224. +11 −0 tools/jsdoc3/test/t/cases/objectlit.js
  225. +11 −0 tools/jsdoc3/test/t/cases/objectlit2.js
  226. +69 −0 tools/jsdoc3/test/t/cases/paramtag.js
  227. +9 −0 tools/jsdoc3/test/t/cases/privatetag.js
  228. +10 −0 tools/jsdoc3/test/t/cases/projecttag.js
  229. +9 −0 tools/jsdoc3/test/t/cases/quotename.js
  230. +9 −0 tools/jsdoc3/test/t/cases/quotename2.js
  231. +9 −0 tools/jsdoc3/test/t/cases/readonlytag.js
  232. +15 −0 tools/jsdoc3/test/t/cases/requirestag.js
  233. +20 −0 tools/jsdoc3/test/t/cases/returnstag.js
  234. +13 −0 tools/jsdoc3/test/t/cases/seetag.js
  235. +9 −0 tools/jsdoc3/test/t/cases/sincetag.js
  236. +14 −0 tools/jsdoc3/test/t/cases/starbangstar.js
  237. +24 −0 tools/jsdoc3/test/t/cases/this-and-objectlit.js
  238. +19 −0 tools/jsdoc3/test/t/cases/this.js
  239. +12 −0 tools/jsdoc3/test/t/cases/this2.js
  240. +11 −0 tools/jsdoc3/test/t/cases/this3.js
  241. +16 −0 tools/jsdoc3/test/t/cases/thistag.js
  242. +22 −0 tools/jsdoc3/test/t/cases/typedeftag.js
  243. +16 −0 tools/jsdoc3/test/t/cases/typekind.js
  244. +16 −0 tools/jsdoc3/test/t/cases/typetag.js
  245. +29 −0 tools/jsdoc3/test/t/cases/var.js
  246. +21 −0 tools/jsdoc3/test/t/cases/variations.js
  247. +15 −0 tools/jsdoc3/test/t/cases/variations3.js
  248. +9 −0 tools/jsdoc3/test/t/cases/versiontag.js
  249. +16 −0 tools/jsdoc3/test/t/cases/virtual.js
  250. +91 −0 tools/jsdoc3/test/t/common/dumper.js
  251. +34 −0 tools/jsdoc3/test/t/common/events.js
  252. +16 −0 tools/jsdoc3/test/t/common/query.js
  253. +19 −0 tools/jsdoc3/test/t/common/scanner.js
  254. +51 −0 tools/jsdoc3/test/t/common/util.js
  255. +127 −0 tools/jsdoc3/test/t/jsdoc/name.js
  256. +37 −0 tools/jsdoc3/test/t/jsdoc/opts/parser.js
  257. +16 −0 tools/jsdoc3/test/t/jsdoc/src/handlers.js
  258. +52 −0 tools/jsdoc3/test/t/jsdoc/src/parser.js
  259. +119 −0 tools/jsdoc3/test/t/jsdoc/util/templateHelper.js
  260. +2 −0  tools/jsdoc3/test/tutorials/build.sh
  261. +8 −0 tools/jsdoc3/test/tutorials/src/x.js
  262. +3 −0  tools/jsdoc3/test/tutorials/tutorials/test.html
  263. +1 −0  tools/jsdoc3/test/tutorials/tutorials/test.js
  264. +1 −0  tools/jsdoc3/test/tutorials/tutorials/test2.json
  265. +1 −0  tools/jsdoc3/test/tutorials/tutorials/test2.markdown
View
4 tools/jsdoc3/.gitignore
@@ -0,0 +1,4 @@
+build-files/java/build
+jsdoc.jar
+test/tutorials/out
+conf.json
View
335 tools/jsdoc3/Jake/lib/mustache.js
@@ -0,0 +1,335 @@
+/*
+ mustache.js — Logic-less templates in JavaScript
+
+ See http://mustache.github.com/ for more info.
+*/
+
+var Mustache = function() {
+ var Renderer = function() {};
+
+ Renderer.prototype = {
+ otag: "{{",
+ ctag: "}}",
+ pragmas: {},
+ buffer: [],
+ pragmas_implemented: {
+ "IMPLICIT-ITERATOR": true,
+ "ARRAY-ORDINALS": true // define #first? and #last? when looping arrays
+ },
+ context: {},
+
+ render: function(template, context, partials, in_recursion) {
+ // reset buffer & set context
+ if(!in_recursion) {
+ this.context = context;
+ this.buffer = []; // TODO: make this non-lazy
+ }
+
+ // fail fast
+ if(!this.includes("", template)) {
+ if(in_recursion) {
+ return template;
+ } else {
+ this.send(template);
+ return;
+ }
+ }
+
+ template = this.render_pragmas(template);
+ var html = this.render_section(template, context, partials);
+ if(in_recursion) {
+ return this.render_tags(html, context, partials, in_recursion);
+ }
+
+ this.render_tags(html, context, partials, in_recursion);
+ },
+
+ /*
+ Sends parsed lines
+ */
+ send: function(line) {
+ if(line != "") {
+ this.buffer.push(line);
+ }
+ },
+
+ /*
+ Looks for %PRAGMAS
+ */
+ render_pragmas: function(template) {
+ // no pragmas
+ if(!this.includes("%", template)) {
+ return template;
+ }
+
+ var that = this;
+ var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
+ this.ctag);
+ return template.replace(regex, function(match, pragma, options) {
+ if(!that.pragmas_implemented[pragma]) {
+ throw({message:
+ "This implementation of mustache doesn't understand the '" +
+ pragma + "' pragma"});
+ }
+ that.pragmas[pragma] = {};
+ if(options) {
+ var opts = options.split("=");
+ that.pragmas[pragma][opts[0]] = opts[1];
+ }
+ return "";
+ // ignore unknown pragmas silently
+ });
+ },
+
+ /*
+ Tries to find a partial in the curent scope and render it
+ */
+ render_partial: function(name, context, partials) {
+ name = this.trim(name);
+ if(!partials || partials[name] === undefined) {
+ throw({message: "unknown_partial '" + name + "'"});
+ }
+ if(typeof(context[name]) != "object") {
+ return this.render(partials[name], context, partials, true);
+ }
+ return this.render(partials[name], context[name], partials, true);
+ },
+
+ /*
+ Renders inverted (^) and normal (#) sections
+ */
+ render_section: function(template, context, partials) {
+ if(!this.includes("#", template) && !this.includes("^", template)) {
+ return template;
+ }
+
+ var that = this;
+ // CSW - Added "+?" so it finds the tighest bound, not the widest
+ var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
+ "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
+ "\\s*", "mg");
+
+ // for each {{#foo}}{{/foo}} section do...
+ return template.replace(regex, function(match, type, name, content) {
+ var value = that.find(name, context);
+ if(type == "^") { // inverted section
+ if(!value || that.is_array(value) && value.length === 0) {
+ // false or empty list, render it
+ return that.render(content, context, partials, true);
+ } else {
+ return "";
+ }
+ } else if(type == "#") { // normal section
+ if(that.is_array(value)) { // Enumerable, Let's loop!
+ var len = value.length;
+ return value.map(function(row, i) {
+ return that.render(content, that.create_context(row, {first: i === 0, last: i === len-1}),
+ partials, true);
+ }).join("");
+ } else if(that.is_object(value)) { // Object, Use it as subcontext!
+ return that.render(content, that.create_context(value),
+ partials, true);
+ } else if(typeof value === "function") {
+ // higher order section
+ return value.call(context, content, function(text) {
+ return that.render(text, context, partials, true);
+ });
+ } else if(value) { // boolean section
+ return that.render(content, context, partials, true);
+ } else {
+ return "";
+ }
+ }
+ });
+ },
+
+ /*
+ Replace {{foo}} and friends with values from our view
+ */
+ render_tags: function(template, context, partials, in_recursion) {
+ // tit for tat
+ var that = this;
+
+ var new_regex = function() {
+ return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
+ that.ctag + "+", "g");
+ };
+
+ var regex = new_regex();
+ var tag_replace_callback = function(match, operator, name) {
+ switch(operator) {
+ case "!": // ignore comments
+ return "";
+ case "=": // set new delimiters, rebuild the replace regexp
+ that.set_delimiters(name);
+ regex = new_regex();
+ return "";
+ case ">": // render partial
+ return that.render_partial(name, context, partials);
+ case "{": // the triple mustache is unescaped
+ return that.find(name, context);
+ default: // escape the value
+ return that.escape(that.find(name, context));
+ }
+ };
+ var lines = template.split("\n");
+ for(var i = 0; i < lines.length; i++) {
+ lines[i] = lines[i].replace(regex, tag_replace_callback, this);
+ if(!in_recursion) {
+ this.send(lines[i]);
+ }
+ }
+
+ if(in_recursion) {
+ return lines.join("\n");
+ }
+ },
+
+ set_delimiters: function(delimiters) {
+ var dels = delimiters.split(" ");
+ this.otag = this.escape_regex(dels[0]);
+ this.ctag = this.escape_regex(dels[1]);
+ },
+
+ escape_regex: function(text) {
+ // thank you Simon Willison
+ if(!arguments.callee.sRE) {
+ var specials = [
+ '/', '.', '*', '+', '?', '|',
+ '(', ')', '[', ']', '{', '}', '\\'
+ ];
+ arguments.callee.sRE = new RegExp(
+ '(\\' + specials.join('|\\') + ')', 'g'
+ );
+ }
+ return text.replace(arguments.callee.sRE, '\\$1');
+ },
+
+ /*
+ find `name` in current `context`. That is find me a value
+ from the view object
+ */
+ find: function(name, context) {
+ name = this.trim(name);
+
+ // Checks whether a value is thruthy or false or 0
+ function is_kinda_truthy(bool) {
+ return bool === false || bool === 0 || bool;
+ }
+
+ var value;
+ if(is_kinda_truthy(context[name])) {
+ value = context[name];
+ } else if(is_kinda_truthy(this.context[name])) {
+ value = this.context[name];
+ }
+
+ if(typeof value === "function") {
+ return value.apply(context);
+ }
+ if(value !== undefined) {
+ return value;
+ }
+ // silently ignore unkown variables
+ return "";
+ },
+
+ // Utility methods
+
+ /* includes tag */
+ includes: function(needle, haystack) {
+ return haystack.indexOf(this.otag + needle) != -1;
+ },
+
+ /*
+ Does away with nasty characters
+ */
+ escape: function(s) {
+ s = String(s === null ? "" : s);
+ return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) {
+ switch(s) {
+ case "&": return "&amp;";
+ case "\\": return "\\\\";
+ case '"': return '&quot;';
+ case "'": return '&#39;';
+ case "<": return "&lt;";
+ case ">": return "&gt;";
+ default: return s;
+ }
+ });
+ },
+
+ // by @langalex, support for arrays of strings
+ create_context: function(_context, opts) {
+ if(this.is_object(_context)) {
+ if (this.pragmas["ARRAY-ORDINALS"] && opts) {
+ _context['first?'] = opts.first || false;
+ _context['last?'] = opts.last || false;
+ }
+ return _context;
+ } else {
+ var iterator = ".";
+ if(this.pragmas["IMPLICIT-ITERATOR"]) {
+ iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
+ }
+ var ctx = {};
+ ctx[iterator] = _context;
+ if (this.pragmas["ARRAY-ORDINALS"] && opts){
+ ctx['first?'] = opts.first || false;
+ ctx['last?'] = opts.last || false;
+ }
+ return ctx;
+ }
+ },
+
+ is_object: function(a) {
+ return a && typeof a == "object";
+ },
+
+ is_array: function(a) {
+ return Object.prototype.toString.call(a) === '[object Array]';
+ },
+
+ /*
+ Gets rid of leading and trailing whitespace
+ */
+ trim: function(s) {
+ return s.replace(/^\s*|\s*$/g, "");
+ },
+
+ /*
+ Why, why, why? Because IE. Cry, cry cry.
+ */
+ map: function(array, fn) {
+ if (typeof array.map == "function") {
+ return array.map(fn);
+ } else {
+ var r = [];
+ var l = array.length;
+ for(var i = 0; i < l; i++) {
+ r.push(fn(array[i]));
+ }
+ return r;
+ }
+ }
+ };
+
+ return({
+ name: "mustache.js",
+ version: "0.3.1-dev",
+
+ /*
+ Turns a template and view into HTML
+ */
+ to_html: function(template, view, partials, send_fun) {
+ var renderer = new Renderer();
+ if(send_fun) {
+ renderer.send = send_fun;
+ }
+ renderer.render(template, view, partials);
+ if(!send_fun) {
+ return renderer.buffer.join("\n");
+ }
+ }
+ });
+}();
View
36 tools/jsdoc3/Jake/templates/package.json.tmpl
@@ -0,0 +1,36 @@
+{
+ "name": "{{appname}}",
+ "version": "{{appversion}}",
+ "revision": "{{timestamp}}",
+ "description": "An automatic documentation generator for javascript.",
+ "keywords": [ "documentation", "javascript" ],
+ "licenses": [
+ {
+ "type": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0"
+ }
+ ],
+ "repositories": [
+ {
+ "type": "git",
+ "url": "git://github.com/micmath/jsdoc.git"
+ }
+ ],
+ "bugs": "https://github.com/micmath/jsdoc/issues",
+ "contributors" : [
+ {
+ "name": "Michael Mathews",
+ "email": "micmath@gmail.com"
+ },
+ {
+ "name": "Rafa\u0105 Wrzeszcz",
+ "email": "rafal.wrzeszcz@wrzasq.pl"
+ }
+ ],
+ "maintainers": [
+ {
+ "name": "Michael Mathews",
+ "email": "micmath@gmail.com"
+ }
+ ]
+}
View
73 tools/jsdoc3/Jakefile.js
@@ -0,0 +1,73 @@
+// see: https://github.com/mde/jake
+
+desc('Updating package.json revision.');
+task('default', [], function(params) {
+ var fs = require('fs'), sys = require('sys');
+
+ // import the Mustache template tool
+ eval(fs.readFileSync('Jake/lib/mustache.js', 'utf8'));
+
+ var templates = {
+ packagejson : fs.readFileSync('Jake/templates/package.json.tmpl', 'utf8')
+ };
+
+ var metadata = {
+ appname : 'JSDoc',
+ appversion : '3.0.0alpha',
+ timestamp : '' + new Date().getTime()
+ };
+
+ var outdir = './';
+
+ var rendered = Mustache.to_html(templates.packagejson, metadata);
+
+ fs.writeFileSync(outdir + 'package.json', rendered, 'utf8');
+
+ process.exit(0);
+
+});
+
+desc('Installs a plugin/template.');
+task('install', [], function(loc) {
+ var fs = require('fs'), util = require('util'), path = require('path'), wrench = require('wrench/wrench');
+
+ if(!loc) {
+ fail("You must specify the location of the plugin/template.");
+ }
+
+ if(!path.existsSync(loc)) {
+ fail("plugin/template location [" + loc + "] is not valid.");
+ }
+
+ var pluginLoc = path.join(loc, "plugins"), templateLoc = path.join(loc, "templates"), jsdocLoc = process.cwd(), name, config;
+
+ //First the plugin
+ if(path.existsSync(pluginLoc)) {
+ //copy it over
+ wrench.copyDirSyncRecursive(pluginLoc, path.join(jsdocLoc, "plugins"), {
+ preserve : true
+ });
+ //find out what it's called
+ name = fs.readdirSync(pluginLoc)[0].replace(".js", "");
+ //And finally edit the conf.json
+ try {
+ config = JSON.parse(fs.readFileSync(path.join(jsdocLoc, 'conf.json'), 'utf8'));
+ if(config.plugins.indexOf('plugins/' + name) == -1) {
+ config.plugins.push('plugins/' + name);
+ fs.writeFileSync(path.join(jsdocLoc, 'conf.json'), JSON.stringify(config, null, " "), 'utf8');
+ }
+ } catch (e) {
+ fail("Could not edit the conf.json file: " + e);
+ }
+ }
+
+ //Then the template
+ if(path.existsSync(pluginLoc)) {
+ wrench.copyDirSyncRecursive(templateLoc, path.join(jsdocLoc, "templates"), {
+ preserve : true
+ });
+ }
+
+ process.exit(0);
+
+});
View
136 tools/jsdoc3/LICENSE.md
@@ -0,0 +1,136 @@
+License
+=======
+
+JSDoc 3 is free software, licensed under the Apache License,
+Version 2.0 (the "License"); you MAY NOT use this software except in
+compliance with the License. You have permission to use it for commercial,
+non-commercial, or any other purpose you like, according to the
+License below.
+
+Copyright (c) 2011 Michael Mathews <micmath@gmail.com>
+All rights reserved.
+
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied. See the License for the specific language governing
+permissions and limitations under the License.
+
+You may obtain the source code for JSDoc 3 at
+https://github.com/micmath/JSDoc
+
+
+In Addition
+===========
+
+Third party software is included, used-by or distributed along
+with JSDoc 3. Each is provided under its own license and has source
+available from other locations.
+
+
+Rhino
+----
+
+Rhino is open source and licensed by Mozilla under the MPL 1.1 or
+later/GPL 2.0 or later licenses.
+
+https://developer.mozilla.org/en/Rhino_License
+
+You may obtain the source code for Rhino from the Mozilla web site at
+http://www.mozilla.org/rhino/download.html
+
+markdown-js
+----
+
+markdown-js is released under the MIT license. You may obtain a copy of the
+License at http://www.opensource.org/licenses/mit-license.php
+
+Copyright (c) 2009-2010 Dominic Baggott
+Copyright (c) 2009-2010 Ash Berlin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+You may obtain the source code for markdown-js at
+https://github.com/evilstreak/markdown-js
+
+sqlitejdbc (build/java/classes/sqlitejdbc-v054.jar)
+----
+
+Copyright (c) 2007 David Crawshaw <david@zentus.com>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+You may obtain the source code for sqlitejdbc at
+https://github.com/crawshaw/sqlitejdbc
+
+Underscore Template
+----
+
+Underscore.js 1.1.4
+
+Copyright (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
+
+Underscore is freely distributable under the MIT license.
+Portions of Underscore are inspired or borrowed from Prototype,
+Oliver Steele's Functional, and John Resig's Micro-Templating.
+
+For all details and documentation:
+http://documentcloud.github.com/underscore/#template
+
+TaffyDB
+----
+
+Copyright (c) 2008 All rights reserved.
+
+Software License Agreement (BSD License)
+
+Redistribution and use of this software in source and binary forms,
+with or without modification, are permitted provided that the
+following condition is met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+You may obtain the source code for TaffyDB at
+https://github.com/typicaljoe/taffydb
View
95 tools/jsdoc3/README.md
@@ -0,0 +1,95 @@
+JSDoc 3
+=======
+
+An inline API documentation processor for JavaScript. JSDoc 3 is intended to be
+an upgrade to JsDoc Toolkit (JSDoc 2).
+
+Notice
+------
+
+This is *beta software*! It is available for testing purposes and may not be
+suitable for production use yet.
+
+Installation
+------------
+
+Download a copy of JSDoc 3 from the official Git Hub repository here:
+<https://github.com/jsdoc3/jsdoc>
+
+To test that jsdoc is working, change your working directory to the jsdoc folder
+and run the following command:
+
+ java -cp lib/js.jar org.mozilla.javascript.tools.shell.Main \
+ -modules node_modules -modules rhino_modules \
+ jsdoc.js -T
+
+If you are operating on a Mac OSX or *nix platform, you can shorten that command
+to this:
+
+ ./jsdoc -T
+
+Usage
+-----
+
+This example assumes that your working directory is the jsdoc application base
+directory:
+
+ ./jsdoc yourSourceCodeFile.js
+
+For help regarding the supported commandline options use the --help option.
+
+ ./jsdoc --help
+
+Generated documentation will appear in the folder specified by the --destination
+option, or in a folder named "out" by default.
+
+Dependencies
+------------
+
+JSDoc 3 utilises the Mozilla Rhino engine, which requires Java. JSDoc 3 is known
+to work with version 1.6.0_24 of Java.
+
+JSDoc 3 uses advanced features in the Rhino application which are only
+available in or after the 1.7 release 3. A copy of this version of Rhino is
+included in JSDoc so this is not normally an issue that the user needs to be
+concerned with. However, in rare cases, users may have their Java CLASSPATH
+configured to override that included Rhino and point to some older version of
+Rhino instead. If this is the case, simply correct the CLASSPATH to remove the
+older Rhino.
+
+The version of rhino distributed with JSDoc3 can be found here: https://github.com/jannon/rhino
+
+Debugging
+---------
+
+Rhino is not always very friendly when it comes to reporting errors in
+JavaScript. Luckily it comes with a full-on debugger included that can be much
+more useful than a simple stack trace. To invoke JSDoc with the debugger try the
+following command:
+
+ $ java -classpath lib/js.jar \
+ org.mozilla.javascript.tools.debugger.Main -debug \
+ -modules node_modules -modules rhino_modules \
+ jsdoc.js \
+ your/script.js
+
+This will open a debugging window. Choose "Break on Exceptions" from the "Debug"
+menu, then press the "Run" button. If there is an error, you should see exactly
+where it is in the source code.
+
+See Also
+--------
+
+Project Documentation: <http://usejsdoc.org/> (under development)
+Project Documentation Source: <https://github.com/micmath/micmath.github.com>
+JSDoc User's Group: <http://groups.google.com/group/jsdoc-users>
+JSDoc3 Ant Task <https://github.com/jannon/jsdoc3-ant-task>
+Project Annoncements: <http://twitter.com/jsdoc3>
+
+License
+-------
+
+JSDoc 3 is copyright (c) 2011 Michael Mathews <micmath@gmail.com>
+
+See file "LICENSE.md" in this distribution for more details about
+terms of use.
View
0  tools/jsdoc3/changes.md
No changes.
View
11 tools/jsdoc3/conf.json.EXAMPLE
@@ -0,0 +1,11 @@
+{
+ "tags": {
+ "allowUnknownTags": true
+ },
+ "source": {
+ "includePattern": ".+\\.js(doc)?$",
+ "excludePattern": "(^|\\/)_"
+ },
+ "plugins": [],
+ "jsVersion": 180
+}
View
9 tools/jsdoc3/jsdoc
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# rhino discards the path to the current script file, so we must add it back
+SOURCE="$0"
+while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
+BASEDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+java -classpath ${BASEDIR}/lib/js.jar org.mozilla.javascript.tools.shell.Main -modules ${BASEDIR}/node_modules -modules ${BASEDIR}/rhino_modules -modules ${BASEDIR} ${BASEDIR}/jsdoc.js --dirname=${BASEDIR} $@
+
+#java -classpath ${BASEDIR}/lib/js.jar org.mozilla.javascript.tools.debugger.Main -debug -modules ${BASEDIR}/node_modules -modules ${BASEDIR}/rhino_modules -modules ${BASEDIR} ${BASEDIR}/jsdoc.js --dirname=${BASEDIR} $@
View
296 tools/jsdoc3/jsdoc.js
@@ -0,0 +1,296 @@
+/**
+ * @project jsdoc
+ * @author Michael Mathews <micmath@gmail.com>
+ * @license See LICENSE.md file included in this distribution.
+ */
+
+// try: $ java -classpath build-files/java/classes/js.jar org.mozilla.javascript.tools.shell.Main main.js `pwd` script/to/parse.js
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
+
+/** The absolute path to the base directory of the jsdoc application.
+ @type string
+ @global
+ */
+__dirname = '.',
+args = Array.prototype.slice.call(arguments, 0);
+
+// rhino has no native way to get the base dirname of the currently running script
+// so this information must be manually passed in from the command line
+for (var i = 0; i < args.length; i++) {
+ if ( /^--dirname(?:=(.+?)(\/|\/\.)?)?$/i.test(args[i]) ) {
+ if (RegExp.$1) {
+ __dirname = RegExp.$1; // last wins
+ args.splice(i--, 1); // remove --dirname opt from arguments
+ }
+ else {
+ __dirname = args[i + 1];
+ args.splice(i--, 2);
+ }
+ }
+}
+
+load(__dirname + '/lib/rhino-shim.js');
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
+
+
+/** Data representing the environment in which this app is running.
+ @namespace
+*/
+env = {
+ /** Running start and finish times. */
+ run: {
+ start: new Date(),
+ finish: null
+ },
+
+ /**
+ The command line arguments passed into jsdoc.
+ @type Array
+ */
+ args: Array.prototype.slice.call(args, 0),
+
+
+ /**
+ The parsed JSON data from the configuration file.
+ @type Object
+ */
+ conf: {},
+
+ /**
+ The command line arguments, parsed into a key/value hash.
+ @type Object
+ @example if (env.opts.help) { print 'Helpful message.'; }
+ */
+ opts: {}
+};
+
+/**
+ Data that must be shared across the entire application.
+ @namespace
+*/
+app = {
+ jsdoc: {
+ scanner: new (require('jsdoc/src/scanner').Scanner)(),
+ parser: new (require('jsdoc/src/parser').Parser)(),
+ name: require('jsdoc/name')
+ }
+}
+
+try { main(); }
+catch(e) {
+ if (e.rhinoException != null) {
+ e.rhinoException.printStackTrace();
+ }
+ else throw e;
+}
+finally { env.run.finish = new Date(); }
+
+/** Print string/s out to the console.
+ @param {string} ... String/s to print out to console.
+ */
+function print() {
+ for (var i = 0, leni = arguments.length; i < leni; i++) {
+ java.lang.System.out.println('' + arguments[i]);
+ }
+}
+
+/**
+ Try to recursively print out all key/values in an object.
+ @global
+ @param {Object} ... Object/s to dump out to console.
+ */
+function dump() {
+ for (var i = 0, leni = arguments.length; i < leni; i++) {
+ print( require('jsdoc/util/dumper').dump(arguments[i]) );
+ }
+}
+
+/** @global
+ @param {string} filepath The path to the script file to include (read and execute).
+*/
+function include(filepath) {
+ try {
+ load(__dirname + '/' + filepath);
+ }
+ catch (e) {
+ console.log('Cannot include "' + __dirname + '/' + filepath + '": '+e);
+ }
+}
+
+/**
+ Cause the VM running jsdoc to exit running.
+ @param {number} [n = 0] The exit status.
+ */
+function exit(n) {
+ n = n || 0;
+ java.lang.System.exit(n);
+}
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
+
+
+/**
+ Run the jsoc application.
+ */
+function main() {
+ var sourceFiles,
+ packageJson,
+ docs,
+ jsdoc = {
+ opts: {
+ parser: require('jsdoc/opts/parser'),
+ }
+ },
+ resolver,
+ dictionary = require('jsdoc/tag/dictionary'),
+ fs = require('fs');
+
+ env.opts = jsdoc.opts.parser.parse(env.args);
+
+ try {
+ env.conf = JSON.parse(
+ fs.readFileSync( env.opts.configure || __dirname + '/conf.json' )
+ );
+ }
+ catch (e) {
+ try {
+ //Try to copy over the example conf
+ var example = fs.readFileSync(__dirname + '/conf.json.EXAMPLE', 'utf8');
+ fs.writeFileSync(__dirname + '/conf.json', example, 'utf8');
+ env.conf = JSON.parse(example);
+ }
+ catch(e) {
+ throw('Configuration file cannot be evaluated. ' + e);
+ }
+ }
+
+ // allow to pass arguments from configuration file
+ if (env.conf.opts) {
+ for (var opt in env.conf.opts) {
+ // arguments passed in command are more important
+ if (!(opt in env.opts)) {
+ env.opts[opt] = env.conf.opts[opt];
+ }
+ }
+ // command file list is concatenated after conf list
+ if( env.conf.opts._ ){
+ env.opts._ = env.conf.opts._.concat( env.opts._ );
+ }
+ }
+
+ if (env.opts.query) {
+ env.opts.query = require('common/query').toObject(env.opts.query);
+ }
+
+ // which version of javascript will be supported? (rhino only)
+ if (typeof version === 'function') {
+ version(env.conf.jsVersion || 180);
+ }
+
+ if (env.opts.help) {
+ console.log( jsdoc.opts.parser.help() );
+ exit(0);
+ }
+ else if (env.opts.test) {
+ include('test/runner.js');
+ exit(0);
+ }
+
+ // allow user-defined plugins to...
+ if (env.conf.plugins) {
+ for (var i = 0, leni = env.conf.plugins.length; i < leni; i++) {
+ var plugin = require(env.conf.plugins[i]);
+
+ //...register event handlers
+ if (plugin.handlers) {
+ for (var eventName in plugin.handlers) {
+ app.jsdoc.parser.on(eventName, plugin.handlers[eventName]);
+ }
+ }
+
+ //...define tags
+ if (plugin.defineTags) {
+ plugin.defineTags(dictionary);
+ }
+
+ //...add a node visitor
+ if (plugin.nodeVisitor) {
+ app.jsdoc.parser.addNodeVisitor(plugin.nodeVisitor);
+ }
+ }
+ }
+
+ // any source file named package.json is treated special
+ for (var i = 0, l = env.opts._.length; i < l; i++ ) {
+ if (/\bpackage\.json$/i.test(env.opts._[i])) {
+ packageJson = require('fs').readFileSync( env.opts._[i] );
+ env.opts._.splice(i--, 1);
+ }
+ }
+
+ if (env.opts._.length > 0) { // are there any files to scan and parse?
+
+ var includeMatch = (env.conf.source && env.conf.source.includePattern)? new RegExp(env.conf.source.includePattern) : null,
+ excludeMatch = (env.conf.source && env.conf.source.excludePattern)? new RegExp(env.conf.source.excludePattern) : null;
+
+ sourceFiles = app.jsdoc.scanner.scan(env.opts._, (env.opts.recurse? 10 : undefined), includeMatch, excludeMatch);
+
+ require('jsdoc/src/handlers').attachTo(app.jsdoc.parser);
+
+ docs = app.jsdoc.parser.parse(sourceFiles, env.opts.encoding);
+
+ //The files are ALWAYS useful for the templates to have
+ //If there is no package.json, just create an empty package
+ var packageDocs = new (require('jsdoc/package').Package)(packageJson);
+ packageDocs.files = sourceFiles || [];
+ docs.push(packageDocs);
+
+ function indexAll(docs) {
+ var lookupTable = {};
+
+ docs.forEach(function(doc) {
+ if ( !lookupTable.hasOwnProperty(doc.longname) ) {
+ lookupTable[doc.longname] = [];
+ }
+ lookupTable[doc.longname].push(doc);
+ });
+ docs.index = lookupTable;
+ }
+
+ indexAll(docs);
+
+ require('jsdoc/augment').addInherited(docs);
+ require('jsdoc/borrow').resolveBorrows(docs);
+
+ if (env.opts.explain) {
+ console.log(docs);
+ exit(0);
+ }
+
+ // load this module anyway to ensure root instance exists
+ // it's not a problem since without tutorials root node will have empty children list
+ resolver = require('jsdoc/tutorial/resolver');
+
+ if (env.opts.tutorials) {
+ resolver.load(env.opts.tutorials);
+ resolver.resolve();
+ }
+
+ env.opts.template = env.opts.template || 'templates/default';
+
+ // should define a global "publish" function
+ include(env.opts.template + '/publish.js');
+
+ if (typeof publish === 'function') {
+ publish(
+ new (require('typicaljoe/taffy'))(docs),
+ env.opts,
+ resolver.root
+ );
+ }
+ else { // TODO throw no publish warning?
+ }
+ }
+}
View
BIN  tools/jsdoc3/lib/js.jar
Binary file not shown
View
36 tools/jsdoc3/lib/rhino-shim.js
@@ -0,0 +1,36 @@
+/**
+ @overview A minimal emulation of the standard features of nodejs necessary
+ to get jsdoc to run.
+ */
+
+/**
+ Emulate nodejs console functions.
+ @see http://nodejs.org/docs/v0.4.8/api/stdio.html
+ */
+console = {
+ log: function(/*...*/) {
+ var args = Array.prototype.slice.call(arguments, 0),
+ dumper = dumper || require('jsdoc/util/dumper');
+
+ for (var i = 0, len = args.length; i < len; i++) {
+ if (typeof args[i] !== 'string') {
+ args[i] = dumper.dump(args[i]);
+ }
+ }
+
+ print( args.join(' ') );
+ }
+};
+
+/**
+ Emulate nodejs process functions.
+ @see http://nodejs.org/docs/v0.4.8/api/process.html
+ */
+process = {
+ exit: function(n) {
+ n = n || 0;
+ java.lang.System.exit(n);
+ },
+ argv: [__dirname + '/jsdoc.js'].concat(Array.prototype.slice.call(arguments, 0))
+};
+
View
140 tools/jsdoc3/node_modules/common/args.js
@@ -0,0 +1,140 @@
+/**
+ Parse the command line arguments.
+ @module common/args
+ @author Michael Mathews <micmath@gmail.com>
+ @license Apache License 2.0 - See file 'LICENSE.md' in this project.
+ */
+(function() {
+
+ /**
+ Create an instance of the parser.
+ @classdesc A parser to interpret the key value pairs entered on the command
+ line.
+ @constructor
+ */
+ exports.ArgParser = function() {
+ this._options = [];
+ }
+
+ exports.ArgParser.prototype._getOptionByShortName = function(name) {
+ for (var i = this._options.length; i--;) {
+ if (this._options[i].shortName === name) { return this._options[i]; }
+ }
+ return null;
+ }
+
+ exports.ArgParser.prototype._getOptionByLongName = function(name) {
+ for (var i = this._options.length; i--;) {
+ if (this._options[i].longName === name) { return this._options[i]; }
+ }
+ return null;
+ }
+
+ /**
+ * Provide information about a legal option.
+ * @param {character} shortName The short name of the option, entered like: -T.
+ * @param {string} longName The equivalent long name of the option, entered like: --test.
+ * @param {boolean} hasValue Does this option require a value? Like: -t templatename
+ * @param {string} helpText
+ * @example
+ * myParser.addOption('t', 'template', true, 'The path to the template.');
+ * myParser.addOption('h', 'help', false, 'Show the help message.');
+ */
+ exports.ArgParser.prototype.addOption = function(shortName, longName, hasValue, helpText) {
+ this._options.push({shortName: shortName, longName: longName, hasValue: hasValue, helpText: helpText});
+ };
+
+ /**
+ Generate a summary of all the options with corresponding help text.
+ @returns {string}
+ */
+ exports.ArgParser.prototype.help = function() {
+ var help = 'OPTIONS:\n',
+ option;
+
+ for (var i = 0, leni = this._options.length; i < leni; i++) {
+ option = this._options[i];
+
+ if (option.shortName) {
+ help += '-' + option.shortName + (option.longName? ' or ' : '');
+ }
+
+ if (option.longName) {
+ help += '--' + option.longName;
+ }
+
+ if (option.hasValue) {
+ help += ' <value>';
+ }
+
+ help += ' ' + option.helpText + '\n';
+ }
+
+ return help;
+ };
+
+ /**
+ Get the options.
+ @param {Array.<string>} args An array, like ['-x', 'hello']
+ @param {Object} [defaults={}] An optional collection of default values.
+ @returns {Object} The keys will be the longNames, or the shortName if
+ no longName is defined for that option. The values will be the values
+ provided, or `true` if the option accepts no value.
+ */
+ exports.ArgParser.prototype.parse = function(args, defaults) {
+ var result = defaults || {};
+
+ result._ = [];
+
+ for (var i = 0, leni = args.length; i < leni; i++) {
+ var arg = '' + args[i],
+ next = (i < leni-1)? '' + args[i+1] : null,
+ option,
+ shortName,
+ longName,
+ name,
+ value = null;
+
+ // like -t
+ if (arg.charAt(0) === '-') {
+
+ // like: --template
+ if (arg.charAt(1) === '-') {
+ name = longName = arg.slice(2);
+ option = this._getOptionByLongName(longName);
+ }
+ else {
+ name = shortName = arg.slice(1);
+ option = this._getOptionByShortName(shortName);
+ }
+
+ if (option === null) {
+ throw new Error( 'Unknown command line option found: ' + name );
+ }
+
+ if (option.hasValue) {
+ value = next;
+ i++;
+
+ if (value === null || value.charAt(0) === '-') {
+ throw new Error( 'Command line option requires a value: ' + name );
+ }
+ }
+ else {
+ value = true;
+ }
+
+ if (option.longName && shortName) {
+ name = option.longName;
+ }
+
+ result[name] = value;
+ }
+ else {
+ result._.push(arg);
+ }
+ }
+
+ return result;
+ }
+})();
View
302 tools/jsdoc3/node_modules/common/assert.js
@@ -0,0 +1,302 @@
+// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
+//
+// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
+//
+// Originally from narwhal.js (http://narwhaljs.org)
+// Copyright (c) 2009 Thomas Robinson <280north.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the 'Software'), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// UTILITY
+var common = { util: require('common/util') };;
+var pSlice = Array.prototype.slice;
+
+// 1. The assert module provides functions that throw
+// AssertionError's when particular conditions are not met. The
+// assert module must conform to the following interface.
+
+var assert = exports;
+
+// 2. The AssertionError is defined in assert.
+// new assert.AssertionError({ message: message,
+// actual: actual,
+// expected: expected })
+
+assert.AssertionError = function AssertionError(options) {
+ this.name = 'AssertionError';
+ this.message = options.message;
+ this.actual = options.actual;
+ this.expected = options.expected;
+ this.operator = options.operator;
+ var stackStartFunction = options.stackStartFunction || fail;
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, stackStartFunction);
+ }
+};
+common.util.inherits(assert.AssertionError, Error);
+
+assert.AssertionError.prototype.toString = function() {
+ if (this.message) {
+ return [this.name + ':', this.message].join(' ');
+ } else {
+ return [this.name + ':',
+ JSON.stringify(this.expected),
+ this.operator,
+ JSON.stringify(this.actual)].join(' ');
+ }
+};
+
+// assert.AssertionError instanceof Error
+
+assert.AssertionError.__proto__ = Error.prototype;
+
+// At present only the three keys mentioned above are used and
+// understood by the spec. Implementations or sub modules can pass
+// other keys to the AssertionError's constructor - they will be
+// ignored.
+
+// 3. All of the following functions must throw an AssertionError
+// when a corresponding condition is not met, with a message that
+// may be undefined if not provided. All assertion methods provide
+// both the actual and expected values to the assertion error for
+// display purposes.
+
+function fail(actual, expected, message, operator, stackStartFunction) {
+ throw new assert.AssertionError({
+ message: message,
+ actual: actual,
+ expected: expected,
+ operator: operator,
+ stackStartFunction: stackStartFunction
+ });
+}
+
+// EXTENSION! allows for well behaved errors defined elsewhere.
+assert.fail = fail;
+
+// 4. Pure assertion tests whether a value is truthy, as determined
+// by !!guard.
+// assert.ok(guard, message_opt);
+// This statement is equivalent to assert.equal(true, guard,
+// message_opt);. To test strictly for the value true, use
+// assert.strictEqual(true, guard, message_opt);.
+
+assert.ok = function ok(value, message) {
+ if (!!!value) fail(value, true, message, '==', assert.ok);
+};
+
+// 5. The equality assertion tests shallow, coercive equality with
+// ==.
+// assert.equal(actual, expected, message_opt);
+
+assert.equal = function equal(actual, expected, message) {
+ if (actual != expected) fail(actual, expected, message, '==', assert.equal);
+};
+
+// 6. The non-equality assertion tests for whether two objects are not equal
+// with != assert.notEqual(actual, expected, message_opt);
+
+assert.notEqual = function notEqual(actual, expected, message) {
+ if (actual == expected) {
+ fail(actual, expected, message, '!=', assert.notEqual);
+ }
+};
+
+// 7. The equivalence assertion tests a deep equality relation.
+// assert.deepEqual(actual, expected, message_opt);
+
+assert.deepEqual = function deepEqual(actual, expected, message) {
+ if (!_deepEqual(actual, expected)) {
+ fail(actual, expected, message, 'deepEqual', assert.deepEqual);
+ }
+};
+
+function _deepEqual(actual, expected) {
+ // 7.1. All identical values are equivalent, as determined by ===.
+ if (actual === expected) {
+ return true;
+
+ } else if (this.Buffer && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
+ if (actual.length != expected.length) return false;
+
+ for (var i = 0; i < actual.length; i++) {
+ if (actual[i] !== expected[i]) return false;
+ }
+
+ return true;
+
+ // 7.2. If the expected value is a Date object, the actual value is
+ // equivalent if it is also a Date object that refers to the same time.
+ } else if (actual instanceof Date && expected instanceof Date) {
+ return actual.getTime() === expected.getTime();
+
+ // 7.3. Other pairs that do not both pass typeof value == 'object',
+ // equivalence is determined by ==.
+ } else if (typeof actual != 'object' && typeof expected != 'object') {
+ return actual == expected;
+
+ // 7.4. For all other Object pairs, including Array objects, equivalence is
+ // determined by having the same number of owned properties (as verified
+ // with Object.prototype.hasOwnProperty.call), the same set of keys
+ // (although not necessarily the same order), equivalent values for every
+ // corresponding key, and an identical 'prototype' property. Note: this
+ // accounts for both named and indexed properties on Arrays.
+ } else {
+ return objEquiv(actual, expected);
+ }
+}
+
+function isUndefinedOrNull(value) {
+ return value === null || value === undefined;
+}
+
+function isArguments(object) {
+ return Object.prototype.toString.call(object) == '[object Arguments]';
+}
+
+function objEquiv(a, b) {
+ if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
+ return false;
+ // an identical 'prototype' property.
+ if (a.prototype !== b.prototype) return false;
+ //~~~I've managed to break Object.keys through screwy arguments passing.
+ // Converting to array solves the problem.
+ if (isArguments(a)) {
+ if (!isArguments(b)) {
+ return false;
+ }
+ a = pSlice.call(a);
+ b = pSlice.call(b);
+ return _deepEqual(a, b);
+ }
+ try {
+ var ka = Object.keys(a),
+ kb = Object.keys(b),
+ key, i;
+ } catch (e) {//happens when one is a string literal and the other isn't
+ return false;
+ }
+ // having the same number of owned properties (keys incorporates
+ // hasOwnProperty)
+ if (ka.length != kb.length)
+ return false;
+ //the same set of keys (although not necessarily the same order),
+ ka.sort();
+ kb.sort();
+ //~~~cheap key test
+ for (i = ka.length - 1; i >= 0; i--) {
+ if (ka[i] != kb[i])
+ return false;
+ }
+ //equivalent values for every corresponding key, and
+ //~~~possibly expensive deep test
+ for (i = ka.length - 1; i >= 0; i--) {
+ key = ka[i];
+ if (!_deepEqual(a[key], b[key])) return false;
+ }
+ return true;
+}
+
+// 8. The non-equivalence assertion tests for any deep inequality.
+// assert.notDeepEqual(actual, expected, message_opt);
+
+assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
+ if (_deepEqual(actual, expected)) {
+ fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
+ }
+};
+
+// 9. The strict equality assertion tests strict equality, as determined by ===.
+// assert.strictEqual(actual, expected, message_opt);
+
+assert.strictEqual = function strictEqual(actual, expected, message) {
+ if (actual !== expected) {
+ fail(actual, expected, message, '===', assert.strictEqual);
+ }
+};
+
+// 10. The strict non-equality assertion tests for strict inequality, as
+// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
+
+assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
+ if (actual === expected) {
+ fail(actual, expected, message, '!==', assert.notStrictEqual);
+ }
+};
+
+function expectedException(actual, expected) {
+ if (!actual || !expected) {
+ return false;
+ }
+
+ if (expected instanceof RegExp) {
+ return expected.test(actual);
+ } else if (actual instanceof expected) {
+ return true;
+ } else if ( expected.call({}, actual) === true ) {
+ return true;
+ }
+
+ return false;
+}
+
+function _throws(shouldThrow, block, expected, message) {
+ var actual;
+
+ if (typeof expected === 'string') {
+ message = expected;
+ expected = null;
+ }
+
+ try {
+ block();
+ } catch (e) {
+ actual = e;
+ }
+
+ message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
+ (message ? ' ' + message : '.');
+
+ if (shouldThrow && !actual) {
+ fail('Missing expected exception' + message);
+ }
+
+ if (!shouldThrow && expectedException(actual, expected)) {
+ fail('Got unwanted exception' + message);
+ }
+
+ if ((shouldThrow && actual && expected &&
+ !expectedException(actual, expected)) || (!shouldThrow && actual)) {
+ throw actual;
+ }
+}
+
+// 11. Expected to throw an error:
+// assert.throws(block, Error_opt, message_opt);
+
+assert['throws'] = function(block, /*optional*/error, /*optional*/message) {
+ _throws.apply(this, [true].concat(pSlice.call(arguments)));
+};
+
+// EXTENSION! This is annoying to write outside this module.
+assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
+ _throws.apply(this, [false].concat(pSlice.call(arguments)));
+};
+
+assert.ifError = function(err) { if (err) {throw err;}};
View
71 tools/jsdoc3/node_modules/common/events.js
@@ -0,0 +1,71 @@
+/**
+ Functions related to events. Designed to be mixed into other classes.
+ @exports common/events
+ @author Michael Mathews <micmath@gmail.com>
+ @license Apache License 2.0 - See file 'LICENSE.md' in this project.
+*/
+module.exports = {
+ /**
+ @param {string} type
+ @param {function} handler
+ @returns {this}
+ */
+ on: function(type, handler, context) {
+ if ( !type || !handler ) {
+ return;
+ }
+ if ( !context ) { context = this; }
+
+ if ( !this.__bindings ) { this.__bindings = {}; }
+ // TODO check here for hasOwnProperty?
+ if ( !this.__bindings[type] ) { this.__bindings[type] = []; }
+
+ var call = function(e) {
+ return handler.call(context, e);
+ };
+ this.__bindings[type].push( {handler: handler, call: call} );
+
+ return this; // chainable
+ },
+
+ /**
+ @param {string} type
+ @param {object} [eventData]
+ @returns {this}
+ */
+ fire: function(eventType, eventData) {
+ if ( !eventType || !this.__bindings || !this.__bindings[eventType] ) {
+ return;
+ }
+
+ // run handlers in first-in-first-run order
+ for (var i = 0, leni = this.__bindings[eventType].length; i < leni; i++) {
+ if ( false === this.__bindings[eventType][i].call(eventData) ) {
+ if (eventData) { eventData.defaultPrevented = true; }
+ }
+ }
+
+ return this; // chainable
+ },
+
+ /**
+ @param {string} type
+ @param {function} handler
+ */
+ removeListener: function(type, handler) {
+ if ( !type || !handler || !this.__bindings || !this.__bindings[type] ) {
+ return;
+ }
+
+ var i = this.__bindings[type].length;
+ while ( i-- ) {
+ if ( this.__bindings[type][i].handler === handler ) {
+ this.__bindings[type].splice(i, 1);
+ }
+ }
+
+ if (this.__bindings[type].length === 0) {
+ delete this.__bindings[type];
+ }
+ }
+};
View
42 tools/jsdoc3/node_modules/common/query.js
@@ -0,0 +1,42 @@
+/**
+ @description Support parsing of command line querystrings into JS objects.
+ @module common/query
+ @example
+
+ -q 'format=xml&root+node=documentation&publish='
+
+ > becomes
+
+ {
+ "format": "xml",
+ "root node": "documentation",
+ "publish": true
+ }
+*/
+(function() {
+ var query = module.exports = {
+ /**
+ @name module:common/query.toObject
+ @param {string} querystring
+ @returns {object}
+ */
+ toObject: function(querystring) {
+ var object = {};
+
+ querystring.replace(
+ new RegExp('([^?=&]+)(?:=([^&]*))?', 'g'),
+ function($0, key, val) {
+ object[query._decode(key)] =
+ (typeof val !== 'undefined')? query._decode(val) : true;
+ }
+ );
+
+ return object;
+ },
+
+ /** @private */
+ _decode: function(string) {
+ return decodeURIComponent( string.replace(/\+/g, ' ') );
+ }
+ };
+})();
View
55 tools/jsdoc3/node_modules/common/sqlite.js
@@ -0,0 +1,55 @@
+importPackage(java.sql);
+java.lang.Class.forName('org.sqlite.JDBC');
+
+var DB = exports.DB = function(dbname) {
+ this.dbname = dbname;
+}
+
+DB.prototype.connect = function() {
+ this.conn = DriverManager.getConnection('jdbc:sqlite:' + this.dbname);
+ return this;
+}
+
+DB.prototype.prepare = function(statement) { // like "insert into symbols values (?, ?, ?);"
+ this.prep = this.conn.prepareStatement(statement);
+ return this;
+}
+
+DB.prototype.values = function() { // replaces "?" placeholders in prepared statement
+ for (var i = 0, leni = arguments.length; i < leni; i++) {
+ this.prep.setString(i+1, arguments[i]);
+ }
+ this.prep.addBatch();
+
+ return this;
+}
+
+DB.prototype.commit = function() {
+ this.conn.setAutoCommit(false);
+ this.prep.executeBatch();
+ this.conn.setAutoCommit(true);
+
+ return this;
+}
+
+DB.prototype.query = function(statement) { // like "select * from symbols;"
+ this.stat = this.conn.createStatement();
+ this.resultSet = this.stat.executeQuery(statement);
+
+ return this.resultSet;
+}
+
+DB.prototype.update = function(statement) { // like "create table symbols (id, longname, kind);"
+ this.stat = this.conn.createStatement();
+ this.resultSet = this.stat.executeUpdate(statement);
+
+ return this;
+}
+
+DB.prototype.close = function() {
+ if (this.resultSet) this.resultSet.close();
+ if (this.stat) this.stat.close();
+ if (this.conn) this.conn.close();
+
+ return this;
+}
View
119 tools/jsdoc3/node_modules/common/util.js
@@ -0,0 +1,119 @@
+/**
+ @module common/util
+ */
+
+exports.print = function() {
+ for (var i = 0, len = arguments.length; i < len; ++i) {
+ java.lang.System.out.print(String(arguments[i]));
+ }
+};
+
+exports.puts = function() {
+ for (var i = 0, len = arguments.length; i < len; ++i) {
+ java.lang.System.out.println(arguments[i] + '\n');
+ }
+};
+
+exports.debug = function(x) {
+ exports.puts('DEBUG: ' + x + '\n');
+};
+
+var error = exports.error = function(x) {
+ for (var i = 0, len = arguments.length; i < len; ++i) {
+ exports.puts(arguments[i] + '\n');
+ }
+};
+
+exports.format = {
+ stylize: function(str, styleType) {
+ // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+ var styles =
+ { 'bold' : [1, 22],
+ 'italic' : [3, 23],
+ 'underline' : [4, 24],
+ 'inverse' : [7, 27],
+ 'white' : [37, 39],
+ 'grey' : [90, 39],
+ 'black' : [30, 39],
+ 'blue' : [34, 39],
+ 'cyan' : [36, 39],
+ 'green' : [32, 39],
+ 'magenta' : [35, 39],
+ 'red' : [31, 39],
+ 'yellow' : [33, 39] };
+
+ var style =
+ { 'special': 'cyan',
+ 'number': 'blue',
+ 'boolean': 'yellow',
+ 'undefined': 'grey',
+ 'null': 'bold',
+ 'string': 'green',
+ 'date': 'magenta',
+ // "name": intentionally not styling
+ 'regexp': 'red' }[styleType];
+
+ if (style) {
+ return '\033[' + styles[style][0] + 'm' + str +
+ '\033[' + styles[style][1] + 'm';
+ } else {
+ return str;
+ }
+ },
+
+ pad: function (n) {
+ return n < 10 ? '0' + n.toString(10) : n.toString(10);
+ }
+}
+
+var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+ 'Oct', 'Nov', 'Dec'];
+
+/**
+ * Create a timestamp string.
+ * @returns {string} Like 26 Feb 2011 16:19:34
+ */
+exports.timestamp = function() {
+ var d = new Date();
+ var time = [pad(d.getHours()),
+ pad(d.getMinutes()),
+ pad(d.getSeconds())].join(':');
+ return [d.getDate(), months[d.getMonth()], d.getFullYear(), time].join(' ');
+}
+
+exports.log = function(msg) {
+ exports.puts(exports.timestamp() + ' - ' + msg.toString());
+};
+
+/**
+ * Inherit the prototype methods from one constructor into another.
+ * @param {function} ctor Constructor function which needs to inherit the prototype.
+ * @param {function} superCtor Constructor function to inherit prototype from.
+ */
+exports.inherits = function(ctor, superCtor) {
+ ctor.super_ = superCtor;
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: { value: ctor, enumerable: false }
+ });
+};
+
+/**
+ * Mix in the members of a source object over a target object.
+ * @param {object} target
+ * @param {object} source
+ */
+exports.mixin = function(target, source /*...*/){
+ var sourceProperty;
+
+ for (var i = 1, len = arguments.length; i < len; i++) {
+ source = arguments[i];
+
+ for (sourceProperty in source) {
+ if( source.hasOwnProperty(sourceProperty) ) {
+ target[sourceProperty] = source[sourceProperty]; // overwrites target property
+ }
+ }
+ }
+
+ return target;
+};
View
1,446 tools/jsdoc3/node_modules/evilstreak/markdown.js
@@ -0,0 +1,1446 @@
+// Released under MIT license
+// Copyright (c) 2009-2010 Dominic Baggott
+// Copyright (c) 2009-2010 Ash Berlin
+
+(function( expose ) {
+
+/**
+ * class Markdown
+ *
+ * Markdown processing in Javascript done right. We have very particular views
+ * on what constitutes 'right' which include:
+ *
+ * - produces well-formed HTML (this means that em and strong nesting is
+ * important)
+ *
+ * - has an intermediate representation to allow processing of parsed data (We
+ * in fact have two, both as [JsonML]: a markdown tree and an HTML tree).
+ *
+ * - is easily extensible to add new dialects without having to rewrite the
+ * entire parsing mechanics
+ *
+ * - has a good test suite
+ *
+ * This implementation fulfills all of these (except that the test suite could
+ * do with expanding to automatically run all the fixtures from other Markdown
+ * implementations.)
+ *
+ * ##### Intermediate Representation
+ *
+ * *TODO* Talk about this :) Its JsonML, but document the node names we use.
+ *
+ * [JsonML]: http://jsonml.org/ "JSON Markup Language"
+ **/
+var Markdown = expose.Markdown = function Markdown(dialect) {
+ switch (typeof dialect) {
+ case "undefined":
+ this.dialect = Markdown.dialects.Gruber;
+ break;
+ case "object":
+ this.dialect = dialect;
+ break;
+ default:
+ if (dialect in Markdown.dialects) {
+ this.dialect = Markdown.dialects[dialect];
+ }
+ else {
+ throw new Error("Unknown Markdown dialect '" + String(dialect) + "'");
+ }
+ break;
+ }
+ this.em_state = [];
+ this.strong_state = [];
+ this.debug_indent = "";
+}
+
+/**
+ * parse( markdown, [dialect] ) -> JsonML
+ * - markdown (String): markdown string to parse
+ * - dialect (String | Dialect): the dialect to use, defaults to gruber
+ *
+ * Parse `markdown` and return a markdown document as a Markdown.JsonML tree.
+ **/
+expose.parse = function( source, dialect ) {
+ // dialect will default if undefined
+ var md = new Markdown( dialect );
+ return md.toTree( source );
+}
+
+/**
+ * toHTML( markdown ) -> String
+ * toHTML( md_tree ) -> String
+ * - markdown (String): markdown string to parse
+ * - md_tree (Markdown.JsonML): parsed markdown tree
+ *
+ * Take markdown (either as a string or as a JsonML tree) and run it through
+ * [[toHTMLTree]] then turn it into a well-formated HTML fragment.
+ **/
+expose.toHTML = function toHTML( source ) {
+ var input = expose.toHTMLTree( source );
+
+ return expose.renderJsonML( input );
+}
+
+/**
+ * toHTMLTree( markdown, [dialect] ) -> JsonML
+ * toHTMLTree( md_tree ) -> JsonML
+ * - markdown (String): markdown string to parse
+ * - dialect (String | Dialect): the dialect to use, defaults to gruber
+ * - md_tree (Markdown.JsonML): parsed markdown tree
+ *
+ * Turn markdown into HTML, represented as a JsonML tree. If a string is given
+ * to this function, it is first parsed into a markdown tree by calling
+ * [[parse]].
+ **/
+expose.toHTMLTree = function toHTMLTree( input, dialect ) {
+ // convert string input to an MD tree
+ if ( typeof input ==="string" ) input = this.parse( input, dialect );
+
+ // Now convert the MD tree to an HTML tree
+
+ // remove references from the tree
+ var attrs = extract_attr( input ),
+ refs = {};
+
+ if ( attrs && attrs.references ) {
+ refs = attrs.references;
+ }
+
+ var html = convert_tree_to_html( input, refs );
+ merge_text_nodes( html );
+ return html;
+}
+
+var mk_block = Markdown.mk_block = function(block, trail, line) {
+ // Be helpful for default case in tests.
+ if ( arguments.length == 1 ) trail = "\n\n";
+
+ var s = new String(block);
+ s.trailing = trail;
+ // To make it clear its not just a string
+ s.toSource = function() {
+ return "Markdown.mk_block( " +
+ uneval(block) +
+ ", " +
+ uneval(trail) +
+ ", " +
+ uneval(line) +
+ " )"
+ }
+
+ if (line != undefined)
+ s.lineNumber = line;
+
+ return s;
+}
+
+function count_lines( str ) {
+ var n = 0, i = -1;;
+ while ( ( i = str.indexOf('\n', i+1) ) != -1) n++;
+ return n;
+}