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
57 apply : function(o, c, defaults){
59 // no "this" reference for friendly out of scope calls
60 JSDOC.apply(o, defaults);
62 if(o && c && typeof c == 'object'){
72 * Qdump is used to generated cache dumps of objects
73 * @arg mixed t - object/array to dump
74 * @arg string prefix output with
75 * @arg string suffix output with
76 * @arg mixed defaults for the object - so they are not dumped..
79 toQDump : function(t, pref, suf, defs)
81 //println("got ToDump: " + pref +" ??? " + suf);
82 //var ret = "JSDOC.Symbol.fromDump(";
84 defs = (typeof(defs) == "undefined") ? {} : defs;
86 var isAr = t.constructor == Array;
90 // println("dump: " + i + " : " +typeof(t[i]));
93 k = typeof(i) == "number" ? i +":" : i.toSource()+":" ;
95 if (typeof(i) != "number") {
109 //if ((typeof(defs[i]) != 'undefined') && (v.toSource() == defs[i]).toSource()) {
127 if (!v.length) { // ?? skip empty!!
135 qret += k + v.toSource();
155 // println(k +"?:" + (v.constructor == Array ? "ARRAY" : "OBJECT"));
158 // what about raw objects...
159 if (v.constructor == Array) {
160 //println("ARRAYLEN:" + v.length);
161 var toadd = JSDOC.toQDump(v, '[', ']');
163 println("Array: " + toadd);
174 //println("AFT AR:" + qret);
177 if (v.constructor == Object) {
178 var toadd = JSDOC.toQDump(v, '{', '}');
187 //println("AFT AR:" + qret);
190 //println("v:toQdump" + typeof(v['toQDump']));
191 if (typeof(v['toQDump']) != "undefined") {
196 qret += k + v.toQDump(v);
199 println("SKIP " + i + " : " +typeof(t[i]) + ":" + t[i].toSource());
203 println("SKIP " + i + " : " +typeof(t[i]) );
211 return pref + qret + suf;
215 * Depreciated - use Script.prettyDump() - cant remember real name..
220 prettyDump : function(src)
222 // println("tidy SRC");
223 return Script.prettyDump(src);
225 var ar = Script.tokenize(src);
226 println("tidy" + ar.length);
231 // this is reallllllllly sloooooowwwwww!!! = perhaps we should just dump it straight to the file!!!
233 for( var i =0 ;i< ar.length; i++) {
235 //println(ar[i].toSource());
237 //println("tidy" + i + ":" + tok.val);
238 if ( (tok.val == '{') || (tok.val == '[') || (tok.val == '(') ) {
244 if ( (tok.val == '}') || (tok.val == ']') || (tok.val == ')') ) {
246 indent = indent.substring(2); // strip spaces..
247 if (i < (ar.length-1) && ar[i+1].val == ',') {
252 eret += (lbr ? "" : "\n" + indent ) + tok.val ;
256 if ( (tok.val == ',')) {
262 eret += "\n" + indent;