1 //<script type="text/javascript">
3 This is the main container for the JSDOC application.
7 Options = import.Options.Options;
8 XObject = import.XObject.XObject;
9 File = import.File.File;
10 /****************** INCLUDES ARE ALL AT THE BOTTOM OF THIS FILE!!!!! *******************/
12 // should not realy be here -- or anywhere...??
22 * apply properties to an object
24 * @param object to get properties (eg. JSDOC.Token.prototype)
25 * @param object of properties, - eg. a list of all the methods
26 * @param default (optional) -- no idea :)
30 build : function (opts)
33 XObject.extend(Options, opts);
40 Options.LOG.inform("JsDoc Toolkit main() running at "+new Date()+".");
41 Options.LOG.inform("With options: ");
45 // the -c option: use a configuration file - not supported at present..
60 apply : function(o, c, defaults){
62 // no "this" reference for friendly out of scope calls
63 JSDOC.apply(o, defaults);
65 if(o && c && typeof c == 'object'){
75 * Qdump is used to generated cache dumps of objects
76 * @arg mixed t - object/array to dump
77 * @arg string prefix output with
78 * @arg string suffix output with
79 * @arg mixed defaults for the object - so they are not dumped..
82 toQDump : function(t, pref, suf, defs)
84 //println("got ToDump: " + pref +" ??? " + suf);
85 //var ret = "JSDOC.Symbol.fromDump(";
87 defs = (typeof(defs) == "undefined") ? {} : defs;
89 var isAr = t.constructor == Array;
93 // println("dump: " + i + " : " +typeof(t[i]));
96 k = typeof(i) == "number" ? i +":" : i.toSource()+":" ;
98 if (typeof(i) != "number") {
112 //if ((typeof(defs[i]) != 'undefined') && (v.toSource() == defs[i]).toSource()) {
130 if (!v.length) { // ?? skip empty!!
138 qret += k + v.toSource();
158 // println(k +"?:" + (v.constructor == Array ? "ARRAY" : "OBJECT"));
161 // what about raw objects...
162 if (v.constructor == Array) {
163 //println("ARRAYLEN:" + v.length);
164 var toadd = JSDOC.toQDump(v, '[', ']');
166 println("Array: " + toadd);
177 //println("AFT AR:" + qret);
180 if (v.constructor == Object) {
181 var toadd = JSDOC.toQDump(v, '{', '}');
190 //println("AFT AR:" + qret);
193 //println("v:toQdump" + typeof(v['toQDump']));
194 if (typeof(v['toQDump']) != "undefined") {
199 qret += k + v.toQDump(v);
202 println("SKIP " + i + " : " +typeof(t[i]) + ":" + t[i].toSource());
206 println("SKIP " + i + " : " +typeof(t[i]) );
214 return pref + qret + suf;
218 * Depreciated - use Script.prettyDump() - cant remember real name..
223 prettyDump : function(src)
225 // println("tidy SRC");
226 return Script.prettyDump(src);
228 var ar = Script.tokenize(src);
229 println("tidy" + ar.length);
234 // this is reallllllllly sloooooowwwwww!!! = perhaps we should just dump it straight to the file!!!
236 for( var i =0 ;i< ar.length; i++) {
238 //println(ar[i].toSource());
240 //println("tidy" + i + ":" + tok.val);
241 if ( (tok.val == '{') || (tok.val == '[') || (tok.val == '(') ) {
247 if ( (tok.val == '}') || (tok.val == ']') || (tok.val == ')') ) {
249 indent = indent.substring(2); // strip spaces..
250 if (i < (ar.length-1) && ar[i+1].val == ',') {
255 eret += (lbr ? "" : "\n" + indent ) + tok.val ;
259 if ( (tok.val == ',')) {
265 eret += "\n" + indent;