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;
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: ");
43 // the -c option: use a configuration file - not supported at present..
58 apply : function(o, c, defaults){
60 // no "this" reference for friendly out of scope calls
61 JSDOC.apply(o, defaults);
63 if(o && c && typeof c == 'object'){
73 * Qdump is used to generated cache dumps of objects
74 * @arg mixed t - object/array to dump
75 * @arg string prefix output with
76 * @arg string suffix output with
77 * @arg mixed defaults for the object - so they are not dumped..
80 toQDump : function(t, pref, suf, defs)
82 //println("got ToDump: " + pref +" ??? " + suf);
83 //var ret = "JSDOC.Symbol.fromDump(";
85 defs = (typeof(defs) == "undefined") ? {} : defs;
87 var isAr = t.constructor == Array;
91 // println("dump: " + i + " : " +typeof(t[i]));
94 k = typeof(i) == "number" ? i +":" : i.toSource()+":" ;
96 if (typeof(i) != "number") {
110 //if ((typeof(defs[i]) != 'undefined') && (v.toSource() == defs[i]).toSource()) {
128 if (!v.length) { // ?? skip empty!!
136 qret += k + v.toSource();
156 // println(k +"?:" + (v.constructor == Array ? "ARRAY" : "OBJECT"));
159 // what about raw objects...
160 if (v.constructor == Array) {
161 //println("ARRAYLEN:" + v.length);
162 var toadd = JSDOC.toQDump(v, '[', ']');
164 println("Array: " + toadd);
175 //println("AFT AR:" + qret);
178 if (v.constructor == Object) {
179 var toadd = JSDOC.toQDump(v, '{', '}');
188 //println("AFT AR:" + qret);
191 //println("v:toQdump" + typeof(v['toQDump']));
192 if (typeof(v['toQDump']) != "undefined") {
197 qret += k + v.toQDump(v);
200 println("SKIP " + i + " : " +typeof(t[i]) + ":" + t[i].toSource());
204 println("SKIP " + i + " : " +typeof(t[i]) );
212 return pref + qret + suf;
216 * Depreciated - use Script.prettyDump() - cant remember real name..
221 prettyDump : function(src)
223 // println("tidy SRC");
224 return Script.prettyDump(src);
226 var ar = Script.tokenize(src);
227 println("tidy" + ar.length);
232 // this is reallllllllly sloooooowwwwww!!! = perhaps we should just dump it straight to the file!!!
234 for( var i =0 ;i< ar.length; i++) {
236 //println(ar[i].toSource());
238 //println("tidy" + i + ":" + tok.val);
239 if ( (tok.val == '{') || (tok.val == '[') || (tok.val == '(') ) {
245 if ( (tok.val == '}') || (tok.val == ']') || (tok.val == ')') ) {
247 indent = indent.substring(2); // strip spaces..
248 if (i < (ar.length-1) && ar[i+1].val == ',') {
253 eret += (lbr ? "" : "\n" + indent ) + tok.val ;
257 if ( (tok.val == ',')) {
263 eret += "\n" + indent;